From 0ae57bbbecc46783c477a63a9a5d5d36370837e7 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 15 Sep 2017 16:47:22 +0800 Subject: [PATCH] =?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 c847601626..a01d4347a7 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