|
|
@ -2,6 +2,7 @@ package com.fr.design.parameter; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
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.CRPropertyDescriptor; |
|
|
|
import com.fr.design.designer.creator.CRPropertyDescriptor; |
|
|
@ -13,6 +14,7 @@ import com.fr.design.file.HistoryTemplateListPane; |
|
|
|
import com.fr.design.fit.common.TemplateTool; |
|
|
|
import com.fr.design.fit.common.TemplateTool; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.fun.ParameterExpandablePaneUIProvider; |
|
|
|
import com.fr.design.fun.ParameterExpandablePaneUIProvider; |
|
|
|
|
|
|
|
import com.fr.design.fun.WidgetAdvancedPaneProvider; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
@ -32,6 +34,9 @@ import com.fr.design.widget.ui.designer.AbstractDataModify; |
|
|
|
import com.fr.design.widget.ui.designer.component.UIBoundSpinner; |
|
|
|
import com.fr.design.widget.ui.designer.component.UIBoundSpinner; |
|
|
|
import com.fr.form.ui.container.WParameterLayout; |
|
|
|
import com.fr.form.ui.container.WParameterLayout; |
|
|
|
import com.fr.general.Background; |
|
|
|
import com.fr.general.Background; |
|
|
|
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
|
|
|
import com.fr.plugin.observer.PluginEvent; |
|
|
|
|
|
|
|
import com.fr.plugin.observer.PluginEventListener; |
|
|
|
import com.fr.report.stable.FormConstants; |
|
|
|
import com.fr.report.stable.FormConstants; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
@ -41,6 +46,8 @@ import javax.swing.JPanel; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Rectangle; |
|
|
|
import java.awt.Rectangle; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -59,6 +66,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
//是否是新设计模式下决策报表
|
|
|
|
//是否是新设计模式下决策报表
|
|
|
|
private boolean newForm; |
|
|
|
private boolean newForm; |
|
|
|
private PropertyGroupPane extraPropertyGroupPane; |
|
|
|
private PropertyGroupPane extraPropertyGroupPane; |
|
|
|
|
|
|
|
protected final List<BasicBeanPane<WParameterLayout>> extraPaneList = new ArrayList<>(); |
|
|
|
|
|
|
|
private JPanel backgroundPane; |
|
|
|
|
|
|
|
|
|
|
|
public RootDesignDefinePane(XCreator xCreator) { |
|
|
|
public RootDesignDefinePane(XCreator xCreator) { |
|
|
|
super(xCreator); |
|
|
|
super(xCreator); |
|
|
@ -144,7 +153,6 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
fireAfterEditor.setSelected(false); |
|
|
|
fireAfterEditor.setSelected(false); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
background = new AccessibleBackgroundEditor(); |
|
|
|
|
|
|
|
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), |
|
|
|
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_center_normal.png"), |
|
|
|
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),}; |
|
|
|
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),}; |
|
|
@ -152,6 +160,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment); |
|
|
|
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment); |
|
|
|
hAlignmentPane.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Left") |
|
|
|
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")}); |
|
|
|
, 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 f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double[] rowSize = {p, p, p, p, p, p}; |
|
|
|
double[] rowSize = {p, p, p, p, p, p}; |
|
|
@ -159,7 +169,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
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_Form_Label_Name")), labelNameTextField}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), background}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), backgroundPane}, |
|
|
|
new Component[]{displayReport, null}, |
|
|
|
new Component[]{displayReport, null}, |
|
|
|
new Component[]{useParamsTemplate, null}, |
|
|
|
new Component[]{useParamsTemplate, null}, |
|
|
|
new Component[]{fireAfterEditor, null}, |
|
|
|
new Component[]{fireAfterEditor, null}, |
|
|
@ -176,6 +186,54 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
return jPanel; |
|
|
|
return jPanel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initExtraPane() { |
|
|
|
|
|
|
|
initPluginListener(); |
|
|
|
|
|
|
|
refreshExtraAdvancedPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initPluginListener() { |
|
|
|
|
|
|
|
GeneralContext.listenPluginRunningChanged(new PluginEventListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
|
|
|
refreshExtraAdvancedPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, pluginContext -> pluginContext.getRuntime().contain(WidgetAdvancedPaneProvider.XML_TAG)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void refreshExtraAdvancedPane() { |
|
|
|
|
|
|
|
extraPaneList.clear(); |
|
|
|
|
|
|
|
backgroundPane.removeAll(); |
|
|
|
|
|
|
|
Set<WidgetAdvancedPaneProvider<WParameterLayout>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); |
|
|
|
|
|
|
|
for (WidgetAdvancedPaneProvider<WParameterLayout> provider : providers) { |
|
|
|
|
|
|
|
if (!provider.accept(creator)) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (extraPaneList.isEmpty()) { |
|
|
|
|
|
|
|
if (background == null) { |
|
|
|
|
|
|
|
background = new AccessibleBackgroundEditor(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
backgroundPane.add(background); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
for (BasicBeanPane<WParameterLayout> pane : extraPaneList) { |
|
|
|
|
|
|
|
backgroundPane.add(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 插入配置项面板 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param index 插入的位置 |
|
|
|
|
|
|
|
* @param pane 配置项面板 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void insertShortCut(int index, BasicBeanPane<WParameterLayout> pane) { |
|
|
|
|
|
|
|
int size = extraPaneList.size(); |
|
|
|
|
|
|
|
index = Math.min(index, size); |
|
|
|
|
|
|
|
extraPaneList.add(index, pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param |
|
|
|
* @param |
|
|
|
* @Description: 获取新决策报表的AdvancePane |
|
|
|
* @Description: 获取新决策报表的AdvancePane |
|
|
@ -199,8 +257,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
fireAfterEditor.setSelected(false); |
|
|
|
fireAfterEditor.setSelected(false); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
background = new AccessibleBackgroundEditor(); |
|
|
|
backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
this.initExtraPane(); |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double[] rowSize = {p, p, p, p, p}; |
|
|
|
double[] rowSize = {p, p, p, p, p}; |
|
|
@ -208,7 +266,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
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_Form_Label_Name")), labelNameTextField}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), background}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), backgroundPane}, |
|
|
|
new Component[]{displayReport, null}, |
|
|
|
new Component[]{displayReport, null}, |
|
|
|
new Component[]{useParamsTemplate, null}, |
|
|
|
new Component[]{useParamsTemplate, null}, |
|
|
|
new Component[]{fireAfterEditor, null}, |
|
|
|
new Component[]{fireAfterEditor, null}, |
|
|
@ -229,7 +287,13 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void populateBean(WParameterLayout ob) { |
|
|
|
public void populateBean(WParameterLayout ob) { |
|
|
|
labelNameTextField.setText(ob.getLabelName()); |
|
|
|
labelNameTextField.setText(ob.getLabelName()); |
|
|
|
|
|
|
|
if (extraPaneList.isEmpty()) { |
|
|
|
background.setValue(ob.getBackground()); |
|
|
|
background.setValue(ob.getBackground()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
for (BasicBeanPane<WParameterLayout> pane : extraPaneList) { |
|
|
|
|
|
|
|
pane.populateBean(ob); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
displayReport.setSelected(ob.isDelayDisplayContent()); |
|
|
|
displayReport.setSelected(ob.isDelayDisplayContent()); |
|
|
|
useParamsTemplate.setSelected(ob.isUseParamsTemplate()); |
|
|
|
useParamsTemplate.setSelected(ob.isUseParamsTemplate()); |
|
|
|
fireAfterEditor.setEnabled(ob.isUseParamsTemplate()); |
|
|
|
fireAfterEditor.setEnabled(ob.isUseParamsTemplate()); |
|
|
@ -277,8 +341,14 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
wParameterLayout.setParamsFireStopEdit(fireAfterEditor.isSelected()); |
|
|
|
wParameterLayout.setParamsFireStopEdit(fireAfterEditor.isSelected()); |
|
|
|
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
jTemplate.needAddTemplateIdAttr(useParamsTemplate.isSelected()); |
|
|
|
jTemplate.needAddTemplateIdAttr(useParamsTemplate.isSelected()); |
|
|
|
wParameterLayout.setBackground((Background) background.getValue()); |
|
|
|
|
|
|
|
wParameterLayout.setPosition((Integer) hAlignmentPane.getSelectedItem()); |
|
|
|
wParameterLayout.setPosition((Integer) hAlignmentPane.getSelectedItem()); |
|
|
|
|
|
|
|
if (extraPaneList.isEmpty()) { |
|
|
|
|
|
|
|
wParameterLayout.setBackground((Background) background.getValue()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
for (BasicBeanPane<WParameterLayout> pane : extraPaneList) { |
|
|
|
|
|
|
|
pane.updateBean(wParameterLayout); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return wParameterLayout; |
|
|
|
return wParameterLayout; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -299,6 +369,13 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> { |
|
|
|
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
jTemplate.needAddTemplateIdAttr(useParamsTemplate.isSelected()); |
|
|
|
jTemplate.needAddTemplateIdAttr(useParamsTemplate.isSelected()); |
|
|
|
wParameterLayout.setBackground((Background) background.getValue()); |
|
|
|
wParameterLayout.setBackground((Background) background.getValue()); |
|
|
|
|
|
|
|
if (extraPaneList.isEmpty()) { |
|
|
|
|
|
|
|
background.setValue(wParameterLayout.getBackground()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
for (BasicBeanPane<WParameterLayout> pane : extraPaneList) { |
|
|
|
|
|
|
|
pane.populateBean(wParameterLayout); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//设置参数模板面板的高度
|
|
|
|
//设置参数模板面板的高度
|
|
|
|
int height = (int) paraHeight.getTextField().getValue(); |
|
|
|
int height = (int) paraHeight.getTextField().getValue(); |
|
|
|
FormDesigner designer = TemplateTool.getCurrentEditingNewJForm().getFormDesign(); |
|
|
|
FormDesigner designer = TemplateTool.getCurrentEditingNewJForm().getFormDesign(); |
|
|
|