Browse Source

Merge remote-tracking branch 'origin/release/9.0' into release/9.0

master
juhaoyu 7 years ago
parent
commit
6ce46e708b
  1. 149
      designer/src/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  2. 10
      designer/src/com/fr/design/module/DesignerModule.java
  3. 25
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  4. 4
      designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java
  5. 274
      designer/src/com/fr/poly/creator/ChartBlockCreator.java
  6. 7
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  7. 54
      designer/src/com/fr/quickeditor/ChartQuickEditor.java
  8. 199
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  9. 51
      designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java
  10. 34
      designer/src/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java
  11. 31
      designer/src/com/fr/quickeditor/chartquick/PolyChartQuickEditor.java
  12. 6
      designer_base/src/com/fr/design/actions/core/ActionFactory.java
  13. 2
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  14. 2
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  15. BIN
      designer_base/src/com/fr/design/images/buttonicon/anas.png
  16. BIN
      designer_base/src/com/fr/design/images/chart/ChartType.png
  17. 4
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  18. 4
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  19. 10
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  20. 2
      designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java
  21. 3
      designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java
  22. 2
      designer_base/src/com/fr/env/RemoteEnv.java
  23. 29
      designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java
  24. BIN
      designer_chart/src/com/fr/plugin/chart/map/images/mapData.png
  25. 2
      designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java
  26. 157
      designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java
  27. 16
      designer_form/src/com/fr/design/designer/creator/CRPropertyDescriptorPane.java
  28. 33
      designer_form/src/com/fr/design/designer/creator/PropertyGroupPane.java
  29. 40
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  30. 17
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  31. 17
      designer_form/src/com/fr/design/mainframe/JForm.java
  32. 2
      designer_form/src/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java
  33. 2
      designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java
  34. 29
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  35. 16
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  36. 16
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java
  37. 2
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  38. 23
      designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java

149
designer/src/com/fr/design/dscolumn/DSColumnAdvancedPane.java

