Browse Source

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

master
MoMeak 7 years ago
parent
commit
0a22d5c95c
  1. 6
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  2. 2
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  3. 6
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  4. 6
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  5. 263
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  6. 32
      designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java
  7. 25
      designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java
  8. 15
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  9. 8
      designer_base/src/com/fr/design/file/HistoryTemplateListPane.java
  10. 47
      designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java
  11. 2
      designer_base/src/com/fr/design/gui/style/NumberDragBar.java
  12. BIN
      designer_base/src/com/fr/design/images/buttonicon/run24.png
  13. BIN
      designer_base/src/com/fr/design/images/buttonicon/runs.png
  14. BIN
      designer_base/src/com/fr/design/images/m_edit/paste.png
  15. 0
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java
  16. 0
      designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java
  17. 2
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  18. 6
      designer_chart/src/com/fr/design/chart/gui/ChartComponent.java
  19. 6
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  20. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  21. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  22. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java
  23. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  24. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java
  25. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java
  26. 16
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java
  27. 17
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java
  28. 7
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/PiePlotTableDataContentPane.java
  29. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  30. 13
      designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java
  31. 0
      designer_chart/src/com/fr/plugin/chart/background.png
  32. 18
      designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java
  33. 23
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  34. 84
      designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java
  35. 84
      designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java
  36. 12
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java
  37. 12
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java
  38. 116
      designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java
  39. 121
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java
  40. 48
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java
  41. 53
      designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java
  42. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java
  43. 183
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  44. 17
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java
  45. 3
      designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java
  46. 18
      designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java
  47. 18
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  48. 15
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  49. 23
      designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  50. 13
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  51. 6
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  52. 6
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  53. 7
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  54. 5
      designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  55. 13
      designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  56. 6
      designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java
  57. 90
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  58. 11
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  59. 18
      designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java
  60. 30
      designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java
  61. 6
      designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java
  62. 5
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

6
designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
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;
@ -14,7 +14,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UIPropertyTextField text; private UITextField text;
public CheckBoxDefinePane() { public CheckBoxDefinePane() {
this.iniComoponents(); this.iniComoponents();
@ -22,7 +22,7 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UIPropertyTextField(); text = new UITextField();
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(text, BorderLayout.CENTER); panel.add(text, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0));

2
designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java

@ -24,7 +24,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false); directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setPreferredSize(new Dimension(100, 30)); directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
contentPane.add(waterMarkDictPane, BorderLayout.NORTH); contentPane.add(waterMarkDictPane, BorderLayout.NORTH);

6
designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -5,7 +5,7 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
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.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
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;
@ -24,7 +24,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UIPropertyTextField errorMsgTextField; protected UITextField errorMsgTextField;
protected JPanel validatePane; protected JPanel validatePane;
public FieldEditorDefinePane() { public FieldEditorDefinePane() {
@ -44,7 +44,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
errorMsgTextField = new UIPropertyTextField(); errorMsgTextField = new UITextField();
// // richer:主要为了方便查看比较长的错误信息 // // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {

6
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -9,7 +9,7 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane;
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.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
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;
@ -28,7 +28,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private static final int P_W = 610; private static final int P_W = 610;
private static final int P_H = 580; private static final int P_H = 580;
private UIPropertyTextField srcTextField; private UITextField srcTextField;
private ReportletParameterViewPane parameterViewPane; private ReportletParameterViewPane parameterViewPane;
private UICheckBox horizontalCheck; private UICheckBox horizontalCheck;
private UICheckBox verticalCheck; private UICheckBox verticalCheck;
@ -61,7 +61,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
java.awt.Component[][] coms = { java.awt.Component[][] coms = {
{horizontalCheck, null}, {horizontalCheck, null},
{verticalCheck, null}, {verticalCheck, null},
{new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UIPropertyTextField()}, {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()},
{new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}}; {new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE);

263
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -20,6 +20,7 @@ import javax.swing.text.DefaultFormatter;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
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;
@ -39,113 +40,23 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private SpinnerNumberModel maxValueModel; private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner; private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel; private SpinnerNumberModel minValueModel;
private UIBasicSpinner decimalLength; private UISpinner decimalLength;
private JPanel limitNumberPane; private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private ActionListener actionListener1 = new ActionListener() { private ActionListener allowDecimalsListener;
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
} else {
limitNumberPane.setVisible(false);
}
}
};
private ActionListener actionListener2 = new ActionListener() { private ActionListener allowNegativeListener ;
@Override public ActionListener setMaxListener;
public void actionPerformed(ActionEvent e) {
if (allowNegativeCheckBox.isSelected()) {
minValueModel.setMinimum(-Double.MAX_VALUE);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(-Double.MAX_VALUE);
}
} else {
minValueModel.setMinimum(0.0);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
if (maxValue < 0.0) {
maxValueSpinner.setValue(0.0);
}
}
}
};
private ActionListener setMinListener;
public ActionListener actionListener3 = new ActionListener() { private ChangeListener maxValueChangeListener;
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setVisible(true);
Double value = new Double(0);
if (setMinValueCheckBox.isSelected()) {
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
value = minValue;
}
}
maxValueSpinner.setValue(value);
} else {
maxValueSpinner.setVisible(false);
minValueModel.setMaximum(Double.MAX_VALUE);
}
}
};
private ActionListener actionListener4 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setVisible(true);
Double value = new Double(0);
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
value = maxValue;
}
}
minValueSpinner.setValue(value);
} else {
minValueSpinner.setVisible(false);
maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
}
}
};
private ChangeListener changeListener1 = new ChangeListener() { private ChangeListener minValueChangeListener;
@Override
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
private ChangeListener changeListener2 = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
// super();
this.initComponents();
} }
@ -160,73 +71,53 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
content.add(waterMarkDictPane, BorderLayout.CENTER); content.add(waterMarkDictPane, BorderLayout.CENTER);
return content; return content;
} }
public JPanel setValidatePane() { public JPanel setValidatePane() {
initListeners();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals"));
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.decimalLength = new UIBasicSpinner(new SpinnerNumberModel(16, 0, Integer.MAX_VALUE, 1)); this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
this.decimalLength.setPreferredSize(new Dimension(155, 20)); this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(allowNegativeListener);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Max_Value"), false);
setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(155, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
this.maxValueSpinner.setVisible(false); this.setMaxValueCheckBox.addActionListener(setMaxListener);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.maxValueSpinner.addChangeListener(maxValueChangeListener);
this.maxValueSpinner.addChangeListener(changeListener1);
this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Min_Value"), false); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Min_Value"), false);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(155, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
this.minValueSpinner.setVisible(false); this.setMinValueCheckBox.addActionListener(setMinListener);
this.setMinValueCheckBox.addActionListener(actionListener4); this.minValueSpinner.addChangeListener(minValueChangeListener);
this.minValueSpinner.addChangeListener(changeListener2);
UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"})); UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"}));
numberLabel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
JPanel decimalPane = new JPanel(new BorderLayout());
decimalPane.add(decimalLength, BorderLayout.CENTER);
decimalPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel maxValueSpinnerPane = new JPanel(new BorderLayout());
maxValueSpinnerPane.add(maxValueSpinner, BorderLayout.CENTER);
maxValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel minValueSpinnerPane = new JPanel(new BorderLayout());
minValueSpinnerPane.add(minValueSpinner, BorderLayout.CENTER);
minValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
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[]{allowDecimalsCheckBox, null}, new Component[]{allowDecimalsCheckBox, null},
new Component[]{numberLabel, decimalPane}, new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null}, new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinnerPane}, new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinnerPane}, new Component[]{setMinValueCheckBox, minValueSpinner},
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
pane.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 0)); pane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return pane; return pane;
} }
@ -237,28 +128,28 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.decimalLength.setValue(e.getMaxDecimalLength()); this.decimalLength.setValue(e.getMaxDecimalLength());
} else { } else {
this.limitNumberPane.setVisible(false); this.limitNumberPane.setVisible(false);
this.limitNumberPane.setPreferredSize(new Dimension(0,0));
} }
allowNegativeCheckBox.setSelected(e.isAllowNegative()); allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) { if (e.getMaxValue() == Double.MAX_VALUE) {
setMaxValueCheckBox.setSelected(false); setMaxValueCheckBox.setSelected(false);
maxValueSpinner.setValue(new Double(Double.MAX_VALUE)); maxValueSpinner.setValue(new Double(Double.MAX_VALUE));
maxValueSpinner.setVisible(false); maxValueSpinner.setEnabled(false);
} else { } else {
setMaxValueCheckBox.setSelected(true); setMaxValueCheckBox.setSelected(true);
maxValueSpinner.setVisible(true); maxValueSpinner.setEnabled(true);
maxValueSpinner.setValue(new Double(e.getMaxValue())); maxValueSpinner.setValue(new Double(e.getMaxValue()));
} }
if (e.getMinValue() == -Double.MAX_VALUE) { if (e.getMinValue() == -Double.MAX_VALUE) {
setMinValueCheckBox.setSelected(false); setMinValueCheckBox.setSelected(false);
minValueSpinner.setValue(new Double(-Double.MAX_VALUE)); minValueSpinner.setValue(new Double(-Double.MAX_VALUE));
minValueSpinner.setVisible(false); minValueSpinner.setEnabled(false);
} else { } else {
minValueSpinner.setEnabled(true);
setMinValueCheckBox.setSelected(true); setMinValueCheckBox.setSelected(true);
minValueSpinner.setVisible(true);
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
@ -270,7 +161,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
NumberEditor ob = new NumberEditor(); NumberEditor ob = new NumberEditor();
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength((Integer) this.decimalLength.getValue()); ob.setMaxDecimalLength((int)this.decimalLength.getValue());
} }
ob.setAllowNegative(allowNegativeCheckBox.isSelected()); ob.setAllowNegative(allowNegativeCheckBox.isSelected());
@ -292,18 +183,108 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
return ob; return ob;
} }
private void checkVisible() {
private void initListeners(){ allowDecimalsListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
limitNumberPane.setPreferredSize(new Dimension(215,20));
} else {
limitNumberPane.setVisible(false);
limitNumberPane.setPreferredSize(new Dimension(0,0));
}
}
};
allowNegativeListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (allowNegativeCheckBox.isSelected()) {
minValueModel.setMinimum(-Double.MAX_VALUE);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(-Double.MAX_VALUE);
}
} else {
minValueModel.setMinimum(0.0);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
if (maxValue < 0.0) {
maxValueSpinner.setValue(0.0);
}
}
}
};
setMaxListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMinValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setVisible(true); Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
value = minValue;
}
}
maxValueSpinner.setValue(value);
} else { } else {
minValueSpinner.setVisible(false); maxValueSpinner.setEnabled(false);
minValueModel.setMaximum(Double.MAX_VALUE);
} }
}
};
setMinListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setVisible(true); minValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
value = maxValue;
}
}
minValueSpinner.setValue(value);
} else { } else {
minValueSpinner.setVisible(false); minValueSpinner.setEnabled(false);
maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
}
} }
};
maxValueChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
minValueChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
} }
private void setNotAllowsInvalid(UIBasicSpinner jspinner) { private void setNotAllowsInvalid(UIBasicSpinner jspinner) {

32
designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java

@ -1,19 +1,23 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.BorderLayout; import java.awt.*;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.form.ui.TreeComboBoxEditor; import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter;
public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> { public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
protected TreeSettingPane treeSettingPane; protected AccessibleTreeModelEditor treeSettingPane;
protected TreeRootPane treeRootPane; protected TreeRootPane treeRootPane;
public TreeComboBoxEditorDefinePane() { public TreeComboBoxEditorDefinePane() {
@ -27,10 +31,23 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane(); treeRootPane = new TreeRootPane();
content.add(treeRootPane, BorderLayout.NORTH); content.add(treeRootPane, BorderLayout.NORTH);
treeSettingPane = new TreeSettingPane(true);
return content; return content;
} }
@Override
protected JPanel setFirstContentPane() {
treeSettingPane = new AccessibleTreeModelEditor();
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel north = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), treeSettingPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
north.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
JPanel center = super.setFirstContentPane();
jPanel.add(north, BorderLayout.NORTH);
jPanel.add(center, BorderLayout.CENTER);
return jPanel;
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "treecombobox"; return "treecombobox";
@ -38,19 +55,20 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
@Override @Override
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) { protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) {
treeSettingPane.populate(e); treeSettingPane.setValue(e.getDictionary());
treeRootPane.populate(e.getTreeAttr()); treeRootPane.populate(e.getTreeAttr());
} }
@Override @Override
protected TreeComboBoxEditor updateSubCustomWritableRepeatEditorBean() { protected TreeComboBoxEditor updateSubCustomWritableRepeatEditorBean() {
TreeComboBoxEditor editor = treeSettingPane.updateTreeComboBox(); TreeComboBoxEditor editor = new TreeComboBoxEditor();
editor.setDictionary((Dictionary)treeSettingPane.getValue());
editor.setTreeAttr(treeRootPane.update()); editor.setTreeAttr(treeRootPane.update());
return editor; return editor;
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return treeSettingPane; return null;
} }
} }

