|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
package com.fr.design.fit.attrpane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.io.IOFile; |
|
|
|
|
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.designer.IntervalConstants; |
|
|
|
|
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.ilable.UILabel; |
|
|
|
|
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.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
|
import com.fr.design.mainframe.FormSelectionUtils; |
|
|
|
|
import com.fr.design.mainframe.WidgetPropertyPane; |
|
|
|
|
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.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.WFitLayout; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.general.act.BorderPacker; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.report.core.ReportUtils; |
|
|
|
|
|
|
|
|
@ -54,7 +59,8 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane<WFit
|
|
|
|
|
private UIComboBox layoutComboBox; |
|
|
|
|
private UISpinner componentIntervel; |
|
|
|
|
private PaddingBoundPane paddingBound; |
|
|
|
|
private AccessibleWLayoutBorderStyleEditor stylePane; |
|
|
|
|
private FollowingThemePane themePane; |
|
|
|
|
private LayoutStylePane stylePane; |
|
|
|
|
private AccessibleBodyWatermarkEditor watermarkEditor; |
|
|
|
|
|
|
|
|
|
public FRFitLayoutExtendDefinePane(XCreator xCreator) { |
|
|
|
@ -67,53 +73,80 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane<WFit
|
|
|
|
|
|
|
|
|
|
public void initComponent() { |
|
|
|
|
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(); |
|
|
|
|
UIExpandablePane advanceExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, advancePane); |
|
|
|
|
this.add(advanceExpandablePane, BorderLayout.NORTH); |
|
|
|
|
UIExpandablePane layoutExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, createLayoutPane()); |
|
|
|
|
this.add(layoutExpandablePane, BorderLayout.CENTER); |
|
|
|
|
UIExpandablePane advanceExpandablePane = new UIExpandablePane( |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), |
|
|
|
|
280, 20, |
|
|
|
|
advancePane |
|
|
|
|
); |
|
|
|
|
this.add(advanceExpandablePane, BorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JPanel createAdvancePane() { |
|
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
stylePane = new AccessibleWLayoutBorderStyleEditor(); |
|
|
|
|
JPanel contentPane0 = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
paddingBound = new PaddingBoundPane(); |
|
|
|
|
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
JPanel waterMarkPane = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
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} |
|
|
|
|
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1); |
|
|
|
|
jp2.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
jPanel.add(paddingBound, BorderLayout.CENTER); |
|
|
|
|
jPanel.add(jp2, BorderLayout.NORTH); |
|
|
|
|
return jPanel; |
|
|
|
|
waterMarkPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
contentPane1.add(waterMarkPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
paddingBound = new PaddingBoundPane(); |
|
|
|
|
contentPane1.add(paddingBound, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
return contentPane0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JPanel createLayoutPane() { |
|
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
JPanel containerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
|
|
layoutComboBox = initUIComboBox(FRLayoutTypeItems.ITEMS); |
|
|
|
|
componentIntervel = new UISpinner(0, Integer.MAX_VALUE, 1, 0); |
|
|
|
|
JPanel componentIntervelPane = UIComponentUtils.wrapWithBorderLayoutPane(componentIntervel); |
|
|
|
|
|
|
|
|
|
UILabel intervalLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Component_Interval")); |
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
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; |
|
|
|
|
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
new Component[][]{ |
|
|
|
|
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout_Type")), layoutComboBox}, |
|
|
|
|
{intervalLabel, componentIntervelPane} |
|
|
|
|
}, |
|
|
|
|
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
|
containerPane.add(contentPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
return containerPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -144,7 +177,9 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane<WFit
|
|
|
|
|
paddingBound.populate(ob); |
|
|
|
|
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); |
|
|
|
|
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())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -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"))) { |
|
|
|
|
paddingBound.update(layout); |
|
|
|
|
} |
|
|
|
|
LayoutBorderStyle borderStyle = (LayoutBorderStyle) stylePane.getValue(); |
|
|
|
|
layout.setBorderStyleFollowingTheme(themePane.isFollowingTheme()); |
|
|
|
|
LayoutBorderStyle borderStyle = stylePane.updateBean(); |
|
|
|
|
if (borderStyle != null) { |
|
|
|
|
layout.setBorderStyle(borderStyle); |
|
|
|
|
} |
|
|
|
|