@ -5,7 +5,10 @@ import com.fr.data.util.SortOrder;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.*; import com.fr.design.formula.CustomVariableResolver;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.SortFormulaPane;
import com.fr.design.formula.UIFormula;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -28,6 +31,8 @@ import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.*;
public class DSColumnAdvancedPane extends BasicPane { public class DSColumnAdvancedPane extends BasicPane {
private static final String InsetText = " "; private static final String InsetText = " ";
@ -36,12 +41,11 @@ public class DSColumnAdvancedPane extends BasicPane {
private ValuePane valuePane; private ValuePane valuePane;
private UICheckBox horizontalExtendableCheckBox; private UICheckBox horizontalExtendableCheckBox;
private UICheckBox verticalExtendableCheckBox; private UICheckBox verticalExtendableCheckBox;
// private UICheckBox isCoverCheckBox;
private UICheckBox useMultiplyNumCheckBox; private UICheckBox useMultiplyNumCheckBox;
private UISpinner multiNumSpinner; private UISpinner multiNumSpinner;
public DSColumnAdvancedPane() { public DSColumnAdvancedPane() {
this(DSColumnPane.SETTING_ALL); this(DSColumnPane.SETTING_ALL);
} }
public DSColumnAdvancedPane(int setting) { public DSColumnAdvancedPane(int setting) {
@ -49,15 +53,15 @@ public class DSColumnAdvancedPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
sortPane = new SortPane(); sortPane = new SortPane();
sortPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Sort-Sort_Order"),null)); sortPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Sort-Sort_Order"), null));
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
selectCountPane = new SelectCountPane(); selectCountPane = new SelectCountPane();
selectCountPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("BindColumn-Results_Filter"),null)); selectCountPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("BindColumn-Results_Filter"), null));
} }
valuePane = new ValuePane(); valuePane = new ValuePane();
valuePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("BindColumn-Custom_Data_Appearance"),null)); valuePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("BindColumn-Custom_Data_Appearance"), null));
JPanel extendablePane = null; JPanel extendablePane = null;
@ -68,54 +72,54 @@ public class DSColumnAdvancedPane extends BasicPane {
extendableDirectionPane.add(horizontalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Horizontal_Extendable"))); extendableDirectionPane.add(horizontalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Horizontal_Extendable")));
extendableDirectionPane.add(verticalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Vertical_Extendable"))); extendableDirectionPane.add(verticalExtendableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Vertical_Extendable")));
extendablePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("ExpandD-Expandable")); extendablePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("ExpandD-Expandable"));
extendablePane.setLayout(new BorderLayout()); extendablePane.setLayout(new BorderLayout());
extendablePane.add(extendableDirectionPane, BorderLayout.CENTER); extendablePane.add(extendableDirectionPane, BorderLayout.CENTER);
} }
JPanel multiNumPane = null; JPanel multiNumPane = null;
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
multiNumPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Fill_blank_Data")); multiNumPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Fill_blank_Data"));
useMultiplyNumCheckBox = new UICheckBox(Inter.getLocText("Column_Multiple")); useMultiplyNumCheckBox = new UICheckBox(Inter.getLocText("Column_Multiple"));
multiNumPane.add(useMultiplyNumCheckBox); multiNumPane.add(useMultiplyNumCheckBox);
multiNumPane.add(new UILabel(InsetText)); multiNumPane.add(new UILabel(InsetText));
multiNumSpinner = new UISpinner(1, 10000, 1, 1); multiNumSpinner = new UISpinner(1, 10000, 1, 1);
multiNumPane.add(multiNumSpinner); multiNumPane.add(multiNumSpinner);
useMultiplyNumCheckBox.addActionListener(new ActionListener() { useMultiplyNumCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkButtonEnabled(); checkButtonEnabled();
} }
}); });
} }
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED,
TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] columnSize = {TableLayout.FILL}; double[] columnSize = {TableLayout.FILL};
Component[][] components = null; Component[][] components = null;
if (setting > DSColumnPane.SETTING_DSRELATED) { if (setting > DSColumnPane.SETTING_DSRELATED) {
components = new Component[][]{ components = new Component[][]{
{sortPane}, {sortPane},
{selectCountPane}, {selectCountPane},
{valuePane}, {valuePane},
{extendablePane}, {extendablePane},
{multiNumPane} {multiNumPane}
}; };
} else { } else {
components = new Component[][]{ components = new Component[][]{
{sortPane}, {sortPane},
{valuePane} {valuePane}
}; };
} }
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("Advanced"); return Inter.getLocText("Advanced");
} }
public void populate(TemplateCellElement cellElement) { public void populate(TemplateCellElement cellElement) {
@ -127,13 +131,13 @@ public class DSColumnAdvancedPane extends BasicPane {
valuePane.populate(cellElement); valuePane.populate(cellElement);
if (selectCountPane != null) { if (selectCountPane != null) {
selectCountPane.populate(cellElement); selectCountPane.populate(cellElement);
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
if (cellExpandAttr == null) { if (cellExpandAttr == null) {
cellExpandAttr = new CellExpandAttr(); cellExpandAttr = new CellExpandAttr();
cellElement.setCellExpandAttr(cellExpandAttr); cellElement.setCellExpandAttr(cellExpandAttr);
} }
// extendable // extendable
switch (cellExpandAttr.getExtendable()) { switch (cellExpandAttr.getExtendable()) {
@ -176,9 +180,9 @@ public class DSColumnAdvancedPane extends BasicPane {
valuePane.update(cellElement); valuePane.update(cellElement);
if (selectCountPane != null) { if (selectCountPane != null) {
selectCountPane.update(cellElement); selectCountPane.update(cellElement);
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
if (cellExpandAttr == null) { if (cellExpandAttr == null) {
cellExpandAttr = new CellExpandAttr(); cellExpandAttr = new CellExpandAttr();
cellElement.setCellExpandAttr(cellExpandAttr); cellElement.setCellExpandAttr(cellExpandAttr);
@ -208,10 +212,10 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
private static class SortPane extends SortFormulaPane { private static class SortPane extends SortFormulaPane {
private CellElement cellElement; private CellElement cellElement;
@Override @Override
public void formulaAction() { public void formulaAction() {
if (cellElement == null) { if (cellElement == null) {
return; return;
} }
@ -221,10 +225,10 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
String[] displayNames = DesignTableDataManager.getSelectedColumnNames( String[] displayNames = DesignTableDataManager.getSelectedColumnNames(
DesignTableDataManager.getEditingTableDataSource(), ((DSColumn) value).getDSName()); DesignTableDataManager.getEditingTableDataSource(), ((DSColumn) value).getDSName());
showFormulaDialog(displayNames); showFormulaDialog(displayNames);
} }
void populate(CellElement cellElement) { void populate(CellElement cellElement) {
if (cellElement == null) { if (cellElement == null) {
@ -316,7 +320,7 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
}); });
selectCountCardPane =FRGUIPaneFactory.createCardLayout_S_Pane(); selectCountCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
this.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(InsetText), selectCountComboBox, this.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(InsetText), selectCountComboBox,
new UILabel(InsetText), selectCountCardPane}, FlowLayout.LEFT), BorderLayout.WEST); new UILabel(InsetText), selectCountCardPane}, FlowLayout.LEFT), BorderLayout.WEST);
// selectCountCardPane.setLayout(new CardLayout()); // selectCountCardPane.setLayout(new CardLayout());
@ -328,16 +332,16 @@ public class DSColumnAdvancedPane extends BasicPane {
bottomFormulaPane = new JFormulaField("-1"); bottomFormulaPane = new JFormulaField("-1");
serialTextField = new UITextField(18); serialTextField = new UITextField(18);
JPanel oddPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1") JPanel oddPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
+ " " + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), FlowLayout.LEFT); + " " + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), FlowLayout.LEFT);
JPanel evenPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1") JPanel evenPane = GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
+ " " + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FlowLayout.LEFT); + " " + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FlowLayout.LEFT);
JPanel specifyPane = GUICoreUtils.createFlowPane(new JComponent[]{ JPanel specifyPane = GUICoreUtils.createFlowPane(new JComponent[]{
serialTextField, new UILabel( serialTextField, new UILabel(
Inter.getLocText(new String[]{ Inter.getLocText(new String[]{
"Format", "BindColumn-Result_Serial_Number_Start_From_1", "Inner_Parameter", "Group_Count"}, "Format", "BindColumn-Result_Serial_Number_Start_From_1", "Inner_Parameter", "Group_Count"},
new String[]{": 1,2-3,5,8 ", ",", "$__count__"}) new String[]{": 1,2-3,5,8 ", ",", "$__count__"})
) )
}, FlowLayout.LEFT); }, FlowLayout.LEFT);
serialTextField.setToolTipText(Inter.getLocText("StyleFormat-Sample") + ":=JOINARRAY(GREPARRAY(RANGE($__count__), item!=4), \",\")"); serialTextField.setToolTipText(Inter.getLocText("StyleFormat-Sample") + ":=JOINARRAY(GREPARRAY(RANGE($__count__), item!=4), \",\")");
selectCountCardPane.add(undefinedPane, "UNDEFINE"); selectCountCardPane.add(undefinedPane, "UNDEFINE");
selectCountCardPane.add(topFormulaPane, "TOP"); selectCountCardPane.add(topFormulaPane, "TOP");
@ -367,11 +371,11 @@ public class DSColumnAdvancedPane extends BasicPane {
if (selectCount != null) { if (selectCount != null) {
int selectCountType = selectCount.getType(); int selectCountType = selectCount.getType();
this.selectCountComboBox.setSelectedIndex(selectCountType); this.selectCountComboBox.setSelectedIndex(selectCountType);
if (selectCountType == SelectCount.TOP) { if (selectCountType == TOP.getValue()) {
this.topFormulaPane.populate(selectCount.getFormulaCount()); this.topFormulaPane.populate(selectCount.getFormulaCount());
} else if (selectCountType == SelectCount.BOTTOM) { } else if (selectCountType == BOTTOM.getValue()) {
this.bottomFormulaPane.populate(selectCount.getFormulaCount()); this.bottomFormulaPane.populate(selectCount.getFormulaCount());
} else if (selectCountType == SelectCount.SPECIFY) { } else if (selectCountType == SPECIFY.getValue()) {
this.serialTextField.setText(selectCount.getSerial()); this.serialTextField.setText(selectCount.getSerial());
} }
} }
@ -395,11 +399,11 @@ public class DSColumnAdvancedPane extends BasicPane {
SelectCount selectCount = new SelectCount(); SelectCount selectCount = new SelectCount();
dSColumn.setSelectCount(selectCount); dSColumn.setSelectCount(selectCount);
selectCount.setType(selectCountSelectIndex); selectCount.setType(selectCountSelectIndex);
if (selectCountSelectIndex == SelectCount.TOP) { if (selectCountSelectIndex == TOP.getValue()) {
selectCount.setFormulaCount(this.topFormulaPane.getFormulaText()); selectCount.setFormulaCount(this.topFormulaPane.getFormulaText());
} else if (selectCountSelectIndex == SelectCount.BOTTOM) { } else if (selectCountSelectIndex == BOTTOM.getValue()) {
selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText()); selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText());
} else if (selectCountSelectIndex == SelectCount.SPECIFY) { } else if (selectCountSelectIndex == SPECIFY.getValue()) {
selectCount.setSerial(this.serialTextField.getText()); selectCount.setSerial(this.serialTextField.getText());
} }
} }
@ -411,8 +415,8 @@ public class DSColumnAdvancedPane extends BasicPane {
return ((JSpinner.DefaultEditor) editor).getTextField(); return ((JSpinner.DefaultEditor) editor).getTextField();
} else { } else {
System.err.println("Unexpected editor type: " System.err.println("Unexpected editor type: "
+ spinner.getEditor().getClass() + spinner.getEditor().getClass()
+ " isn't a descendant of DefaultEditor"); + " isn't a descendant of DefaultEditor");
return null; return null;
} }
} }
@ -420,13 +424,13 @@ public class DSColumnAdvancedPane extends BasicPane {
private static class JFormulaField extends JPanel { private static class JFormulaField extends JPanel {
private CellElement cellElement; private CellElement cellElement;
private UITextField formulaTextField; private UITextField formulaTextField;
private String defaultValue; private String defaultValue;
public JFormulaField(String defaultValue) { public JFormulaField(String defaultValue) {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
UILabel bottomLabel = new UILabel("="); UILabel bottomLabel = new UILabel("=");
bottomLabel.setFont(new Font("Dialog", Font.BOLD, 12)); bottomLabel.setFont(new Font("Dialog", Font.BOLD, 12));
this.add(bottomLabel); this.add(bottomLabel);
@ -439,20 +443,21 @@ public class DSColumnAdvancedPane extends BasicPane {
bottomFrmulaButton.setToolTipText(Inter.getLocText("Formula") + "..."); bottomFrmulaButton.setToolTipText(Inter.getLocText("Formula") + "...");
bottomFrmulaButton.setPreferredSize(new Dimension(25, formulaTextField.getPreferredSize().height)); bottomFrmulaButton.setPreferredSize(new Dimension(25, formulaTextField.getPreferredSize().height));
bottomFrmulaButton.addActionListener(formulaButtonActionListener); bottomFrmulaButton.addActionListener(formulaButtonActionListener);
} }
public void populate(String formulaContent) {
this.formulaTextField.setText(formulaContent);
}
public void populate(String formulaContent) { public void populateElement(CellElement cellElement) {
this.formulaTextField.setText(formulaContent); this.cellElement = cellElement;
} }
public void populateElement(CellElement cellElement) {
this.cellElement = cellElement;
}
public String getFormulaText() { public String getFormulaText() {
return this.formulaTextField.getText(); return this.formulaTextField.getText();
} }
private ActionListener formulaButtonActionListener = new ActionListener() { private ActionListener formulaButtonActionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
Formula valueFormula = new Formula(); Formula valueFormula = new Formula();
@ -479,7 +484,7 @@ public class DSColumnAdvancedPane extends BasicPane {
formulaPane.populate(valueFormula, new CustomVariableResolver(displayNames, true)); formulaPane.populate(valueFormula, new CustomVariableResolver(displayNames, true));
formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(JFormulaField.this), new DialogActionAdapter() { formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(JFormulaField.this), new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
Formula valueFormula = formulaPane.update(); Formula valueFormula = formulaPane.update();
if (valueFormula.getContent().length() <= 1) { if (valueFormula.getContent().length() <= 1) {
formulaTextField.setText(defaultValue); formulaTextField.setText(defaultValue);

10
designer/src/com/fr/design/module/DesignerModule.java

@ -32,7 +32,8 @@ import com.fr.general.xml.GeneralXMLTools;
import com.fr.io.importer.Excel2007ReportImporter; import com.fr.io.importer.Excel2007ReportImporter;
import com.fr.io.importer.ExcelReportImporter; import com.fr.io.importer.ExcelReportImporter;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.quickeditor.ChartQuickEditor; import com.fr.quickeditor.chartquick.BasicChartQuickEditor;
import com.fr.quickeditor.chartquick.FloatChartQuickEditor;
import com.fr.quickeditor.cellquick.*; import com.fr.quickeditor.cellquick.*;
import com.fr.quickeditor.floatquick.FloatImageQuickEditor; import com.fr.quickeditor.floatquick.FloatImageQuickEditor;
import com.fr.quickeditor.floatquick.FloatStringQuickEditor; import com.fr.quickeditor.floatquick.FloatStringQuickEditor;
@ -119,7 +120,7 @@ public class DesignerModule extends DesignModule {
ActionFactory.registerCellEditor(BiasTextPainter.class, CellBiasTextPainterEditor.class); ActionFactory.registerCellEditor(BiasTextPainter.class, CellBiasTextPainterEditor.class);
ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.class); ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.class);
ActionFactory.registerChartCellEditorInEditor(ChartQuickEditor.class); ActionFactory.registerChartCellEditorInEditor(BasicChartQuickEditor.class);
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);
for (ElementUIProvider provider : providers) { for (ElementUIProvider provider : providers) {
@ -139,11 +140,10 @@ public class DesignerModule extends DesignModule {
private void registerFloatEditor() { private void registerFloatEditor() {
ActionFactory.registerFloatEditor(String.class, FloatStringQuickEditor.class); ActionFactory.registerFloatEditor(String.class, FloatStringQuickEditor.class);
ActionFactory.registerFloatEditor(Formula.class, FloatStringQuickEditor.class); ActionFactory.registerFloatEditor(Formula.class, FloatStringQuickEditor.class);
FloatImageQuickEditor floatImageQuickEditor = new FloatImageQuickEditor();
ActionFactory.registerFloatEditor(Image.class, FloatImageQuickEditor.class); ActionFactory.registerFloatEditor(Image.class, FloatImageQuickEditor.class);
ActionFactory.registerFloatEditor(BufferedImage.class, FloatImageQuickEditor.class); ActionFactory.registerFloatEditor(BufferedImage.class, FloatImageQuickEditor.class);
ActionFactory.registerChartFloatEditorInEditor(ChartQuickEditor.class);
ActionFactory.registerChartFloatEditorInEditor(FloatChartQuickEditor.class);
} }
/** /**

25
designer/src/com/fr/design/parameter/ParameterDefinitePane.java

@ -75,12 +75,23 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
this.setBorder(null); this.setBorder(null);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
setComponentBg(this); setComponentBg(this);
// formParaDesignEditor = new FormParaDesigner(new FormParameterUI());
paraDesignEditor = DesignModuleFactory.getFormParaDesigner(); paraDesignEditor = DesignModuleFactory.getFormParaDesigner();
if (paraDesignEditor == null) { if (paraDesignEditor == null) {
return; return;
} }
paraDesignEditor.initWidgetToolbarPane(); paraDesignEditor.initWidgetToolbarPane();
this.add(paraDesignEditor.createWrapper(), BorderLayout.CENTER);
setButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/parametersetting.png"));
setButton.set4ToolbarButton();
isshowWindowItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Show_Parameter_Window"));
isdelayItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Delay_Playing"));
initListeners();
}
private void initListeners() {
((TargetComponent) paraDesignEditor).addTargetModifiedListener(new TargetModifiedListener() { ((TargetComponent) paraDesignEditor).addTargetModifiedListener(new TargetModifiedListener() {
@Override @Override
public void targetModified(TargetModifiedEvent e) { public void targetModified(TargetModifiedEvent e) {
@ -93,7 +104,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
paraDesignEditor.addListener(this); paraDesignEditor.addListener(this);
propertyChangeListener = new PropertyChangeAdapter() { propertyChangeListener = new PropertyChangeAdapter() {
@Override @Override
public void propertyChange() { public void propertyChange() {
if (isEditing) { if (isEditing) {
@ -102,12 +112,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
} }
} }
}; };
this.add(paraDesignEditor.createWrapper(), BorderLayout.CENTER);
// WidgetToolBarPane.getRecentSearchManger(formParaDesignEditor);
setButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/parametersetting.png"));
setButton.set4ToolbarButton();
isshowWindowItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Show_Parameter_Window"));
isshowWindowItem.addItemListener(new ItemListener() { isshowWindowItem.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
@ -116,9 +121,8 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
} }
} }
}); });
isdelayItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Delay_Playing"));
isdelayItem.addItemListener(new ItemListener() {
isdelayItem.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if (propertyChangeListener != null) { if (propertyChangeListener != null) {
@ -128,7 +132,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
} }
}); });
setButton.addActionListener(new ActionListener() { setButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -298,7 +301,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
*/ */
public void refreshParameter() { public void refreshParameter() {
if (paraDesignEditor != null) { if (paraDesignEditor != null) {
paraDesignEditor.refreshParameter(this); paraDesignEditor.refreshParameter(this, this.workBook);
} }
} }

4
designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java

@ -89,7 +89,9 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
* 选中指定index的按钮 * 选中指定index的按钮
*/ */
public void selectIndexButton(int index) { public void selectIndexButton(int index) {
if (index < 0 || index > radioButtons.size() - 1) { //这里删了默认按钮,所以这边判断的时候不能-1了
// if (index < 0 || index > radioButtons.size() - 1) { fanglei: 这个注释不要删!不然以后可能忘记这个问题
if (index < 0 || index > radioButtons.size()) {
return; return;
} }

274
designer/src/com/fr/poly/creator/ChartBlockCreator.java

@ -1,166 +1,156 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.poly.creator; package com.fr.poly.creator;
import java.awt.*;
import java.awt.image.BufferedImage;
import javax.swing.*;
import com.fr.base.ScreenResolution;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.quickeditor.ChartQuickEditor; import com.fr.quickeditor.chartquick.PolyChartQuickEditor;
import com.fr.report.poly.PolyChartBlock; import com.fr.report.poly.PolyChartBlock;
import com.fr.stable.unit.FU; import com.fr.stable.unit.FU;
import com.fr.stable.unit.UNIT; import com.fr.stable.unit.UNIT;
import com.fr.stable.unit.UnitRectangle; import com.fr.stable.unit.UnitRectangle;
import javax.swing.*;
import java.awt.*;
/** /**
* @author richer * @author richer
* @since 6.5.4 创建于2011-5-10 * @since 6.5.4 创建于2011-5-10
*/ */
public class ChartBlockCreator extends BlockCreator<PolyChartBlock> { public class ChartBlockCreator extends BlockCreator<PolyChartBlock> {
private MiddleChartComponent cpm; private MiddleChartComponent cpm;
private ChartBlockEditor editor; private ChartBlockEditor editor;
//图表默认宽高330*240 //图表默认宽高330*240
private static final UNIT DEFAULT_WIDTH = FU.getInstance(12573000); private static final UNIT DEFAULT_WIDTH = FU.getInstance(12573000);
private static final UNIT DEFAULT_HEIGHT = FU.getInstance(9144000); private static final UNIT DEFAULT_HEIGHT = FU.getInstance(9144000);
public ChartBlockCreator() { public ChartBlockCreator() {
} }
public ChartBlockCreator(PolyChartBlock block) { public ChartBlockCreator(PolyChartBlock block) {
super(block); super(block);
} }
public void setResolution(int resolution){ public void setResolution(int resolution) {
this.resolution = resolution; this.resolution = resolution;
} }
/** /**
* 初始化 * 初始化
* @return 初始化的控件. *
*/ * @return 初始化的控件.
public JComponent initMonitor() { */
cpm = DesignModuleFactory.getChartComponent(getValue().getChartCollection()); public JComponent initMonitor() {
cpm.setBorder(BorderFactory.createLineBorder(Color.lightGray)); cpm = DesignModuleFactory.getChartComponent(getValue().getChartCollection());
return cpm; cpm.setBorder(BorderFactory.createLineBorder(Color.lightGray));
} return cpm;
}
public UnitRectangle getDefaultBlockBounds() {
return new UnitRectangle(UNIT.ZERO, UNIT.ZERO, DEFAULT_WIDTH, DEFAULT_HEIGHT); public UnitRectangle getDefaultBlockBounds() {
} return new UnitRectangle(UNIT.ZERO, UNIT.ZERO, DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
@Override
public BlockEditor getEditor() { @Override
if (editor == null) { public BlockEditor getEditor() {
editor = new ChartBlockEditor(designer, this); if (editor == null) {
} editor = new ChartBlockEditor(designer, this);
return editor; }
} return editor;
}
@Override
public int getX(float time) { @Override
return (int) (this.getX() * time); public int getX(float time) {
} return (int) (this.getX() * time);
}
@Override
public int getY(float time) { @Override
return (int) (this.getY() * time); public int getY(float time) {
} return (int) (this.getY() * time);
}
/**
* 检测按钮状态 /**
* * 检测按钮状态
* @date 2015-2-5-上午11:33:46 *
* * @date 2015-2-5-上午11:33:46
*/ */
public void checkButtonEnable() { public void checkButtonEnable() {
if (editor == null) { if (editor == null) {
editor = new ChartBlockEditor(designer, this); editor = new ChartBlockEditor(designer, this);
} }
editor.checkChartButtonsEnable(); editor.checkChartButtonsEnable();
} }
@Override @Override
public PolyChartBlock getValue() { public PolyChartBlock getValue() {
return block; return block;
} }
@Override @Override
public void setValue(PolyChartBlock block) { public void setValue(PolyChartBlock block) {
this.block = block; this.block = block;
cpm.populate(this.block.getChartCollection()); cpm.populate(this.block.getChartCollection());
} }
/**
/** * 获取当前工具栏组
* 获取当前工具栏组 *
* * @return 工具栏组
* @return 工具栏组 * @date 2015-2-5-上午11:29:07
* */
* @date 2015-2-5-上午11:29:07 public ToolBarDef[] toolbars4Target() {
* return new ToolBarDef[0];
*/ }
public ToolBarDef[] toolbars4Target() {
return new ToolBarDef[0]; /**
} * 在Form的工具栏组
*
/** * @return 组件数组
* 在Form的工具栏组 * @date 2015-2-5-上午11:31:46
* */
* @return 组件数组 public JComponent[] toolBarButton4Form() {
* return new JComponent[0];
* @date 2015-2-5-上午11:31:46 }
*
*/ /**
public JComponent[] toolBarButton4Form() { * 目标的列表
return new JComponent[0]; *
} * @return 返回列表.
*/
/** public MenuDef[] menus4Target() {
* 目标的列表 return new MenuDef[0];
* @return 返回列表. }
*/
public MenuDef[] menus4Target() { public int getMenuState() {
return new MenuDef[0];
}
public int getMenuState(){
return DesignState.POLY_SHEET; return DesignState.POLY_SHEET;
} }
/** /**
* 模板的Menu * 模板的Menu
* @return 模板的menu *
*/ * @return 模板的menu
public ShortCut[] shortcut4TemplateMenu() { */
return new ShortCut[0]; public ShortCut[] shortcut4TemplateMenu() {
} return new ShortCut[0];
}
@Override
public PolyElementCasePane getEditingElementCasePane() { @Override
return null; public PolyElementCasePane getEditingElementCasePane() {
} return null;
}
@Override
public QuickEditor getQuickEditor(TargetComponent tc) { @Override
ChartQuickEditor quitEditor = new ChartQuickEditor(); public QuickEditor getQuickEditor(TargetComponent tc) {
quitEditor.populate(tc); PolyChartQuickEditor quitEditor = new PolyChartQuickEditor();
return quitEditor; quitEditor.populate(tc);
} return quitEditor;
}
} }

7
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -66,10 +66,10 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p};
JComponent centerBody = createCenterBody(); JComponent centerBody = createCenterBody();
JPanel topContent = initTopContent(); JPanel topContent = initTopContent();
if (isScrollAll()) { if (isScrollAll()) {
double[] scrollAllRowSize = {p, p};
prepareScrollBar(); prepareScrollBar();
topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground())); topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground()));
centerBody.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); centerBody.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground()));
@ -77,7 +77,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
new Component[]{topContent, null}, new Component[]{topContent, null},
new Component[]{centerBody, null} new Component[]{centerBody, null}
}; };
leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, scrollAllRowSize, columnSize, HGAP, VGAP);
this.setLayout(new CellElementBarLayout(leftContentPane) { this.setLayout(new CellElementBarLayout(leftContentPane) {
@Override @Override
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
@ -104,6 +104,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
this.add(scrollBar); this.add(scrollBar);
this.add(leftContentPane); this.add(leftContentPane);
} else { } else {
double[] scrollContentRowSize = {p, f};
topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 10, this.getBackground())); topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 10, this.getBackground()));
centerBody.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, this.getBackground())); centerBody.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, this.getBackground()));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -111,7 +112,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
new Component[]{centerBody, null} new Component[]{centerBody, null}
}; };
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP), BorderLayout.CENTER); this.add(TableLayoutHelper.createGapTableLayoutPane(components, scrollContentRowSize, columnSize, HGAP, VGAP), BorderLayout.CENTER);
} }
} }

