Browse Source

REPORT-67316 决策报表-客户模板是绝对布局固定大小的,复制客户模板里的tab到一个新建的绝对布局固定大小frm,保存关闭再打开新建模板,tab下的报表块尺寸变了

feature/x
kerry 3 years ago
parent
commit
a1fdbf1e0d
  1. 15
      designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java

15
designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java

@ -16,6 +16,7 @@ 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.design.utils.gui.LayoutUtils;
import com.fr.form.main.Form;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WTitleLayout;
@ -290,11 +291,25 @@ public class FormSelectionUtils {
public static XCreator copyXcreator(Form form, XCreator xCreator) throws CloneNotSupportedException{
Widget copied = (Widget) xCreator.toData().clone();
XCreator copiedCreator = XCreatorUtils.createXCreator(copied, xCreator.getSize());
//主要用来处理组件间隔和padding,保证界面上展示的组件尺寸是计算过padding和组件间隔的
LayoutUtils.layoutContainer(copiedCreator);
traverAndAdjust(copiedCreator);
ArrayList<String> nameSpace = new ArrayList<>();
copyWidgetName(form, nameSpace, 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 当前表单

Loading…
Cancel
Save