25
designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -1,10 +1,13 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.frpane.TreeSettingPane;
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.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -16,8 +19,8 @@ import java.awt.*;
* richer:tree editor * richer:tree editor
*/ */
public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> { public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
protected TreeSettingPane treeSettingPane;
protected TreeRootPane treeRootPane; protected TreeRootPane treeRootPane;
private AccessibleTreeModelEditor accessibleTreeModelEditor;
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
@ -27,7 +30,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
@Override @Override
protected void populateSubFieldEditorBean(TreeEditor e) { protected void populateSubFieldEditorBean(TreeEditor e) {
this.treeSettingPane.populate(e); this.accessibleTreeModelEditor.setValue(e.getDictionary());
treeRootPane.populate(e.getTreeAttr()); treeRootPane.populate(e.getTreeAttr());
if (this.removeRepeatCheckBox != null) { if (this.removeRepeatCheckBox != null) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
@ -36,7 +39,8 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
@Override @Override
protected TreeEditor updateSubFieldEditorBean() { protected TreeEditor updateSubFieldEditorBean() {
TreeEditor editor = treeSettingPane.updateTreeEditor(); TreeEditor editor = new TreeEditor();
editor.setDictionary((Dictionary) accessibleTreeModelEditor.getValue());
editor.setTreeAttr(treeRootPane.update()); editor.setTreeAttr(treeRootPane.update());
if (this.removeRepeatCheckBox != null) { if (this.removeRepeatCheckBox != null) {
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected()); editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected());
@ -50,13 +54,17 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
} }
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
accessibleTreeModelEditor = new AccessibleTreeModelEditor();
JPanel createTree = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), accessibleTreeModelEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
createTree.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
contentPane.add(contenter,BorderLayout.NORTH); contentPane.add(contenter,BorderLayout.NORTH);
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false);
contenter.add(removeRepeatCheckBox); removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
contenter.add(createTree, BorderLayout.NORTH);
contenter.add(removeRepeatCheckBox, BorderLayout.CENTER);
JPanel otherContentPane = this.setThirdContentPane(); JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) { if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER); contentPane.add(otherContentPane,BorderLayout.CENTER);
@ -69,7 +77,6 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane(); treeRootPane = new TreeRootPane();
content.add(treeRootPane, BorderLayout.NORTH); content.add(treeRootPane, BorderLayout.NORTH);
treeSettingPane = new TreeSettingPane(true);
return content; return content;
} }
@ -80,6 +87,6 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return treeSettingPane; return null;
} }
} }

15
designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java

@ -1,7 +1,7 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WaterMark; import com.fr.form.ui.WaterMark;
@ -13,25 +13,22 @@ import java.awt.event.KeyListener;
public class WaterMarkDictPane extends JPanel { public class WaterMarkDictPane extends JPanel {
private UIPropertyTextField waterMarkTextField; private UITextField waterMarkTextField;
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
waterMarkTextField = new UIPropertyTextField(); waterMarkTextField = new UITextField();
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));
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[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), emptyLabel, waterMarkTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkTextField},
}; };
double[] rowSize = {p}; double[] rowSize = {p};
double[] columnSize = {p, p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}}; int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 18, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }

8
designer_base/src/com/fr/design/file/HistoryTemplateListPane.java

@ -8,7 +8,6 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.gui.chart.DownLoadOnLineSourcesHelper;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.UIList; import com.fr.design.gui.ilist.UIList;
@ -233,13 +232,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
getCurrentEditingTemplate().repaint(); getCurrentEditingTemplate().repaint();
} }
public void downLoadSources() {
DownLoadOnLineSourcesHelper pane = new DownLoadOnLineSourcesHelper();
pane.addMapJSONSiteInfo();
pane.addPhantomSiteInfo();
pane.installOnline();
}
private class HistoryListCellRender extends DefaultListCellRenderer { private class HistoryListCellRender extends DefaultListCellRenderer {
@Override @Override

47
designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java

@ -1,47 +0,0 @@
package com.fr.design.gui.itextfield;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.text.Document;
/**
* Created by ibm on 2017/8/16.
*/
public class UIPropertyTextField extends UITextField{
public UIPropertyTextField() {
super();
}
public UIPropertyTextField(int columns) {
super(columns);
}
public UIPropertyTextField(String text, int columns) {
super(text, columns);
}
public UIPropertyTextField(String text) {
super(text);
}
public UIPropertyTextField(Document doc, String text, int columns) {
super(doc, text, columns);
}
protected void initListener() {
if (shouldResponseChangeListener()) {
addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
}
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
}
}
}

2
designer_base/src/com/fr/design/gui/style/NumberDragBar.java

@ -74,7 +74,7 @@ public class NumberDragBar extends JComponent {
g2.setColor(isEnabled() ? UIConstants.FONT_COLOR : UIManager.getColor("Label.disabledForeground")); g2.setColor(isEnabled() ? UIConstants.FONT_COLOR : UIManager.getColor("Label.disabledForeground"));
g2.drawString(String.valueOf(minValue), 2, 10); g2.drawString(String.valueOf(minValue), 2, 10);
g2.drawString(String.valueOf(maxValue), width - 20, 10); g2.drawString(String.valueOf(maxValue), width - 10 * String.valueOf(maxValue).length(), 10);
if(minValue < 0) { if(minValue < 0) {
g2.drawString("0", width / 2 - 2, 10); g2.drawString("0", width / 2 - 2, 10);
} }

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

After

Width:  |  Height:  |  Size: 942 B

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 482 B

BIN
designer_base/src/com/fr/design/images/m_edit/paste.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 214 B

0
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java

0
designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java → designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java

2
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -42,6 +42,7 @@ import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.DownloadOnlineSourcesHelper;
import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.AreaIndependentVanChartInterface; import com.fr.plugin.chart.area.AreaIndependentVanChartInterface;
import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.area.VanChartAreaPlot;
@ -125,6 +126,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
//重新注册designModuleFactory //重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance());
DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
} }
}); });
} }

6
designer_chart/src/com/fr/design/chart/gui/ChartComponent.java

@ -331,10 +331,4 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
public void callback() { public void callback() {
this.repaint(); this.repaint();
} }
@Override
public void downLoadSources() {
HistoryTemplateListPane.getInstance().downLoadSources();
}
} }

6
designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