54
designer/src/com/fr/quickeditor/ChartQuickEditor.java

@ -1,54 +0,0 @@
package com.fr.quickeditor;
import com.fr.base.chart.BaseChartCollection;
//import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.poly.PolyDesigner;
import com.fr.poly.creator.ChartBlockEditor;
import com.fr.report.cell.Elem;
import java.awt.*;
public class ChartQuickEditor extends QuickEditor<TargetComponent>{
// kunsnat: editingPropertyPane初始化 避开设计器启动, 在用到的时候再初始化.
//private BaseChartPropertyPane editingPropertyPane = null;
public ChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
}
@Override
protected void refresh() {
BaseChartPropertyPane editingPropertyPane = null;
BaseChartCollection collection = null;
if(tc instanceof PolyDesigner) {
ChartBlockEditor chartBlockEditor = (ChartBlockEditor)((PolyDesigner)tc).getSelection().getEditor();
collection = chartBlockEditor.getValue().getChartCollection();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.setSupportCellData(false);
} else {
Selection selection = ((ElementCasePane)tc).getSelection();
Elem element = null;
if(selection instanceof CellSelection) {
CellSelection cs = (CellSelection)selection;
element = ((ElementCasePane)tc).getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow());
} else if(selection instanceof FloatSelection){
FloatSelection fs = (FloatSelection)selection;
element = ((ElementCasePane)tc).getEditingElementCase().getFloatElement(fs.getSelectedFloatName());
}
collection = (BaseChartCollection) element.getValue();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
}
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}

