public class SelectionModel
extends java.lang.Object
构造器和说明 |
---|
SelectionModel(FormDesigner designer) |
限定符和类型 | 方法和说明 |
---|---|
void |
copySelectedCreator2ClipBoard()
复制当前选中的组件到剪切板
|
void |
cutSelectedCreator2ClipBoard()
将所选组件剪切到剪切板上
|
void |
deleteSelection()
删除当前所有选择的组件
|
Direction |
getDirectionAt(java.awt.event.MouseEvent e) |
java.awt.Rectangle |
getHotspotBounds()
获得当前选择区域
|
FormSelection |
getSelection() |
boolean |
hasSelectedPasteSource()
是否有组件被选择。
|
boolean |
hasSelectionComponent()
是否有组件被选择。
|
static boolean |
isEmpty()
formSelction是否为空
|
void |
move(int x,
int y)
移动组件至指定位置
|
boolean |
pasteFromClipBoard()
从剪切板粘帖组件
|
void |
releaseDragging()
释放捕获
|
void |
removeCreator(XCreator creator,
int creatorWidth,
int creatorHeight)
从选择组件中删除某组件
|
void |
reset()
重置。
|
void |
selectACreator(XCreator comp) |
void |
selectACreatorAtMouseEvent(java.awt.event.MouseEvent e)
鼠标点击一下,所选中的单个组件。
|
void |
setHotspotBounds(java.awt.Rectangle rect)
设置选择区域
|
void |
setSelectedCreator(XCreator rootComponent) |
void |
setSelectedCreators(java.util.ArrayList<XCreator> rebuildSelection) |
public SelectionModel(FormDesigner designer)
public void reset()
public static boolean isEmpty()
public void selectACreatorAtMouseEvent(java.awt.event.MouseEvent e)
e
- 鼠标事件public void selectACreator(XCreator comp)
public void cutSelectedCreator2ClipBoard()
public void copySelectedCreator2ClipBoard()
public boolean pasteFromClipBoard()
public FormSelection getSelection()
public void deleteSelection()
public void removeCreator(XCreator creator, int creatorWidth, int creatorHeight)
creator
- 组件creatorWidth
- 组件之前宽度creatorHeight
- 组件之前高度public void setHotspotBounds(java.awt.Rectangle rect)
public java.awt.Rectangle getHotspotBounds()
public boolean hasSelectedPasteSource()
举例:frm组件复用 绝对布局情况下,不选择时有三层容器:
底层@see XWBorderLayout
中层@see XWFitLayout
表层@see XWAbsoluteBodyLayout
但是编辑窗口的最外层其实是表层@see XWAbsoluteBodyLayout
,
其他两层不是靠添加组件就可以编辑的。
public boolean hasSelectionComponent()
public void move(int x, int y)
x
- 坐标xy
- 坐标ypublic void releaseDragging()
public Direction getDirectionAt(java.awt.event.MouseEvent e)
public void setSelectedCreator(XCreator rootComponent)
public void setSelectedCreators(java.util.ArrayList<XCreator> rebuildSelection)