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