Browse Source

REPORT-59237 继续优化判断绘制间距线的地方代码

persist/11.0
方磊 3 years ago
parent
commit
8feffddfc0
  1. 33
      designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

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

@ -137,43 +137,22 @@ public class FormSpacingLineDrawer {
GraphDrawHelper.drawString(g2d, text, labelX, labelY); GraphDrawHelper.drawString(g2d, text, labelX, labelY);
} }
private boolean isSelectedParaComponent() {
return designer.getParaComponent() == selectedCreator;
}
private boolean isSelectedRootComponent() {
return designer.isRoot(selectedCreator);
}
private boolean isSelectedForm() {
return selectedCreator.getParent() == null;
}
private boolean isNeedExtendedLine(AbstractFormParallelLine[] nearestSides) { private boolean isNeedExtendedLine(AbstractFormParallelLine[] nearestSides) {
return nearestSides[0].isVerticalCenterLineBeforeTheParallelLine(nearestSides[1]) || nearestSides[0].isVerticalCenterLineBehindTheParallelLine(nearestSides[1]); return nearestSides[0].isVerticalCenterLineBeforeTheParallelLine(nearestSides[1]) || nearestSides[0].isVerticalCenterLineBehindTheParallelLine(nearestSides[1]);
} }
private boolean isSelectedRootPane() {
// form、body、para这三个选中了,都不要画任何间距线
return isSelectedForm() || isSelectedRootComponent() || isSelectedParaComponent();
}
// 当前组件是否在参数面板里面 // 当前组件是否在参数面板里面
private boolean isCompInBody(XCreator creator) { private boolean isComponentInBody(XCreator creator) {
XLayoutContainer container = XCreatorUtils.getHotspotContainer(creator); XLayoutContainer container = XCreatorUtils.getHotspotContainer(creator);
return container != null && !container.acceptType(XWParameterLayout.class); return container != null && !container.acceptType(XWParameterLayout.class);
} }
private boolean isSelectedCompInBody() { private boolean isSelectedComponentInBody() {
return isCompInBody(selectedCreator); return isComponentInBody(selectedCreator);
}
private boolean isHoveredCompInBody() {
return isCompInBody(hoverCreator);
} }
private boolean isCompInBody() { private boolean isHoveredComponentInBody() {
return isSelectedCompInBody() && isHoveredCompInBody(); return isComponentInBody(hoverCreator);
} }
private boolean isBodyAbsoluteLayout() { private boolean isBodyAbsoluteLayout() {
@ -185,7 +164,7 @@ public class FormSpacingLineDrawer {
} }
private boolean isDrawSpacingLine() { private boolean isDrawSpacingLine() {
return isInAbsoluteLayout() && !isSelectedRootPane() && isCompInBody(); return isInAbsoluteLayout() && isSelectedComponentInBody() && isHoveredComponentInBody();
} }
private AbstractFormParallelLine[] getNearestHorizontalSide() { private AbstractFormParallelLine[] getNearestHorizontalSide() {

Loading…
Cancel
Save