diff --git a/designer-base/src/main/java/com/fr/design/file/Releasable.java b/designer-base/src/main/java/com/fr/design/file/Releasable.java new file mode 100644 index 000000000..cb78789e6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/file/Releasable.java @@ -0,0 +1,5 @@ +package com.fr.design.file; + +public interface Releasable { + void releaseResources(); +} 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..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 @@ -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 @@ -242,7 +242,27 @@ public class UIEastResizableContainer extends JPanel { * 伸缩右子面板时,触发此方法 */ public void onResize() { - // do nothing here + refreshContainer(); + if (DesignModeContext.isAuthorityEditing()) { + DesignerContext.getDesignerFrame().doResize(); + } + } + + public void showContainer() { + if (containerWidth != leftPaneWidth) { + return; + } + containerWidth = preferredWidth; + onResize(); + } + + public void hideContainer() { + if (containerWidth == leftPaneWidth) { + return; + } + setPreferredWidth(containerWidth); + containerWidth = leftPaneWidth; + onResize(); } private class TopToolPane extends JPanel { @@ -281,15 +301,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 +330,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); } diff --git a/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java b/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java index 72ff96982..834b6b4a8 100644 --- a/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java @@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.properties.EventPropertyTable; +import com.fr.design.file.Releasable; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.FormDesigner; import com.fr.design.widget.EventCreator; @@ -13,7 +14,7 @@ import com.fr.stable.Nameable; /** * Created by kerry on 5/17/21 */ -public class EventPropertyPane extends UIListGroupControlPane { +public class EventPropertyPane extends UIListGroupControlPane implements Releasable { private XCreator creator; private FormDesigner designer; @@ -24,6 +25,12 @@ public class EventPropertyPane extends UIListGroupControlPane { this.designer = designer; } + @Override + public void releaseResources() { + creator = null; + designer = null; + this.removeAll(); + } /** * 刷新 @@ -44,7 +51,6 @@ public class EventPropertyPane extends UIListGroupControlPane { } - public void populateNameObjects() { Widget widget = creator.toData(); populateNameObjects(widget); @@ -93,7 +99,7 @@ public class EventPropertyPane extends UIListGroupControlPane { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_Event"); } - protected String getWrapperLabelText(){ + protected String getWrapperLabelText() { return Toolkit.i18nText("Fine-Design_Report_Event"); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index b8f3ff638..d8b604e19 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -7,6 +7,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.file.Releasable; import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.gui.core.FormWidgetOption; import com.fr.design.gui.core.UserDefinedWidgetOption; @@ -56,7 +57,7 @@ import java.awt.event.MouseEvent; /** * @author null */ -public class FormParaWidgetPane extends JPanel { +public class FormParaWidgetPane extends JPanel implements Releasable { private static FormParaWidgetPane THIS; private final static int BORDER = 5; private final static int WIDGET_WIDTHGAP = 4; @@ -119,6 +120,15 @@ public class FormParaWidgetPane extends JPanel { return THIS; } + public static FormParaWidgetPane getInstance(){ + return THIS; + } + + @Override + public void releaseResources() { + designer = null; + } + public FormParaWidgetPane() { setLayout(new FlowLayout(FlowLayout.LEFT)); DesignerContext.getDesignerFrame().getCenterTemplateCardPane().addComponentListener(new ComponentAdapter() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index 8fbc4d06d..f22592ee7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.design.dialog.BasicPane; +import com.fr.design.file.Releasable; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; @@ -23,7 +24,7 @@ import java.util.List; * Date: 14-7-8 * Time: 下午8:18 */ -public class FormWidgetDetailPane extends FormDockView{ +public class FormWidgetDetailPane extends FormDockView implements Releasable { private static final int ONLINE_TAB = 1; private JPanel centerPane; @@ -52,6 +53,11 @@ public class FormWidgetDetailPane extends FormDockView{ private static FormWidgetDetailPane singleton = new FormWidgetDetailPane(); } + @Override + public void releaseResources() { + setEditingFormDesigner(null); + } + public String getViewTitle() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Tree_And_Table"); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 3ddc16c9c..eee57c99f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -116,7 +116,8 @@ public class JForm extends JTemplate