From 672d03266e6ed516fae41ecd68b1073c1470bbf3 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Wed, 16 Jun 2021 18:02:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-53875=20=E6=96=B0=E5=A2=9E=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=BA=93=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../icontainer/UIEastResizableContainer.java | 38 ++++++++++++++----- .../message/DesignerModuleClickType.java | 10 ++++- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 77407a3ed..53ee3bb9c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -172,7 +172,7 @@ public class UIEastResizableContainer extends JPanel { leftPane.setBounds(0, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight); // parameterPane.setBounds(20, 0, 230, getParameterPaneHeight());//10,0,230,462 - rightPane.setBounds(leftPaneWidth, 0, containerWidth-leftPaneWidth, getHeight());//20,0,230,0 + rightPane.setBounds(leftPaneWidth, 0, containerWidth - leftPaneWidth, getHeight());//20,0,230,0 } @Override @@ -245,6 +245,31 @@ public class UIEastResizableContainer extends JPanel { // do nothing here } + public void showContainer() { + if (containerWidth != leftPaneWidth) { + return; + } + containerWidth = preferredWidth; + onResize(); + refreshContainer(); + if (DesignModeContext.isAuthorityEditing()) { + DesignerContext.getDesignerFrame().doResize(); + } + } + + public void hideContainer() { + if (containerWidth == leftPaneWidth) { + return; + } + setPreferredWidth(containerWidth); + containerWidth = leftPaneWidth; + onResize(); + refreshContainer(); + if (DesignModeContext.isAuthorityEditing()) { + DesignerContext.getDesignerFrame().doResize(); + } + } + private class TopToolPane extends JPanel { private int model = UIConstants.MODEL_NORMAL; @@ -281,15 +306,9 @@ public class UIEastResizableContainer extends JPanel { public void mouseClicked(MouseEvent e) { if (e.getX() <= ARROW_RANGE) { if (containerWidth == leftPaneWidth) { - containerWidth = preferredWidth; + showContainer(); } else { - setPreferredWidth(containerWidth); - containerWidth = leftPaneWidth; - } - onResize(); - refreshContainer(); - if (DesignModeContext.isAuthorityEditing()) { - DesignerContext.getDesignerFrame().doResize(); + hideContainer(); } } } @@ -316,5 +335,4 @@ public class UIEastResizableContainer extends JPanel { g.drawImage(button, 18, 7, 5, 10, null); } } - } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/login/message/DesignerModuleClickType.java b/designer-base/src/main/java/com/fr/design/login/message/DesignerModuleClickType.java index 85b8983f1..fb7ff4d0c 100644 --- a/designer-base/src/main/java/com/fr/design/login/message/DesignerModuleClickType.java +++ b/designer-base/src/main/java/com/fr/design/login/message/DesignerModuleClickType.java @@ -3,11 +3,16 @@ package com.fr.design.login.message; import com.fr.config.ServerPreferenceConfig; import com.fr.design.dialog.NotificationDialogAction; import com.fr.design.extra.WebViewDlgHelper; +import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.mainframe.JTemplate; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.upm.UpmFinder; import com.fr.design.utils.DesignUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import com.fr.stable.bridge.StableFactory; import com.fr.stable.os.Arch; import com.fr.stable.os.OperatingSystem; @@ -39,7 +44,10 @@ public enum DesignerModuleClickType { @Override public void doClick() { try { - // TODO + BaseJForm jform = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, BaseJForm.class); + DesignerContext.getDesignerFrame().addAndActivateJTemplate((JTemplate) jform); + EastRegionContainerPane.getInstance().showContainer(); + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } From 4aec5671a5b0edda1327a52f18f1cc7a9372d891 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Wed, 16 Jun 2021 18:14:10 +0800 Subject: [PATCH 2/2] fix --- .../gui/icontainer/UIEastResizableContainer.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 53ee3bb9c..125cd3aa1 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -242,7 +242,10 @@ public class UIEastResizableContainer extends JPanel { * 伸缩右子面板时,触发此方法 */ public void onResize() { - // do nothing here + refreshContainer(); + if (DesignModeContext.isAuthorityEditing()) { + DesignerContext.getDesignerFrame().doResize(); + } } public void showContainer() { @@ -251,10 +254,6 @@ public class UIEastResizableContainer extends JPanel { } containerWidth = preferredWidth; onResize(); - refreshContainer(); - if (DesignModeContext.isAuthorityEditing()) { - DesignerContext.getDesignerFrame().doResize(); - } } public void hideContainer() { @@ -264,10 +263,6 @@ public class UIEastResizableContainer extends JPanel { setPreferredWidth(containerWidth); containerWidth = leftPaneWidth; onResize(); - refreshContainer(); - if (DesignModeContext.isAuthorityEditing()) { - DesignerContext.getDesignerFrame().doResize(); - } } private class TopToolPane extends JPanel {