diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java index e570ee515d..9d69f2247e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java @@ -132,7 +132,17 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam } private UITextField createEditor() { - UITextField editor = new UITextField(); + UITextField editor = new UITextField() { + @Override + protected void initListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + attributeChange(); + } + }); + } + }; editor.setEditable(false); editor.setPreferredSize(new Dimension(110, 20)); addPopupListener(editor); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java index eb50df659b..d096471a7c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java @@ -51,29 +51,29 @@ public class UpMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { gapFix.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); titleWidthFix.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); buttonGroup.add(titleWidthFix); + JPanel flowLeft = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); + flowLeft.add(gapFix); + flowLeft.add(titleWidthFix); + JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{displayGap, flowLeft}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 15, 20)); + centerPane.setPreferredSize(new Dimension(500, 20)); + final JPanel wrapTabWidthPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tabWidthLabel, tabWidthPanel}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + wrapTabWidthPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 15, 20)); + wrapTabWidthPanel.setPreferredSize(new Dimension(200, 20)); gapFix.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { updatePreviewPane(); + wrapTabWidthPanel.setVisible(titleWidthFix.isSelected()); } }); titleWidthFix.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { updatePreviewPane(); + wrapTabWidthPanel.setVisible(titleWidthFix.isSelected()); } }); - - - JPanel flowLeft = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); - flowLeft.add(gapFix); - flowLeft.add(titleWidthFix); - JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{displayGap, flowLeft}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); - centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 15, 20)); - centerPane.setPreferredSize(new Dimension(500, 20)); - JPanel wrapTabWidthPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tabWidthLabel, tabWidthPanel}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); - wrapTabWidthPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 15, 20)); - wrapTabWidthPanel.setPreferredSize(new Dimension(200, 20)); JPanel outerPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); outerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 5, 20)); outerPane.add(centerPane); 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 0000000000..0a718ee60c --- /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 900334cb7a..3a53cf5ffb 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 a5dabe2f05..dff0e159a1 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 @@ -11,7 +11,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.form.ui.container.WAbsoluteLayout; import javax.swing.BorderFactory; @@ -23,7 +22,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 ff8ef4411f..4481307bff 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 @@ -26,7 +26,6 @@ import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; -import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.Widget; @@ -48,7 +47,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 +207,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { } xwAbsoluteBodyLayout.add(component); } + copyLayoutAttr(wFitLayout, wAbsoluteBodyLayout); xWFitLayout.setBackupParent(xwAbsoluteBodyLayout); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); formDesigner.getSelectionModel().setSelectedCreators( diff --git a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java index 753e3e7763..e92bf212ee 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java @@ -10,7 +10,10 @@ import com.fr.stable.Constants; import com.fr.stable.unit.*; import javax.swing.*; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; import java.math.BigDecimal; +import java.text.ParseException; /** * @author richie @@ -30,6 +33,17 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane