From 52d9dfdf35449753a4e3f2f83a69408545264007 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 18 Aug 2021 15:42:36 +0800 Subject: [PATCH 01/14] =?UTF-8?q?REPORT-56049=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E7=BB=84=E4=BB=B6=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=A0=91=E9=80=89=E4=B8=AD=E6=8E=A7=E4=BB=B6=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E9=80=89=E4=B8=AD=E5=90=8E=E4=B8=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E7=9A=84=E8=AF=9D=EF=BC=8C=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=87=BA=E7=8E=B0=E5=B7=A5=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/ComponentTree.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java index 0f39f089f8..2d0bb383fc 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java @@ -425,6 +425,7 @@ public class ComponentTree extends JTree { Rectangle rectangle = getRelativeBounds(comp); comp.showSelectedPopup(designer, rectangle, comp.acceptType(XWTitleLayout.class, XWCardMainBorderLayout.class, XWAbsoluteLayout.class)); comp.setSelected(true); + designer.repaint(); } /** From 768b74b87b32dfeff62658b2f5307c76a7f537b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 18 Aug 2021 16:32:58 +0800 Subject: [PATCH 02/14] =?UTF-8?q?REPORT-56926&REPORT-57238=20=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E5=9B=A0=E4=B8=BA=E4=BF=AE=E5=A4=8D=E8=BF=99=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E9=97=AE=E9=A2=98=E5=BC=95=E8=B5=B7=E7=9A=84=E6=96=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/MultiSelectionArrangement.java | 2 ++ .../mainframe/widget/ui/FormMultiWidgetCardPane.java | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java b/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java index 54298e186d..27756de832 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java @@ -76,6 +76,7 @@ public class MultiSelectionArrangement { // 水平分布,手动,传入一个间距,排列selectedCreators public void horizontalManualDistribution(int gap) { + sortHorizontal(); reSizeRecByHorizontal(gap); horizontalDistribution(gap); } @@ -150,6 +151,7 @@ public class MultiSelectionArrangement { } public void verticalManualDistribution(int gap) { + sortVertical(); reSizeRecByVertical(gap); verticalDistribution(gap); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java index 30dc8124a1..0263df5bf9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java @@ -158,7 +158,13 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane { } private UINumberField createIntNumberField(boolean isVertical, String tipText) { - final UINumberField numberField = new UINumberField(); + final UINumberField numberField = new UINumberField() { + private static final long serialVersionUID = -448512934137620557L; + + public boolean shouldResponseChangeListener() { + return false; + } + }; numberField.setPlaceholder(tipText); numberField.addFocusListener(new FocusAdapter() { @Override From 69bfee3359ca16974c8c82b9a2b68cd881ad4abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 18 Aug 2021 17:12:52 +0800 Subject: [PATCH 03/14] =?UTF-8?q?REPORT-56895=20=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=97=B4=E8=B7=9D=E7=BA=BF=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/FormSpacingLineDrawer.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index e2982f0414..9c3dbe746c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -80,10 +80,10 @@ public class FormSpacingLineDrawer { return; } - int startX = (int) nearestSides[0].getStartPointOnVerticalCenterLine().getX(); - int startY = (int) nearestSides[0].getStartPointOnVerticalCenterLine().getY(); - int endX = (int) nearestSides[0].getEndPointOnVerticalCenterLine(nearestSides[1].getParallelValue()).getX(); - int endY = (int) nearestSides[0].getEndPointOnVerticalCenterLine(nearestSides[1].getParallelValue()).getY(); + int startX = (int) nearestSides[0].getStartPointOnVerticalCenterLine().getX() - designer.getHorizontalScaleValue(); + int startY = (int) nearestSides[0].getStartPointOnVerticalCenterLine().getY() - designer.getVerticalScaleValue(); + int endX = (int) nearestSides[0].getEndPointOnVerticalCenterLine(nearestSides[1].getParallelValue()).getX() - designer.getHorizontalScaleValue(); + int endY = (int) nearestSides[0].getEndPointOnVerticalCenterLine(nearestSides[1].getParallelValue()).getY() - designer.getVerticalScaleValue(); drawSpacingLine(g, startX, startY, endX, endY); drawSpacingText(g, String.valueOf(gap), (startX + endX) / 2, (startY + endY) / 2); @@ -98,10 +98,10 @@ public class FormSpacingLineDrawer { private void drawExtendedLine(Graphics g, AbstractFormParallelLine[] nearestSides) { if (isNeedExtendedLine(nearestSides)) { - int startX = (int) nearestSides[1].getExtendedLineStartPoint(nearestSides[0]).getX(); - int startY = (int) nearestSides[1].getExtendedLineStartPoint(nearestSides[0]).getY(); - int endX = (int) nearestSides[1].getExtendedLineEndPoint(nearestSides[0]).getX(); - int endY = (int) nearestSides[1].getExtendedLineEndPoint(nearestSides[0]).getY(); + int startX = (int) nearestSides[1].getExtendedLineStartPoint(nearestSides[0]).getX() - designer.getHorizontalScaleValue(); + int startY = (int) nearestSides[1].getExtendedLineStartPoint(nearestSides[0]).getY() - designer.getVerticalScaleValue(); + int endX = (int) nearestSides[1].getExtendedLineEndPoint(nearestSides[0]).getX() - designer.getHorizontalScaleValue(); + int endY = (int) nearestSides[1].getExtendedLineEndPoint(nearestSides[0]).getY() - designer.getVerticalScaleValue(); drawExtendedLine(g, startX, startY, endX, endY); } } From e77b612aa7af2156c0cae01dd0836deb20ae13a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 18 Aug 2021 18:53:22 +0800 Subject: [PATCH 04/14] =?UTF-8?q?REPORT-57333=20=E3=80=90FRM=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E6=8E=A8=E8=8D=90=E3=80=91=E7=BB=84=E4=BB=B6=E5=A4=8D?= =?UTF-8?q?=E7=94=A8-=E7=8E=B0=E5=9C=A8=E8=BF=98=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=BB=9D=E5=AF=B9=E7=94=BB=E5=B8=83=E5=9D=97?= =?UTF-8?q?=E4=B8=8A=E9=87=8D=E5=8F=A0=E6=94=BE=E7=BD=AE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/beans/models/StateModel.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java index 3b676921b1..87459bd07d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java @@ -24,7 +24,6 @@ import java.awt.Cursor; import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; -import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.util.ArrayList; @@ -184,9 +183,6 @@ public class StateModel { FormSelectionUtils.rebuildSelection(designer); designer.getEditListenerTable().fireCreatorModified( selectionModel.getSelection().getSelectedCreator(), DesignerEvent.CREATOR_ADDED); - } else { - selectionModel.getSelection().setSelectionBounds(selectedPositionBackup, designer); - Toolkit.getDefaultToolkit().beep(); } // 取消提示 designer.setPainter(null); From 2018937ad70336f88d8efda4b55afc1570e325c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 18 Aug 2021 20:15:38 +0800 Subject: [PATCH 05/14] =?UTF-8?q?REPORT-57181=20=E3=80=90FRM=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E6=8E=A8=E8=8D=90=E3=80=91=E7=BB=84=E4=BB=B6=E5=A4=8D?= =?UTF-8?q?=E7=94=A8-=E8=87=AA=E5=8A=A8=E9=97=B4=E8=B7=9D=E7=9B=AE?= =?UTF-8?q?=E5=89=8D=E4=B9=88=E6=9C=89=E6=8A=8A=E5=B0=8F=E6=95=B0=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=88=90=E6=95=B4=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/MultiSelectionArrangement.java | 66 ++++++++++++++----- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java b/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java index 27756de832..49dbc8c974 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java @@ -70,22 +70,22 @@ public class MultiSelectionArrangement { // 水平分布,自动,间距由selectedCreators和border共同计算而来 public void horizontalAutoDistribution() { sortHorizontal(); - int gap = calculateHorizontalGap(); - horizontalDistribution(gap); + int[] gaps = calculateHorizontalGaps(); + horizontalDistribution(gaps); } // 水平分布,手动,传入一个间距,排列selectedCreators public void horizontalManualDistribution(int gap) { sortHorizontal(); reSizeRecByHorizontal(gap); - horizontalDistribution(gap); + horizontalDistribution(fillGaps(gap, selectedCreators.size() - 1)); } - private void horizontalDistribution(int gap) { + private void horizontalDistribution(int[] gaps) { for (int i = 1; i < selectedCreators.size() - 1; i++) { XCreator creator = selectedCreators.get(i); XCreator preCreator = selectedCreators.get(i - 1); - creator.setLocation(preCreator.getX() + preCreator.getWidth() + gap, creator.getY()); + creator.setLocation(preCreator.getX() + preCreator.getWidth() + gaps[i - 1], creator.getY()); } update(); } @@ -133,34 +133,35 @@ public class MultiSelectionArrangement { } // 计算selectedCreators的均分间距 - private int calculateHorizontalGap() { + private int[] calculateHorizontalGaps() { int sum = 0; for (XCreator creator : selectedCreators) { sum += creator.getWidth(); } + int gapCount = selectedCreators.size() - 1; XCreator head = selectedCreators.get(0); - XCreator tail = selectedCreators.get(selectedCreators.size() - 1); + XCreator tail = selectedCreators.get(gapCount); int distanceBetweenHeadAndTailCreators = Math.abs(head.getX() - tail.getX()) + tail.getWidth(); - return (distanceBetweenHeadAndTailCreators - sum) / (selectedCreators.size() - 1); + return calculateIntegerGaps(distanceBetweenHeadAndTailCreators - sum, gapCount); } public void verticalAutoDistribution() { sortVertical(); - int gap = calculateVerticalGap(); - verticalDistribution(gap); + int[] gaps = calculateVerticalGaps(); + verticalDistribution(gaps); } public void verticalManualDistribution(int gap) { sortVertical(); reSizeRecByVertical(gap); - verticalDistribution(gap); + verticalDistribution(fillGaps(gap, selectedCreators.size() - 1)); } - private void verticalDistribution(int gap) { + private void verticalDistribution(int[] gaps) { for (int i = 1; i < selectedCreators.size() - 1; i++) { XCreator creator = selectedCreators.get(i); XCreator preCreator = selectedCreators.get(i - 1); - creator.setLocation(creator.getX(), preCreator.getY() + preCreator.getHeight() + gap); + creator.setLocation(creator.getX(), preCreator.getY() + preCreator.getHeight() + gaps[i - 1]); } update(); } @@ -207,15 +208,48 @@ public class MultiSelectionArrangement { }); } - private int calculateVerticalGap() { + private int[] calculateVerticalGaps() { int sum = 0; for (XCreator creator : selectedCreators) { sum += creator.getHeight(); } + int gapCount = selectedCreators.size() - 1; XCreator head = selectedCreators.get(0); - XCreator tail = selectedCreators.get(selectedCreators.size() - 1); + XCreator tail = selectedCreators.get(gapCount); int distanceBetweenHeadAndTailCreators = Math.abs(head.getY() - tail.getY()) + tail.getHeight(); - return (distanceBetweenHeadAndTailCreators - sum) / (selectedCreators.size() - 1); + return calculateIntegerGaps(distanceBetweenHeadAndTailCreators - sum, gapCount); + } + + private int[] calculateIntegerGaps(int gapTotalSize, int gapCount) { + int finalGap[] = new int[gapCount]; + // gapTotalSize: 原先的所有未取整的gap的总和,是一个整数 + int intGap = Math.round((float) gapTotalSize / gapCount); + // 把所有取整的gap求和,得到的整数gap + int intTotalSize = intGap * (gapCount); + // 求差,可以知道总误差 + int difference = intTotalSize - gapTotalSize; + // 遍历,由于取整是四舍五入得到的,取整后每个gap和取整前的gap最多相差0.5,故difference绝对值小于gapCount的 + for (int i = 0; i < gapCount; i++) { + if (i < Math.abs(difference)) { + if (difference < 0) { + // 说明取整后gap总误差小于取整前总gap,一个个加1补上 + finalGap[i] = intGap + 1; + } else { + // 说明取整后gap总误差大于取整前总gap,一个个减1去掉 + finalGap[i] = intGap - 1; + } + } else { + finalGap[i] = intGap; + } + } + return finalGap; + } + + // 创建用gap填满一个size大小的数组 + private int[] fillGaps(int gap, int size) { + int[] gaps = new int[size]; + Arrays.fill(gaps, gap); + return gaps; } private void update() { From 2589d26e3cacefad175150200e615c15823315e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 19 Aug 2021 10:48:08 +0800 Subject: [PATCH 06/14] =?UTF-8?q?REPORT-57333=20=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/beans/models/StateModel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java index 87459bd07d..3b676921b1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java @@ -24,6 +24,7 @@ import java.awt.Cursor; import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; +import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.util.ArrayList; @@ -183,6 +184,9 @@ public class StateModel { FormSelectionUtils.rebuildSelection(designer); designer.getEditListenerTable().fireCreatorModified( selectionModel.getSelection().getSelectedCreator(), DesignerEvent.CREATOR_ADDED); + } else { + selectionModel.getSelection().setSelectionBounds(selectedPositionBackup, designer); + Toolkit.getDefaultToolkit().beep(); } // 取消提示 designer.setPainter(null); From 5b524fefbd317b63c60890434898ef71d97c8e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 19 Aug 2021 11:04:29 +0800 Subject: [PATCH 07/14] =?UTF-8?q?REPORT-57317=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=97=B4=E8=B7=9D=E6=8F=90=E7=A4=BA=E6=96=87=E5=AD=97=E7=9A=84?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormSpacingLineDrawer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index 9c3dbe746c..284df68e1c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -17,9 +17,10 @@ import java.awt.geom.RoundRectangle2D; public class FormSpacingLineDrawer { private static final Color LINE_COLOR = new Color(230, 82, 81); private static final Color TEXT_COLOR = new Color(255, 255, 255); - private static final int TEXT_PADDING_HORIZONTAL = 6; - private static final int TEXT_PADDING_VERTICAL = 1; + private static final int TEXT_PADDING_HORIZONTAL = 8; + private static final int TEXT_PADDING_VERTICAL = 2; private static final int MIN_SPACING = 10; + private static final float TIP_FONT_SIZE = 10F; private FormDesigner designer; private XCreator hoverCreator = null; @@ -109,7 +110,7 @@ public class FormSpacingLineDrawer { private void drawSpacingText(Graphics g, String text, int x, int y) { Graphics2D g2d = (Graphics2D) g.create(); g2d.setColor(LINE_COLOR); - Font newFont = g2d.getFont().deriveFont(8F).deriveFont(Font.BOLD); + Font newFont = g2d.getFont().deriveFont(TIP_FONT_SIZE).deriveFont(Font.BOLD); g2d.setFont(newFont); FontMetrics metrics = g2d.getFontMetrics(); int lineHeight = metrics.getAscent(); // 这里由于都是数字,要居中必须忽略掉leading和descent的高度 From 27b2c177b002bbe9d60b69f4abbaf4002ed8e7a2 Mon Sep 17 00:00:00 2001 From: xiqiu Date: Thu, 19 Aug 2021 13:52:49 +0800 Subject: [PATCH 08/14] =?UTF-8?q?REPORT-53615=20=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=8Bcombox=E7=9A=84=E5=B1=95=E7=A4=BA=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JDBCDefPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 1b2953b4c5..ae3f08a2b6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -515,8 +515,9 @@ public class JDBCDefPane extends JPanel { refreshDriverManage(true); this.driverManageBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Driver_Manage_Self_Define")); String represent = getRepresent(jdbcDatabase.getDriver(), jdbcDatabase.getDriverSource()); - this.driverLoaderBox.removeItem(represent); - this.driverLoaderBox.addItem(represent); + if (!nameAndRepresent.containsValue(represent)) { + this.driverLoaderBox.addItem(represent); + } this.driverLoaderBox.setSelectedItem(represent); } this.urlTextField.setText(jdbcDatabase.getURL()); From 7f4e2c13ccb8cb126db61ffc175bf302a502fcf3 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 19 Aug 2021 14:39:35 +0800 Subject: [PATCH 09/14] =?UTF-8?q?REPORT-57438=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E6=B5=8B=E8=AF=95=E3=80=91=E6=9D=83=E9=99=90=E7=BB=86?= =?UTF-8?q?=E7=B2=92=E5=BA=A6=E6=8E=A7=E5=88=B6-=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=8E=A7=E4=BB=B6=EF=BC=8C=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91=E6=A0=8F=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/widget/ui/FormSingleWidgetCardPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java index a9e5e5d980..9f0c44ded3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.widget.ui; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; @@ -154,7 +155,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { private static void freshPropertyMode(XCreator xCreator) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (!(jTemplate instanceof JForm) && jTemplate.isUpMode()) { + if (!(jTemplate instanceof JForm) && jTemplate.isUpMode() && !DesignModeContext.isAuthorityEditing()) { if (xCreator instanceof XWParameterLayout) { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA); } else { From 35f319633de1afdb4905690c95ae14097344e795 Mon Sep 17 00:00:00 2001 From: xiqiu Date: Thu, 19 Aug 2021 15:16:14 +0800 Subject: [PATCH 10/14] =?UTF-8?q?REPORT-57658=20=20=20=E5=A4=84=E7=90=86od?= =?UTF-8?q?bc=E9=93=BE=E6=8E=A5=E7=9A=84=E5=85=B1=E5=AD=98=E5=85=B3?= =?UTF-8?q?=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JDBCDefPane.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index ae3f08a2b6..3349581248 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -185,6 +185,12 @@ public class JDBCDefPane extends JPanel { driverManageLabel.setVisible(selectSelfDefine); driverLoaderBox.setVisible(selectSelfDefine); driverComboBox.setVisible(!selectSelfDefine); + // 选中自定义的话,将odbc的屏蔽,选中默认的话,重新触发一次driverComboBox的事件 + if (selectSelfDefine) { + odbcTipsLink.setVisible(false); + } else { + driverComboBox.setSelectedItem(driverComboBox.getSelectedItem()); + } } }; ActionListener dbtypeActionListener = new ActionListener() { From 21f5292f2d3fad71ec3184e5a40ebff98d562b6d Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Thu, 19 Aug 2021 15:19:39 +0800 Subject: [PATCH 11/14] =?UTF-8?q?REPORT-57520=20=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97=E5=86=85=E5=9B=BE=E8=A1=A8=E8=B6=85=E9=93=BE=E4=B8=8D?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=98=BE=E7=A4=BA=E6=82=AC=E6=B5=AE=E7=AA=97?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/module/ChartHyperlinkGroup.java | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java index 728ebbe057..7611f3300d 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java @@ -58,26 +58,21 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup { if (template == null) { return false; } - if (template.isJWorkBook() || DesignModeContext.isDuchampMode()) { // 如果是普通报表单元格,那么没有 FormHyperlink 选项 FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); //返回true表示可用,返回false表示不可用 return !ComparatorUtils.equals(clazz, formHyperlink.getClass()); - } else { // 如果是决策报表 - Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; - for (Class aClass : classes) { - if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { - // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 - if (ComparatorUtils.equals(aClass, clazz)) { - return false; - } - } else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { - // 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项 - return !ComparatorUtils.equals(clazz, ChartHyperRelateFloatLink.class); - } + if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { + // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 + Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; + return !ArrayUtils.contains(classes, clazz); + } else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { + // 编辑的是决策报表中的报表块,那么没有 ChartHyperPoplink 和 ChartHyperRelateFloatLink + Class[] classes = new Class[]{ChartHyperPoplink.class, ChartHyperRelateFloatLink.class}; + return !ArrayUtils.contains(classes, clazz); } } return true; @@ -101,17 +96,14 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup { return !ComparatorUtils.equals(object.getClass(), formHyperlink.getClass()); } else { // 如果是决策报表 - Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; - for (Class aClass : classes) { - if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { - // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 - if (ComparatorUtils.equals(aClass, object.getClass())) { - return false; - } - } else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { - // 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项 - return !ComparatorUtils.equals(object.getClass(), ChartHyperRelateFloatLink.class); - } + if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { + // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 + Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; + return !ArrayUtils.contains(classes, object.getClass()); + } else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { + // 编辑的是决策报表中的报表块,那么没有 ChartHyperPoplink 和 ChartHyperRelateFloatLink + Class[] classes = new Class[]{ChartHyperPoplink.class, ChartHyperRelateFloatLink.class}; + return !ArrayUtils.contains(classes, object.getClass()); } } return true; From 03c1ccc659d63a613c3beb7785632a60bb321798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 19 Aug 2021 15:36:23 +0800 Subject: [PATCH 12/14] =?UTF-8?q?REPORT-57128=20=E3=80=90FRM=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E6=8E=A8=E8=8D=90=E3=80=91=E7=BB=84=E4=BB=B6=E5=A4=8D?= =?UTF-8?q?=E7=94=A8-=E5=85=B3=E4=BA=8E=E6=82=AC=E6=B5=AEhover=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E4=BA=A4=E4=BA=92=E8=AE=BE=E8=AE=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 1 + .../com/fr/design/mainframe/FormDesigner.java | 2 +- .../mainframe/FormSpacingLineDrawer.java | 28 ++++++++++++++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 25726a5634..636fdcaaf1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -217,6 +217,7 @@ public class EditingMouseListener extends MouseInputAdapter { int oldX = e.getX(); int oldY = e.getY(); offsetEventPoint(e); + designer.getSpacingLineDrawer().updateMouseEvent(e, false); if (e.isPopupTrigger()) { if (stateModel.isDragging()) { stateModel.draggingCancel(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 7d7b341663..d193b6774f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1145,7 +1145,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection return comp == null ? container : comp; } - private XLayoutContainer getRootContainer(int y) { + public XLayoutContainer getRootContainer(int y) { XLayoutContainer container = y < paraHeight - formArea.getVerticalValue() ? paraComponent : rootComponent; if (container == null) { container = rootComponent; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index 284df68e1c..977d55a686 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -1,6 +1,8 @@ package com.fr.design.mainframe; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.utils.ComponentUtils; import com.fr.stable.Constants; import com.fr.stable.GraphDrawHelper; @@ -35,7 +37,7 @@ public class FormSpacingLineDrawer { public void updateMouseEvent(MouseEvent e, boolean isMouseMoveEvent) { XCreator creator = designer.getSelectionModel().getSelection().getSelectedCreator(); if (creator != null) { - this.hoverCreator = designer.getComponentAt(e.getX(), e.getY(), creator.getLevel()); + this.hoverCreator = getHoverComponentAt(e.getX(), e.getY()); } this.isMouseMoveEvent = isMouseMoveEvent; } @@ -147,13 +149,8 @@ public class FormSpacingLineDrawer { return isSelectedForm() || isSelectedRootComponent(); } - private boolean isSelectedCreatorSameParentWithHoveredCreator() { - XCreator selectedCreator = designer.getSelectionModel().getSelection().getSelectedCreator(); - return selectedCreator != null && hoverCreator != null && selectedCreator.getParent() == hoverCreator.getParent(); - } - private boolean isDrawSpacingLine() { - return !isSelectedRootPane() && isSelectedCreatorSameParentWithHoveredCreator() && isMouseMoveEvent; + return !isSelectedRootPane() && hoverCreator != null && isMouseMoveEvent; } private AbstractFormParallelLine[] getNearestHorizontalSide() { @@ -197,4 +194,21 @@ public class FormSpacingLineDrawer { } return nearestSides; } + + private XCreator getHoverComponentAt(int x, int y) { + XCreator component = designer.getComponentAt(x, y); + XLayoutContainer parent = XCreatorUtils.getHotspotContainer(component).getTopLayout(); + if (parent != null) { + if (!parent.isEditable()) { + return parent; + } else { + if (parent == component) { + return null; + } + return component; + } + } else { + return component; + } + } } From 60d47de8e8db2ba90e13973cf36e70596915cca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 19 Aug 2021 18:37:37 +0800 Subject: [PATCH 13/14] =?UTF-8?q?REPORT-57128&REPORT-57657=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=B8=AD=E4=BC=9A?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=B4=E8=B7=9D=E7=BA=BF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98&=E4=BF=AE=E5=A4=8D=E6=8A=A5=E8=A1=A8=E5=9D=97?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=9D=97=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E7=BA=BF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/FormSpacingLineDrawer.java | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index 977d55a686..ff036c8ef3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -1,8 +1,13 @@ package com.fr.design.mainframe; +import com.fr.design.designer.creator.XChartEditor; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XElementCase; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.form.parameter.FormParaDesigner; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.utils.ComponentUtils; import com.fr.stable.Constants; import com.fr.stable.GraphDrawHelper; @@ -131,6 +136,11 @@ public class FormSpacingLineDrawer { GraphDrawHelper.drawString(g2d, text, labelX, labelY); } + private boolean isSelectedParaComponent() { + return designer.getSelectionModel().getSelection().size() == 1 && + designer.getParaComponent() == designer.getSelectionModel().getSelection().getSelectedCreator(); + } + private boolean isSelectedRootComponent() { return designer.getSelectionModel().getSelection().size() == 1 && designer.isRoot(designer.getSelectionModel().getSelection().getSelectedCreator()); @@ -146,11 +156,38 @@ public class FormSpacingLineDrawer { } private boolean isSelectedRootPane() { - return isSelectedForm() || isSelectedRootComponent(); + // form、body、para这三个选中了,都不要画任何间距线 + return isSelectedForm() || isSelectedRootComponent() || isSelectedParaComponent(); + } + + // 当前组件是否在参数面板里面 + private boolean isCompInPara(XCreator creator) { + XLayoutContainer container = XCreatorUtils.getHotspotContainer(creator); + + boolean xCreatorAccept = creator.acceptType(XWParameterLayout.class); + boolean containerAccept = container != null && container.acceptType(XWParameterLayout.class); + + return xCreatorAccept || containerAccept; + } + + private boolean isBodyAbsoluteLayout() { + return !(designer instanceof FormParaDesigner) && FormDesignerUtils.isBodyAbsolute(designer); + } + + private boolean isSelectedCompInPara() { + return isCompInPara(designer.getSelectionModel().getSelection().getSelectedCreator()); + } + + private boolean isHoveredCompInPara() { + return isCompInPara(hoverCreator); + } + + private boolean isSelectedCompOrHoveredCompInPara() { + return isSelectedCompInPara() || isHoveredCompInPara(); } private boolean isDrawSpacingLine() { - return !isSelectedRootPane() && hoverCreator != null && isMouseMoveEvent; + return isBodyAbsoluteLayout() && !isSelectedRootPane() && hoverCreator != null && !isSelectedCompOrHoveredCompInPara() && isMouseMoveEvent; } private AbstractFormParallelLine[] getNearestHorizontalSide() { @@ -205,6 +242,10 @@ public class FormSpacingLineDrawer { if (parent == component) { return null; } + + if (component instanceof XChartEditor || component instanceof XElementCase) { + return (XCreator) component.getParent(); + } return component; } } else { From 5028683f568c66667eed0da8cfa3eb7bc7d0691f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 19 Aug 2021 18:44:57 +0800 Subject: [PATCH 14/14] =?UTF-8?q?REPORT-57128&REPORT-57657=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81=E5=86=97=E4=BD=99=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormSpacingLineDrawer.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index ff036c8ef3..540c707d49 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -137,18 +137,15 @@ public class FormSpacingLineDrawer { } private boolean isSelectedParaComponent() { - return designer.getSelectionModel().getSelection().size() == 1 && - designer.getParaComponent() == designer.getSelectionModel().getSelection().getSelectedCreator(); + return designer.getParaComponent() == designer.getSelectionModel().getSelection().getSelectedCreator(); } private boolean isSelectedRootComponent() { - return designer.getSelectionModel().getSelection().size() == 1 && - designer.isRoot(designer.getSelectionModel().getSelection().getSelectedCreator()); + return designer.isRoot(designer.getSelectionModel().getSelection().getSelectedCreator()); } private boolean isSelectedForm() { - return designer.getSelectionModel().getSelection().size() == 1 && - designer.getSelectionModel().getSelection().getSelectedCreator().getParent() == null; + return designer.getSelectionModel().getSelection().getSelectedCreator().getParent() == null; } private boolean isNeedExtendedLine(AbstractFormParallelLine[] nearestSides) {