Browse Source

REPORT-54885 优化api命名

feature/10.0
方磊 3 years ago
parent
commit
0c59cab942
  1. 4
      designer-form/src/main/java/com/fr/design/mainframe/AbstractFormParallelLine.java
  2. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormHorizontalParallelLine.java
  3. 8
      designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java
  4. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormVerticalParallelLine.java

4
designer-form/src/main/java/com/fr/design/mainframe/AbstractFormParallelLine.java

@ -17,9 +17,9 @@ public abstract class AbstractFormParallelLine {
return (startPosition + endPosition) / 2;
}
abstract public Point getCenterPoint();
abstract public Point getCenterPerpendicularLineStartPoint();
abstract public Point getPerpendicularPoint(int parallelValue);
abstract public Point getCenterPerpendicularLineEndPoint(int parallelValue);
public boolean isBeforeParallelLine(AbstractFormParallelLine parallelLine) {
return this.getCenterPosition() < parallelLine.getStartPosition();

4
designer-form/src/main/java/com/fr/design/mainframe/FormHorizontalParallelLine.java

@ -8,14 +8,14 @@ public class FormHorizontalParallelLine extends AbstractFormParallelLine {
}
@Override
public Point getCenterPoint() {
public Point getCenterPerpendicularLineStartPoint() {
Point point = new Point();
point.setLocation(getCenterPosition(), parallelValue);
return point;
}
@Override
public Point getPerpendicularPoint(int parallelValue) {
public Point getCenterPerpendicularLineEndPoint(int parallelValue) {
Point point = new Point();
point.setLocation(getCenterPosition(), parallelValue);
return point;

8
designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

@ -73,10 +73,10 @@ public class FormSpacingLineDrawer {
return;
}
int startX = (int) nearestSides[0].getCenterPoint().getX();
int startY = (int) nearestSides[0].getCenterPoint().getY();
int endX = (int) nearestSides[0].getPerpendicularPoint(nearestSides[1].getParallelValue()).getX();
int endY = (int) nearestSides[0].getPerpendicularPoint(nearestSides[1].getParallelValue()).getY();
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();
drawSpacingLine(g, startX, startY, endX, endY);
drawSpacingText(g, String.valueOf(gap), (startX + endX) / 2, (startY + endY) / 2);

4
designer-form/src/main/java/com/fr/design/mainframe/FormVerticalParallelLine.java

@ -8,14 +8,14 @@ public class FormVerticalParallelLine extends AbstractFormParallelLine {
}
@Override
public Point getCenterPoint() {
public Point getCenterPerpendicularLineStartPoint() {
Point point = new Point();
point.setLocation(parallelValue, getCenterPosition());
return point;
}
@Override
public Point getPerpendicularPoint(int parallelValue) {
public Point getCenterPerpendicularLineEndPoint(int parallelValue) {
Point point = new Point();
point.setLocation(parallelValue, getCenterPosition());
return point;

Loading…
Cancel
Save