199
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -34,6 +34,7 @@ import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.FilterTypeEnum;
import com.fr.report.cell.cellattr.core.group.SelectCount; import com.fr.report.cell.cellattr.core.group.SelectCount;
import javax.swing.*; import javax.swing.*;
@ -46,6 +47,9 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.*;
/** /**
* 单元格元素 数据列编辑器 * 单元格元素 数据列编辑器
* *
@ -58,10 +62,6 @@ public class CellDSColumnEditor extends CellQuickEditor {
private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL; private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL;
private static final Color TIP_FONT_COLOR = new Color(0x7F333334, true); private static final Color TIP_FONT_COLOR = new Color(0x7F333334, true);
private enum FilterType {
//前N个 后N个 奇数 偶数 自定义 未定义
TOP, BOTTOM, ODD, EVEN, SPECIFY, UNDEFINE
}
private JPanel dsColumnRegion; private JPanel dsColumnRegion;
private JPanel centerPane; private JPanel centerPane;
@ -669,6 +669,69 @@ public class CellDSColumnEditor extends CellQuickEditor {
private JFormulaField topFormulaPane; private JFormulaField topFormulaPane;
private JFormulaField bottomFormulaPane; private JFormulaField bottomFormulaPane;
private ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
int selectIndex = rsComboBox.getSelectedIndex();
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectIndex == TOP.getValue()) {
//前N个
setCardPaneLayout.show(setCardPane, TOP.name());
tipCardPaneLayout.show(tipCardPane, TOP.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == BOTTOM.getValue()) {
//后N个
setCardPaneLayout.show(setCardPane, BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, BOTTOM.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == ODD.getValue()) {
//奇数
setCardPaneLayout.show(setCardPane, ODD.name());
tipCardPaneLayout.show(tipCardPane, ODD.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == EVEN.getValue()) {
//偶数
setCardPaneLayout.show(setCardPane, EVEN.name());
tipCardPaneLayout.show(tipCardPane, EVEN.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == SPECIFY.getValue()) {
//指定
setCardPaneLayout.show(setCardPane, SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, SPECIFY.name());
//显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else {
//未定义
setCardPaneLayout.show(setCardPane, UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name());
//隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
}
}
};
public ResultSetFilterConfigPane() { public ResultSetFilterConfigPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel filterLabel = new UILabel(Inter.getLocText("BindColumn-Results_Filter")); UILabel filterLabel = new UILabel(Inter.getLocText("BindColumn-Results_Filter"));
@ -681,65 +744,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
Inter.getLocText("Even"), Inter.getLocText("Even"),
Inter.getLocText("Specify") Inter.getLocText("Specify")
}); });
rsComboBox.addActionListener(new ActionListener() { rsComboBox.addActionListener(actionListener);
public void actionPerformed(ActionEvent evt) {
int selectIndex = rsComboBox.getSelectedIndex();
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectIndex == 1) {
//前N个
setCardPaneLayout.show(setCardPane, FilterType.TOP.name());
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == 2) {
//后N个
setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == 3) {
//奇数
setCardPaneLayout.show(setCardPane, FilterType.ODD.name());
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == 4) {
setCardPaneLayout.show(setCardPane, FilterType.EVEN.name());
tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == 5) {
setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name());
//显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else {
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name());
//隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
}
}
});
//配置展示CardLayout //配置展示CardLayout
setCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); setCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
//提示信息展示CardLayout //提示信息展示CardLayout
@ -747,36 +752,36 @@ public class CellDSColumnEditor extends CellQuickEditor {
//前N个 //前N个
topFormulaPane = new JFormulaField(DEFAULT_VALUE); topFormulaPane = new JFormulaField(DEFAULT_VALUE);
setCardPane.add(topFormulaPane, FilterType.TOP.name()); setCardPane.add(topFormulaPane, TOP.name());
tipCardPane.add(new JPanel(), FilterType.TOP.name()); tipCardPane.add(new JPanel(), TOP.name());
//后N个 //后N个
bottomFormulaPane = new JFormulaField(DEFAULT_VALUE); bottomFormulaPane = new JFormulaField(DEFAULT_VALUE);
setCardPane.add(bottomFormulaPane, FilterType.BOTTOM.name()); setCardPane.add(bottomFormulaPane, BOTTOM.name());
tipCardPane.add(new JPanel(), FilterType.BOTTOM.name()); tipCardPane.add(new JPanel(), BOTTOM.name());
//自定义值下方没有提示信息,也没有输入框 //自定义值下方没有提示信息,也没有输入框
setCardPane.add(new JPanel(), FilterType.UNDEFINE.name()); setCardPane.add(new JPanel(), UNDEFINE.name());
tipCardPane.add(new JPanel(), FilterType.UNDEFINE.name()); tipCardPane.add(new JPanel(), UNDEFINE.name());
//奇数 UILabel 占一行作为提示信息 //奇数 UILabel 占一行作为提示信息
setCardPane.add(new JPanel(), FilterType.ODD.name()); setCardPane.add(new JPanel(), ODD.name());
MultilineLabel oddTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Odd_Tip")); MultilineLabel oddTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Odd_Tip"));
oddTip.setForeground(TIP_FONT_COLOR); oddTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(oddTip, FilterType.ODD.name()); tipCardPane.add(oddTip, ODD.name());
//偶数 UILabel 占一行作为提示信息 //偶数 UILabel 占一行作为提示信息
setCardPane.add(new JPanel(), FilterType.EVEN.name()); setCardPane.add(new JPanel(), EVEN.name());
MultilineLabel evenTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Even_Tip")); MultilineLabel evenTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Even_Tip"));
evenTip.setForeground(TIP_FONT_COLOR); evenTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(evenTip, FilterType.EVEN.name()); tipCardPane.add(evenTip, EVEN.name());
//输入框占用右半边,提示信息占一行 //输入框占用右半边,提示信息占一行
serialTextField = new UITextField(16); serialTextField = new UITextField(16);
setCardPane.add(serialTextField, FilterType.SPECIFY.name()); setCardPane.add(serialTextField, SPECIFY.name());
MultilineLabel specifyTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Specify_Tip")); MultilineLabel specifyTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Specify_Tip"));
specifyTip.setForeground(TIP_FONT_COLOR); specifyTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(specifyTip, FilterType.SPECIFY.name()); tipCardPane.add(specifyTip, SPECIFY.name());
contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new Component[][]{ contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new Component[][]{
{filterLabel, rsComboBox}, {filterLabel, rsComboBox},
{null, setCardPane}, {null, setCardPane},
@ -787,6 +792,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
} }
public void populate(CellElement cellElement) { public void populate(CellElement cellElement) {
rsComboBox.removeActionListener(actionListener);
if (cellElement != null) { if (cellElement != null) {
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value != null && value instanceof DSColumn) { if (value != null && value instanceof DSColumn) {
@ -794,42 +800,59 @@ public class CellDSColumnEditor extends CellQuickEditor {
SelectCount selectCount = dSColumn.getSelectCount(); SelectCount selectCount = dSColumn.getSelectCount();
this.topFormulaPane.populateElement(cellElement); this.topFormulaPane.populateElement(cellElement);
this.bottomFormulaPane.populateElement(cellElement); this.bottomFormulaPane.populateElement(cellElement);
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectCount != null) { if (selectCount != null) {
int selectCountType = selectCount.getType(); int selectCountType = selectCount.getType();
this.rsComboBox.setSelectedIndex(selectCountType); this.rsComboBox.setSelectedIndex(selectCountType);
switch (selectCountType) { switch (FilterTypeEnum.getFilterByValue(selectCountType)) {
case SelectCount.TOP: case TOP:
this.topFormulaPane.populate(selectCount.getFormulaCount()); this.topFormulaPane.populate(selectCount.getFormulaCount());
//前N个
setCardPaneLayout.show(setCardPane, TOP.name());
tipCardPaneLayout.show(tipCardPane, TOP.name());
//隐藏tip 显示set //隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0)); tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
break; break;
case SelectCount.BOTTOM: case BOTTOM:
this.bottomFormulaPane.populate(selectCount.getFormulaCount()); this.bottomFormulaPane.populate(selectCount.getFormulaCount());
//后N个
setCardPaneLayout.show(setCardPane, BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, BOTTOM.name());
//隐藏tip 显示set //隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0)); tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
break; break;
case SelectCount.SPECIFY: case SPECIFY:
this.serialTextField.setText(selectCount.getSerial()); this.serialTextField.setText(selectCount.getSerial());
//指定
setCardPaneLayout.show(setCardPane, SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, SPECIFY.name());
//显示set和tip //显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(224, 40)); tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
case SelectCount.EVEN: case EVEN:
//偶数
setCardPaneLayout.show(setCardPane, EVEN.name());
tipCardPaneLayout.show(tipCardPane, EVEN.name());
//隐藏set 显示tip //隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40)); tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
case SelectCount.ODD: case ODD:
//奇数
setCardPaneLayout.show(setCardPane, ODD.name());
tipCardPaneLayout.show(tipCardPane, ODD.name());
//隐藏set 显示tip //隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -837,6 +860,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
default: default:
//未定义
setCardPaneLayout.show(setCardPane, UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name());
//隐藏set和tip //隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -844,6 +870,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} }
} else { } else {
//未定义
setCardPaneLayout.show(setCardPane, UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, UNDEFINE.name());
//隐藏set和tip //隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -852,6 +881,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
} }
} }
} }
rsComboBox.addActionListener(actionListener);
} }
public void update(CellElement cellElement) { public void update(CellElement cellElement) {
@ -866,11 +896,11 @@ public class CellDSColumnEditor extends CellQuickEditor {
SelectCount selectCount = new SelectCount(); SelectCount selectCount = new SelectCount();
selectCount.setType(selectedFilterIndex); selectCount.setType(selectedFilterIndex);
dSColumn.setSelectCount(selectCount); dSColumn.setSelectCount(selectCount);
if (selectedFilterIndex == SelectCount.TOP) { if (selectedFilterIndex == TOP.getValue()) {
selectCount.setFormulaCount(this.topFormulaPane.getFormulaText()); selectCount.setFormulaCount(this.topFormulaPane.getFormulaText());
} else if (selectedFilterIndex == SelectCount.BOTTOM) { } else if (selectedFilterIndex == BOTTOM.getValue()) {
selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText()); selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText());
} else if (selectedFilterIndex == SelectCount.SPECIFY) { } else if (selectedFilterIndex == SPECIFY.getValue()) {
selectCount.setSerial(this.serialTextField.getText()); selectCount.setSerial(this.serialTextField.getText());
} }
} }
@ -887,6 +917,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
topFormulaPane.addListener(formulaListener); topFormulaPane.addListener(formulaListener);
bottomFormulaPane.addListener(formulaListener); bottomFormulaPane.addListener(formulaListener);
rsComboBox.registerChangeListener(formulaListener); rsComboBox.registerChangeListener(formulaListener);
serialTextField.registerChangeListener(formulaListener);
} }
} }

51
designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java

@ -0,0 +1,51 @@
package com.fr.quickeditor.chartquick;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.ChartCellAction;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.Elem;
import javax.swing.*;
public class BasicChartQuickEditor extends CellQuickEditor {
private BaseChartPropertyPane editingPropertyPane;
public BasicChartQuickEditor() {
super();
}
@Override
public JComponent createCenterBody() {
editingPropertyPane = DesignModuleFactory.getChartPropertyPane();
editingPropertyPane.setBorder(BorderFactory.createEmptyBorder());
return editingPropertyPane;
}
@Override
public boolean isScrollAll() {
return false;
}
@Override
public Object getComboBoxSelected() {
return ActionFactory.createAction(ChartCellAction.class);
}
@Override
protected void refreshDetails() {
BaseChartCollection collection;
Selection selection = tc.getSelection();
Elem element;
CellSelection cs = (CellSelection) selection;
element = tc.getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow());
collection = (BaseChartCollection) element.getValue();
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}

34
designer/src/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java

@ -0,0 +1,34 @@
package com.fr.quickeditor.chartquick;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.Elem;
import java.awt.*;
public class FloatChartQuickEditor extends QuickEditor<ElementCasePane> {
public FloatChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
}
@Override
protected void refresh() {
BaseChartPropertyPane editingPropertyPane;
BaseChartCollection collection;
Selection selection = tc.getSelection();
Elem element;
FloatSelection fs = (FloatSelection) selection;
element = tc.getEditingElementCase().getFloatElement(fs.getSelectedFloatName());
collection = (BaseChartCollection) element.getValue();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}

31
designer/src/com/fr/quickeditor/chartquick/PolyChartQuickEditor.java

@ -0,0 +1,31 @@
package com.fr.quickeditor.chartquick;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
import com.fr.poly.PolyDesigner;
import com.fr.poly.creator.ChartBlockEditor;
import java.awt.*;
public class PolyChartQuickEditor extends QuickEditor<TargetComponent> {
public PolyChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
}
@Override
protected void refresh() {
BaseChartPropertyPane editingPropertyPane;
BaseChartCollection collection;
ChartBlockEditor chartBlockEditor = (ChartBlockEditor) ((PolyDesigner) tc).getSelection().getEditor();
collection = chartBlockEditor.getValue().getChartCollection();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.setSupportCellData(false);
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}

6
designer_base/src/com/fr/design/actions/core/ActionFactory.java

@ -24,11 +24,11 @@ public class ActionFactory {
private ActionFactory() { private ActionFactory() {
} }
private static Map<Class, Class<? extends QuickEditor>> floatEditor = new HashMap<Class, Class<? extends QuickEditor>>(); private static Map<Class, Class<? extends QuickEditor>> floatEditor = new HashMap<>();
private static Class chartCollectionClass = null; private static Class chartCollectionClass = null;
private static Map<Class, Class<? extends QuickEditor>> cellEditor = new HashMap<Class, Class<? extends QuickEditor>>(); private static Map<Class, Class<? extends QuickEditor>> cellEditor = new HashMap<>();
private static UpdateAction chartPreStyleAction = null; private static UpdateAction chartPreStyleAction = null;
@ -98,7 +98,7 @@ public class ActionFactory {
} }
/** /**
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollection和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册.
* *
* @param editor 待说明 * @param editor 待说明
*/ */

