Browse Source

Merge branch 'bugfix/10.0' of https://cloud.finedevelop.com/scm/~hades/design into bugfix/10.0

bugfix/10.0
hades 5 years ago
parent
commit
6142b6ded8
  1. 21
      designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java
  2. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java

21
designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java

@ -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,22 +177,6 @@ public class SelectionModel {
} }
private void pasteXWFitLayout() { private void pasteXWFitLayout() {
if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) {
XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator();
//tab布局编辑器内部左上角第一个坐标点
int leftUpX = container.toData().getMargin().getLeft() + 1;
int leftUpY = container.toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY));
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 leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1;
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1;
@ -206,7 +192,6 @@ public class SelectionModel {
rectangle.y + DELTA_X_Y); rectangle.y + DELTA_X_Y);
} }
} }
}
/** /**
* 粘贴时选择组件 * 粘贴时选择组件

4
designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java

@ -11,6 +11,7 @@ import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
@ -317,6 +318,9 @@ public class FormSelection {
clipBoard.reset(); clipBoard.reset();
for (XCreator root : selection) { for (XCreator root : selection) {
if(root.acceptType(XWTabFitLayout.class)){
continue;
}
try { try {
XCreator creator = XCreatorUtils.createXCreator((Widget) root.toData().clone()); XCreator creator = XCreatorUtils.createXCreator((Widget) root.toData().clone());
creator.setBounds(root.getBounds()); creator.setBounds(root.getBounds());

Loading…
Cancel
Save