@ -113,20 +113,20 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
} }
}; };
styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight())); styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight()));
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character")+":", styleAttrPane); return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character"), styleAttrPane);
} }
private JPanel createButtonBackgroundColorPane(){ private JPanel createButtonBackgroundColorPane(){
colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background") + ":", colorSelectBox4button); return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background"), colorSelectBox4button);
} }
private JPanel createButtonConfigPane() { private JPanel createButtonConfigPane() {
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,p}; double[] rowSize = {p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(),null}, new Component[]{createTitleStylePane(),null},
new Component[]{createButtonBackgroundColorPane(),null}, new Component[]{createButtonBackgroundColorPane(),null},

12
designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java

@ -59,6 +59,18 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
} }
} }
protected void initLayout() {
this.setLayout(new BorderLayout());
if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
if (nameArray.length > 1) {
pane.add(tabPane);
this.add(pane, BorderLayout.NORTH);
}
}
this.add(centerPane, BorderLayout.CENTER);
}
protected List<NamePane> initPaneList(Plot plot, AbstractAttrNoScrollPane parent) { protected List<NamePane> initPaneList(Plot plot, AbstractAttrNoScrollPane parent) {
plot4Pane = plot; plot4Pane = plot;

12
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java

@ -44,8 +44,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
initSeriesPane(); initSeriesPane();
this.add(seriesPane, "0,2,2,2"); JPanel panel = new JPanel(new BorderLayout());
seriesPane.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
panel.add(seriesPane);
this.add(panel, "0,2,2,2");
} }
//kunsnat: 用于重载, 甘特图, 股价图 第一列 默认应该不可编辑. //kunsnat: 用于重载, 甘特图, 股价图 第一列 默认应该不可编辑.
@ -192,4 +194,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
} }
} }
protected JSeparator getJSeparator() {
JSeparator jSeparator = new JSeparator();
jSeparator.setPreferredSize(new Dimension(246, 2));
return jSeparator;
}
} }

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java

@ -27,6 +27,7 @@ public class BubblePlotReportDataContentPane extends AbstractReportDataContentPa
initEveryPane(); initEveryPane();
filterPane = new ChartDataFilterPane(new BubblePlot(), parent); filterPane = new ChartDataFilterPane(new BubblePlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4"); this.add(panel, "0,6,2,4");
} }

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -67,6 +67,7 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
this.add(catePane, "0,0,2,0"); this.add(catePane, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4"); this.add(panel, "0,6,2,4");
addButton.addActionListener(new ActionListener() { addButton.addActionListener(new ActionListener() {

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java

@ -38,6 +38,7 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent
this.add(categoryName, "0,0,2,0"); this.add(categoryName, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4"); } this.add(panel, "0,6,2,4"); }
protected TinyFormulaPane initCategoryBox(final String leftLabel) { protected TinyFormulaPane initCategoryBox(final String leftLabel) {

9
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java

@ -57,13 +57,8 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
filterPane = new ChartDataFilterPane(new MeterPlot(), parent); filterPane = new ChartDataFilterPane(new MeterPlot(), parent);
JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane); JPanel pane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
double[] cs = {p};
components = new Component[][]{
new Component[]{panel1},
};
JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSize, cs);
this.add(pane, BorderLayout.CENTER); this.add(pane, BorderLayout.CENTER);
} }

16
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java

@ -6,7 +6,6 @@ import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.BubbleTableDefinition; import com.fr.chart.chartdata.BubbleTableDefinition;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -14,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -52,23 +52,23 @@ public class BubblePlotTableDataContentPane extends AbstractTableDataContentPane
double[] columnSize_north = {p, f}; double[] columnSize_north = {p, f};
double[] rowSize_north = {p, p, p, p}; double[] rowSize_north = {p, p, p, p};
Component[][] components_north = new Component[][]{ Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")+":", SwingConstants.RIGHT), seriesName}, new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")), seriesName},
new Component[]{new UILabel("x :",SwingConstants.RIGHT), xCombox}, new Component[]{new UILabel("x"), xCombox},
new Component[]{new UILabel("y :",SwingConstants.RIGHT), yCombox}, new Component[]{new UILabel("y"), yCombox},
new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")+":", SwingConstants.RIGHT), bubbleSize} new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}
}; };
JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north); JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); north.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{north}, new Component[]{north},
new Component[]{new JSeparator()}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane), null},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{dataScreeningPane}
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);

17
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java

@ -11,6 +11,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -42,12 +43,19 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
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,p,p,p,p,p,p, p}; double[] rowSize = {p, p};
Component[][] components = createComponents(); Component[][] components = createComponents();
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
panel.setBorder(BorderFactory.createEmptyBorder(10,24,10,15));
this.add(getJSeparator(),BorderLayout.NORTH);
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
this.add(jPanel,BorderLayout.SOUTH);
nameBox.addItemListener(tooltipListener); nameBox.addItemListener(tooltipListener);
valueBox.addItemListener(tooltipListener); valueBox.addItemListener(tooltipListener);
@ -55,11 +63,8 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
private Component[][] createComponents() { private Component[][] createComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{new BoldFontTextLabel(METER_NAME, SwingConstants.RIGHT), getNameComponent()}, new Component[]{new BoldFontTextLabel(METER_NAME), getNameComponent()},
new Component[]{new BoldFontTextLabel(METER_VALUE, SwingConstants.RIGHT), valueBox}, new Component[]{new BoldFontTextLabel(METER_VALUE), valueBox},
new Component[]{new JSeparator(), null},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{filterPane, null}
}; };
} }

7
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/PiePlotTableDataContentPane.java

@ -1,18 +1,19 @@
package com.fr.design.mainframe.chart.gui.data.table; package com.fr.design.mainframe.chart.gui.data.table;
import java.awt.BorderLayout;
import java.util.List;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.PiePlot; import com.fr.chart.chartattr.PiePlot;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import java.awt.*;
import java.util.List;
public class PiePlotTableDataContentPane extends AbstractTableDataContentPane{ public class PiePlotTableDataContentPane extends AbstractTableDataContentPane{
private SeriesTypeUseComboxPane typeChoosePane; private SeriesTypeUseComboxPane typeChoosePane;
public PiePlotTableDataContentPane(ChartDataPane parent) { public PiePlotTableDataContentPane(ChartDataPane parent) {
typeChoosePane = new SeriesTypeUseComboxPane(parent, new PiePlot()); typeChoosePane = new SeriesTypeUseComboxPane(parent, new PiePlot());
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(typeChoosePane, BorderLayout.CENTER); this.add(typeChoosePane, BorderLayout.CENTER);
} }

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java

@ -57,6 +57,7 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane<ChartCollection> {
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent);
JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane); JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, BorderLayout.SOUTH); this.add(panel, BorderLayout.SOUTH);
} }

13
designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java → designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java