2
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -302,6 +302,8 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
ShortCut addItem = addItemShortCut().getShortCut(); ShortCut addItem = addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
topToolBar.validate(); topToolBar.validate();
this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板
cardPane.add(controlUpdatePane, "EDIT");
this.repaint(); this.repaint();
} }

2
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -214,6 +214,7 @@ public abstract class UIListControlPane extends UIControlPane {
@Override @Override
public void populate(Nameable[] nameableArray) { public void populate(Nameable[] nameableArray) {
isPopulating = true; // 加一个标识位,避免切换单元格时,触发 saveSettings isPopulating = true; // 加一个标识位,避免切换单元格时,触发 saveSettings
nameableList.getCellEditor().stopCellEditing();
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel();
listModel.removeAllElements(); listModel.removeAllElements();
if (ArrayUtils.isEmpty(nameableArray)) { if (ArrayUtils.isEmpty(nameableArray)) {
@ -582,6 +583,7 @@ public abstract class UIListControlPane extends UIControlPane {
UIListControlPane.this.nameableList.getCellEditor() UIListControlPane.this.nameableList.getCellEditor()
.stopCellEditing(); .stopCellEditing();
} catch (Exception ignored) { } catch (Exception ignored) {
// do nothing
} }
// bug:在选中一个NameObject并删除,会遗留下Name. // bug:在选中一个NameObject并删除,会遗留下Name.
doBeforeRemove(); doBeforeRemove();

BIN
designer_base/src/com/fr/design/images/buttonicon/anas.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 454 B

BIN
designer_base/src/com/fr/design/images/chart/ChartType.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 138 B

4
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -681,7 +681,7 @@ CellWrite-InsertRow_DEFAULT=\u9ED8\u8BA4\u503C
Widget-Load_By_Complete=\u5B8C\u5168\u52A0\u8F7D Widget-Load_By_Complete=\u5B8C\u5168\u52A0\u8F7D
FR-Designer-Basic_Only_Submit_Current_Sheet=\u53EA\u63D0\u4EA4\u5F53\u524Dsheet FR-Designer-Basic_Only_Submit_Current_Sheet=\u53EA\u63D0\u4EA4\u5F53\u524Dsheet
Sort-Sort_Order=\u6392\u5217\u987A\u5E8F Sort-Sort_Order=\u6392\u5217\u987A\u5E8F
File-File_Size_Limit=\u6587\u4EF6\u5927\u5C0F\u9650\u5236 File-File_Size_Limit=\u5927\u5C0F\u9650\u5236
PrintP-Print=\u6253\u5370(T) PrintP-Print=\u6253\u5370(T)
FR-Designer-StyleAlignment_Center=\u5C45\u4E2D FR-Designer-StyleAlignment_Center=\u5C45\u4E2D
Preference-Setting_Colors=\u989C\u8272\u8BBE\u7F6E Preference-Setting_Colors=\u989C\u8272\u8BBE\u7F6E
@ -1806,7 +1806,7 @@ FR-Designer-Dependence_Connect_Server_Error=\u65E0\u6CD5\u8FDE\u63A5\u670D\u52A1
High=\u9AD8 High=\u9AD8
HJS-Send_Failed=\u53D1\u9001\u5931\u8D25 HJS-Send_Failed=\u53D1\u9001\u5931\u8D25
HJS-Message=\u5185\u5BB9 HJS-Message=\u5185\u5BB9
File-Allow_Upload_Files=\u5141\u8BB8\u4E0A\u4F20\u6587\u4EF6\u7C7B\u578B File-Allow_Upload_Files=\u6587\u4EF6\u7C7B\u578B
FR-Designer-Form-ToolBar_Chart=\u56FE\u8868 FR-Designer-Form-ToolBar_Chart=\u56FE\u8868
Thick_Bottom_Border_Line=\u7C97\u5E95\u6846\u7EBF Thick_Bottom_Border_Line=\u7C97\u5E95\u6846\u7EBF
FR-Action_Remove=\u5220\u9664 FR-Action_Remove=\u5220\u9664

4
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -589,7 +589,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
if (popupDialog != null && isPoppedOut) { if (popupDialog != null && isPoppedOut) {
popupDialog.replaceContentPane(this); popupDialog.replaceContentPane(this);
} }
if (popupPane != null && !isRightPaneVisible()) { if (popupPane != null && popupPane.isVisible()) {
popupPane.replaceContentPane(contentArea); popupPane.replaceContentPane(contentArea);
} }
@ -627,7 +627,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
if (isRightPaneVisible()) { if (isRightPaneVisible()) {
hideCurrentPopupPane(); hideCurrentPopupPane();
replaceContentPane(contentPane); replaceContentPane(contentPane);
} else if(popupPane != null) { } else if(popupPane != null && popupPane.isVisible()) {
popupPane.replaceContentPane(contentArea); popupPane.replaceContentPane(contentArea);
} }
} }

10
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.*; import com.fr.base.*;
import com.fr.base.io.IOFile; import com.fr.base.io.IOFile;
import com.fr.base.iofileattr.TemplateIdAttrMark;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -46,6 +47,7 @@ import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.UUID;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.*; import javax.swing.*;
@ -1066,12 +1068,12 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
} }
/** /**
* 由于老版本的模板没有模板ID当勾选使用参数模板时候就加一个模板ID * 由于老版本的模板没有模板ID当勾选使用参数模板时候就加一个模板ID attr
* @param isUseParamTemplate 是否使用参数模板 * @param isUseParamTemplate 是否使用参数模板
*/ */
public void needAddTemplateId(boolean isUseParamTemplate) { public void needAddTemplateIdAttr(boolean isUseParamTemplate) {
if (isUseParamTemplate && StringUtils.isEmpty(template.getTemplateID())) { if (isUseParamTemplate && template.getAttrMark(TemplateIdAttrMark.XML_TAG) == null) {
template.initTemplateID(); template.addAttrMark(new TemplateIdAttrMark(UUID.randomUUID().toString()));
} }
} }
} }

2
designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java

@ -28,7 +28,7 @@ public class BasicPropertyPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
widgetName = new UITextField(); widgetName = new UITextField();
widgetName.setGlobalName(Inter.getLocText("FR-Designer_Widget_Name")); widgetName.setGlobalName(Inter.getLocText("FR-Designer_Basic"));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p}; double[] rowSize = {p};

3
designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java

