public class FRFitLayoutAdapter extends FRBodyLayoutAdapter
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
WIDGETPANEICONPATH |
actualVal, BORDER_PROPORTION, BOTTOM_HALF, COMP_BOTTOM, COMP_LEFT, COMP_RIGHT, COMP_TOP, DEFAULT_AREA_LENGTH, downComps, isFindRelatedComps, leftComps, margin, minHeight, minWidth, rightComps, TOP_HALF, trisectAreaDirect, upComps
container, layout
构造器和说明 |
---|
FRFitLayoutAdapter(XLayoutContainer container)
构造函数
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
accept(XCreator creator,
int x,
int y)
能否对应位置放置当前组件
|
void |
addComp(XCreator child,
int x,
int y)
添加组件
|
void |
calculateBounds(java.awt.Rectangle backupBound,
java.awt.Rectangle bounds,
XCreator xCreator,
int row,
int difference)
拖拽控件边框后,根据控件的大小尺寸,进行相关组件的调整
|
protected void |
calculateDownRelatComponent(int objY,
int objHeight)
删除或拉伸下边框 调整下方的组件位置大小
|
protected boolean |
calculateLefttRelatComponent(int objWidth)
删除或拉伸控件左边框时 调整左侧的组件位置大小;
|
protected boolean |
calculateLefttRelatComponent(int objWidth,
boolean isDel) |
protected void |
calculateRelatedComponent(int objX,
int objY,
int objWidth,
int objHeight)
获取有哪些相关联的组件
|
protected void |
calculateRightRelatComponent(int objX,
int objWidth)
删除或拉伸控件右边框 调整右侧组件位置大小
|
protected boolean |
calculateUpRelatComponent(int objHeight)
删除或拉伸上边框 调整上方的组件位置大小
|
protected boolean |
calculateUpRelatComponent(int objHeight,
boolean isDel) |
protected boolean |
canAcceptWhileCrossPoint(java.awt.Component comp,
int x,
int y)
交叉点区域时,能否对应位置放入组件
|
protected boolean |
canAcceptWhileTrisection(java.awt.Component comp,
int x,
int y)
三等分区域时,能否对应位置放入组件
|
protected void |
delete(XCreator creator,
int creatorWidth,
int creatorHeight)
删除组件或者重新拖动时,其它组件重新计算位置大小
|
void |
fix(XCreator creator)
拖拽控件边框后,根据控件的大小尺寸,进行相关组件的调整
|
void |
fix(XCreator child,
int x,
int y)
新拖入组件时,计算调整其他关联组件位置大小
|
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 java.awt.Rectangle |
getLayoutBound(XWCardMainBorderLayout mainLayout) |
ConstraintsGroupModel |
getLayoutConstraints(XCreator creator) |
GroupModel |
getLayoutProperties()
返回布局自身属性,方便一些特有设置在layout刷新时处理
|
HoverPainter |
getPainter()
返回该布局管理适配器的Painter,为容器提供放置位置的标识。
|
boolean |
intersectsEdge(int x,
int y,
XLayoutContainer container)
是否在组件边缘
|
boolean |
isCrossPointArea(java.awt.Component currentComp,
int x,
int y)
是否为组件交叉点区域 或者是相邻三组建中间点
|
boolean |
isEdit() |
boolean |
isTrisectionArea(java.awt.Component parentComp,
int x,
int y)
判断是否鼠标在组件的三等分区域,如果组件在布局管理器中间,上下左右都可能会三等分
|
boolean |
matchEdge(int x,
int y)
是否在组件边缘
|
void |
recalculateChildrenSize(int x,
int y,
int creatorWidth,
int creatorHeight)
重新计算内部组件大小
|
void |
recalculateChildrenSize(int x,
int y,
int creatorWidth,
int creatorHeight,
boolean isDel)
重新计算内部组件大小
|
void |
setEdit(boolean edit) |
void |
updateCreatorBackBound() |
clearCompsList, getParaEditorYOffset, initCompsList
addAfter, addBean, addBefore, addNextComponent, canAcceptMoreComponent, getContainer, removeBean, showComponent, supportBackupSize, whetherUseBackupSize
public static final java.lang.String WIDGETPANEICONPATH
public FRFitLayoutAdapter(XLayoutContainer container)
container
- XWFitLayout容器public boolean isEdit()
public void setEdit(boolean edit)
public HoverPainter getPainter()
LayoutAdapter
getPainter
在接口中 LayoutAdapter
getPainter
在类中 AbstractLayoutAdapter
public GroupModel getLayoutProperties()
getLayoutProperties
在接口中 LayoutAdapter
getLayoutProperties
在类中 AbstractLayoutAdapter
public void addComp(XCreator child, int x, int y)
addComp
在类中 FRBodyLayoutAdapter
child
- 待添加的组件x
- 坐标xy
- 坐标ypublic void updateCreatorBackBound()
public boolean accept(XCreator creator, int x, int y)
accept
在接口中 LayoutAdapter
accept
在类中 FRBodyLayoutAdapter
creator
- 组件x
- 添加的位置x,该位置是相对于container的y
- 添加的位置y,该位置是相对于container的public boolean matchEdge(int x, int y)
x
- 横坐标y
- 纵坐标public boolean intersectsEdge(int x, int y, XLayoutContainer container)
x
- 横坐标y
- 纵坐标container
- 参照组件protected boolean canAcceptWhileCrossPoint(java.awt.Component comp, int x, int y)
canAcceptWhileCrossPoint
在类中 FRBodyLayoutAdapter
comp
- 待放置组件x
- xy
- yprotected boolean canAcceptWhileTrisection(java.awt.Component comp, int x, int y)
FRBodyLayoutAdapter
canAcceptWhileTrisection
在类中 FRBodyLayoutAdapter
comp
- 待放置组件x
- xy
- ypublic boolean isTrisectionArea(java.awt.Component parentComp, int x, int y)
isTrisectionArea
在类中 FRBodyLayoutAdapter
parentComp
- 鼠标所在区域的组件x
- 坐标xy
- 坐标ypublic boolean isCrossPointArea(java.awt.Component currentComp, int x, int y)
isCrossPointArea
在类中 FRBodyLayoutAdapter
currentComp
- 当前组件x
- 坐标xy
- 坐标yprotected java.awt.Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout)
public void fix(XCreator creator)
fix
在接口中 LayoutAdapter
fix
在类中 AbstractLayoutAdapter
creator
- 组件public void calculateBounds(java.awt.Rectangle backupBound, java.awt.Rectangle bounds, XCreator xCreator, int row, int difference)
backupBound
- 边界备份bounds
- 组件边界xCreator
- 组件row
- 选中的行difference
- 偏移量public void fix(XCreator child, int x, int y)
child
- 新拖入的组件x
- 鼠标所在x坐标y
- 鼠标所在y坐标protected void fixHalve(java.awt.Component currentComp, XCreator child, int x, int y)
fixHalve
在类中 FRBodyLayoutAdapter
currentComp
- 当前位置组件child
- 待放置组件x
- xy
- yprotected void fixCrossPointArea(java.awt.Component currentComp, XCreator child, int x, int y)
fixCrossPointArea
在类中 FRBodyLayoutAdapter
currentComp
- 当前位置组件child
- 待放置组件x
- xy
- yprotected void fixTrisect(java.awt.Component currentComp, XCreator child, int x, int y)
fixTrisect
在类中 FRBodyLayoutAdapter
currentComp
- 鼠标所在组件child
- 待插入组件protected void delete(XCreator creator, int creatorWidth, int creatorHeight)
delete
在类中 AbstractLayoutAdapter
public void recalculateChildrenSize(int x, int y, int creatorWidth, int creatorHeight)
x
- 坐标xy
- 坐标ycreatorWidth
- 删除的组件之前所在布局的宽度creatorHeight
- 删除的组件之前所在布局的高度public void recalculateChildrenSize(int x, int y, int creatorWidth, int creatorHeight, boolean isDel)
x
- 坐标xy
- 坐标ycreatorWidth
- 删除的组件之前所在布局的宽度creatorHeight
- 删除的组件之前所在布局的高度isDel
- 删除操作protected void calculateRelatedComponent(int objX, int objY, int objWidth, int objHeight)
protected void calculateRightRelatComponent(int objX, int objWidth)
objX
- 调整后的坐标xobjWidth
- 调整后的宽度protected boolean calculateLefttRelatComponent(int objWidth)
protected boolean calculateLefttRelatComponent(int objWidth, boolean isDel)
protected void calculateDownRelatComponent(int objY, int objHeight)
protected boolean calculateUpRelatComponent(int objHeight)
protected boolean calculateUpRelatComponent(int objHeight, boolean isDel)
public int[] getChildPosition(java.awt.Component currentComp, XCreator child, int x, int y)
getChildPosition
在类中 FRBodyLayoutAdapter
public ConstraintsGroupModel getLayoutConstraints(XCreator creator)
getLayoutConstraints
在接口中 LayoutAdapter
getLayoutConstraints
在类中 AbstractLayoutAdapter