From 9fce24b6c9b5218daddb802d6f9a48714a373603 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 22 Sep 2017 17:22:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4781=20=E5=BC=B9=E5=87=BA=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=8C=89=E9=92=AE=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../accessibles/BaseAccessibleEditor.java | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java b/designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java index ec6d4405ed..e0d134ad6c 100644 --- a/designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java +++ b/designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java @@ -4,29 +4,31 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; +import java.awt.Graphics2D; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; - +import javax.swing.AbstractButton; import javax.swing.BorderFactory; - +import com.fr.design.constants.UIConstants; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButton; - import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; - +import javax.swing.plaf.ButtonUI; import com.fr.base.BaseUtils; import com.fr.design.Exception.ValidationException; +import com.fr.design.gui.ibutton.UIButtonUI; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.editors.TextField; import com.fr.design.dialog.BasicPane; import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Encoder; +import com.fr.design.utils.gui.GUIPaintUtils; /** * @since 6.5.3 @@ -89,6 +91,26 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor public boolean shouldResponseChangeListener() { return false; } + @Override + public ButtonUI getUI() { + return new UIButtonUI() { + @Override + protected boolean isPressed(AbstractButton b) { + return model.isArmed() && model.isPressed(); + } + + @Override + protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) { + if (isPressed(b) && b.isPressedPainted()) { + GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.COMBOBOX_BTN_PRESS); + } else if (isRollOver(b)) { + GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_ROLLOVER); + } else if (b.isNormalPainted()) { + GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_NORMAL); + } + } + }; + } }; initPopupButton(); btPopup.addActionListener(new ActionListener() {