@ -3,6 +3,7 @@ package com.fr.design.parameter;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.parameter.ParameterUI; import com.fr.base.parameter.ParameterUI;
import com.fr.design.mainframe.AuthorityEditPane; import com.fr.design.mainframe.AuthorityEditPane;
import com.fr.design.mainframe.JTemplate;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -31,6 +32,8 @@ public interface ParameterDesignerProvider {
void refreshParameter(ParaDefinitePane paraDefinitePane); void refreshParameter(ParaDefinitePane paraDefinitePane);
void refreshParameter(ParaDefinitePane paraDefinitePane, JTemplate jt);
boolean isWithQueryButton(); boolean isWithQueryButton();
java.util.List<String> getAllXCreatorNameList(); java.util.List<String> getAllXCreatorNameList();

2
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -1534,7 +1534,7 @@ public class RemoteEnv extends AbstractEnv {
testServerConnection(); testServerConnection();
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design"); para.put("op", "svgrelate");
para.put("cmd", "design_save_svg"); para.put("cmd", "design_save_svg");
para.put("filePath", svgFile.getFilePath()); para.put("filePath", svgFile.getFilePath());
para.put("current_uid", this.createUserID()); para.put("current_uid", this.createUserID());

29
designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java

@ -34,6 +34,7 @@ import com.fr.plugin.chart.service.WMSFactory;
import com.fr.plugin.chart.type.GISLayerType; import com.fr.plugin.chart.type.GISLayerType;
import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel; import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuEvent;
@ -79,6 +80,9 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
ZoomLevel.SEVENTEEN, ZoomLevel.SEVENTEENPOINTFIVE, ZoomLevel.SEVENTEEN, ZoomLevel.SEVENTEENPOINTFIVE,
ZoomLevel.EIGHTEEN ZoomLevel.EIGHTEEN
}; };
//深蓝和高德地图下拉框层级
private static final ZoomLevel[] BLUE_ZOOM_LEVELS =(ZoomLevel[]) ArrayUtils.subarray(ZOOM_LEVELS, 0, 34);
private static final ZoomLevel[] GAODE_ZOOM_LEVELS =ArrayUtils.addAll(new ZoomLevel[]{ZoomLevel.AUTO}, (ZoomLevel[])ArrayUtils.subarray(ZOOM_LEVELS, 7, 38));
private static final String AUTO_CENTER_STRING = Inter.getLocText("Plugin-ChartF_Automatic"); private static final String AUTO_CENTER_STRING = Inter.getLocText("Plugin-ChartF_Automatic");
private static final String CUSTOM_CENTER_STRING = Inter.getLocText("Plugin-ChartF_Custom"); private static final String CUSTOM_CENTER_STRING = Inter.getLocText("Plugin-ChartF_Custom");
@ -230,6 +234,13 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
gisLayer = new UIComboBox(layers); gisLayer = new UIComboBox(layers);
gisLayer.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
refreshZoomLevel();
}
});
gisLayer.addPopupMenuListener(new PopupMenuListener() { gisLayer.addPopupMenuListener(new PopupMenuListener() {
public void popupMenuCanceled(PopupMenuEvent e) { public void popupMenuCanceled(PopupMenuEvent e) {
} }
@ -296,6 +307,23 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
return panel; return panel;
} }
private void refreshZoomLevel(){
//gis图层不同,对应的缩放等级不同。
ZoomLevel[] levels;
if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Inter.getLocText("Plugin-ChartF_Layer_Blue"))) {
levels = BLUE_ZOOM_LEVELS;
} else if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Inter.getLocText("Plugin-ChartF_Layer_GaoDe"))) {
levels = GAODE_ZOOM_LEVELS;
} else {
levels = ZOOM_LEVELS;
}
zoomLevel.removeAllItems();
for (int i = 0; i < levels.length; i++) {
zoomLevel.addItem(levels[i]);
}
}
private JPanel createCustomTileLayer() { private JPanel createCustomTileLayer() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p}; double[] rowSize = {p, p};
@ -620,6 +648,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
customTileLayer.setText(layer.getCustomTileLayer()); customTileLayer.setText(layer.getCustomTileLayer());
attribution.setText(layer.getAttribution()); attribution.setText(layer.getAttribution());
refreshZoomLevel();
zoomLevel.setSelectedItem(mapPlot.getZoomLevel()); zoomLevel.setSelectedItem(mapPlot.getZoomLevel());
ViewCenter viewCenter = mapPlot.getViewCenter(); ViewCenter viewCenter = mapPlot.getViewCenter();

BIN
designer_chart/src/com/fr/plugin/chart/map/images/mapData.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 493 B

2
designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java

@ -108,7 +108,7 @@ public class CompositeComponentAdapter implements ComponentAdapter {
ArrayList<PropertyGroupPane> groups = new ArrayList<PropertyGroupPane>(); ArrayList<PropertyGroupPane> groups = new ArrayList<PropertyGroupPane>();
for (String groupName : groupNames) { for (String groupName : groupNames) {
ArrayList<CRPropertyDescriptor> groupProperties = maps.get(groupName); ArrayList<CRPropertyDescriptor> groupProperties = maps.get(groupName);
PropertyGroupPane propertyGroupPane = new PropertyGroupPane(groupProperties.toArray(new CRPropertyDescriptor[0]), xCreator, groupName); PropertyGroupPane propertyGroupPane = new PropertyGroupPane(groupProperties.toArray(new CRPropertyDescriptor[0]), xCreator, groupName, designer);
groups.add(propertyGroupPane); groups.add(propertyGroupPane);
} }
return groups; return groups;

157
designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java

@ -136,37 +136,7 @@ public class SelectionModel {
private void unselectedPaste() { private void unselectedPaste() {
if (designer.getClass().equals(FormDesigner.class)) { if (designer.getClass().equals(FormDesigner.class)) {
if (selection.getSelectedCreator() instanceof XWFitLayout) { if (selection.getSelectedCreator() instanceof XWFitLayout) {
if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) { pasteXWFitLayout();
XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator();
//tab布局编辑器内部左上角第一个坐标点
int leftUpX = container.toData().getMargin().getLeft() + 1;
int leftUpY = container.toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, container, clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
} else {
//自适应布局编辑器内部左上角第一个坐标点
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1;
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(),
clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
}
} else { } else {
//绝对布局 //绝对布局
//编辑器外面还有两层容器,使用designer.getRootComponent()获取到的是编辑器中层的容器,不是编辑器表层 //编辑器外面还有两层容器,使用designer.getRootComponent()获取到的是编辑器中层的容器,不是编辑器表层
@ -186,6 +156,40 @@ public class SelectionModel {
} }
} }
private void pasteXWFitLayout() {
if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) {
XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator();
//tab布局编辑器内部左上角第一个坐标点
int leftUpX = container.toData().getMargin().getLeft() + 1;
int leftUpY = container.toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, container, clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
} else {
//自适应布局编辑器内部左上角第一个坐标点
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1;
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(),
clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
}
}
/** /**
* 粘贴时选择组件 * 粘贴时选择组件
*/ */
@ -227,7 +231,11 @@ public class SelectionModel {
XCreator[] roots = selection.getSelectedCreators(); XCreator[] roots = selection.getSelectedCreators();
if (roots.length > 0) { if (roots.length > 0) {
boolean isInPara = true; // 在参数面板内删除控件
for (XCreator creator : roots) { for (XCreator creator : roots) {
if (isInPara && !(creator.getParent() instanceof XWParameterLayout)) {
isInPara = false;
}
if (creator.acceptType(XWParameterLayout.class)) { if (creator.acceptType(XWParameterLayout.class)) {
designer.removeParaComponent(); designer.removeParaComponent();
} }
@ -236,8 +244,7 @@ public class SelectionModel {
// 清除被选中的组件 // 清除被选中的组件
selection.reset(); selection.reset();
} }
setSelectedCreator(designer.getRootComponent()); setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent());
FormSelectionUtils.rebuildSelection(designer);
// 触发事件 // 触发事件
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED);
designer.repaint(); designer.repaint();
@ -401,45 +408,57 @@ public class SelectionModel {
if (x < (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) { if (x < (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) {
return Location.outer; return Location.outer;
} else if ((x >= (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) && (x <= bounds.x)) { } else if ((x >= (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) && (x <= bounds.x)) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { return getDirectionLeft(bounds, y);
return Location.outer;
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.left_top;
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.left;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.left_bottom;
} else {
return Location.outer;
}
} else if ((x > bounds.x) && (x < (bounds.x + bounds.width))) { } else if ((x > bounds.x) && (x < (bounds.x + bounds.width))) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { return getDirectionCenter(bounds, y);
return Location.outer;
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.top;
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.inner;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.bottom;
} else {
return Location.outer;
}
} else if ((x >= (bounds.x + bounds.width)) } else if ((x >= (bounds.x + bounds.width))
&& (x <= (bounds.x + bounds.width + XCreatorConstants.RESIZE_BOX_SIZ))) { && (x <= (bounds.x + bounds.width + XCreatorConstants.RESIZE_BOX_SIZ))) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { return getDirectionRight(bounds, y);
return Location.outer; } else {
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) { return Location.outer;
return Location.right_top; }
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) { }
return Location.right;
} else if ((y >= (bounds.y + bounds.height)) private Direction getDirectionRight(Rectangle bounds, int y) {
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) { if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) {
return Location.right_bottom; return Location.outer;
} else { } else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.outer; return Location.right_top;
} } else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.right;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.right_bottom;
} else {
return Location.outer;
}
}
private Direction getDirectionCenter(Rectangle bounds, int y) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) {
return Location.outer;
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.top;
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.inner;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.bottom;
} else {
return Location.outer;
}
}
private Direction getDirectionLeft(Rectangle bounds, int y) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) {
return Location.outer;
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.left_top;
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.left;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.left_bottom;
} else { } else {
return Location.outer; return Location.outer;
} }

16
designer_form/src/com/fr/design/designer/creator/CRPropertyDescriptorPane.java