@ -1,4 +1,4 @@
package com.fr.design.gui.chart; package com.fr.plugin.chart;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
@ -26,7 +26,7 @@ import java.util.List;
/** /**
* Created by shine on 2017/8/21. * Created by shine on 2017/8/21.
*/ */
public class DownLoadOnLineSourcesHelper { public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent{
// 定义加载窗口大小 // 定义加载窗口大小
private static final int LOAD_WIDTH = 455; private static final int LOAD_WIDTH = 455;
private static final int INCIDENT_HEIGHT = 15; private static final int INCIDENT_HEIGHT = 15;
@ -151,7 +151,7 @@ public class DownLoadOnLineSourcesHelper {
private void initDialog() { private void initDialog() {
// 创建标签,并在标签上放置一张图片 // 创建标签,并在标签上放置一张图片
BufferedImage image = IOUtils.readImage("/com/fr/design/gui/chart/background.png"); BufferedImage image = IOUtils.readImage("/com/fr/plugin/chart/background.png");
ImageIcon imageIcon = new ImageIcon(image); ImageIcon imageIcon = new ImageIcon(image);
UILabel label = new UILabel(imageIcon); UILabel label = new UILabel(imageIcon);
label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT); label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT);
@ -209,6 +209,13 @@ public class DownLoadOnLineSourcesHelper {
} }
} }
@Override
public void downloadSources() {
this.addMapJSONSiteInfo();
this.addPhantomSiteInfo();
this.installOnline();
}
private class SiteInfo { private class SiteInfo {
String siteKind; String siteKind;
String localDir; String localDir;

0
designer_base/src/com/fr/design/gui/chart/background.png → designer_chart/src/com/fr/plugin/chart/background.png

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

18
designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java

@ -8,7 +8,6 @@ import com.fr.chart.chartdata.BubbleTableDefinition;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
@ -50,7 +49,7 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = { p, p,p,p}; double[] rowSize = {p, p};
double[] columnSize_north = {p, f}; double[] columnSize_north = {p, f};
double[] rowSize_north = {p, p, p, p}; double[] rowSize_north = {p, p, p, p};
@ -62,19 +61,16 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}, new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize},
}; };
JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north); JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
Component[][] components = new Component[][]{
new Component[]{north},
new Component[]{filterPane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(getJSeparator(), BorderLayout.NORTH);
this.add(north, BorderLayout.CENTER);
this.add(filterPane, BorderLayout.SOUTH);
seriesName.addItemListener(tooltipListener); seriesName.addItemListener(tooltipListener);
xCombox.addItemListener(tooltipListener); xCombox.addItemListener(tooltipListener);

23
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java

@ -9,6 +9,7 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane; import com.fr.design.chart.javascript.ChartEmailPane;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.fun.HyperlinkProvider; import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator;
@ -25,7 +26,6 @@ import com.fr.js.ParameterJavaScript;
import com.fr.js.ReportletHyperlink; import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink; import com.fr.js.WebHyperlink;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.designer.other.ChartHyperlinkNameObjectCreartor;
import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; import com.fr.plugin.chart.designer.other.HyperlinkMapFactory;
import com.fr.stable.ListMap; import com.fr.stable.ListMap;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
@ -89,7 +89,6 @@ public class VanChartHyperLinkPane extends UIListControlPane {
} }
public void populate(TargetComponent elementCasePane) { public void populate(TargetComponent elementCasePane) {
// hyperlinkGroupPaneActionProvider.populate(this, elementCasePane);
} }
/** /**
@ -128,12 +127,11 @@ public class VanChartHyperLinkPane extends UIListControlPane {
// paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); // paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
} }
//todo@mengao 去掉UIMenuNameableCreator
java.util.List<UIMenuNameableCreator> list = refreshList(paneMap); java.util.List<UIMenuNameableCreator> list = refreshList(paneMap);
ChartHyperlinkNameObjectCreartor[] creators= new ChartHyperlinkNameObjectCreartor[list.size()]; NameObjectCreator[] creators = new NameObjectCreator[list.size()];
for (int i = 0; list != null && i < list.size(); i++) { for (int i = 0; list != null && i < list.size(); i++) {
UIMenuNameableCreator uiMenuNameableCreator = list.get(i); UIMenuNameableCreator uiMenuNameableCreator = list.get(i);
creators[i] = new ChartHyperlinkNameObjectCreartor(uiMenuNameableCreator.getObj(),uiMenuNameableCreator.getName(), uiMenuNameableCreator.getClass(), uiMenuNameableCreator.getPaneClazz()); creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz());
} }
@ -147,7 +145,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
if (javaScript != null && javaScript.getJavaScript() != null) { if (javaScript != null && javaScript.getJavaScript() != null) {
JavaScript script = javaScript.getJavaScript(); JavaScript script = javaScript.getJavaScript();
UIMenuNameableCreator uiMenuNameableCreator = new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); UIMenuNameableCreator uiMenuNameableCreator = new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass()));
nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator)); nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj()));
} }
} }
@ -182,9 +180,9 @@ public class VanChartHyperLinkPane extends UIListControlPane {
nameGroup.clear(); nameGroup.clear();
for (int i = 0; i < nameables.length; i++) { for (int i = 0; i < nameables.length; i++) {
UIMenuNameableCreator menu = (UIMenuNameableCreator)((NameObject)nameables[i]).getObject(); JavaScript javaScript = (JavaScript) ((NameObject) nameables[i]).getObject();
NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj()); String name = nameables[i].getName();
nameJava.setName(nameables[i].getName()); NameJavaScript nameJava = new NameJavaScript(name, javaScript);
nameGroup.addNameHyperlink(nameJava); nameGroup.addNameHyperlink(nameJava);
} }
@ -231,11 +229,4 @@ public class VanChartHyperLinkPane extends UIListControlPane {
return null; return null;
} }
protected Object getob2Populate (Object ob2Populate) {
if (ob2Populate == null) {
return ob2Populate;
}
return ((UIMenuNameableCreator)ob2Populate).getObj();
}
} }

84
designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java

@ -1,84 +0,0 @@
package com.fr.plugin.chart.designer.other;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/18.
*/
public class ChartConditionNameObjectCreator extends NameObjectCreator {
private BasePlot plot;
private ConditionUIMenuNameableCreator conditionUIMenuNameableCreator;
public ChartConditionNameObjectCreator(BasePlot plot, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.plot = plot;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends ConditionUIMenuNameableCreator> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor(Plot.class, String.class, Object.class, Class.class);
ConditionUIMenuNameableCreator conditionUIMenuNameableCreator = constructor.newInstance(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), getUpdatePane());
return new NameObject(helper.createUnrepeatedName(this.menuName()), conditionUIMenuNameableCreator);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
/**
* @param ob
* @return
*/
public Object acceptObject2Populate(Object ob) {
if (ob instanceof NameObject) {
ob = ((NameObject) ob).getObject();
}
if (clazzOfObject != null && clazzOfObject.isInstance(ob)) {
doSthChanged4Icon(ob);
conditionUIMenuNameableCreator = (ConditionUIMenuNameableCreator) ((ConditionUIMenuNameableCreator) ob).clone();
return ob;
}
return null;
}
/**
* save update bean
*
* @param wrapper
* @param bean
*/
public void saveUpdatedBean(ListModelElement wrapper, Object bean) {
conditionUIMenuNameableCreator.setObj(bean);
((NameObject) wrapper.wrapper).setObject(conditionUIMenuNameableCreator);
}
}

84
designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java

@ -1,84 +0,0 @@
package com.fr.plugin.chart.designer.other;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/21.
*/
public class ChartHyperlinkNameObjectCreartor extends NameObjectCreator {
private Object object;
private UIMenuNameableCreator uIMenuNameableCreator;
public ChartHyperlinkNameObjectCreartor(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.object = object;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends UIMenuNameableCreator> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor(String.class, Object.class, Class.class);
UIMenuNameableCreator uIMenuNameableCreator = constructor.newInstance(menuName, object, getUpdatePane());
return new NameObject(helper.createUnrepeatedName(this.menuName()), uIMenuNameableCreator);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
/**
* @param ob
* @return
*/
public Object acceptObject2Populate(Object ob) {
if (ob instanceof NameObject) {
ob = ((NameObject) ob).getObject();
}
if (clazzOfObject != null && clazzOfObject.isInstance(ob)) {
doSthChanged4Icon(ob);
uIMenuNameableCreator = ((UIMenuNameableCreator) ob).clone();
if (uIMenuNameableCreator.getObj() != null && object.getClass().isInstance(uIMenuNameableCreator.getObj())) {
return ob;
}
}
return null;
}
/**
* save update bean
*
* @param wrapper
* @param bean
*/
public void saveUpdatedBean(ListModelElement wrapper, Object bean) {
uIMenuNameableCreator.setObj(bean);
((NameObject) wrapper.wrapper).setObject(uIMenuNameableCreator);
}
}

12
designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java

@ -6,14 +6,10 @@ import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.awt.*; import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/** /**
* Created by Mitisky on 16/5/20. * Created by Mitisky on 16/5/20.
@ -41,17 +37,11 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(conditionPane, BorderLayout.CENTER); this.add(conditionPane, BorderLayout.CENTER);
//todo@mango
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
list.add(new ConditionUIMenuNameableCreator(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), showPane));
NameObject[] nameables = new NameObject[collection.getConditionAttrSize()]; NameObject[] nameables = new NameObject[collection.getConditionAttrSize()];
for(int i = 0; i < collection.getConditionAttrSize(); i++) { for(int i = 0; i < collection.getConditionAttrSize(); i++) {
ConditionUIMenuNameableCreator c =new ConditionUIMenuNameableCreator(plot, collection.getConditionAttr(i).getName(), collection.getConditionAttr(i), showPane); nameables[i]=(new NameObject(collection.getConditionAttr(i).getName(),collection.getConditionAttr(i)));
nameables[i]=(new NameObject(c.getName(),c));
} }
conditionPane.populate(nameables); conditionPane.populate(nameables);

12
designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java

@ -6,14 +6,13 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
@ -36,7 +35,7 @@ public class VanChartListControlPane extends UIListControlPane {
@Override @Override
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
return new ChartConditionNameObjectCreator[]{new ChartConditionNameObjectCreator(this.plot, Inter.getLocText("Condition_Attributes"), ConditionUIMenuNameableCreator.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())}; return new NameObjectCreator[]{new NameObjectCreator(Inter.getLocText("Condition_Attributes"), ConditionAttr.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())};
} }
@ -77,10 +76,6 @@ public class VanChartListControlPane extends UIListControlPane {
return Inter.getLocText("Condition_Attributes"); return Inter.getLocText("Condition_Attributes");
} }
protected Object getob2Populate(Object ob2Populate) {
return ((ConditionUIMenuNameableCreator) ob2Populate).getObj();
}
/** /**
* Update. * Update.
@ -91,8 +86,7 @@ public class VanChartListControlPane extends UIListControlPane {
cc.clearConditionAttr(); cc.clearConditionAttr();
for (int i = 0; i < nameables.length; i++) { for (int i = 0; i < nameables.length; i++) {
UIMenuNameableCreator uiMenuNameableCreator = (UIMenuNameableCreator) ((NameObject) nameables[i]).getObject(); ConditionAttr ca = (ConditionAttr) ((NameObject) nameables[i]).getObject();
ConditionAttr ca = (ConditionAttr) uiMenuNameableCreator.getObj();
ca.setName(nameables[i].getName()); ca.setName(nameables[i].getName());
cc.addConditionAttr(ca); cc.addConditionAttr(ca);

116
designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java

@ -0,0 +1,116 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by mengao on 2017/8/22.
*/
public class AlertLineListControlPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override
public NameableCreator[] createNameableCreators() {
return new ChartNameObjectCreator[]{new ChartNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")},
Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_AlertLine");
}
protected String getAddItemText() {
return Inter.getLocText("Plugin-ChartF_AlertLine");
}
public void populate(Plot plot) {
this.plot = plot;
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
refreshNameableCreator(creators);
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
for (VanChartAxis axis : xAxisList) {
List<VanChartAlertValue> values = axis.getAlertValues();
for (VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue));
}
}
for (VanChartAxis axis : yAxisList) {
List<VanChartAlertValue> values = axis.getAlertValues();
for (VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue));
}
}
populate(nameObjects.toArray(new NameObject[nameObjects.size()]));
doLayout();
}
public void update(Plot plot) {
Nameable[] nameables = this.update();
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
for (VanChartAxis axis : xAxisList) {
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for (int i = 0; i < nameables.length; i++) {
VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setAlertPaneSelectName(nameables[i].getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
for (VanChartAxis axis : yAxisList) {
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for (int i = 0; i < nameables.length; i++) {
VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setAlertPaneSelectName(nameables[i].getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
}
}

121
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java

@ -0,0 +1,121 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by mengao on 2017/8/22.
*/
public class BackgroundListControlPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot, false);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override
public NameableCreator[] createNameableCreators() {
return new BackgroundNameObjectCreator[]{new BackgroundNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")},
Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground");
}
@Override
public String getAddItemText() {
return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground");
}
public void populate(Plot plot) {
this.plot = plot;
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, VanChartCustomIntervalBackgroundPane.class)};
refreshNameableCreator(creators);
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
for (VanChartAxis axis : xAxisList) {
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) {
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background));
}
}
for (VanChartAxis axis : yAxisList) {
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) {
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background));
}
}
populate(nameObjects.toArray(new NameObject[nameObjects.size()]));
doLayout();
}
public void update(Plot plot, boolean isDefaultIntervalBackground) {
Nameable[] nameables = this.update();
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
for (VanChartAxis axis : xAxisList) {
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if (!isDefaultIntervalBackground) {
for (int i = 0; i < nameables.length; i++) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setCustomIntervalBackgroundSelectName(nameables[i].getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
for (VanChartAxis axis : yAxisList) {
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if (!isDefaultIntervalBackground) {
for (int i = 0; i < nameables.length; i++) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setCustomIntervalBackgroundSelectName(nameables[i].getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
}
}

48
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java

@ -0,0 +1,48 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.general.FRLogger;
import com.fr.general.NameObject;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/23.
*/
public class BackgroundNameObjectCreator extends ChartNameObjectCreator {
public BackgroundNameObjectCreator(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(object, menuName, clazz, updatePane);
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends VanChartCustomIntervalBackground> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor();
VanChartCustomIntervalBackground vanChartCustomIntervalBackground = constructor.newInstance();
vanChartCustomIntervalBackground.setAxisNamesArray((String[]) object);
vanChartCustomIntervalBackground.setAxisName(((String[]) object)[0]);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartCustomIntervalBackground);
} catch (NoSuchMethodException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InstantiationException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InvocationTargetException e) {
FRLogger.getLogger().error(e.getMessage(), e);
}
return null;
}
}

53
designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java

@ -0,0 +1,53 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.general.FRLogger;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/21.
*/
public class ChartNameObjectCreator extends NameObjectCreator {
protected Object object;
public ChartNameObjectCreator(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.object = object;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends VanChartAlertValue> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor();
VanChartAlertValue vanChartAlertValue = constructor.newInstance();
vanChartAlertValue.setAxisNamesArray((String[]) object);
vanChartAlertValue.setAxisName(((String[]) object)[0]);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue);
} catch (NoSuchMethodException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InstantiationException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InvocationTargetException e) {
FRLogger.getLogger().error(e.getMessage(), e);
}
return null;
}
}

11
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java

@ -46,6 +46,8 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
private UIComboBox fontName; private UIComboBox fontName;
private ColorSelectBox fontColor; private ColorSelectBox fontColor;
private VanChartAlertValue chartAlertValue;
public VanChartAlertValuePane(){ public VanChartAlertValuePane(){
initComponents(); initComponents();
} }
@ -134,6 +136,7 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
} }
public void populateBean(VanChartAlertValue chartAlertValue){ public void populateBean(VanChartAlertValue chartAlertValue){
this.chartAlertValue =chartAlertValue;
alertAxis = new UIButtonGroup(chartAlertValue.getAxisNamesArray(), chartAlertValue.getAxisNamesArray()); alertAxis = new UIButtonGroup(chartAlertValue.getAxisNamesArray(), chartAlertValue.getAxisNamesArray());
alertAxis.setSelectedItem(chartAlertValue.getAxisName()); alertAxis.setSelectedItem(chartAlertValue.getAxisName());
alertAxis.addChangeListener(new ChangeListener() { alertAxis.addChangeListener(new ChangeListener() {
@ -165,8 +168,7 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
fontColor.setSelectObject(chartAlertValue.getAlertFont().getForeground()); fontColor.setSelectObject(chartAlertValue.getAlertFont().getForeground());
} }
@Override public VanChartAlertValue updateBean(){
public void updateBean(VanChartAlertValue chartAlertValue) {
chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString()); chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString());
chartAlertValue.setAlertValueFormula(new Formula(alertValue.updateBean())); chartAlertValue.setAlertValueFormula(new Formula(alertValue.updateBean()));
@ -191,9 +193,6 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
} else { } else {
chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.LEFT : Constants.RIGHT); chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.LEFT : Constants.RIGHT);
} }
} return chartAlertValue;
public VanChartAlertValue updateBean(){
return null;
} }
} }

