|
|
|
@ -1,10 +1,11 @@
|
|
|
|
|
package com.fr.design.parameter; |
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fine.swing.ui.layout.Column; |
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
|
import com.fr.design.border.FineBorderFactory; |
|
|
|
|
import com.fr.design.data.DataCreatorUI; |
|
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
|
import com.fr.design.designer.creator.CRPropertyDescriptor; |
|
|
|
|
import com.fr.design.designer.creator.PropertyGroupPane; |
|
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
@ -21,18 +22,16 @@ import com.fr.design.gui.ilable.UILabel;
|
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.mainframe.DesignerUIModeConfig; |
|
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
|
import com.fr.design.mainframe.FormSelection; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; |
|
|
|
|
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder; |
|
|
|
|
import com.fr.design.utils.gui.LayoutUtils; |
|
|
|
|
import com.fr.design.utils.gui.UIComponentUtils; |
|
|
|
|
import com.fr.design.widget.ui.designer.AbstractDataModify; |
|
|
|
|
import com.fr.design.widget.ui.designer.component.UIBoundSpinner; |
|
|
|
|
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder; |
|
|
|
|
import com.fr.form.ui.container.WParameterLayout; |
|
|
|
|
import com.fr.general.Background; |
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
@ -40,7 +39,6 @@ import com.fr.plugin.observer.PluginEvent;
|
|
|
|
|
import com.fr.plugin.observer.PluginEventListener; |
|
|
|
|
import com.fr.report.stable.FormConstants; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import javax.swing.JCheckBox; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
@ -51,6 +49,14 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.fix; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT; |
|
|
|
|
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT; |
|
|
|
|
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Created by ibm on 2017/8/2. |
|
|
|
|
*/ |
|
|
|
@ -69,6 +75,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
private PropertyGroupPane extraPropertyGroupPane; |
|
|
|
|
protected final List<BasicBeanPane<WParameterLayout>> extraPaneList = new ArrayList<>(); |
|
|
|
|
private JPanel backgroundPane; |
|
|
|
|
private JPanel corePane; |
|
|
|
|
|
|
|
|
|
public RootDesignDefinePane(XCreator xCreator) { |
|
|
|
|
super(xCreator); |
|
|
|
@ -80,6 +87,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
|
|
|
|
|
public void initComponent() { |
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
corePane = new Column(); |
|
|
|
|
this.add(corePane, BorderLayout.CENTER); |
|
|
|
|
if (newForm) { |
|
|
|
|
paraHeight = new UIBoundSpinner(0, Integer.MAX_VALUE, 1, 0); |
|
|
|
|
} else { |
|
|
|
@ -87,10 +96,11 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
} |
|
|
|
|
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); |
|
|
|
|
corePane.add(advanceExpandablePane); |
|
|
|
|
JPanel layoutPane = createBoundsPane(); |
|
|
|
|
UIExpandablePane layoutExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Size"), 280, 20, layoutPane); |
|
|
|
|
this.add(layoutExpandablePane, BorderLayout.CENTER); |
|
|
|
|
corePane.add(fix(10).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())).getComponent()); |
|
|
|
|
corePane.add(layoutExpandablePane); |
|
|
|
|
this.addExtraUIExpandablePaneFromPlugin(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -104,23 +114,21 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
panel.add(uiExpandablePane); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.add(panel, BorderLayout.SOUTH); |
|
|
|
|
corePane.add(panel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JPanel createBoundsPane() { |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}}; |
|
|
|
|
Component[] component = newForm ? new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Design_Height")), paraHeight} : |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Desin_Width")), designerWidth}; |
|
|
|
|
Component[][] components = new Component[][]{component}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
|
jPanel.add(panel); |
|
|
|
|
return jPanel; |
|
|
|
|
if (newForm) { |
|
|
|
|
return row( |
|
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Design_Height"))).weight(LEFT_WEIGHT), |
|
|
|
|
cell(paraHeight).weight(RIGHT_WEIGHT) |
|
|
|
|
).getComponent(); |
|
|
|
|
} else { |
|
|
|
|
return row( |
|
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Desin_Width"))).weight(LEFT_WEIGHT), |
|
|
|
|
cell(designerWidth).weight(RIGHT_WEIGHT) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public JPanel createAdvancePane() { |
|
|
|
@ -139,14 +147,12 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
* @date: 2020/11/05 15:36 |
|
|
|
|
*/ |
|
|
|
|
private JPanel getTemplateAdvancePane() { |
|
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
labelNameTextField = new UITextField(); |
|
|
|
|
displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); |
|
|
|
|
UIComponentUtils.setLineWrap(displayReport); |
|
|
|
|
useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); |
|
|
|
|
fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event")); |
|
|
|
|
fireAfterEditor.setEnabled(false); |
|
|
|
|
fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); |
|
|
|
|
useParamsTemplate.addChangeListener(e -> { |
|
|
|
|
boolean isSelected = ((UICheckBox) e.getSource()).isSelected(); |
|
|
|
|
fireAfterEditor.setEnabled(isSelected); |
|
|
|
@ -154,37 +160,37 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
fireAfterEditor.setSelected(false); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),}; |
|
|
|
|
Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()}, |
|
|
|
|
{new LazyIcon("h_center"), new LazyIcon("h_center").white()}, |
|
|
|
|
{new LazyIcon("h_right"), new LazyIcon("h_right").white()}}; |
|
|
|
|
Integer[] hAlignment = new Integer[]{FormConstants.LEFTPOSITION, FormConstants.CENTERPOSITION, FormConstants.RIGHTPOSITION}; |
|
|
|
|
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment); |
|
|
|
|
|
|
|
|
|
hAlignmentPane = new UIButtonGroup<>(hAlignmentIconArray, hAlignment); |
|
|
|
|
hAlignmentPane.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Left") |
|
|
|
|
, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Right")}); |
|
|
|
|
backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
this.initExtraPane(); |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p, p, p, p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), backgroundPane}, |
|
|
|
|
new Component[]{displayReport, null}, |
|
|
|
|
new Component[]{useParamsTemplate, null}, |
|
|
|
|
new Component[]{fireAfterEditor, null}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position")), hAlignmentPane} |
|
|
|
|
}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
CRPropertyDescriptor[] extraTableEditor = new CRPropertyDescriptor[0]; |
|
|
|
|
extraTableEditor = root.getExtraTableEditor(); |
|
|
|
|
CRPropertyDescriptor[] extraTableEditor = root.getExtraTableEditor(); |
|
|
|
|
extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, root); |
|
|
|
|
|
|
|
|
|
jPanel.add(panel, BorderLayout.NORTH); |
|
|
|
|
jPanel.add(extraPropertyGroupPane, BorderLayout.CENTER); |
|
|
|
|
return jPanel; |
|
|
|
|
return column(VERTICAL_GAP, |
|
|
|
|
row( |
|
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT), |
|
|
|
|
cell(labelNameTextField).weight(RIGHT_WEIGHT) |
|
|
|
|
), |
|
|
|
|
row( |
|
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background"))).weight(LEFT_WEIGHT), |
|
|
|
|
cell(backgroundPane).weight(RIGHT_WEIGHT) |
|
|
|
|
), |
|
|
|
|
cell(displayReport), |
|
|
|
|
cell(useParamsTemplate), |
|
|
|
|
cell(fireAfterEditor), |
|
|
|
|
row( |
|
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position"))).weight(LEFT_WEIGHT), |
|
|
|
|
cell(hAlignmentPane).weight(RIGHT_WEIGHT) |
|
|
|
|
), |
|
|
|
|
cell(extraPropertyGroupPane) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initExtraPane() { |
|
|
|
@ -244,14 +250,12 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
* @date: 2020/11/05 15:36 |
|
|
|
|
*/ |
|
|
|
|
private JPanel getNewFormAdvancePane() { |
|
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
labelNameTextField = new UITextField(); |
|
|
|
|
displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); |
|
|
|
|
UIComponentUtils.setLineWrap(displayReport); |
|
|
|
|
useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); |
|
|
|
|
fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event")); |
|
|
|
|
fireAfterEditor.setEnabled(false); |
|
|
|
|
fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); |
|
|
|
|
useParamsTemplate.addChangeListener(e -> { |
|
|
|
|
boolean isSelected = ((UICheckBox) e.getSource()).isSelected(); |
|
|
|
|
fireAfterEditor.setEnabled(isSelected); |
|
|
|
@ -261,24 +265,20 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
}); |
|
|
|
|
backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
this.initExtraPane(); |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p, p, p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), backgroundPane}, |
|
|
|
|
new Component[]{displayReport, null}, |
|
|
|
|
new Component[]{useParamsTemplate, null}, |
|
|
|
|
new Component[]{fireAfterEditor, null}, |
|
|
|
|
}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0)); |
|
|
|
|
|
|
|
|
|
jPanel.add(panel, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
return jPanel; |
|
|
|
|
return column(VERTICAL_GAP, |
|
|
|
|
row( |
|
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT), |
|
|
|
|
cell(labelNameTextField).weight(RIGHT_WEIGHT) |
|
|
|
|
), |
|
|
|
|
row( |
|
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background"))).weight(LEFT_WEIGHT), |
|
|
|
|
cell(backgroundPane).weight(RIGHT_WEIGHT) |
|
|
|
|
), |
|
|
|
|
cell(displayReport), |
|
|
|
|
cell(useParamsTemplate), |
|
|
|
|
cell(fireAfterEditor) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|