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;