|
|
@ -18,7 +18,9 @@ import com.fr.design.utils.ComponentUtils; |
|
|
|
import com.fr.design.utils.gui.LayoutUtils; |
|
|
|
import com.fr.design.utils.gui.LayoutUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
import java.awt.LayoutManager; |
|
|
|
|
|
|
|
import java.awt.Rectangle; |
|
|
|
|
|
|
|
import java.awt.Toolkit; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
|
@ -175,36 +177,19 @@ public class SelectionModel { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void pasteXWFitLayout() { |
|
|
|
private void pasteXWFitLayout() { |
|
|
|
if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) { |
|
|
|
//自适应布局编辑器内部左上角第一个坐标点
|
|
|
|
XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator(); |
|
|
|
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; |
|
|
|
//tab布局编辑器内部左上角第一个坐标点
|
|
|
|
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; |
|
|
|
int leftUpX = container.toData().getMargin().getLeft() + 1; |
|
|
|
//选中第一个坐标点坐在的组件
|
|
|
|
int leftUpY = container.toData().getMargin().getTop() + 1; |
|
|
|
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); |
|
|
|
//选中第一个坐标点坐在的组件
|
|
|
|
Rectangle rectangle = selection.getRelativeBounds(); |
|
|
|
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); |
|
|
|
if (hasSelectedPasteSource()) { |
|
|
|
Rectangle rectangle = selection.getRelativeBounds(); |
|
|
|
selectedPaste(); |
|
|
|
if (hasSelectedPasteSource()) { |
|
|
|
|
|
|
|
selectedPaste(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
FormSelectionUtils.paste2Container(designer, container, clipboard, |
|
|
|
|
|
|
|
rectangle.x + rectangle.width / 2, |
|
|
|
|
|
|
|
rectangle.y + DELTA_X_Y); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//自适应布局编辑器内部左上角第一个坐标点
|
|
|
|
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), |
|
|
|
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; |
|
|
|
clipboard, |
|
|
|
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; |
|
|
|
rectangle.x + rectangle.width / 2, |
|
|
|
//选中第一个坐标点坐在的组件
|
|
|
|
rectangle.y + DELTA_X_Y); |
|
|
|
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); |
|
|
|
|
|
|
|
Rectangle rectangle = selection.getRelativeBounds(); |
|
|
|
|
|
|
|
if (hasSelectedPasteSource()) { |
|
|
|
|
|
|
|
selectedPaste(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), |
|
|
|
|
|
|
|
clipboard, |
|
|
|
|
|
|
|
rectangle.x + rectangle.width / 2, |
|
|
|
|
|
|
|
rectangle.y + DELTA_X_Y); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|