@ -2,10 +2,12 @@ package com.fr.design.designer.creator;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.beans.events.DesignerEvent;
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;
import com.fr.design.gui.xtable.TableUtils; import com.fr.design.gui.xtable.TableUtils;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.ExtendedPropertyEditor; import com.fr.design.mainframe.widget.editors.ExtendedPropertyEditor;
import com.fr.design.mainframe.widget.editors.StringEditor; import com.fr.design.mainframe.widget.editors.StringEditor;
@ -27,10 +29,12 @@ public class CRPropertyDescriptorPane {
private XCreator xCreator; private XCreator xCreator;
private PropertyEditor propertyEditor; private PropertyEditor propertyEditor;
private boolean isPopulate = true; private boolean isPopulate = true;
private FormDesigner designer;
public CRPropertyDescriptorPane(CRPropertyDescriptor crPropertyDescriptor, XCreator xCreator) { public CRPropertyDescriptorPane(CRPropertyDescriptor crPropertyDescriptor, XCreator xCreator, FormDesigner designer) {
this.crPropertyDescriptor = crPropertyDescriptor; this.crPropertyDescriptor = crPropertyDescriptor;
this.xCreator = xCreator; this.xCreator = xCreator;
this.designer = designer;
} }
public Component[] createTableLayoutComponent() { public Component[] createTableLayoutComponent() {
@ -49,7 +53,7 @@ public class CRPropertyDescriptorPane {
} }
private Component initEditorComponent(CRPropertyDescriptor crPropertyDescriptor, final XCreator xCreator) { private Component initEditorComponent(final CRPropertyDescriptor crPropertyDescriptor, final XCreator xCreator) {
Component component = null; Component component = null;
try { try {
// 如果已有的编辑器就生成对应的component // 如果已有的编辑器就生成对应的component
@ -87,6 +91,14 @@ public class CRPropertyDescriptorPane {
if (extendEditor.refreshInTime()) { if (extendEditor.refreshInTime()) {
WidgetPropertyPane.getInstance().refreshDockingView(); WidgetPropertyPane.getInstance().refreshDockingView();
} }
if (designer == null) {
return;
}
if ("widgetName".equals(crPropertyDescriptor.getName())) {
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
} else {
designer.fireTargetModified();
}
} }
}); });

33
designer_form/src/com/fr/design/designer/creator/PropertyGroupPane.java

@ -1,19 +1,16 @@
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
import com.fr.base.FRContext;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.FreeButton; import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
/** /**
* Created by kerry on 2017/9/7. * Created by kerry on 2017/9/7.
@ -23,6 +20,7 @@ public class PropertyGroupPane extends BasicPane {
private CRPropertyDescriptorPane[] crPropertyDescriptorPanes; private CRPropertyDescriptorPane[] crPropertyDescriptorPanes;
private XCreator xCreator; private XCreator xCreator;
private String groupName; private String groupName;
private FormDesigner designer;
public String getGroupName() { public String getGroupName() {
return groupName; return groupName;
@ -36,22 +34,25 @@ public class PropertyGroupPane extends BasicPane {
public PropertyGroupPane(CRPropertyDescriptor[] crPropertyDescriptors, XCreator xCreator) { public PropertyGroupPane(CRPropertyDescriptor[] crPropertyDescriptors, XCreator xCreator) {
this.crPropertyDescriptors = crPropertyDescriptors; this.crPropertyDescriptors = crPropertyDescriptors;
this.xCreator = xCreator; this.xCreator = xCreator;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
initComponent(); initComponent();
} }
public PropertyGroupPane(CRPropertyDescriptor[] crPropertyDescriptors, XCreator xCreator, String groupName) { public PropertyGroupPane(CRPropertyDescriptor[] crPropertyDescriptors, XCreator xCreator, String groupName, FormDesigner designer) {
this(crPropertyDescriptors, xCreator); this.designer = designer;
this.groupName = groupName; this.groupName = groupName;
this.crPropertyDescriptors = crPropertyDescriptors;
this.xCreator = xCreator;
initComponent();
} }
public void initComponent() { public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
int count = crPropertyDescriptors.length; int count = crPropertyDescriptors.length;
crPropertyDescriptorPanes = new CRPropertyDescriptorPane[count]; crPropertyDescriptorPanes = new CRPropertyDescriptorPane[count];
Component[][] components = new Component[count][]; Component[][] components = new Component[count][];
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
crPropertyDescriptorPanes[i] = new CRPropertyDescriptorPane(crPropertyDescriptors[i], xCreator); crPropertyDescriptorPanes[i] = new CRPropertyDescriptorPane(crPropertyDescriptors[i], xCreator, designer);
components[i] = crPropertyDescriptorPanes[i].createTableLayoutComponent(); components[i] = crPropertyDescriptorPanes[i].createTableLayoutComponent();
} }
@ -71,21 +72,5 @@ public class PropertyGroupPane extends BasicPane {
return "PropertyGroupPane"; return "PropertyGroupPane";
} }
public static void main(String[] args) {
try {
XCreator xCreator = new XButton(new FreeButton(), new Dimension(100, 100));
PropertyGroupPane propertyGroupPane = new PropertyGroupPane(xCreator.supportedDescriptor(), xCreator);
JFrame jf = new JFrame("jFrame");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(propertyGroupPane, BorderLayout.CENTER);
jf.setSize(439, 400);
jf.setVisible(true);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
}
} }

40
designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java

@ -37,16 +37,7 @@ import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.AuthorityEditPane; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormDesignerModeForSpecial;
import com.fr.design.mainframe.FormParaPane;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.parameter.ParaDefinitePane; import com.fr.design.parameter.ParaDefinitePane;
import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterDesignerProvider;
import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.ParameterPropertyPane;
@ -79,6 +70,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
private static final int SECOND_H_LOCATION = 170; private static final int SECOND_H_LOCATION = 170;
private static final int ADD_HEIGHT = 20; private static final int ADD_HEIGHT = 20;
private static final int H_GAP = 105; private static final int H_GAP = 105;
private static final int SUBMIT_BUTTON_H_LOCATION = 270;
private static final int PARA_IMAGE_SHIFT_X = -4;
private static final int FORM_AREA_PADDING_LEFT = 13;
private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png"); private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png");
@ -175,12 +169,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(DesignerEvent evt) {
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_ADDED if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_RENAMED) {
paraDefinitePane.setParameterArray( paraDefinitePane.setParameterArray(
paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters())); paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()));
paraDefinitePane.refreshParameter(); paraDefinitePane.refreshParameter();
@ -196,7 +185,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
*/ */
public Component createWrapper() { public Component createWrapper() {
FormArea area = new FormArea(this, false); FormArea area = new FormArea(this, false);
area.setBorder(BorderFactory.createEmptyBorder(0, 13, 0, 0)); area.setBorder(BorderFactory.createEmptyBorder(0, FORM_AREA_PADDING_LEFT, 0, 0));
return area; return area;
} }
@ -224,6 +213,16 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
* @param p 参数面板 * @param p 参数面板
*/ */
public void refreshParameter(ParaDefinitePane p) { public void refreshParameter(ParaDefinitePane p) {
refreshParameter(p, DesignerContext.getDesignerFrame().getSelectedJTemplate());
}
/**
* 刷新参数
*
* @param p 参数面板
* @param jt 当前模版
*/
public void refreshParameter(ParaDefinitePane p, JTemplate jt) {
XLayoutContainer rootContainer = this.getRootComponent(); XLayoutContainer rootContainer = this.getRootComponent();
java.util.List<String> namelist = getAllXCreatorNameList(rootContainer); java.util.List<String> namelist = getAllXCreatorNameList(rootContainer);
// parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名 // parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名
@ -240,8 +239,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(
p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray());
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height); ParameterPropertyPane.getInstance().refreshState(jt);
} }
/** /**
@ -439,7 +437,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
for (Parameter p : paras) { for (Parameter p : paras) {
if (p.getName().equalsIgnoreCase(creator.toData().getWidgetName())) { if (p.getName().equalsIgnoreCase(creator.toData().getWidgetName())) {
g.drawImage(paraImage, creator.getX() - 4, creator.getY() + 2, null); g.drawImage(paraImage, creator.getX() + PARA_IMAGE_SHIFT_X, creator.getY() + 2, null);
break; break;
} }
} }
@ -617,7 +615,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
formSubmitButton.setWidgetName("Search"); formSubmitButton.setWidgetName("Search");
formSubmitButton.setText(Inter.getLocText("FR-Designer_Query")); formSubmitButton.setText(Inter.getLocText("FR-Designer_Query"));
xCreator = XCreatorUtils.createXCreator(formSubmitButton); xCreator = XCreatorUtils.createXCreator(formSubmitButton);
if (!(this.autoAddComponent(xCreator, 270, FIRST_V_LOCATION + V_COMPONENT_GAP if (!(this.autoAddComponent(xCreator, SUBMIT_BUTTON_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP
* (currentIndex / NUM_IN_A_LINE)))) { * (currentIndex / NUM_IN_A_LINE)))) {
return false; return false;
} }

17
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -123,6 +123,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
private static final int SECOND_H_LOCATION = 170; private static final int SECOND_H_LOCATION = 170;
private static final int ADD_HEIGHT = 20; private static final int ADD_HEIGHT = 20;
private static final int H_GAP = 105; private static final int H_GAP = 105;
private static final int SUBMIT_BUTTON_H_LOCATION = 270;
public FormDesigner(Form form) { public FormDesigner(Form form) {
this(form, null); this(form, null);
@ -257,7 +258,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
currentIndex++; currentIndex++;
parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter);
refreshParameter(); refreshParameter();
EastRegionContainerPane.getInstance().refreshDownPane(); fireTargetModified();
} }
/** /**
@ -294,14 +295,14 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
formSubmitButton.setWidgetName("Search"); formSubmitButton.setWidgetName("Search");
formSubmitButton.setText(Inter.getLocText("FR-Designer_Query")); formSubmitButton.setText(Inter.getLocText("FR-Designer_Query"));
xCreator = XCreatorUtils.createXCreator(formSubmitButton); xCreator = XCreatorUtils.createXCreator(formSubmitButton);
if (!(this.autoAddComponent(xCreator, 270, FIRST_V_LOCATION + V_COMPONENT_GAP if (!(this.autoAddComponent(xCreator, SUBMIT_BUTTON_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP
* (currentIndex / NUM_IN_A_LINE)))) { * (currentIndex / NUM_IN_A_LINE)))) {
return; return;
} }
currentIndex = currentIndex + NUM_IN_A_LINE - currentIndex % NUM_IN_A_LINE; currentIndex = currentIndex + NUM_IN_A_LINE - currentIndex % NUM_IN_A_LINE;
parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter);
refreshParameter(); refreshParameter();
EastRegionContainerPane.getInstance().refreshDownPane(); fireTargetModified();
} }
/** /**
@ -667,9 +668,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
// 只有选择组件时不触发模版更新,其他都要触发 // 只有选择组件时不触发模版更新,其他都要触发
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
FormDesigner.this.fireTargetModified(); FormDesigner.this.fireTargetModified();
//bug59192 setParameterArray(getNoRepeatParas(getTarget().getParameters()));
//setParameterArray(getNoRepeatParas(getTarget().getParameters())); refreshParameter();
//refreshParameter();
} }
} }
@ -1147,7 +1147,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* 同步 * 同步
*/ */
public void populateRootSize() { public void populateRootSize() {
// do nothing
} }
/** /**
@ -1233,6 +1233,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/ */
@Override @Override
public void stopEditing() { public void stopEditing() {
// do nothing
} }
/** /**
@ -1412,7 +1413,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
parent = parent.getParent(); parent = parent.getParent();
} }
Object[] components = path.toArray(); Object[] components = (Object[]) path.toArray();
if (components.length == 0) { if (components.length == 0) {
return null; return null;
} }

17
designer_form/src/com/fr/design/mainframe/JForm.java

@ -328,10 +328,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
private void setPropertyPaneChange(XComponent comp) { private void setPropertyPaneChange(XComponent comp) {
if (comp == null) { if (comp == null) {
ParameterPropertyPane.getInstance().setAddParaPaneVisible(false); ParameterPropertyPane.getInstance().setAddParaPaneVisible(false, this);
return; return;
} }
ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout); ParameterPropertyPane.getInstance().setAddParaPaneVisible(isAddParaPaneVisible(comp), this);
editingComponent = comp.createToolPane(this, formDesign); editingComponent = comp.createToolPane(this, formDesign);
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
@ -342,6 +342,16 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
} }
} }
private boolean isAddParaPaneVisible(XComponent comp) {
boolean isVisible = false;
try {
isVisible = comp instanceof XWParameterLayout || ((XCreator) comp).getParent() instanceof XWParameterLayout;
} catch (Throwable throwable) {
// 发生异常则返回 false
}
return isVisible;
}
public JComponent getEditingPane() { public JComponent getEditingPane() {
return editingComponent; return editingComponent;
} }
@ -546,6 +556,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
//撤销的时候要重新选择的body布局 //撤销的时候要重新选择的body布局
this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(), this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(),
formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()})); formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()}));
refreshToolArea();
} else { } else {
String widgetName = this.formDesign.getElementCaseContainerName(); String widgetName = this.formDesign.getElementCaseContainerName();
//这儿太坑了,u.getForm() 与 getTarget内容不一样 //这儿太坑了,u.getForm() 与 getTarget内容不一样
@ -718,7 +729,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign));
ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign); ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign);
parameterPropertyPane.setAddParaPaneVisible(false); parameterPropertyPane.setAddParaPaneVisible(false, this);
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);

2
designer_form/src/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java

@ -27,6 +27,8 @@ public class BasicSetVisiblePropertyPane extends FormBasicPropertyPane {
pane2.add(otherOtherConfig); pane2.add(otherOtherConfig);
} }
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true); visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true);
visibleCheckBox.setGlobalName(Inter.getLocText("FR-Designer_Basic"));
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
pane2.add(visibleCheckBox); pane2.add(visibleCheckBox);
this.add(pane2, BorderLayout.CENTER); this.add(pane2, BorderLayout.CENTER);

2
designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java

@ -17,6 +17,8 @@ public class FormBasicWidgetPropertyPane extends BasicSetVisiblePropertyPane {
public UICheckBox createOtherConfig() { public UICheckBox createOtherConfig() {
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true); enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true);
enableCheckBox.setGlobalName(Inter.getLocText("FR-Designer_Basic"));
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return enableCheckBox; return enableCheckBox;
} }

29
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -133,7 +133,18 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
jPanel.add(attriCardPane, BorderLayout.CENTER); jPanel.add(attriCardPane, BorderLayout.CENTER);
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); jPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
if(FormWidgetDefinePaneFactoryBase.isExtraXWidget(innerCreator.toData())){ final boolean isExtraWidget = FormWidgetDefinePaneFactoryBase.isExtraXWidget(innerCreator.toData());
this.listener = new AttributeChangeListener() {
@Override
public void attributeChange() {
if(!isExtraWidget){
updateCreator();
}
updateWidgetBound();
}
};
if(isExtraWidget){
return; return;
} }
@ -143,13 +154,6 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
jPanel.add(uiExpandablePane, BorderLayout.NORTH); jPanel.add(uiExpandablePane, BorderLayout.NORTH);
this.listener = new AttributeChangeListener() {
@Override
public void attributeChange() {
updateCreator();
}
};
} }
private void initDefinePane() { private void initDefinePane() {
@ -206,18 +210,20 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
public void updateCreator() { public void updateCreator() {
currentEditorDefinePane.setGlobalName(getGlobalName()); currentEditorDefinePane.setGlobalName(getGlobalName());
Widget widget = currentEditorDefinePane.updateBean(); Widget widget = currentEditorDefinePane.updateBean();
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Widget_Name")) && widgetPropertyPane != null) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Basic")) && widgetPropertyPane != null) {
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
xCreator.resetCreatorName(widget.getWidgetName()); xCreator.resetCreatorName(widget.getWidgetName());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED); designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
return; return;
} }
fireValueChanged();
}
public void updateWidgetBound (){
if (widgetBoundPane != null && ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Coords_And_Size"))) { if (widgetBoundPane != null && ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Coords_And_Size"))) {
widgetBoundPane.update(); widgetBoundPane.update();
} }
designer.refreshDesignerUI();
fireValueChanged();
} }
@ -233,7 +239,6 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
XCreator creator = getXCreatorDedicated(); XCreator creator = getXCreatorDedicated();
creator.firePropertyChange(); creator.firePropertyChange();
designer.fireTargetModified(); designer.fireTargetModified();
designer.refreshDesignerUI();
} }
public String getIconPath() { public String getIconPath() {

16
designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

@ -4,10 +4,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane;
import com.fr.design.mainframe.JForm;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -87,18 +84,23 @@ public class ParameterPropertyPane extends JPanel{
} }
// 显示或隐藏添加参数面板 // 显示或隐藏添加参数面板
public void refreshState(JTemplate jt) {
setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem(), jt);
}
// 显示或隐藏添加参数面板
public void refreshState() { public void refreshState() {
setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem()); refreshState(DesignerContext.getDesignerFrame().getSelectedJTemplate());
} }
public void setAddParaPaneVisible(boolean isVisible) { public void setAddParaPaneVisible(boolean isVisible, JTemplate jt) {
if (isVisible == addParaPane.isVisible() || formHierarchyTreePaneWrapper == null) { if (isVisible == addParaPane.isVisible() || formHierarchyTreePaneWrapper == null) {
return; return;
} }
// 表单中,只有添加并选中参数面板时,才显示 // 表单中,只有添加并选中参数面板时,才显示
boolean hideInJForm; boolean hideInJForm;
try { try {
hideInJForm = DesignerContext.getDesignerFrame().getSelectedJTemplate() instanceof JForm && hideInJForm = jt instanceof JForm &&
!(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout); !(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout);
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
hideInJForm = true; hideInJForm = true;

16
designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

@ -35,6 +35,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private static final int BUTTON_HEIGHT = 20; private static final int BUTTON_HEIGHT = 20;
private static final int WIDTH = 225; private static final int WIDTH = 225;
private static final int L_H = 18; private static final int L_H = 18;
private static final int LABEL_PADDING_LEFT = 4;
public ParameterToolBarPane() { public ParameterToolBarPane() {
this.setLayout(new FlowParameterPaneLayout()); this.setLayout(new FlowParameterPaneLayout());
@ -47,9 +48,9 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
return new Dimension(super.getPreferredSize().width, 18); return new Dimension(super.getPreferredSize().width, 18);
} }
}; };
label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated")+":"); label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated") + ":");
label.setHorizontalAlignment(SwingConstants.LEFT); label.setHorizontalAlignment(SwingConstants.LEFT);
label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(0, LABEL_PADDING_LEFT, 0, 0));
this.add(label); this.add(label);
addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all")); addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all"));
@ -68,7 +69,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
public Parameter getTargetParameter(UIButton button) { public Parameter getTargetParameter(UIButton button) {
int index = parameterSelectedLabellist.indexOf(button); int index = parameterSelectedLabellist.indexOf(button);
if(index < 0 || index > parameterList.length - 1) { if (index < 0 || index > parameterList.length - 1) {
return null; return null;
} }
return parameterList[index]; return parameterList[index];
@ -82,7 +83,6 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(label); this.add(label);
if (parameterArray.length == 0) { if (parameterArray.length == 0) {
ParameterPropertyPane.getInstance().refreshState();
this.setVisible(false); this.setVisible(false);
this.repaint(); this.repaint();
return; return;
@ -103,7 +103,6 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(addAll); this.add(addAll);
this.doLayout(); this.doLayout();
ParameterPropertyPane.getInstance().refreshState();
this.repaint(); this.repaint();
} }
@ -124,12 +123,15 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private class FlowParameterPaneLayout implements LayoutManager { private class FlowParameterPaneLayout implements LayoutManager {
public FlowParameterPaneLayout() { public FlowParameterPaneLayout() {
// do nothing
} }
public void addLayoutComponent(String name, Component comp) { public void addLayoutComponent(String name, Component comp) {
// do nothing
} }
public void removeLayoutComponent(Component comp) { public void removeLayoutComponent(Component comp) {
// do nothing
} }
public Dimension preferredLayoutSize(Container parent) { public Dimension preferredLayoutSize(Container parent) {
@ -137,7 +139,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
layoutContainer(parent); layoutContainer(parent);
int h= ((parameterSelectedLabellist.size() == 0) ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); int h= (parameterSelectedLabellist.isEmpty() ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height);
return new Dimension(w, h); return new Dimension(w, h);
} }
@ -155,7 +157,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
breakid = 1; breakid = 1;
for (UIButton tab : parameterSelectedLabellist) { for (UIButton tab : parameterSelectedLabellist) {
Dimension dim = tab.getPreferredSize(); Dimension dim = tab.getPreferredSize();
if(x + dim.width > width) { if (x + dim.width > width) {
breakid++; breakid++;
x = 0; x = 0;
y += (dim.height + GAP_V); y += (dim.height + GAP_V);

2
designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java

@ -128,7 +128,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected());
wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected()); wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected());
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
jTemplate.needAddTemplateId(useParamsTemplate.isSelected()); jTemplate.needAddTemplateIdAttr(useParamsTemplate.isSelected());
wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setBackground((Background) background.getValue());
wParameterLayout.setPosition((int)hAlignmentPane.getSelectedItem()); wParameterLayout.setPosition((int)hAlignmentPane.getSelectedItem());
return wParameterLayout; return wParameterLayout;

23
designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java

@ -7,7 +7,6 @@ import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
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.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -20,7 +19,7 @@ import java.awt.*;
public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> { public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> {
private DictionaryComboBox acceptType; private DictionaryComboBox acceptType;
private UICheckBox singleFileCheckBox; private UICheckBox singleFileCheckBox;
private UINumberField fileSizeField; private UISpinner fileSizeField;
private UISpinner fontSizeField; private UISpinner fontSizeField;
public MultiFileEditorPane(XCreator xCreator) { public MultiFileEditorPane(XCreator xCreator) {
@ -38,36 +37,30 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays); acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays);
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD")); singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD"));
singleFileCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); singleFileCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
fileSizeField = new UINumberField(); fileSizeField = new UISpinner(0, Integer.MAX_VALUE, 1, -1);
fileSizeField.setPreferredSize(new Dimension(140, 20));
fontSizeField = new UISpinner(0, 20, 1, 0); fontSizeField = new UISpinner(0, 20, 1, 0);
JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
singleFilePane.add(singleFileCheckBox); singleFilePane.add(singleFileCheckBox);
JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel fileSizePane = new JPanel(new BorderLayout());
allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); fileSizePane.add(fileSizeField, BorderLayout.CENTER);
allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); fileSizePane.add(new UILabel(" KB"), BorderLayout.EAST);
allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"));
allowTypePane.add(acceptType);
JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"));
fileSizePane.add(fileSizeField);
fileSizePane.add(new UILabel(" KB"));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{singleFileCheckBox, null }, new Component[]{singleFileCheckBox, null },
new Component[]{new UILabel(Inter.getLocText("File-Allow_Upload_Files")), acceptType}, new Component[]{new UILabel(Inter.getLocText("File-Allow_Upload_Files")), acceptType},
new Component[]{new UILabel( Inter.getLocText("File-File_Size_Limit")), fileSizeField}, new Component[]{new UILabel( Inter.getLocText("File-File_Size_Limit")), fileSizePane},
new Component[]{new UILabel( Inter.getLocText("FR-Designer_Font-Size")), fontSizeField} new Component[]{new UILabel( Inter.getLocText("FR-Designer_Font-Size")), fontSizeField}
}; };
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
boundsPane.add(panel); boundsPane.add(panel);

Loading…
Cancel
Save