From 9f5f83c8783ee0431d50b3678417050f7f1842b2 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 14 Sep 2017 14:38:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=9D=9E=E7=82=B9=E5=87=BB=E7=8A=B6=E6=80=81=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=20&=20=E4=B8=8B=E6=8B=89=E6=A1=86=E9=80=89=E9=A1=B9=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ibutton/UIButtonUI.java | 29 ++++++------------- .../gui/icombobox/UIComboBoxRenderer.java | 2 +- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java b/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java index cd76c30cb..a38011208 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIButtonUI.java @@ -1,27 +1,16 @@ package com.fr.design.gui.ibutton; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.Rectangle; -import java.awt.RenderingHints; - -import javax.swing.AbstractButton; -import javax.swing.ButtonModel; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.SwingUtilities; -import javax.swing.plaf.basic.BasicButtonUI; -import javax.swing.plaf.basic.BasicHTML; -import javax.swing.text.View; - import com.fr.design.constants.UIConstants; import com.fr.design.roleAuthority.ReportAndFSManagePane; +import com.fr.design.utils.gui.GUIPaintUtils; +import com.fr.stable.StringUtils; import sun.swing.SwingUtilities2; -import com.fr.stable.StringUtils; -import com.fr.design.utils.gui.GUIPaintUtils; +import javax.swing.*; +import javax.swing.plaf.basic.BasicButtonUI; +import javax.swing.plaf.basic.BasicHTML; +import javax.swing.text.View; +import java.awt.*; public class UIButtonUI extends BasicButtonUI { @@ -66,7 +55,7 @@ public class UIButtonUI extends BasicButtonUI { protected boolean isPressed(AbstractButton b) { ButtonModel model = b.getModel(); - return (model.isArmed() && model.isPressed()) || b.isSelected(); + return model.isArmed() && model.isPressed(); } private void paintContent(Graphics g, AbstractButton b, String text) { @@ -127,7 +116,7 @@ public class UIButtonUI extends BasicButtonUI { return; } Icon selectedIcon = null; - /* the fallback icon should be based on the selected state */ + /* the fallback icon should be based on the selected state */ if (model.isSelected()) { selectedIcon = (Icon) b.getSelectedIcon(); if (selectedIcon != null) { diff --git a/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java b/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java index 7674b574f..4be4fdcf0 100644 --- a/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java +++ b/designer_base/src/com/fr/design/gui/icombobox/UIComboBoxRenderer.java @@ -27,7 +27,7 @@ public class UIComboBoxRenderer extends DefaultListCellRenderer { cellHasFocus = cellHasFocus && !this.isEnabled(); JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); renderer.setForeground(Color.black); - list.setSelectionBackground(UIConstants.FLESH_BLUE); + list.setSelectionBackground(UIConstants.COMBOBOX_BTN_PRESS); list.setSelectionForeground(Color.black); renderer.setText(" " + renderer.getText()); return renderer;