|
|
@ -1,7 +1,10 @@ |
|
|
|
package com.fr.design.fit.attrpane; |
|
|
|
package com.fr.design.fit.attrpane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.io.IOFile; |
|
|
|
import com.fr.base.io.IOFile; |
|
|
|
import com.fr.base.iofile.attr.WatermarkAttr; |
|
|
|
import com.fr.base.iofile.attr.WatermarkAttr; |
|
|
|
|
|
|
|
import com.fr.base.theme.FormTheme; |
|
|
|
|
|
|
|
import com.fr.base.theme.TemplateTheme; |
|
|
|
import com.fr.design.data.DataCreatorUI; |
|
|
|
import com.fr.design.data.DataCreatorUI; |
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
@ -15,14 +18,15 @@ import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
|
|
|
import com.fr.design.gui.style.FollowingThemePane; |
|
|
|
|
|
|
|
import com.fr.design.gui.xpane.LayoutStylePane; |
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.mainframe.FormSelectionUtils; |
|
|
|
import com.fr.design.mainframe.FormSelectionUtils; |
|
|
|
import com.fr.design.mainframe.WidgetPropertyPane; |
|
|
|
import com.fr.design.mainframe.WidgetPropertyPane; |
|
|
|
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor; |
|
|
|
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.utils.gui.UIComponentUtils; |
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; |
|
|
|
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; |
|
|
@ -34,6 +38,7 @@ 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.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
import com.fr.general.act.BorderPacker; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.report.core.ReportUtils; |
|
|
|
import com.fr.report.core.ReportUtils; |
|
|
|
|
|
|
|
|
|
|
@ -54,7 +59,8 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane<WFit |
|
|
|
private UIComboBox layoutComboBox; |
|
|
|
private UIComboBox layoutComboBox; |
|
|
|
private UISpinner componentIntervel; |
|
|
|
private UISpinner componentIntervel; |
|
|
|
private PaddingBoundPane paddingBound; |
|
|
|
private PaddingBoundPane paddingBound; |
|
|
|
private AccessibleWLayoutBorderStyleEditor stylePane; |
|
|
|
private FollowingThemePane themePane; |
|
|
|
|
|
|
|
private LayoutStylePane stylePane; |
|
|
|
private AccessibleBodyWatermarkEditor watermarkEditor; |
|
|
|
private AccessibleBodyWatermarkEditor watermarkEditor; |
|
|
|
|
|
|
|
|
|
|
|
public FRFitLayoutExtendDefinePane(XCreator xCreator) { |
|
|
|
public FRFitLayoutExtendDefinePane(XCreator xCreator) { |
|
|
@ -67,53 +73,80 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane<WFit |
|
|
|
|
|
|
|
|
|
|
|
public void initComponent() { |
|
|
|
public void initComponent() { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
UIExpandablePane layoutExpandablePane = new UIExpandablePane( |
|
|
|
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), |
|
|
|
|
|
|
|
280, 20, |
|
|
|
|
|
|
|
createLayoutPane() |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
this.add(layoutExpandablePane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
JPanel advancePane = createAdvancePane(); |
|
|
|
JPanel advancePane = createAdvancePane(); |
|
|
|
UIExpandablePane advanceExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, advancePane); |
|
|
|
UIExpandablePane advanceExpandablePane = new UIExpandablePane( |
|
|
|
this.add(advanceExpandablePane, BorderLayout.NORTH); |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), |
|
|
|
UIExpandablePane layoutExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, createLayoutPane()); |
|
|
|
280, 20, |
|
|
|
this.add(layoutExpandablePane, BorderLayout.CENTER); |
|
|
|
advancePane |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
this.add(advanceExpandablePane, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JPanel createAdvancePane() { |
|
|
|
public JPanel createAdvancePane() { |
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel contentPane0 = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
stylePane = new AccessibleWLayoutBorderStyleEditor(); |
|
|
|
|
|
|
|
|
|
|
|
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Widget_Style_Setting")); |
|
|
|
|
|
|
|
stylePane = new LayoutStylePane(); |
|
|
|
|
|
|
|
themePane.addFollowThemePane(stylePane, new FollowingThemePane.FollowingThemeActionChangeListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onFollowingTheme(boolean following) { |
|
|
|
|
|
|
|
stylePane.supportBodyStyle(!following); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BorderPacker style = stylePane.updateBean(); |
|
|
|
|
|
|
|
if (following) { |
|
|
|
|
|
|
|
TemplateTheme theme = themePane.getUsingTheme(); |
|
|
|
|
|
|
|
if (theme instanceof FormTheme) { |
|
|
|
|
|
|
|
style = ((FormTheme) theme).getBodyStyle().merge(style); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
stylePane.populateBean((LayoutBorderStyle) style); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
contentPane0.add(themePane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel contentPane1 = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
contentPane0.add(contentPane1, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
watermarkEditor = new AccessibleBodyWatermarkEditor(); |
|
|
|
watermarkEditor = new AccessibleBodyWatermarkEditor(); |
|
|
|
paddingBound = new PaddingBoundPane(); |
|
|
|
JPanel waterMarkPane = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
|
|
|
new Component[][]{ |
|
|
|
new Component[][]{ |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")), stylePane}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), watermarkEditor} |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), watermarkEditor} |
|
|
|
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1); |
|
|
|
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1); |
|
|
|
jp2.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
waterMarkPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
jPanel.add(paddingBound, BorderLayout.CENTER); |
|
|
|
contentPane1.add(waterMarkPane, BorderLayout.NORTH); |
|
|
|
jPanel.add(jp2, BorderLayout.NORTH); |
|
|
|
|
|
|
|
return jPanel; |
|
|
|
paddingBound = new PaddingBoundPane(); |
|
|
|
|
|
|
|
contentPane1.add(paddingBound, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return contentPane0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JPanel createLayoutPane() { |
|
|
|
public JPanel createLayoutPane() { |
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel containerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
|
|
|
layoutComboBox = initUIComboBox(FRLayoutTypeItems.ITEMS); |
|
|
|
layoutComboBox = initUIComboBox(FRLayoutTypeItems.ITEMS); |
|
|
|
componentIntervel = new UISpinner(0, Integer.MAX_VALUE, 1, 0); |
|
|
|
componentIntervel = new UISpinner(0, Integer.MAX_VALUE, 1, 0); |
|
|
|
JPanel componentIntervelPane = UIComponentUtils.wrapWithBorderLayoutPane(componentIntervel); |
|
|
|
JPanel componentIntervelPane = UIComponentUtils.wrapWithBorderLayoutPane(componentIntervel); |
|
|
|
|
|
|
|
|
|
|
|
UILabel intervalLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Component_Interval")); |
|
|
|
UILabel intervalLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Component_Interval")); |
|
|
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
new Component[][]{ |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout_Type")), layoutComboBox}, |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
{intervalLabel, componentIntervelPane} |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
}, |
|
|
|
|
|
|
|
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
|
|
|
|
containerPane.add(contentPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
return containerPane; |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout_Type")), layoutComboBox}, |
|
|
|
|
|
|
|
new Component[]{intervalLabel, componentIntervelPane} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
|
|
|
centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); |
|
|
|
|
|
|
|
jPanel.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
return jPanel; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -144,7 +177,9 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane<WFit |
|
|
|
paddingBound.populate(ob); |
|
|
|
paddingBound.populate(ob); |
|
|
|
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); |
|
|
|
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); |
|
|
|
componentIntervel.setValue(ob.getCompInterval()); |
|
|
|
componentIntervel.setValue(ob.getCompInterval()); |
|
|
|
stylePane.setValue(ob.getBorderStyle()); |
|
|
|
themePane.supportFollowingTheme(ob.supportThemed()); |
|
|
|
|
|
|
|
themePane.setFollowingTheme(ob.isBorderStyleFollowingTheme()); |
|
|
|
|
|
|
|
stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle()); |
|
|
|
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile())); |
|
|
|
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -163,7 +198,8 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane<WFit |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding_Duplicate"))) { |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding_Duplicate"))) { |
|
|
|
paddingBound.update(layout); |
|
|
|
paddingBound.update(layout); |
|
|
|
} |
|
|
|
} |
|
|
|
LayoutBorderStyle borderStyle = (LayoutBorderStyle) stylePane.getValue(); |
|
|
|
layout.setBorderStyleFollowingTheme(themePane.isFollowingTheme()); |
|
|
|
|
|
|
|
LayoutBorderStyle borderStyle = stylePane.updateBean(); |
|
|
|
if (borderStyle != null) { |
|
|
|
if (borderStyle != null) { |
|
|
|
layout.setBorderStyle(borderStyle); |
|
|
|
layout.setBorderStyle(borderStyle); |
|
|
|
} |
|
|
|
} |
|
|
|