|
|
@ -142,22 +142,29 @@ public class SelectionModel { |
|
|
|
int leftUpY = container.toData().getMargin().getTop() + 1; |
|
|
|
int leftUpY = container.toData().getMargin().getTop() + 1; |
|
|
|
//选中第一个坐标点坐在的组件
|
|
|
|
//选中第一个坐标点坐在的组件
|
|
|
|
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); |
|
|
|
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); |
|
|
|
pasteFromClipBoard(); |
|
|
|
Rectangle rectangle = selection.getRelativeBounds(); |
|
|
|
|
|
|
|
if (hasSelectedPasteSource()) { |
|
|
|
|
|
|
|
selectedPaste(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
FormSelectionUtils.paste2Container(designer, container, clipboard, |
|
|
|
|
|
|
|
rectangle.x + rectangle.width / 2, |
|
|
|
|
|
|
|
rectangle.y + DELTA_X_Y); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//自适应布局编辑器内部左上角第一个坐标点
|
|
|
|
//自适应布局编辑器内部左上角第一个坐标点
|
|
|
|
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; |
|
|
|
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; |
|
|
|
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; |
|
|
|
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; |
|
|
|
//选中第一个坐标点坐在的组件
|
|
|
|
//选中第一个坐标点坐在的组件
|
|
|
|
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); |
|
|
|
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); |
|
|
|
|
|
|
|
Rectangle rectangle = selection.getRelativeBounds(); |
|
|
|
if (hasSelectedPasteSource()) { |
|
|
|
if (hasSelectedPasteSource()) { |
|
|
|
selectedPaste(); |
|
|
|
selectedPaste(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), |
|
|
|
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), |
|
|
|
clipboard, |
|
|
|
clipboard, |
|
|
|
DELTA_X_Y, |
|
|
|
rectangle.x + rectangle.width / 2, |
|
|
|
DELTA_X_Y); |
|
|
|
rectangle.y + DELTA_X_Y); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//绝对布局
|
|
|
|
//绝对布局
|
|
|
|