From d8576dcefca8b06713c0cdb375c6113fb0e9a43a Mon Sep 17 00:00:00 2001 From: Hans Date: Wed, 21 Oct 2020 14:52:35 +0800 Subject: [PATCH] =?UTF-8?q?MOBILE-29857=E3=80=90RN=E3=80=91=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E4=B8=8A=E5=9C=86=E7=82=B9=E6=8C=87=E7=A4=BA?= =?UTF-8?q?=E5=99=A8=E9=80=89=E4=B8=AD=E5=A1=AB=E5=85=85=E8=89=B2=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=90=8E=E6=B2=A1=E6=9C=89=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/MobileTabCommonSettingPane.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index 4670456ae..def9cf795 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -35,6 +35,7 @@ public class MobileTabCommonSettingPane extends BasicPane { private ModeButtonGroup buttonGroup; private NewColorSelectBox initDotColorBox; private NewColorSelectBox selectDotColorBox; + private boolean isPopulate; public MobileTabCommonSettingPane(boolean isTopComponent) { initComponent(isTopComponent); @@ -89,23 +90,27 @@ public class MobileTabCommonSettingPane extends BasicPane { initDotColorBox = new NewColorSelectBox(0){ @Override protected void iniListener() { - } - - @Override - public void mouseClicked(MouseEvent e) { - super.mouseClicked(e); - this.attributeChange(); + this.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (!isPopulate) { + attributeChange(); + } + } + }); } }; selectDotColorBox = new NewColorSelectBox(0){ @Override protected void iniListener() { - } - - @Override - public void mouseClicked(MouseEvent e) { - super.mouseClicked(e); - this.attributeChange(); + this.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (!isPopulate) { + attributeChange(); + } + } + }); } }; JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColorLabel, initDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); @@ -189,7 +194,9 @@ public class MobileTabCommonSettingPane extends BasicPane { color = defaultColor; } if (color != colorBox.getSelectObject()) { + isPopulate = true; colorBox.setSelectObject(color); + isPopulate = false; } }