From ac5c016673f719ca46011cd815a5b08c7060b115 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 14 Jul 2020 15:39:25 +0800 Subject: [PATCH] REPORT-35381 && REPORT-35379 --- .../java/com/fr/design/actions/help/AboutDialog.java | 2 +- .../java/com/fr/design/actions/help/AboutPane.java | 12 +++++++++++- .../gui/icontainer/UIEastResizableContainer.java | 12 +++++++++++- .../fr/design/mainframe/EastRegionContainerPane.java | 10 +++++++++- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java index b4b6d53c6f..d94e8ea5c3 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java @@ -76,7 +76,7 @@ public class AboutDialog extends JDialog implements ActionListener { this.getRootPane().setDefaultButton(okButton); - this.setSize(new Dimension(660, 600)); + this.setSize(defaultPane.getPreferredSize().width, 600); GUICoreUtils.centerWindow(this); } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java index 3ede159504..a7aac03913 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java @@ -4,6 +4,7 @@ package com.fr.design.actions.help; import com.fr.base.FRContext; +import com.fr.base.GraphHelper; import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.BoldFontTextLabel; @@ -36,9 +37,13 @@ public class AboutPane extends JPanel { private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("help.compNo"); private static final String PRESIDENT_PHONE = CloudCenter.getInstance().acquireUrlByKind("help.PNo"); + private int maxWidth; + public AboutPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - + this.maxWidth = GraphHelper.getWidth(getBuildTitle() + GeneralUtils.readFullBuildNO() + + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO") + + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO_OK")); //center panel JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); this.add(centerPane, BorderLayout.CENTER); @@ -90,6 +95,11 @@ public class AboutPane extends JPanel { } } + @Override + public Dimension getPreferredSize() { + return new Dimension(this.maxWidth, super.getPreferredSize().height); + } + private void addPhoneAndQQPane(JPanel contentPane) { BoxCenterAligmentPane boxCenterAlignmentPane; // 英文版不显示服务电话和QQ 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 2a5c29d8c8..df07acf1ab 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 @@ -18,6 +18,10 @@ import java.awt.event.MouseMotionListener; */ public class UIEastResizableContainer extends JPanel { private static final long serialVersionUID = 1854340560790476907L; + + public static final int MAX_CONTAINER_WIDTH = 500; + public static final int MIN_CONTAINER_WIDTH = 286; + private int containerWidth = 240; private int preferredWidth = 240; private int topToolPaneHeight = 25; @@ -262,7 +266,13 @@ public class UIEastResizableContainer extends JPanel { @Override public void mouseDragged(MouseEvent e) { - // do nothing + containerWidth = UIEastResizableContainer.this.getWidth() + (UIEastResizableContainer.this.getLocationOnScreen().x - e.getXOnScreen()); + containerWidth = Math.min(containerWidth, MAX_CONTAINER_WIDTH); + containerWidth = Math.max(containerWidth, MIN_CONTAINER_WIDTH); + refreshContainer(); + if ( DesignModeContext.isAuthorityEditing()) { + DesignerContext.getDesignerFrame().doResize(); + } } }); addMouseListener(new MouseAdapter() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 394dfca1e2..b2ea7be11f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.base.FRContext; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -66,7 +67,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private JPanel leftPane; private JPanel rightPane; private FixedPopupPane currentPopupPane; - private static final int CONTAINER_WIDTH = 286; + private static final int CONTAINER_WIDTH = containerWidth(); private static final int TAB_WIDTH = 38; private static final int TAB_BUTTON_WIDTH = 32; private static final int TAB_BUTTON_HEIGHT = 28; @@ -107,6 +108,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板) + private static int containerWidth() { + if (FRContext.isChineseEnv()) { + return UIEastResizableContainer.MIN_CONTAINER_WIDTH; + } + return UIEastResizableContainer.MAX_CONTAINER_WIDTH; + } + /** * 得到实例 *