183
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java

@ -2,30 +2,21 @@ package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.UICorrelationComboBoxPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.VanChartUIMenuNameableCreator;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/** /**
* 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线 * 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线
@ -36,14 +27,14 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
protected ColorSelectBox horizontalGridLine; protected ColorSelectBox horizontalGridLine;
protected ColorSelectBox verticalGridLine; protected ColorSelectBox verticalGridLine;
protected UICorrelationComboBoxPane alertLine; protected AlertLineListControlPane alertLine;
private UIButtonGroup isDefaultIntervalBackground; private UIButtonGroup isDefaultIntervalBackground;
private JPanel centerPane; private JPanel centerPane;
private CardLayout cardLayout; private CardLayout cardLayout;
protected ColorSelectBox horizontalColorBackground; protected ColorSelectBox horizontalColorBackground;
private ColorSelectBox verticalColorBackground; private ColorSelectBox verticalColorBackground;
protected UICorrelationComboBoxPane customIntervalBackground; protected BackgroundListControlPane customIntervalBackground;
public VanChartAxisAreaPane() { public VanChartAxisAreaPane() {
initComponents(); initComponents();
@ -82,8 +73,10 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
} }
protected JPanel createAlertLinePane() { protected JPanel createAlertLinePane() {
alertLine = new UICorrelationComboBoxPane(); alertLine = new AlertLineListControlPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"), alertLine);
alertLine.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15));
return panel;
} }
protected JPanel createIntervalPane(double[] row, double[] col) { protected JPanel createIntervalPane(double[] row, double[] col) {
@ -92,7 +85,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
verticalColorBackground = new ColorSelectBox(100); verticalColorBackground = new ColorSelectBox(100);
Component[][] components = getIntervalPaneComponents(); Component[][] components = getIntervalPaneComponents();
JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
customIntervalBackground = new UICorrelationComboBoxPane(); customIntervalBackground = new BackgroundListControlPane();
cardLayout = new CardLayout(); cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout); centerPane = new JPanel(cardLayout);
@ -107,7 +100,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); JPanel intervalPane = new JPanel(new BorderLayout(0, 6));
intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH);
intervalPane.add(centerPane, BorderLayout.CENTER); intervalPane.add(centerPane, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"), intervalPane);
intervalPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15));
return panel;
} }
protected Component[][] getIntervalPaneComponents() { protected Component[][] getIntervalPaneComponents() {
@ -132,18 +127,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
public void populateBean(Plot plot) { public void populateBean(Plot plot) {
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
populateGridLine(rectanglePlot); populateGridLine(rectanglePlot);
populateAlert(xAxisList, yAxisList, axisNames); alertLine.populate(plot);
isDefaultIntervalBackground.setSelectedIndex(rectanglePlot.isDefaultIntervalBackground() ? 0 : 1); isDefaultIntervalBackground.setSelectedIndex(rectanglePlot.isDefaultIntervalBackground() ? 0 : 1);
horizontalColorBackground.setSelectObject(rectanglePlot.getDefaultYAxis().getDefaultIntervalBackgroundColor()); horizontalColorBackground.setSelectObject(rectanglePlot.getDefaultYAxis().getDefaultIntervalBackgroundColor());
verticalColorBackground.setSelectObject(rectanglePlot.getDefaultXAxis().getDefaultIntervalBackgroundColor()); verticalColorBackground.setSelectObject(rectanglePlot.getDefaultXAxis().getDefaultIntervalBackgroundColor());
populateCustomIntervalBackground(xAxisList, yAxisList, axisNames); customIntervalBackground.populate(plot);
checkCardPane(); checkCardPane();
} }
@ -152,97 +145,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor()); verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor());
} }
protected Class<? extends BasicBeanPane> getAlertPaneClass() {
return VanChartAlertValuePane.class;
}
protected void setAlertDemoAxisName(VanChartAlertValue demo, String[] axisNames) {
demo.setAxisName(axisNames[0]);
}
private void populateAlert(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList, String[] axisNames){
List<UIMenuNameableCreator> menuList = new ArrayList<UIMenuNameableCreator>();
VanChartAlertValue demo = new VanChartAlertValue();
demo.setAxisNamesArray(axisNames);
setAlertDemoAxisName(demo, axisNames);
menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_AlertLine"), demo, getAlertPaneClass()));
alertLine.refreshMenuAndAddMenuAction(menuList);
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
for(VanChartAxis axis: xAxisList){
List<VanChartAlertValue> values = axis.getAlertValues();
for(VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass()));
}
}
for(VanChartAxis axis: yAxisList){
List<VanChartAlertValue> values = axis.getAlertValues();
for(VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass()));
}
}
alertLine.populateBean(list);
alertLine.doLayout();
}
protected Class<? extends BasicBeanPane> getIntervalPaneClass() {
return VanChartCustomIntervalBackgroundPane.class;
}
protected void setCustomIntervalBackgroundDemoAxisName(VanChartCustomIntervalBackground demo, String[] axisNames) {
demo.setAxisName(axisNames[0]);
}
private void populateCustomIntervalBackground(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList, String[] axisNames){
List<UIMenuNameableCreator> menuList = new ArrayList<UIMenuNameableCreator>();
VanChartCustomIntervalBackground demo = new VanChartCustomIntervalBackground();
demo.setAxisNamesArray(axisNames);
setCustomIntervalBackgroundDemoAxisName(demo, axisNames);
menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), demo, getIntervalPaneClass()));
customIntervalBackground.refreshMenuAndAddMenuAction(menuList);
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
for(VanChartAxis axis: xAxisList){
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass()));
}
}
for(VanChartAxis axis: yAxisList){
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass()));
}
}
customIntervalBackground.populateBean(list);
customIntervalBackground.doLayout();
}
public void updateBean(Plot plot) { public void updateBean(Plot plot) {
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
updateGirdLine(rectanglePlot); updateGirdLine(rectanglePlot);
updateAlert(xAxisList, yAxisList); alertLine.update(plot);
rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0); rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0);
if (rectanglePlot.isDefaultIntervalBackground()) { if (rectanglePlot.isDefaultIntervalBackground()) {
@ -252,7 +161,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null); rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null);
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null); rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null);
} }
updateCustomIntervalBackground(xAxisList, yAxisList); customIntervalBackground.update(plot, isDefaultIntervalBackground.getSelectedIndex() == 0);
} }
protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) { protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) {
@ -260,36 +169,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject()); rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject());
} }
private void updateAlert(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList){
List<UIMenuNameableCreator> alertList = alertLine.updateBean();
for(VanChartAxis axis : xAxisList){
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for(UIMenuNameableCreator creator : alertList) {
VanChartAlertValue value = (VanChartAlertValue)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setAlertPaneSelectName(creator.getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
for(VanChartAxis axis : yAxisList){
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for(UIMenuNameableCreator creator : alertList) {
VanChartAlertValue value = (VanChartAlertValue)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName()) || yAxisEquals(value.getAxisName(), axis.getAxisName())){
value.setAlertPaneSelectName(creator.getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
}
/** /**
* Y軸和雷達圖的極軸也是相等的 * Y軸和雷達圖的極軸也是相等的
*
* @param axisName * @param axisName
* @param valueAxisName * @param valueAxisName
* @return * @return
@ -299,39 +181,6 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName); ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName);
} }
private void updateCustomIntervalBackground(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList){
List<UIMenuNameableCreator> customList = customIntervalBackground.updateBean();
for(VanChartAxis axis : xAxisList){
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组
for(UIMenuNameableCreator creator : customList) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setCustomIntervalBackgroundSelectName(creator.getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
for(VanChartAxis axis : yAxisList){
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组
for(UIMenuNameableCreator creator : customList) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setCustomIntervalBackgroundSelectName(creator.getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
}
public Plot updateBean() { public Plot updateBean() {
return null; return null;
} }

17
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java

@ -32,8 +32,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
private ColorSelectBox color; private ColorSelectBox color;
private UINumberDragPane transparent; private UINumberDragPane transparent;
public VanChartCustomIntervalBackgroundPane(){ private VanChartCustomIntervalBackground customIntervalBackground;
}
private void doLayoutPane(){ private void doLayoutPane(){
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
@ -44,8 +43,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
top.add(createContentPane()); top.add(createContentPane());
} }
private JPanel createContentPane() private JPanel createContentPane() {
{
bottomValue = new TinyFormulaPane(); bottomValue = new TinyFormulaPane();
topValue = new TinyFormulaPane(); topValue = new TinyFormulaPane();
bottomValue.setPreferredSize(new Dimension(124,20)); bottomValue.setPreferredSize(new Dimension(124,20));
@ -90,6 +88,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
} }
public void populateBean(VanChartCustomIntervalBackground customIntervalBackground){ public void populateBean(VanChartCustomIntervalBackground customIntervalBackground){
this.customIntervalBackground = customIntervalBackground;
backgroundAxis = new UIButtonGroup(customIntervalBackground.getAxisNamesArray(), customIntervalBackground.getAxisNamesArray()); backgroundAxis = new UIButtonGroup(customIntervalBackground.getAxisNamesArray(), customIntervalBackground.getAxisNamesArray());
backgroundAxis.setSelectedItem(customIntervalBackground.getAxisName()); backgroundAxis.setSelectedItem(customIntervalBackground.getAxisName());
@ -99,20 +98,16 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
topValue.populateBean(Utils.objectToString(customIntervalBackground.getToFormula())); topValue.populateBean(Utils.objectToString(customIntervalBackground.getToFormula()));
color.setSelectObject(customIntervalBackground.getBackgroundColor()); color.setSelectObject(customIntervalBackground.getBackgroundColor());
transparent.populateBean(customIntervalBackground.getAlpha() * VanChartAttrHelper.PERCENT); transparent.populateBean(customIntervalBackground.getAlpha() * VanChartAttrHelper.PERCENT);
} }
public void updateBean(VanChartCustomIntervalBackground customIntervalBackground){ public VanChartCustomIntervalBackground updateBean(){
customIntervalBackground.setAxisName(backgroundAxis.getSelectedItem().toString()); customIntervalBackground.setAxisName(backgroundAxis.getSelectedItem().toString());
customIntervalBackground.setFromFormula(new Formula(bottomValue.updateBean())); customIntervalBackground.setFromFormula(new Formula(bottomValue.updateBean()));
customIntervalBackground.setToFormula(new Formula(topValue.updateBean())); customIntervalBackground.setToFormula(new Formula(topValue.updateBean()));
customIntervalBackground.setBackgroundColor(color.getSelectObject()); customIntervalBackground.setBackgroundColor(color.getSelectObject());
customIntervalBackground.setAlpha(transparent.updateBean() / VanChartAttrHelper.PERCENT); customIntervalBackground.setAlpha(transparent.updateBean() / VanChartAttrHelper.PERCENT);
} return customIntervalBackground;
public VanChartCustomIntervalBackground updateBean(){
return null;
} }
} }

3
designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java

@ -29,7 +29,8 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
initAllComponent(); initAllComponent();
JPanel panel = getContentPane(); JPanel panel = getContentPane();
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); panel.setBorder(BorderFactory.createEmptyBorder(10,24,0,15));
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight()));

18
designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java

@ -11,12 +11,12 @@ 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.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -32,7 +32,7 @@ import java.util.List;
*/ */
public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPane implements UIObserver { public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPane implements UIObserver {
private static final int HT = 20; private static final int HT = 20;
private static final int WD = 120; private static final int WD = 100;
private UISpinner levelNumEdit; private UISpinner levelNumEdit;
private UITextField nameField; private UITextField nameField;
protected UIComboBox value; protected UIComboBox value;
@ -103,7 +103,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
calculateCombox.reset(); calculateCombox.reset();
calculateCombox.setPreferredSize(new Dimension(WD, HT)); calculateCombox.setPreferredSize(new Dimension(WD, HT));
components_center[levelNum] = new Component[]{new JSeparator(), null}; components_center[levelNum] = new Component[]{getJSeparator(), null};
components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), value}; components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), value};
components_center[levelNum+2] = new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox}; components_center[levelNum+2] = new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox};
@ -112,7 +112,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
registerListener4Center(); registerListener4Center();
return TableLayoutHelper.createTableLayoutPane(components_center,rowSize_center,columnSize_center); return TableLayout4VanChartHelper.createGapTableLayoutPane(components_center,rowSize_center,columnSize_center);
} }
@ -175,11 +175,11 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
Component[][] components_north = new Component[][]{ Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), nameField}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), nameField},
new Component[]{new JSeparator(),null }, new Component[]{getJSeparator(),null },
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")), levelNumEdit}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")), levelNumEdit},
}; };
return TableLayoutHelper.createTableLayoutPane(components_north, rowSize_north, columnSize_north); return TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, rowSize_north, columnSize_north);
} }
private void refreshCenterPane(){ private void refreshCenterPane(){
@ -357,4 +357,10 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
} }
return false; return false;
} }
protected JSeparator getJSeparator() {
JSeparator jSeparator = new JSeparator();
jSeparator.setPreferredSize(new Dimension(220, 2));
return jSeparator;
}
} }

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

