|
|
@ -16,6 +16,7 @@ import com.fr.design.designer.creator.XWTitleLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
import com.fr.design.fun.FormWidgetOptionProvider; |
|
|
|
import com.fr.design.fun.FormWidgetOptionProvider; |
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
|
|
|
|
import com.fr.design.utils.gui.LayoutUtils; |
|
|
|
import com.fr.form.main.Form; |
|
|
|
import com.fr.form.main.Form; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
import com.fr.form.ui.container.WTitleLayout; |
|
|
|
import com.fr.form.ui.container.WTitleLayout; |
|
|
@ -290,11 +291,25 @@ public class FormSelectionUtils { |
|
|
|
public static XCreator copyXcreator(Form form, XCreator xCreator) throws CloneNotSupportedException{ |
|
|
|
public static XCreator copyXcreator(Form form, XCreator xCreator) throws CloneNotSupportedException{ |
|
|
|
Widget copied = (Widget) xCreator.toData().clone(); |
|
|
|
Widget copied = (Widget) xCreator.toData().clone(); |
|
|
|
XCreator copiedCreator = XCreatorUtils.createXCreator(copied, xCreator.getSize()); |
|
|
|
XCreator copiedCreator = XCreatorUtils.createXCreator(copied, xCreator.getSize()); |
|
|
|
|
|
|
|
//主要用来处理组件间隔和padding,保证界面上展示的组件尺寸是计算过padding和组件间隔的
|
|
|
|
|
|
|
|
LayoutUtils.layoutContainer(copiedCreator); |
|
|
|
|
|
|
|
traverAndAdjust(copiedCreator); |
|
|
|
ArrayList<String> nameSpace = new ArrayList<>(); |
|
|
|
ArrayList<String> nameSpace = new ArrayList<>(); |
|
|
|
copyWidgetName(form, nameSpace, copiedCreator); |
|
|
|
copyWidgetName(form, nameSpace, copiedCreator); |
|
|
|
return copiedCreator; |
|
|
|
return copiedCreator; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void traverAndAdjust(XCreator creator) { |
|
|
|
|
|
|
|
for (int i = 0; i < creator.getComponentCount(); i++) { |
|
|
|
|
|
|
|
Object object = creator.getComponent(i); |
|
|
|
|
|
|
|
if (object instanceof XCreator) { |
|
|
|
|
|
|
|
XCreator temp = (XCreator) object; |
|
|
|
|
|
|
|
temp.adjustCompSize(0.0); |
|
|
|
|
|
|
|
traverAndAdjust(temp); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 拷贝组件 |
|
|
|
* 拷贝组件 |
|
|
|
* @param form 当前表单 |
|
|
|
* @param form 当前表单 |
|
|
|