public class FRBodyLayoutAdapter extends AbstractLayoutAdapter
限定符和类型 | 字段和说明 |
---|---|
protected int |
actualVal |
protected static int |
BORDER_PROPORTION |
protected static double |
BOTTOM_HALF |
protected static int |
COMP_BOTTOM |
protected static int |
COMP_LEFT |
protected static int |
COMP_RIGHT |
protected static int |
COMP_TOP |
protected static int |
DEFAULT_AREA_LENGTH |
protected java.util.List<java.awt.Component> |
downComps |
protected boolean |
isFindRelatedComps |
protected java.util.List<java.awt.Component> |
leftComps |
protected PaddingMargin |
margin |
protected int |
minHeight |
protected int |
minWidth |
protected java.util.List<java.awt.Component> |
rightComps |
protected static double |
TOP_HALF |
protected int |
trisectAreaDirect |
protected java.util.List<java.awt.Component> |
upComps |
container, layout
构造器和说明 |
---|
FRBodyLayoutAdapter(XLayoutContainer container) |
限定符和类型 | 方法和说明 |
---|---|
boolean |
accept(XCreator creator,
int x,
int y)
在添加组件状态时,当鼠标移动到某个容器上方时,如果该容器有布局管理器,则会调用该布局
管理适配器的accept来决定当前位置是否可以放置,并提供特殊的标识,比如红色区域标识。
|
protected void |
addComp(XCreator creator,
int x,
int y) |
protected boolean |
canAcceptWhileCrossPoint(java.awt.Component comp,
int x,
int y)
交叉点区域时,能否对应位置放入组件
|
protected boolean |
canAcceptWhileTrisection(java.awt.Component comp,
int x,
int y)
三等分区域时,能否对应位置放入组件
|
protected void |
clearCompsList()
清除周边组件列表
|
protected void |
fixCrossPointArea(java.awt.Component currentComp,
XCreator child,
int x,
int y)
组件交叉区域进行插入时,调整受到变动的其他组件,之前是交叉区域插入也按照三等分逻辑,后面测试中发现有bug,改为和bi一样的鼠标所在侧平分
默认左上角、右下角区域是垂直方向插入组件
右上角和左下角是水平方向插入组件,这样避免田字块时重复
|
protected void |
fixHalve(java.awt.Component currentComp,
XCreator child,
int x,
int y)
平分,正常情况拖入组件时,按照上1/4区域、下1/4区域为上下平分,中左侧1/2区域、中右侧1/2区域为左右平分
|
protected void |
fixTrisect(java.awt.Component currentComp,
XCreator child,
int x,
int y)
三等分区域时,调整相关联的组件
|
int[] |
getChildPosition(java.awt.Component currentComp,
XCreator child,
int x,
int y)
不调整,只计算位置
|
protected int |
getParaEditorYOffset()
获取因为参数面板导致的Y坐标偏移
|
protected void |
initCompsList()
初始化周边组件列表
|
boolean |
isCrossPointArea(java.awt.Component currentComp,
int x,
int y)
是否为组件交叉点区域 或者是相邻三组建中间点
|
boolean |
isTrisectionArea(java.awt.Component parentComp,
int x,
int y)
判断是否鼠标在组件的三等分区域,如果组件在布局管理器中间,上下左右都可能会三等分
|
addAfter, addBean, addBefore, addNextComponent, canAcceptMoreComponent, delete, fix, getContainer, getLayoutConstraints, getLayoutProperties, getPainter, removeBean, showComponent, supportBackupSize, whetherUseBackupSize
protected static final int COMP_TOP
protected static final int COMP_BOTTOM
protected static final int COMP_LEFT
protected static final int COMP_RIGHT
protected static final double TOP_HALF
protected static final double BOTTOM_HALF
protected static final int DEFAULT_AREA_LENGTH
protected static final int BORDER_PROPORTION
protected int trisectAreaDirect
protected java.util.List<java.awt.Component> rightComps
protected java.util.List<java.awt.Component> leftComps
protected java.util.List<java.awt.Component> downComps
protected java.util.List<java.awt.Component> upComps
protected boolean isFindRelatedComps
protected int minWidth
protected int minHeight
protected int actualVal
protected PaddingMargin margin
public FRBodyLayoutAdapter(XLayoutContainer container)
public boolean accept(XCreator creator, int x, int y)
creator
- 组件x
- 添加的位置x,该位置是相对于container的y
- 添加的位置y,该位置是相对于container的protected void addComp(XCreator creator, int x, int y)
addComp
在类中 AbstractLayoutAdapter
protected boolean canAcceptWhileCrossPoint(java.awt.Component comp, int x, int y)
comp
- 待放置组件x
- xy
- yprotected boolean canAcceptWhileTrisection(java.awt.Component comp, int x, int y)
comp
- 待放置组件x
- xy
- ypublic boolean isTrisectionArea(java.awt.Component parentComp, int x, int y)
parentComp
- 鼠标所在区域的组件x
- 坐标xy
- 坐标ypublic boolean isCrossPointArea(java.awt.Component currentComp, int x, int y)
currentComp
- 当前组件x
- 坐标xy
- 坐标yprotected void initCompsList()
protected void clearCompsList()
protected void fixHalve(java.awt.Component currentComp, XCreator child, int x, int y)
currentComp
- 当前位置组件child
- 待放置组件x
- xy
- yprotected int getParaEditorYOffset()
protected void fixCrossPointArea(java.awt.Component currentComp, XCreator child, int x, int y)
currentComp
- 当前位置组件child
- 待放置组件x
- xy
- yprotected void fixTrisect(java.awt.Component currentComp, XCreator child, int x, int y)
currentComp
- 鼠标所在组件child
- 待插入组件public int[] getChildPosition(java.awt.Component currentComp, XCreator child, int x, int y)