@ -184,16 +184,16 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (widgetBoundPane != null) { if (widgetBoundPane != null) {
widgetBoundPane.populate(); widgetBoundPane.populate();
} }
if (cellWidget instanceof WScaleLayout) { Widget innerWidget = cellWidget;
if (cellWidget.acceptType(WScaleLayout.class)) {
Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget(); Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget();
currentEditorDefinePane.populateBean(((CRBoundsWidget) crBoundsWidget).getWidget()); innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget();
} else if(cellWidget instanceof WTitleLayout){ } else if(cellWidget.acceptType(WTitleLayout.class)){
CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget(); CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget();
currentEditorDefinePane.populateBean(crBoundsWidget.getWidget()); innerWidget = crBoundsWidget.getWidget();
}else{
currentEditorDefinePane.populateBean(cellWidget);
} }
widgetPropertyPane.populate(cellWidget); currentEditorDefinePane.populateBean(innerWidget);
widgetPropertyPane.populate(innerWidget);
reinitAllListeners(); reinitAllListeners();
this.addAttributeChangeListener(listener); this.addAttributeChangeListener(listener);
} }
@ -207,12 +207,12 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
} }
fireValueChanged(); fireValueChanged();
if (xCreator instanceof XWScaleLayout) { if (xCreator.acceptType(XWScaleLayout.class)) {
XCreator xCreator1 = xCreator.getEditingChildCreator(); XCreator xCreator1 = xCreator.getEditingChildCreator();
xCreator1.resetData(widget); xCreator1.resetData(widget);
xCreator.removeAll(); xCreator.removeAll();
xCreator.add(xCreator1); xCreator.add(xCreator1);
}else if(xCreator instanceof XWTitleLayout){ }else if(xCreator.acceptType(XWTitleLayout.class)){
XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0); XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0);
xCreator1.resetData(widget); xCreator1.resetData(widget);
xCreator.removeAll(); xCreator.removeAll();

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

