From 1b087b977c4ab93720cd5a6d6d7a6ba5f1b7155b Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 19 Nov 2019 14:45:27 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-7034=E3=80=90=E6=8A=A5=E8=A1=A8=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E3=80=8Bfrm=E3=80=8Bbody=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E7=9A=84=E5=B8=83=E5=B1=80=E6=96=B9=E5=BC=8F=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=BB=A5=E5=90=8E=EF=BC=8Cbody=E7=9A=84=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=BB=A5=E5=8F=8A=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=9D=87=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/AbstractFRLayoutDefinePane.java | 36 +++++++++++++++++++ .../FRAbsoluteBodyLayoutDefinePane.java | 4 ++- .../layout/FRAbsoluteLayoutDefinePane.java | 2 +- .../layout/FRFitLayoutDefinePane.java | 4 ++- 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java new file mode 100644 index 000000000..0a718ee60 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java @@ -0,0 +1,36 @@ +package com.fr.design.widget.ui.designer.layout; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.widget.ui.designer.AbstractDataModify; +import com.fr.form.ui.container.WSortLayout; + +/** + * @author hades + * @version 9.0 + * Created by hades on 2019/11/18 + */ +public abstract class AbstractFRLayoutDefinePane extends AbstractDataModify { + + + public AbstractFRLayoutDefinePane(XCreator xCreator) { + super(xCreator); + } + + public AbstractFRLayoutDefinePane(XCreator xCreator, FormDesigner designer) { + super(xCreator, designer); + } + + protected void copyLayoutAttr(WSortLayout srcLayout, WSortLayout destLayout) { + destLayout.clearListeners(); + destLayout.clearMobileWidgetList(); + for (int i = 0, len = srcLayout.getMobileWidgetListSize(); i < len; i++) { + destLayout.addMobileWidget(srcLayout.getMobileWidget(i)); + } + destLayout.setSorted(true); + for (int i = 0, len = srcLayout.getListenerSize(); i < len; i++) { + destLayout.addListener(srcLayout.getListener(i)); + } + } + +} diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java index 900334cb7..3a53cf5ff 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java @@ -131,7 +131,9 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { if (layoutType == WBodyLayoutType.ABSOLUTE) { ((XWFitLayout) creator.getBackupParent()).toData().resetStyle(); if (state == WBodyLayoutType.FIT.getTypeValue()) { - ((XWFitLayout)creator.getBackupParent()).switch2FitBodyLayout(creator); + XWFitLayout xwFitLayout = ((XWFitLayout)creator.getBackupParent()); + xwFitLayout.switch2FitBodyLayout(creator); + copyLayoutAttr(layout, xwFitLayout.toData()); } } layout.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue()); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java index a5dabe2f0..81c0bdc67 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java @@ -23,7 +23,7 @@ import java.awt.Component; /** * Created by ibm on 2017/8/2. */ -public class FRAbsoluteLayoutDefinePane extends AbstractDataModify { +public class FRAbsoluteLayoutDefinePane extends AbstractFRLayoutDefinePane { protected UIComboBox comboBox; public FRAbsoluteLayoutDefinePane(XCreator xCreator) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index ff8ef4411..73022d15d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -34,6 +34,7 @@ import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; +import com.fr.form.ui.container.WSortLayout; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.report.core.ReportUtils; @@ -48,7 +49,7 @@ import java.awt.Dimension; /** * Created by ibm on 2017/8/2. */ -public class FRFitLayoutDefinePane extends AbstractDataModify { +public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane { private static final int ADAPT_LABEL_MAX_WIDTH = 80; private XWFitLayout xWFitLayout; private WFitLayout wFitLayout; @@ -208,6 +209,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { } xwAbsoluteBodyLayout.add(component); } + copyLayoutAttr(wFitLayout, wAbsoluteBodyLayout); xWFitLayout.setBackupParent(xwAbsoluteBodyLayout); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); formDesigner.getSelectionModel().setSelectedCreators(