From 8125245303a9082fbcb78b763e64cdc5c1fe936f Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 15 Jan 2018 11:16:47 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-6270=20=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=87=8C=E7=9A=84=E7=9B=B8=E5=85=B3bug=3D>=E5=88=A0?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E2=80=9C=E4=BB=A5=E4=B8=8B=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=9C=AA=E7=94=9F=E6=88=90=E2=80=9D=E6=B2=A1=E6=9C=89=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E6=98=BE=E7=A4=BA=EF=BC=8C=E8=A6=81=E5=86=8D=E7=82=B9?= =?UTF-8?q?=E4=B8=80=E4=B8=8Bpara=E6=89=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/src/com/fr/design/mainframe/JForm.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index ff15e6dc75..30f3f5ca07 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -248,9 +248,11 @@ public class JForm extends JTemplate implements BaseJForm { @Override public void fireCreatorModified(DesignerEvent evt) { - if (evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { + if (evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED) { setPropertyPaneChange(formDesign.getRootComponent()); + } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { + // 在 delete 之前,会先 select 父组件。这里直接传入 lastAffectedCreator 就好了 + setPropertyPaneChange(lastAffectedCreator); } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { lastAffectedCreator = evt.getAffectedCreator(); setPropertyPaneChange(lastAffectedCreator); From 7da828e57bf4a8d2c722137e6a3104218213705e Mon Sep 17 00:00:00 2001 From: MoMeak Date: Mon, 15 Jan 2018 14:45:29 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-6441=209.0=20feature=E9=87=8C?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=9A=84ctrl=E5=BF=AB=E6=8D=B7=E9=94=AE?= =?UTF-8?q?=E9=83=BD=E6=B2=A1=E7=94=A8=E4=BA=86.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/imenu/UIHeadMenu.java | 8 +- .../src/com/fr/design/gui/imenu/UIMenu.java | 76 ++----------------- 2 files changed, 14 insertions(+), 70 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/imenu/UIHeadMenu.java b/designer_base/src/com/fr/design/gui/imenu/UIHeadMenu.java index 627982ffe5..6b560ccf49 100644 --- a/designer_base/src/com/fr/design/gui/imenu/UIHeadMenu.java +++ b/designer_base/src/com/fr/design/gui/imenu/UIHeadMenu.java @@ -268,7 +268,13 @@ public class UIHeadMenu extends UIMenu { return (popupMenu == null) ? new Component[0] : popupMenu.getComponents(); } - + /** + * 得到子元素 + * @return 子元素 + */ + public MenuElement[] getSubElements() { + return popupMenu == null ? new MenuElement[0] : new MenuElement[]{popupMenu}; + } } diff --git a/designer_base/src/com/fr/design/gui/imenu/UIMenu.java b/designer_base/src/com/fr/design/gui/imenu/UIMenu.java index bcdf2ab9f4..3fbc3c9ac1 100644 --- a/designer_base/src/com/fr/design/gui/imenu/UIMenu.java +++ b/designer_base/src/com/fr/design/gui/imenu/UIMenu.java @@ -75,7 +75,9 @@ public class UIMenu extends JMenu { }; popupMenu.setInvoker(this); - + if (popupMenu.getComponentCount() != 0) { + System.out.println(popupMenu.getComponentCount()); + } popupListener = createWinListener(popupMenu); } } @@ -213,75 +215,11 @@ public class UIMenu extends JMenu { popupMenu.insert(new JPopupMenu.Separator(), index); } - /** - * 移除 - * @param item 菜单项 + * 得到子元素 + * @return 子元素 */ - public void remove(JMenuItem item) { - if (popupMenu != null) { - popupMenu.remove(item); - } - } - - /** - * 移除指定位置菜单项 - * @param pos 指定位置 - */ - public void remove(int pos) { - if (pos < 0) { - throw new IllegalArgumentException("index less than zero."); - } - if (pos > getItemCount()) { - throw new IllegalArgumentException("index greater than the number of items."); - } - if (popupMenu != null) { - popupMenu.remove(pos); - } - } - - /** - * 移除组件 - * @param c 组件 - */ - public void remove(Component c) { - if (popupMenu != null) { - popupMenu.remove(c); - } + public MenuElement[] getSubElements() { + return popupMenu == null ? new MenuElement[0] : new MenuElement[]{popupMenu}; } - - /** - * 移除所有 - */ - public void removeAll() { - if (popupMenu != null) { - popupMenu.removeAll(); - } - } - - /** - * 组件总数 - * @return 组件总数 - */ - public int getMenuComponentCount() { - return (popupMenu == null) ? 0 : popupMenu.getComponentCount(); - } - - /** - * 指定位置组件 - * @param n 指定位置 - * @return 组件 - */ - public Component getMenuComponent(int n) { - return (popupMenu == null) ? null : popupMenu.getComponent(n); - } - - /** - * 所有组件 - * @return 所有组件 - */ - public Component[] getMenuComponents() { - return (popupMenu == null) ? new Component[0] : popupMenu.getComponents(); - } - } \ No newline at end of file From 9bba8fa942670f45e8aaf61b157e4a2c09f25041 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Mon, 15 Jan 2018 14:47:08 +0800 Subject: [PATCH 3/5] =?UTF-8?q?REPORT-6441=209.0=20feature=E9=87=8C?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=9A=84ctrl=E5=BF=AB=E6=8D=B7=E9=94=AE?= =?UTF-8?q?=E9=83=BD=E6=B2=A1=E7=94=A8=E4=BA=86.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/imenu/UIMenu.java | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/designer_base/src/com/fr/design/gui/imenu/UIMenu.java b/designer_base/src/com/fr/design/gui/imenu/UIMenu.java index 3fbc3c9ac1..4252656c18 100644 --- a/designer_base/src/com/fr/design/gui/imenu/UIMenu.java +++ b/designer_base/src/com/fr/design/gui/imenu/UIMenu.java @@ -215,6 +215,77 @@ public class UIMenu extends JMenu { popupMenu.insert(new JPopupMenu.Separator(), index); } + + /** + * 移除 + * @param item 菜单项 + */ + public void remove(JMenuItem item) { + if (popupMenu != null) { + popupMenu.remove(item); + } + } + + /** + * 移除指定位置菜单项 + * @param pos 指定位置 + */ + public void remove(int pos) { + if (pos < 0) { + throw new IllegalArgumentException("index less than zero."); + } + if (pos > getItemCount()) { + throw new IllegalArgumentException("index greater than the number of items."); + } + if (popupMenu != null) { + popupMenu.remove(pos); + } + } + + /** + * 移除组件 + * @param c 组件 + */ + public void remove(Component c) { + if (popupMenu != null) { + popupMenu.remove(c); + } + } + + /** + * 移除所有 + */ + public void removeAll() { + if (popupMenu != null) { + popupMenu.removeAll(); + } + } + + /** + * 组件总数 + * @return 组件总数 + */ + public int getMenuComponentCount() { + return (popupMenu == null) ? 0 : popupMenu.getComponentCount(); + } + + /** + * 指定位置组件 + * @param n 指定位置 + * @return 组件 + */ + public Component getMenuComponent(int n) { + return (popupMenu == null) ? null : popupMenu.getComponent(n); + } + + /** + * 所有组件 + * @return 所有组件 + */ + public Component[] getMenuComponents() { + return (popupMenu == null) ? new Component[0] : popupMenu.getComponents(); + } + /** * 得到子元素 * @return 子元素 From fe19f2ec55604162f0295b2d1df1fb262a0b2cd7 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Mon, 15 Jan 2018 14:48:19 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=88=A0=E6=8E=89=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/gui/imenu/UIMenu.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/imenu/UIMenu.java b/designer_base/src/com/fr/design/gui/imenu/UIMenu.java index 4252656c18..140b8e120d 100644 --- a/designer_base/src/com/fr/design/gui/imenu/UIMenu.java +++ b/designer_base/src/com/fr/design/gui/imenu/UIMenu.java @@ -75,9 +75,7 @@ public class UIMenu extends JMenu { }; popupMenu.setInvoker(this); - if (popupMenu.getComponentCount() != 0) { - System.out.println(popupMenu.getComponentCount()); - } + popupListener = createWinListener(popupMenu); } } From 2869ccdf9fa03c66c0f66d8e3e38508ca1bd5251 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Mon, 15 Jan 2018 15:48:43 +0800 Subject: [PATCH 5/5] =?UTF-8?q?REPORT-6386=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8,?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E7=BB=84=E4=BB=B6=E5=BA=93=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/FormParaWidgetPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java index ee5a7ab6bc..a0c7925d74 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java @@ -371,7 +371,7 @@ public class FormParaWidgetPane extends JPanel { designer.addParaComponent(); JPanel pane = FormWidgetDetailPane.getInstance(designer); - EastRegionContainerPane.getInstance().replaceDownPane(pane); + EastRegionContainerPane.getInstance().replaceWidgetLibPane(pane); this.setEnabled(false); designer.addDesignerEditListener(new paraButtonDesignerAdapter(this));