@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.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;
@ -29,8 +30,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
private XWParameterLayout root; private XWParameterLayout root;
private UISpinner designerWidth; private UISpinner designerWidth;
private UICheckBox displayReport; private UICheckBox displayReport;
private UICheckBox useParamsTemplate;
private AccessibleBackgroundEditor background; private AccessibleBackgroundEditor background;
private UIButtonGroup hAlignmentPane; private UIButtonGroup hAlignmentPane;
private UITextField labelNameTextField;
public RootDesignDefinePane(XCreator xCreator) { public RootDesignDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -69,7 +72,9 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelNameTextField = new UITextField();
displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")); displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery"));
useParamsTemplate = new UICheckBox(Inter.getLocText("FR-Designer_Use_Params_Template"));
background = new AccessibleBackgroundEditor(); background = new AccessibleBackgroundEditor();
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
@ -80,12 +85,14 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
, Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")}); , Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")});
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background},
new Component[]{displayReport, null}, new Component[]{displayReport, null},
new Component[]{useParamsTemplate, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
@ -101,8 +108,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override @Override
public void populateBean(WParameterLayout ob) { public void populateBean(WParameterLayout ob) {
labelNameTextField.setText(ob.getLabelName());
background.setValue(ob.getBackground()); background.setValue(ob.getBackground());
displayReport.setSelected(ob.isDelayDisplayContent()); displayReport.setSelected(ob.isDelayDisplayContent());
useParamsTemplate.setSelected(ob.isUseParamsTemplate());
designerWidth.setValue(ob.getDesignWidth()); designerWidth.setValue(ob.getDesignWidth());
hAlignmentPane.setSelectedIndex(ob.getPosition()); hAlignmentPane.setSelectedIndex(ob.getPosition());
} }
@ -111,8 +120,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override @Override
public WParameterLayout updateBean() { public WParameterLayout updateBean() {
WParameterLayout wParameterLayout = (WParameterLayout) creator.toData(); WParameterLayout wParameterLayout = (WParameterLayout) creator.toData();
wParameterLayout.setLabelName(labelNameTextField.getText());
wParameterLayout.setDesignWidth((int) designerWidth.getValue()); wParameterLayout.setDesignWidth((int) designerWidth.getValue());
wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected());
wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected());
wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setBackground((Background) background.getValue());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex());
return wParameterLayout; return wParameterLayout;

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

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
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;
@ -17,9 +17,10 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> { public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> {
private UIPropertyTextField hotkeysTextField; private UITextField hotkeysTextField;
private UIPropertyTextField buttonNameTextField; private UITextField buttonNameTextField;
private AccessibleIconEditor iconPane; private AccessibleIconEditor iconPane;
protected UITextField labelNameTextField;
public ButtonDefinePane(XCreator creator){ public ButtonDefinePane(XCreator creator){
@ -31,18 +32,20 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double rowSize[] = {p, p, p, p, p, p, p}; double rowSize[] = {p, p, p, p, p, p, p, p};
double columnSize[] = {p, f}; double columnSize[] = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
iconPane = new AccessibleIconEditor(); iconPane = new AccessibleIconEditor();
hotkeysTextField = new UIPropertyTextField(); hotkeysTextField = new UITextField();
buttonNameTextField = new UIPropertyTextField(); buttonNameTextField = new UITextField();
labelNameTextField = new UITextField();
Component[] backgroundCompPane = createBackgroundComp(); Component[] backgroundCompPane = createBackgroundComp();
Component[] frFont = createFontPane(); Component[] frFont = createFontPane();
UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background")); UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background"));
backgroundLabel.setVerticalAlignment(SwingConstants.TOP); backgroundLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField}, {new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField},
{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
backgroundCompPane, backgroundCompPane,
frFont, frFont,
{new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane}, {new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane},
@ -73,7 +76,8 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
@Override @Override
public void populateBean(T btn) { public void populateBean(T btn) {
hotkeysTextField.setText(btn.getHotkeys()); hotkeysTextField.setText(btn.getHotkeys());
buttonNameTextField.setText(btn.getLabelName()); buttonNameTextField.setText(btn.getText());
labelNameTextField.setText(btn.getLabelName());
iconPane.setValue(btn.getIconName()); iconPane.setValue(btn.getIconName());
populateSubButtonPane(btn); populateSubButtonPane(btn);
} }
@ -86,8 +90,9 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
public T updateBean() { public T updateBean() {
T btn = updateSubButtonPane(); T btn = updateSubButtonPane();
btn.setHotkeys(hotkeysTextField.getText()); btn.setHotkeys(hotkeysTextField.getText());
btn.setLabelName(buttonNameTextField.getText()); btn.setLabelName(labelNameTextField.getText());
btn.setIconName((String)iconPane.getValue()); btn.setIconName((String)iconPane.getValue());
btn.setText(buttonNameTextField.getText());
return btn; return btn;
} }

13
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java

@ -4,7 +4,7 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
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.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
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;
@ -16,9 +16,10 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UIPropertyTextField text; private UITextField text;
private UISpinner fontSizePane; private UISpinner fontSizePane;
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
protected UITextField labelNameTextField;
public CheckBoxDefinePane(XCreator xCreator) { public CheckBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -27,19 +28,21 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UIPropertyTextField(); text = new UITextField();
fontSizePane = new UISpinner(0, 20, 1, 0); fontSizePane = new UISpinner(0, 20, 1, 0);
labelNameTextField = new UITextField();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
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[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text }, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text },
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane},
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 3},{1, 1}}; int[][] rowCount = {{1, 1},{1, 1}, {1, 3},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));

6
designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java

@ -4,7 +4,7 @@ import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
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.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.ComboBox; import com.fr.form.ui.ComboBox;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -13,7 +13,7 @@ import java.awt.*;
public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> { public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
private UIPropertyTextField waterMarkField; private UITextField waterMarkField;
public ComboBoxDefinePane(XCreator xCreator) { public ComboBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -26,7 +26,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
} }
public Component[] createWaterMarkPane() { public Component[] createWaterMarkPane() {
waterMarkField = new UIPropertyTextField(); waterMarkField = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField};
} }

6
designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java

@ -5,7 +5,7 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
@ -17,7 +17,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
private UIButtonGroup returnType; private UIButtonGroup returnType;
private UIPropertyTextField waterMarkDictPane; private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
public ComboCheckBoxDefinePane(XCreator xCreator) { public ComboCheckBoxDefinePane(XCreator xCreator) {
@ -31,7 +31,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
} }
public Component[] createWaterMarkPane() { public Component[] createWaterMarkPane() {
waterMarkDictPane = new UIPropertyTextField(); waterMarkDictPane = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
} }

7
designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
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;
@ -38,6 +39,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox currentFormatComboBox; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel; private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup; private UIHeadGroup fomatHeadGroup;
protected UITextField labelNameTextField;
public DateEditorDefinePane(XCreator xCreator) { public DateEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -58,12 +60,13 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST); returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}); returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")});
JPanel formatHead = createFormatHead(); JPanel formatHead = createFormatHead();
labelNameTextField = new UITextField();
startDv = new DateValuePane(); startDv = new DateValuePane();
endDv = new DateValuePane(); endDv = new DateValuePane();
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[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead}, new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv}, new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv},
@ -73,7 +76,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox} new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox}
}; };
double[] rowSize = {p, p, p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 3}, {1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 3}, {1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10);

5
designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java

@ -34,15 +34,16 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
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[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
dicPane, dicPane,
removeRepeatPane, removeRepeatPane,
waterMarkComponent, waterMarkComponent,
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p, p,p}; double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1,1},{1,1}}; int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1},{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);

13
designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane;
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.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
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;
@ -22,9 +22,11 @@ import java.awt.event.ItemListener;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UIPropertyTextField errorMsgTextField; protected UITextField errorMsgTextField;
protected JPanel validatePane; protected JPanel validatePane;
protected UISpinner fontSizePane; protected UISpinner fontSizePane;
protected UITextField labelNameTextField;
public FieldEditorDefinePane(XCreator xCreator) { public FieldEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -37,10 +39,11 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
labelNameTextField = new UITextField();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
fontSizePane = new UISpinner(0, 20, 1, 0); fontSizePane = new UISpinner(0, 20, 1, 0);
errorMsgTextField = new UIPropertyTextField(); errorMsgTextField = new UITextField();
JPanel contentPane = this.setFirstContentPane(); JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) { if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
@ -54,6 +57,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); this.allowBlankCheckBox.setSelected(ob.isAllowBlank());
this.errorMsgTextField.setText(ob.getErrorMessage()); this.errorMsgTextField.setText(ob.getErrorMessage());
this.fontSizePane.setValue(ob.getFontSize()); this.fontSizePane.setValue(ob.getFontSize());
this.labelNameTextField.setText(ob.getLabelName());
populateSubFieldEditorBean(ob); populateSubFieldEditorBean(ob);
} }
@ -66,12 +70,13 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
e.setAllowBlank(this.allowBlankCheckBox.isSelected()); e.setAllowBlank(this.allowBlankCheckBox.isSelected());
e.setErrorMessage(this.errorMsgTextField.getText()); e.setErrorMessage(this.errorMsgTextField.getText());
e.setFontSize((int)fontSizePane.getValue()); e.setFontSize((int)fontSizePane.getValue());
e.setLabelName(labelNameTextField.getText());
return e; return e;
} }
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
errorMsgTextField = new UIPropertyTextField(); errorMsgTextField = new UITextField();
// // richer:主要为了方便查看比较长的错误信息 // // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {

6
designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java

@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
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.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
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;
@ -18,7 +18,7 @@ import java.awt.*;
import java.util.List; import java.util.List;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private UIPropertyTextField srcTextField; private UITextField srcTextField;
private ReportletParameterViewPane parameterViewPane; private ReportletParameterViewPane parameterViewPane;
private UICheckBox horizontalCheck; private UICheckBox horizontalCheck;
private UICheckBox verticalCheck; private UICheckBox verticalCheck;
@ -44,7 +44,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
Component[][] coms = { Component[][] coms = {
{ horizontalCheck, null }, { horizontalCheck, null },
{ verticalCheck, null }, { verticalCheck, null },
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UIPropertyTextField() }, { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() },
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } };
int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}}; int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);

