From 328afe1a37176948ad9116e33eea21f599d577bc Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 15 Sep 2017 14:52:21 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E4=B8=AD=E7=BC=96=E8=BE=91=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/src/com/fr/design/mainframe/JForm.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 2913df00a..09a5eac53 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -244,10 +244,6 @@ public class JForm extends JTemplate implements BaseJForm { || evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { setPropertyPaneChange(formDesign.getRootComponent()); } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { - // 防止多次触发 - if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) { - return; - } lastAffectedCreator = evt.getAffectedCreator(); setPropertyPaneChange(lastAffectedCreator); } From 2a78fb3b23ffa0273be54677a7123cec3be5ea5f Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 15 Sep 2017 14:53:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E6=B7=BB=E5=8A=A0=E7=9B=91?= =?UTF-8?q?=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/WidgetPropertyPane.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index d5878a095..dd9678615 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -418,6 +418,11 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope } } } + + @Override + public boolean equals(Object o) { + return o instanceof mobileWidgetDesignerAdapter; + } } @Override From f342c80780713bf340526d35bb07389190bbfad5 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 15 Sep 2017 16:11:43 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/WidgetPropertyPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index dd9678615..c84760162 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -157,7 +157,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope wsp.setBorder(null); mobileParaWidgetTable = new MobileParaWidgetTable(designer); mobileWidgetTable = new MobileWidgetTable(designer); - designer.addDesignerEditListener(new mobileWidgetDesignerAdapter()); + designer.addDesignerEditListener(new MobileWidgetDesignerAdapter()); centerPane = FRGUIPaneFactory.createCardLayout_S_Pane(); cardLayout = (CardLayout) centerPane.getLayout(); centerPane.add(mobileParaWidgetTable, PARA); @@ -382,9 +382,9 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope /** * 移动端属性表监听界面事件(改变大小,编辑,选中,增加控件) */ - private class mobileWidgetDesignerAdapter implements DesignerEditListener { + private class MobileWidgetDesignerAdapter implements DesignerEditListener { - mobileWidgetDesignerAdapter() { + MobileWidgetDesignerAdapter() { } /** @@ -421,7 +421,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope @Override public boolean equals(Object o) { - return o instanceof mobileWidgetDesignerAdapter; + return o instanceof MobileWidgetDesignerAdapter; } } From 0ae57bbbecc46783c477a63a9a5d5d36370837e7 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 15 Sep 2017 16:47:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/WidgetPropertyPane.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index c84760162..a01d4347a 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -245,7 +245,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope */ private Component getExtraBodyTable(AbstractPropertyTable abstractPropertyTable) { Widget selection = designer.getSelectionModel().getSelection().getSelectedCreator().toData(); - if (selection.getWidgetName().equals("body")) { + if ("body".equals(selection.getWidgetName())) { JPanel jPanel = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); jPanel.add(abstractPropertyTable); MobileWidgetTable mobileWidgetTable = new MobileWidgetTable(designer); @@ -294,7 +294,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope XLayoutContainer container = XCreatorUtils.getHotspotContainer(xCreator); boolean xCreatorAccept = xCreator.acceptType(XWParameterLayout.class); - boolean containerAccept = container!=null && container.acceptType(XWParameterLayout.class); + boolean containerAccept = container != null && container.acceptType(XWParameterLayout.class); return xCreatorAccept || containerAccept; } @@ -332,7 +332,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope || evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED || evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) { formWidgetCardPane.populate(); - }else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){ + } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){ // 防止多次触发 if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) { return; @@ -393,10 +393,18 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope * @param evt 事件 */ public void fireCreatorModified(DesignerEvent evt) { - if (evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_ADDED) { + int[] validEventIds = {DesignerEvent.CREATOR_RESIZED, DesignerEvent.CREATOR_EDITED, + DesignerEvent.CREATOR_SELECTED, DesignerEvent.CREATOR_ADDED}; + boolean isValid = false; + for (int validEventId : validEventIds) { + if (evt.getCreatorEventID() == validEventId) { + isValid = true; + break; + } + } + if (!isValid) { + return; + } //fanglei:下面的注释不要删,只是暂时屏蔽 // int value = downPanel.getVerticalScrollBar().getValue(); // if (hasSelectParaPane(getEditingFormDesigner())) { @@ -411,12 +419,12 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope // //控件列表选中某组件,触发表单中选中控件,选中事件又触发列表刷新,滚动条回到0 // //此处设置滚动条值为刷新前 // downPanel.getVerticalScrollBar().setValue(value); - if (mobileExtraPropertyPanes != null) { - for (MobileWidgetDefinePane extraPane : mobileExtraPropertyPanes) { - extraPane.populate(designer); - } + if (mobileExtraPropertyPanes != null) { + for (MobileWidgetDefinePane extraPane : mobileExtraPropertyPanes) { + extraPane.populate(designer); } } + } @Override