|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.fr.design.mainframe; |
|
|
|
|
|
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
import com.fr.design.designer.beans.LayoutAdapter; |
|
|
|
|
import com.fr.design.designer.beans.adapters.layout.AbstractLayoutAdapter; |
|
|
|
|
import com.fr.design.designer.beans.adapters.layout.FRTabFitLayoutAdapter; |
|
|
|
@ -12,6 +13,7 @@ import com.fr.design.designer.creator.XWFitLayout;
|
|
|
|
|
import com.fr.design.designer.creator.XWScaleLayout; |
|
|
|
|
import com.fr.design.designer.creator.XWTitleLayout; |
|
|
|
|
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; |
|
|
|
|
import com.fr.design.fun.FormWidgetOptionProvider; |
|
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
|
import com.fr.form.main.Form; |
|
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
@ -26,6 +28,7 @@ import java.awt.Toolkit;
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 表单选中工具类 |
|
|
|
@ -46,6 +49,8 @@ public class FormSelectionUtils {
|
|
|
|
|
*/ |
|
|
|
|
private static final String POSTFIX = "_c"; |
|
|
|
|
|
|
|
|
|
private static FormWidgetOptionProvider optionProvider; |
|
|
|
|
|
|
|
|
|
private FormSelectionUtils() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -64,10 +69,27 @@ public class FormSelectionUtils {
|
|
|
|
|
//相对布局
|
|
|
|
|
relativePaste(designer, clipboard, adapter, x, y); |
|
|
|
|
return; |
|
|
|
|
} else if (isExtraContainer(parent)) { |
|
|
|
|
// 扩展布局
|
|
|
|
|
optionProvider.formWidgetPaste(clipboard, adapter, x, y); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
Toolkit.getDefaultToolkit().beep(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static boolean isExtraContainer(XLayoutContainer parent) { |
|
|
|
|
if (parent != null) { |
|
|
|
|
Set<FormWidgetOptionProvider> set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); |
|
|
|
|
for (FormWidgetOptionProvider provider : set) { |
|
|
|
|
if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), parent.getClass())) { |
|
|
|
|
optionProvider = provider; |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void rebuildSelection(FormDesigner designer) { |
|
|
|
|
ArrayList<XCreator> newSelection = new ArrayList<>(); |
|
|
|
|