Browse Source

Merge pull request #746 in BA/design from ~MANGO/design:dev to dev

* commit '9536b70257d75451f5b0d031b47c87d8636c5044':
  分两行显示checkbox和输入框,适应国际化情况。
  分两行显示checkbox和输入框,适应国际化情况。
  分两行显示checkbox和输入框,适应国际化情况。
master
superman 8 years ago
parent
commit
06a14a9863
  1. 27
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java
  2. 11
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java

27
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel {
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}; double[] rowSize = { p, p, p, p, p, p, p, p};
Component[][] components = getPanelComponents(); Component[][] components = getPanelComponents();
JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
for(int i = 0; i < components.length; i++) { for(int i = 0; i < components.length; i+=2) {
((UICheckBox)components[i][0]).addActionListener(new ActionListener() { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() {
@Override @Override
@ -57,18 +57,21 @@ public class MinMaxValuePane extends JPanel {
checkBoxUse(); checkBoxUse();
} }
}); });
ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]);
} }
} }
protected Component[][] getPanelComponents() {
protected Component[][] getPanelComponents() { return new Component[][]{
return new Component[][]{ new Component[]{minCheckBox},
new Component[]{minCheckBox, minValueField}, new Component[]{minValueField},
new Component[]{maxCheckBox, maxValueField}, new Component[]{maxCheckBox},
new Component[]{isCustomMainUnitBox, mainUnitField}, new Component[]{maxValueField},
new Component[]{isCustomSecUnitBox, secUnitField}, new Component[]{isCustomMainUnitBox},
}; new Component[]{mainUnitField},
} new Component[]{isCustomSecUnitBox},
new Component[]{secUnitField},
};
}
private void checkBoxUse() { private void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected()); minValueField.setEnabled(minCheckBox.isSelected());

11
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java

@ -151,10 +151,11 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f}; double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f};
double[] rowSize = { p, p,}; double[] rowSize = { p, p, p};
Component[][] component = new Component[][]{ Component[][] component = new Component[][]{
new Component[]{null,initMinMaxValue(),null}, new Component[]{null,initMinMaxValue(),null},
new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, new Component[]{null, addLogarithmicPane2ValuePane(), null},
new Component[]{null, null, addLogText()},
}; };
return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize);
} }
@ -173,10 +174,10 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
JPanel labelLogPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); JPanel labelLogPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
labelLogPane.add(logBox = new UICheckBox(Inter.getLocText("Logarithmic")+":")); labelLogPane.add(logBox = new UICheckBox(Inter.getLocText("Logarithmic")+":"));
labelLogPane.add(new UILabel(Inter.getLocText("Chart_Log_Base"))); labelLogPane.add(new UILabel(Inter.getLocText("Chart_Log_Base")));
logBaseField = new UITextField(4); logBaseField = new UITextField(4);
logBaseField.setText("10"); logBaseField.setText("10");
logBaseField.setPreferredSize(new Dimension(20, 20)); logBaseField.setPreferredSize(new Dimension(55, 20));
logBox.addActionListener(new ActionListener() { logBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -185,7 +186,7 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
}); });
ChartSwingUtils.addListener(logBox, logBaseField); ChartSwingUtils.addListener(logBox, logBaseField);
return labelLogPane; return labelLogPane;
} }

Loading…
Cancel
Save