Browse Source

REPORT-7034【报表】设计器》frm》body属性的布局方式切换以后,body的事件以及移动端设置均失效

feature/big-screen
hades 5 years ago
parent
commit
1b087b977c
  1. 36
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java
  2. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  3. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java
  4. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

36
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<T extends WSortLayout> extends AbstractDataModify<T> {
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));
}
}
}

4
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) { if (layoutType == WBodyLayoutType.ABSOLUTE) {
((XWFitLayout) creator.getBackupParent()).toData().resetStyle(); ((XWFitLayout) creator.getBackupParent()).toData().resetStyle();
if (state == WBodyLayoutType.FIT.getTypeValue()) { 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()); layout.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue());

2
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. * Created by ibm on 2017/8/2.
*/ */
public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayout> { public class FRAbsoluteLayoutDefinePane extends AbstractFRLayoutDefinePane<WAbsoluteLayout> {
protected UIComboBox comboBox; protected UIComboBox comboBox;
public FRAbsoluteLayoutDefinePane(XCreator xCreator) { public FRAbsoluteLayoutDefinePane(XCreator xCreator) {

4
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.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WFitLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
@ -48,7 +49,7 @@ import java.awt.Dimension;
/** /**
* Created by ibm on 2017/8/2. * Created by ibm on 2017/8/2.
*/ */
public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> { public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout> {
private static final int ADAPT_LABEL_MAX_WIDTH = 80; private static final int ADAPT_LABEL_MAX_WIDTH = 80;
private XWFitLayout xWFitLayout; private XWFitLayout xWFitLayout;
private WFitLayout wFitLayout; private WFitLayout wFitLayout;
@ -208,6 +209,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
} }
xwAbsoluteBodyLayout.add(component); xwAbsoluteBodyLayout.add(component);
} }
copyLayoutAttr(wFitLayout, wAbsoluteBodyLayout);
xWFitLayout.setBackupParent(xwAbsoluteBodyLayout); xWFitLayout.setBackupParent(xwAbsoluteBodyLayout);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators( formDesigner.getSelectionModel().setSelectedCreators(

Loading…
Cancel
Save