From 3e65344d93dd9e8994b4dccfcd80dfd0e3cd8b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 5 Aug 2021 16:14:22 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-54885=20=E4=BC=98=E5=8C=96=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/AbstractFormParallelLine.java | 8 ++++---- .../design/mainframe/FormHorizontalParallelLine.java | 12 ++++++------ .../fr/design/mainframe/FormSpacingLineDrawer.java | 10 +++++----- .../design/mainframe/FormVerticalParallelLine.java | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/AbstractFormParallelLine.java b/designer-form/src/main/java/com/fr/design/mainframe/AbstractFormParallelLine.java index c815c7aff..0881742ef 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/AbstractFormParallelLine.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/AbstractFormParallelLine.java @@ -17,15 +17,15 @@ public abstract class AbstractFormParallelLine { return (startPosition + endPosition) / 2; } - abstract public Point getCenterPerpendicularLineStartPoint(); + abstract public Point getStartPointOnVerticalCenterLine(); - abstract public Point getCenterPerpendicularLineEndPoint(int parallelValue); + abstract public Point getEndPointOnVerticalCenterLine(int parallelValue); - public boolean isBeforeParallelLine(AbstractFormParallelLine parallelLine) { + public boolean isVerticalCenterLineBeforeTheParallelLine(AbstractFormParallelLine parallelLine) { return this.getCenterPosition() < parallelLine.getStartPosition(); } - public boolean isBehindParallelLine(AbstractFormParallelLine parallelLine) { + public boolean isVerticalCenterLineBehindTheParallelLine(AbstractFormParallelLine parallelLine) { return this.getCenterPosition() > parallelLine.getEndPosition(); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormHorizontalParallelLine.java b/designer-form/src/main/java/com/fr/design/mainframe/FormHorizontalParallelLine.java index 6e0abeb02..da2671d32 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormHorizontalParallelLine.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormHorizontalParallelLine.java @@ -8,14 +8,14 @@ public class FormHorizontalParallelLine extends AbstractFormParallelLine { } @Override - public Point getCenterPerpendicularLineStartPoint() { + public Point getStartPointOnVerticalCenterLine() { Point point = new Point(); point.setLocation(getCenterPosition(), parallelValue); return point; } @Override - public Point getCenterPerpendicularLineEndPoint(int parallelValue) { + public Point getEndPointOnVerticalCenterLine(int parallelValue) { Point point = new Point(); point.setLocation(getCenterPosition(), parallelValue); return point; @@ -24,9 +24,9 @@ public class FormHorizontalParallelLine extends AbstractFormParallelLine { @Override public Point getExtendedLineStartPoint(AbstractFormParallelLine parallelLine) { Point point = new Point(); - if (isBeforeParallelLine(parallelLine)) { + if (isVerticalCenterLineBeforeTheParallelLine(parallelLine)) { point.setLocation(parallelLine.getStartPosition(), parallelLine.getParallelValue()); - } else if (isBehindParallelLine(parallelLine)) { + } else if (isVerticalCenterLineBehindTheParallelLine(parallelLine)) { point.setLocation(parallelLine.getEndPosition(), parallelLine.getParallelValue()); } return point; @@ -35,9 +35,9 @@ public class FormHorizontalParallelLine extends AbstractFormParallelLine { @Override public Point getExtendedLineEndPoint(AbstractFormParallelLine parallelLine) { Point point = new Point(); - if (isBeforeParallelLine(parallelLine)) { + if (isVerticalCenterLineBeforeTheParallelLine(parallelLine)) { point.setLocation(getStartPosition(), parallelLine.getParallelValue()); - } else if (isBehindParallelLine(parallelLine)) { + } else if (isVerticalCenterLineBehindTheParallelLine(parallelLine)) { point.setLocation(getEndPosition(), parallelLine.getParallelValue()); } return point; 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 df31cf687..0b92efc16 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 @@ -73,10 +73,10 @@ public class FormSpacingLineDrawer { return; } - int startX = (int) nearestSides[0].getCenterPerpendicularLineStartPoint().getX(); - int startY = (int) nearestSides[0].getCenterPerpendicularLineStartPoint().getY(); - int endX = (int) nearestSides[0].getCenterPerpendicularLineEndPoint(nearestSides[1].getParallelValue()).getX(); - int endY = (int) nearestSides[0].getCenterPerpendicularLineEndPoint(nearestSides[1].getParallelValue()).getY(); + 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(); drawSpacingLine(g, startX, startY, endX, endY); drawSpacingText(g, String.valueOf(gap), (startX + endX) / 2, (startY + endY) / 2); @@ -140,7 +140,7 @@ public class FormSpacingLineDrawer { } private boolean isNeedExtendedLine(AbstractFormParallelLine[] nearestSides) { - return nearestSides[0].isBeforeParallelLine(nearestSides[1]) || nearestSides[0].isBehindParallelLine(nearestSides[1]); + return nearestSides[0].isVerticalCenterLineBeforeTheParallelLine(nearestSides[1]) || nearestSides[0].isVerticalCenterLineBehindTheParallelLine(nearestSides[1]); } private boolean isSelectedRootPane() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormVerticalParallelLine.java b/designer-form/src/main/java/com/fr/design/mainframe/FormVerticalParallelLine.java index 0d02f122b..e99cdd207 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormVerticalParallelLine.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormVerticalParallelLine.java @@ -8,14 +8,14 @@ public class FormVerticalParallelLine extends AbstractFormParallelLine { } @Override - public Point getCenterPerpendicularLineStartPoint() { + public Point getStartPointOnVerticalCenterLine() { Point point = new Point(); point.setLocation(parallelValue, getCenterPosition()); return point; } @Override - public Point getCenterPerpendicularLineEndPoint(int parallelValue) { + public Point getEndPointOnVerticalCenterLine(int parallelValue) { Point point = new Point(); point.setLocation(parallelValue, getCenterPosition()); return point; @@ -24,9 +24,9 @@ public class FormVerticalParallelLine extends AbstractFormParallelLine { @Override public Point getExtendedLineStartPoint(AbstractFormParallelLine parallelLine) { Point point = new Point(); - if (isBeforeParallelLine(parallelLine)) { + if (isVerticalCenterLineBeforeTheParallelLine(parallelLine)) { point.setLocation(parallelLine.getParallelValue(), parallelLine.getStartPosition()); - } else if (isBehindParallelLine(parallelLine)) { + } else if (isVerticalCenterLineBehindTheParallelLine(parallelLine)) { point.setLocation(parallelLine.getParallelValue(), parallelLine.getEndPosition()); } return point; @@ -35,9 +35,9 @@ public class FormVerticalParallelLine extends AbstractFormParallelLine { @Override public Point getExtendedLineEndPoint(AbstractFormParallelLine parallelLine) { Point point = new Point(); - if (isBeforeParallelLine(parallelLine)) { + if (isVerticalCenterLineBeforeTheParallelLine(parallelLine)) { point.setLocation(parallelLine.getParallelValue(), getStartPosition()); - } else if (isBehindParallelLine(parallelLine)) { + } else if (isVerticalCenterLineBehindTheParallelLine(parallelLine)) { point.setLocation(parallelLine.getParallelValue(), getEndPosition()); } return point;