From 5ce56e4942f7a4b461fdec45ad6ebb29694d35b1 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 30 Nov 2020 15:08:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-42913=20=E6=94=B9=E5=8F=98=E7=94=B5?= =?UTF-8?q?=E8=84=91=E5=88=86=E8=BE=A8=E7=8E=87=E5=AF=BC=E8=87=B4=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E4=B8=A2=E5=A4=B1=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E6=95=B0=E6=8D=AE=E9=9B=86=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E7=9A=84=E4=BD=8D=E7=BD=AE=E4=B8=8E=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E9=83=BD=E8=B7=9Fparent.getHeight()=20-=20toolPaneY=E6=9C=89?= =?UTF-8?q?=E5=85=B3=EF=BC=8C=E8=80=8C=E5=9C=A8Windows=E4=B8=8B=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=85=88=E6=8A=8A=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=9A=84=E9=AB=98=E5=BA=A6=E8=B0=83=E7=9A=84?= =?UTF-8?q?=E6=AF=94=E8=BE=83=E5=B0=8F=EF=BC=8C=E7=84=B6=E5=90=8E=E5=87=8F?= =?UTF-8?q?=E5=B0=8F=E5=88=86=E8=BE=A8=E7=8E=87=E6=88=96=E8=80=85=E8=B0=83?= =?UTF-8?q?=E5=A4=A7dpi=E4=BD=BF=E6=95=B4=E4=B8=AA=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=94=BE=E5=A4=A7=E6=97=B6=EF=BC=8Cparent.getHeight()=E4=BC=9A?= =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= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=BD=93=E5=8F=91=E7=8E=B0=E7=88=B6?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E9=AB=98=E5=BA=A6=E6=9C=89=E5=8F=98=E5=8C=96?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=8F=8A=E6=97=B6=E8=B0=83=E6=95=B4toolPaneY?= =?UTF-8?q?=E7=9A=84=E5=A4=A7=E5=B0=8F=EF=BC=8C=E9=81=BF=E5=85=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E9=9D=A2=E6=9D=BF=E6=97=A0=E6=B3=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icontainer/UIResizableContainer.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 0a8529abf3..4f4ac9e3b5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -45,6 +45,7 @@ public class UIResizableContainer extends JPanel { private boolean isLeftRightDragEnabled = true; private boolean isDownPaneVisible = true ; private int paraHeight; + private int parentHeight = -1; public UIResizableContainer(int direction) { this(new JPanel(), new JPanel(), direction); @@ -207,7 +208,8 @@ public class UIResizableContainer extends JPanel { if (verticalToolPane == null || downPane == null) { return; } - + // REPORT-42913 如果用户修改了分辨率或者dpi,可能造成toolPaneY大于parent.getHeight,整个downPane将丢失,因此这里调整下toolPaneY + adjustToolPaneY(parent); if (direction == Constants.RIGHT) { if(isDownPaneVisible){ upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); @@ -236,6 +238,18 @@ public class UIResizableContainer extends JPanel { } } + private void adjustToolPaneY(Container parent) { + if (parentHeight == -1) { + // 初始化下parentheight,存一下当前的父容器height + parentHeight = parent.getHeight(); + } else if (parentHeight != parent.getHeight()) { + // parentHeight与父容器height不等时,代表用户调整分辨率或者dpi了,此时调整toolPaneY + toolPaneY = toolPaneY * parent.getHeight() / parentHeight; + toolPaneY = Math.min(toolPaneY, (parent.getHeight() - toolPaneHeight)); + parentHeight = parent.getHeight(); + } + } + @Override public void addLayoutComponent(String name, Component comp) { } @@ -540,4 +554,4 @@ public class UIResizableContainer extends JPanel { jf.setSize(500, 500); jf.setVisible(true); } -} \ No newline at end of file +} From 57440714a88276e5b27217e54f457f443788f501 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 1 Dec 2020 09:56:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-42913=20=E4=B8=BA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E6=AC=A1=E5=85=B3=E9=97=AD=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=97=B6upPane=E9=AB=98=E5=BA=A6=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=88=A4=E6=96=AD=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?upPane=E9=AB=98=E5=BA=A6=E8=B6=85=E8=BF=87=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E6=80=BB=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/icontainer/UIResizableContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 4f4ac9e3b5..35bf403dd5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -164,7 +164,7 @@ public class UIResizableContainer extends JPanel { * @param toolPaneY */ public void setLastToolPaneY(int toolPaneY) { - this.toolPaneY = toolPaneY; + this.toolPaneY = Math.min(toolPaneY, (getHeight() - toolPaneHeight)); } /** From 57d997f141b5ceee335d84120a2a2c87502be75c Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 1 Dec 2020 10:03:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-42913=20=E4=B9=8B=E5=89=8D=E6=83=B3?= =?UTF-8?q?=E5=A4=9A=E4=BA=86=EF=BC=8C=E8=BF=99=E4=B8=AA=E5=9C=A8=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E6=97=B6=E5=80=99=E8=BF=98=E6=B2=A1=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E6=B8=B2=E6=9F=93=E6=95=B4=E4=B8=AA=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E7=9A=84=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=AD=A4=E6=97=B6=E6=8B=BF?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E7=88=B6=E5=AE=B9=E5=99=A8=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/icontainer/UIResizableContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 35bf403dd5..4f4ac9e3b5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -164,7 +164,7 @@ public class UIResizableContainer extends JPanel { * @param toolPaneY */ public void setLastToolPaneY(int toolPaneY) { - this.toolPaneY = Math.min(toolPaneY, (getHeight() - toolPaneHeight)); + this.toolPaneY = toolPaneY; } /**