|
|
@ -46,89 +46,99 @@ public class Inner extends AccessDirection { |
|
|
|
return new Point(x, y); |
|
|
|
return new Point(x, y); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
//TODO 原先这个类是通过一个new一个匿名类继承RectangleDesigner接口实现的,但是报了方法超过50行的PMD错误
|
|
|
|
protected void sorptionPoint(Point point, Rectangle current_bounds, final FormDesigner designer) { |
|
|
|
//TODO 暂时就先这样命名,请原作者看到后重新命名
|
|
|
|
RectangleDesigner rd = new RectangleDesigner() { |
|
|
|
private class RectangleDesigner1 implements RectangleDesigner { |
|
|
|
public void setXAbsorptionline(Absorptionline line) { |
|
|
|
private FormDesigner designer = null; |
|
|
|
designer.getStateModel().setXAbsorptionline(line); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void setYAbsorptionline(Absorptionline line) { |
|
|
|
|
|
|
|
designer.getStateModel().setYAbsorptionline(line); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取当前选中块的水平线数组 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return 块的水平线数组 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public int[] getHorizontalLine(){ |
|
|
|
|
|
|
|
return ArrayUtils.EMPTY_INT_ARRAY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取当前选中块的垂直线数组 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return 块的垂直线数组 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public int[] getVerticalLine(){ |
|
|
|
|
|
|
|
return ArrayUtils.EMPTY_INT_ARRAY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public RectangleIterator createRectangleIterator() { |
|
|
|
|
|
|
|
return getRectangleIterator(designer); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
public RectangleDesigner1(FormDesigner designer) { |
|
|
|
* 设置designer内部组件是否重叠的标志位 |
|
|
|
this.designer = designer; |
|
|
|
* |
|
|
|
} |
|
|
|
* @param isIntersects 是否重叠 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void setWidgetsIntersects(boolean isIntersects) { |
|
|
|
|
|
|
|
designer.setWidgetsIntersect(isIntersects); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
public void setXAbsorptionline(Absorptionline line) { |
|
|
|
* 获取designer内部组件是否重叠的标志位 |
|
|
|
designer.getStateModel().setXAbsorptionline(line); |
|
|
|
* |
|
|
|
} |
|
|
|
* @return 重叠 |
|
|
|
public void setYAbsorptionline(Absorptionline line) { |
|
|
|
*/ |
|
|
|
designer.getStateModel().setYAbsorptionline(line); |
|
|
|
@Override |
|
|
|
} |
|
|
|
public boolean getWidgetsIntersects() { |
|
|
|
|
|
|
|
return designer.isWidgetsIntersect(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取designer相对屏幕的位置 |
|
|
|
* 获取当前选中块的水平线数组 |
|
|
|
* |
|
|
|
* |
|
|
|
* @return 位置 |
|
|
|
* @return 块的水平线数组 |
|
|
|
*/ |
|
|
|
* |
|
|
|
@Override |
|
|
|
*/ |
|
|
|
public Point getDesignerLocationOnScreen() { |
|
|
|
public int[] getHorizontalLine(){ |
|
|
|
return designer.getLocationOnScreen(); |
|
|
|
return ArrayUtils.EMPTY_INT_ARRAY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置等距线 |
|
|
|
* 获取当前选中块的垂直线数组 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param line 吸附线 |
|
|
|
* @return 块的垂直线数组 |
|
|
|
*/ |
|
|
|
* |
|
|
|
@Override |
|
|
|
*/ |
|
|
|
public void setEquidistantLine(Absorptionline line) { |
|
|
|
public int[] getVerticalLine(){ |
|
|
|
designer.getStateModel().setEquidistantLine(line); |
|
|
|
return ArrayUtils.EMPTY_INT_ARRAY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public RectangleIterator createRectangleIterator() { |
|
|
|
|
|
|
|
return getRectangleIterator(designer); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
/** |
|
|
|
public int getDesignerScrollHorizontalValue() { |
|
|
|
* 设置designer内部组件是否重叠的标志位 |
|
|
|
return designer.getArea().getHorizontalValue(); |
|
|
|
* |
|
|
|
} |
|
|
|
* @param isIntersects 是否重叠 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void setWidgetsIntersects(boolean isIntersects) { |
|
|
|
|
|
|
|
designer.setWidgetsIntersect(isIntersects); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
/** |
|
|
|
public int getDesignerScrollVerticalValue() { |
|
|
|
* 获取designer内部组件是否重叠的标志位 |
|
|
|
return designer.getArea().getVerticalValue(); |
|
|
|
* |
|
|
|
} |
|
|
|
* @return 重叠 |
|
|
|
}; |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean isWidgetsIntersects() { |
|
|
|
|
|
|
|
return designer.isWidgetsIntersect(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取designer相对屏幕的位置 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return 位置 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Point getDesignerLocationOnScreen() { |
|
|
|
|
|
|
|
return designer.getLocationOnScreen(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 设置等距线 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param line 吸附线 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void setEquidistantLine(Absorptionline line) { |
|
|
|
|
|
|
|
designer.getStateModel().setEquidistantLine(line); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int getDesignerScrollHorizontalValue() { |
|
|
|
|
|
|
|
return designer.getArea().getHorizontalValue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int getDesignerScrollVerticalValue() { |
|
|
|
|
|
|
|
return designer.getArea().getVerticalValue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected void sorptionPoint(Point point, Rectangle current_bounds, final FormDesigner designer) { |
|
|
|
|
|
|
|
RectangleDesigner1 rd = new RectangleDesigner1(designer); |
|
|
|
//判断当前操作的是不是参数面板,要特殊处理
|
|
|
|
//判断当前操作的是不是参数面板,要特殊处理
|
|
|
|
boolean isParameterLayout = ((XCreator)(designer.getSelectionModel().getSelection().getSelectedCreator().getParent())).acceptType(XWParameterLayout.class); |
|
|
|
boolean isParameterLayout = ((XCreator)(designer.getSelectionModel().getSelection().getSelectedCreator().getParent())).acceptType(XWParameterLayout.class); |
|
|
|
point.setLocation(MoveUtils.sorption(point.x, point.y, current_bounds.width, current_bounds.height, rd, isParameterLayout)); |
|
|
|
point.setLocation(MoveUtils.sorption(point.x, point.y, current_bounds.width, current_bounds.height, rd, isParameterLayout)); |
|
|
|