90
designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -4,13 +4,13 @@ import com.fr.design.designer.creator.XCreator;
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.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
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;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.third.fr.pdf.layout.border.Border;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -24,6 +24,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public NumberEditorDefinePane(XCreator xCreator){ public NumberEditorDefinePane(XCreator xCreator){
super(xCreator); super(xCreator);
} }
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
/** /**
* *
@ -37,23 +38,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private SpinnerNumberModel maxValueModel; private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner; private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel; private SpinnerNumberModel minValueModel;
private com.fr.design.editor.editor.IntegerEditor decimalLength; private UISpinner decimalLength;
private JPanel limitNumberPane; private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private ActionListener actionListener1; private ActionListener allowDecimalsListener;
private ActionListener actionListener2;
private ActionListener allowNegativeListener ;
private ActionListener actionListener3; public ActionListener setMaxListener;
private ActionListener setMinListener;
private ActionListener actionListener4 ; private ChangeListener maxValueChangeListener;
private ChangeListener changeListener1; private ChangeListener minValueChangeListener;
private ChangeListener changeListener2 ;
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
super(); super();
@ -73,13 +72,14 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
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[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1}};
JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
@ -88,17 +88,19 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
private void initListeners(){ private void initListeners(){
actionListener1 = new ActionListener() { allowDecimalsListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true); limitNumberPane.setVisible(true);
limitNumberPane.setPreferredSize(new Dimension(215,20));
} else { } else {
limitNumberPane.setVisible(false); limitNumberPane.setVisible(false);
limitNumberPane.setPreferredSize(new Dimension(0,0));
} }
} }
}; };
actionListener2 = new ActionListener() { allowNegativeListener = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -125,7 +127,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
actionListener3 = new ActionListener() { setMaxListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) { if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true); maxValueSpinner.setEnabled(true);
@ -145,7 +147,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
actionListener4 = new ActionListener() { setMinListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true); minValueSpinner.setEnabled(true);
@ -164,7 +166,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
}; };
changeListener1 = new ChangeListener() { maxValueChangeListener = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -176,7 +178,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
}; };
changeListener2 = new ChangeListener() { minValueChangeListener = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -191,42 +193,42 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public JPanel setValidatePane() { public JPanel setValidatePane() {
initListeners(); initListeners();
// super.addValidatePane();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
this.decimalLength.setColumns(4);
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.allowDecimalsCheckBox.addActionListener(actionListener1); this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(allowNegativeListener);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false);
setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.setMaxValueCheckBox.addActionListener(setMaxListener);
this.maxValueSpinner.addChangeListener(changeListener1); this.maxValueSpinner.addChangeListener(maxValueChangeListener);
this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("Need_Min_Value"), false); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("Need_Min_Value"), false);
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMinValueCheckBox.addActionListener(actionListener4); this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"}));
limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
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[]{allowDecimalsCheckBox, null }, new Component[]{allowDecimalsCheckBox, null },
new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength }, new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null}, new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner}, new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinner}, new Component[]{setMinValueCheckBox, minValueSpinner},
@ -235,7 +237,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return panel; return panel;
} }
@ -273,7 +275,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
formWidgetValuePane.populate(e); formWidgetValuePane.populate(e);
// this.regErrorMsgTextField.setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@ -284,7 +285,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength(this.decimalLength.getValue()); ob.setMaxDecimalLength((int)this.decimalLength.getValue());
} }
ob.setAllowNegative(allowNegativeCheckBox.isSelected()); ob.setAllowNegative(allowNegativeCheckBox.isSelected());
@ -306,20 +307,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
return ob; return ob;
} }
private void checkVisible() {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
} else {
minValueSpinner.setEnabled(false);
}
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
} else {
minValueSpinner.setEnabled(false);
}
}
private void setNotAllowsInvalid(UIBasicSpinner jspinner) { private void setNotAllowsInvalid(UIBasicSpinner jspinner) {
JComponent editor = jspinner.getEditor(); JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) { if (editor instanceof UIBasicSpinner.DefaultEditor) {
@ -331,4 +318,15 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
} }
public Object getValue(UIBasicSpinner jspinner){
JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) {
JFormattedTextField ftf = ((UIBasicSpinner.DefaultEditor) editor).getTextField();
ftf.setColumns(10);
JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter();
return ftf.getValue();
}
return null;
}
} }

11
designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
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;
@ -18,7 +18,7 @@ import java.awt.event.KeyEvent;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> { public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegPane regPane; protected RegPane regPane;
private UIPropertyTextField waterMarkDictPane; private UITextField waterMarkDictPane;
FormWidgetValuePane formWidgetValuePane; FormWidgetValuePane formWidgetValuePane;
public TextFieldEditorDefinePane(XCreator xCreator) { public TextFieldEditorDefinePane(XCreator xCreator) {
@ -47,7 +47,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
}; };
regPane.addPhoneRegListener(pl); regPane.addPhoneRegListener(pl);
waterMarkDictPane = new UIPropertyTextField(); waterMarkDictPane = new UITextField();
waterMarkDictPane.addKeyListener(new KeyAdapter() { waterMarkDictPane.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
regPane.removePhoneRegListener(pl); regPane.removePhoneRegListener(pl);
@ -69,13 +69,14 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
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[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value"), SwingConstants.LEFT), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value"), SwingConstants.LEFT), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark"), SwingConstants.LEFT), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark"), SwingConstants.LEFT), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size"), SwingConstants.LEFT), fontSizePane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size"), SwingConstants.LEFT), fontSizePane}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));

18
designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -11,14 +11,14 @@ import java.awt.*;
public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane { public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
protected UIPropertyTextField waterMarkDictPane; protected UITextField waterMarkDictPane;
public TreeComboBoxEditorDefinePane(XCreator xCreator) { public TreeComboBoxEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
} }
public Component[] createWaterMarkPane(){ public Component[] createWaterMarkPane(){
waterMarkDictPane = new UIPropertyTextField(); waterMarkDictPane = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
} }
@ -27,15 +27,13 @@ public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
return "treecombobox"; return "treecombobox";
} }
protected void populateSubDictionaryEditorBean(TreeEditor ob){ protected void populateSubCustomWritableRepeatEditorBean(TreeEditor ob){
super.populateSubDictionaryEditorBean(ob); super.populateSubCustomWritableRepeatEditorBean(ob);
formWidgetValuePane.populate(ob);
waterMarkDictPane.setText(ob.getWaterMark()); waterMarkDictPane.setText(ob.getWaterMark());
} }
protected TreeEditor updateSubDictionaryEditorBean(){ protected TreeEditor updateSubCustomWritableRepeatEditorBean(){
TreeEditor editor = super.updateSubDictionaryEditorBean(); TreeEditor editor = super.updateSubCustomWritableRepeatEditorBean();
formWidgetValuePane.update(editor);
editor.setWaterMark(waterMarkDictPane.getText()); editor.setWaterMark(waterMarkDictPane.getText());
return editor; return editor;
} }
@ -44,6 +42,6 @@ public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return treeSettingPane; return null;
} }
} }

30
designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java

@ -1,14 +1,16 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.TreeSettingPane;
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.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -19,20 +21,21 @@ import java.awt.*;
/* /*
* richer:tree editor * richer:tree editor
*/ */
public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> { public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
protected TreeSettingPane treeSettingPane;
protected TreeRootPane treeRootPane; protected TreeRootPane treeRootPane;
private UICheckBox mutiSelect; private UICheckBox mutiSelect;
private UICheckBox loadAsync; private UICheckBox loadAsync;
private UICheckBox returnLeaf; private UICheckBox returnLeaf;
private UICheckBox returnPath; private UICheckBox returnPath;
private AccessibleTreeModelEditor accessibleTreeModelEditor;
public TreeEditorDefinePane(XCreator xCreator) { public TreeEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
treeRootPane = new TreeRootPane(); treeRootPane = new TreeRootPane();
treeSettingPane = new TreeSettingPane(true);
} }
public JPanel createOtherPane() { public JPanel createOtherPane() {
mutiSelect = new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not")); mutiSelect = new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"));
loadAsync = new UICheckBox(Inter.getLocText("Widget-Load_By_Async")); loadAsync = new UICheckBox(Inter.getLocText("Widget-Load_By_Async"));
@ -58,9 +61,16 @@ public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
return "tree"; return "tree";
} }
protected void populateSubDictionaryEditorBean(TreeEditor e){
protected Component[] createDictPane(){
accessibleTreeModelEditor = new AccessibleTreeModelEditor();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), accessibleTreeModelEditor};
}
@Override
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) {
accessibleTreeModelEditor.setValue(e.getDictionary());
formWidgetValuePane.populate(e); formWidgetValuePane.populate(e);
treeSettingPane.populate(e);
treeRootPane.populate(e.getTreeAttr()); treeRootPane.populate(e.getTreeAttr());
mutiSelect.setSelected(e.isMultipleSelection()); mutiSelect.setSelected(e.isMultipleSelection());
loadAsync.setSelected(e.isAjax()); loadAsync.setSelected(e.isAjax());
@ -68,7 +78,9 @@ public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
returnPath.setSelected(e.isReturnFullPath()); returnPath.setSelected(e.isReturnFullPath());
} }
protected TreeEditor updateSubDictionaryEditorBean(){
@Override
protected TreeEditor updateSubCustomWritableRepeatEditorBean() {
TreeEditor editor = (TreeEditor)creator.toData(); TreeEditor editor = (TreeEditor)creator.toData();
formWidgetValuePane.update(editor); formWidgetValuePane.update(editor);
editor.setTreeAttr(treeRootPane.update()); editor.setTreeAttr(treeRootPane.update());
@ -76,12 +88,12 @@ public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
editor.setAjax(loadAsync.isSelected()); editor.setAjax(loadAsync.isSelected());
editor.setSelectLeafOnly(returnLeaf.isSelected()); editor.setSelectLeafOnly(returnLeaf.isSelected());
editor.setReturnFullPath(returnPath.isSelected()); editor.setReturnFullPath(returnPath.isSelected());
editor.setDictionary((Dictionary) accessibleTreeModelEditor.getValue());
return editor; return editor;
} }
@Override @Override
public DataCreatorUI dataUI() { public DataCreatorUI dataUI() {
return treeSettingPane; return null;
} }
} }

6
designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java

@ -1,6 +1,6 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.WaterMark; import com.fr.form.ui.WaterMark;
@ -8,12 +8,12 @@ import javax.swing.*;
public class WaterMarkDictPane extends JPanel{ public class WaterMarkDictPane extends JPanel{
private UIPropertyTextField waterMarkTextField; private UITextField waterMarkTextField;
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
waterMarkTextField = new UIPropertyTextField(); waterMarkTextField = new UITextField();
this.add(waterMarkTextField); this.add(waterMarkTextField);
} }

5
designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -38,14 +38,15 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
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[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane},
new Component[]{buttonGroupDictPane, null} new Component[]{buttonGroupDictPane, null}
}; };
double[] rowSize = {p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1}}; int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);

Loading…
Cancel
Save