|
|
@ -31,41 +31,53 @@ public class MinMaxValuePane extends JPanel { |
|
|
|
protected UITextField secUnitField; |
|
|
|
protected UITextField secUnitField; |
|
|
|
|
|
|
|
|
|
|
|
public MinMaxValuePane() { |
|
|
|
public MinMaxValuePane() { |
|
|
|
minCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Min_Value"})); |
|
|
|
minCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Min_Value"})); |
|
|
|
minValueField = new UITextField(6); |
|
|
|
minValueField = new UITextField(6); |
|
|
|
maxCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Max_Value"})); |
|
|
|
maxCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Max_Value"})); |
|
|
|
maxValueField = new UITextField(6); |
|
|
|
maxValueField = new UITextField(6); |
|
|
|
isCustomMainUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_MainGraduationUnit")); |
|
|
|
isCustomMainUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_MainGraduationUnit")); |
|
|
|
mainUnitField = new UITextField(6); |
|
|
|
mainUnitField = new UITextField(6); |
|
|
|
isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit")); |
|
|
|
isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit")); |
|
|
|
secUnitField = new UITextField(6); |
|
|
|
secUnitField = new UITextField(6); |
|
|
|
|
|
|
|
|
|
|
|
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}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = getPanelComponents(); |
|
|
|
Component[][] components = getPanelComponents(); |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, getRowSize(p), columnSize); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(panel,BorderLayout.CENTER); |
|
|
|
this.add(panel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
addComponentListener(components); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < components.length; i++) { |
|
|
|
protected double[] getRowSize(double p) { |
|
|
|
((UICheckBox)components[i][0]).addActionListener(new ActionListener() { |
|
|
|
return new double[]{p, p, p, p}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
protected void addComponentListener(Component[][] components) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
for (int i = 0; i < components.length; i++) { |
|
|
|
checkBoxUse(); |
|
|
|
addListener((UICheckBox) components[i][0]); |
|
|
|
} |
|
|
|
ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); |
|
|
|
}); |
|
|
|
|
|
|
|
ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void addListener(UICheckBox checkBox) { |
|
|
|
|
|
|
|
checkBox.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
checkBoxUse(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getPanelComponents() { |
|
|
|
protected Component[][] getPanelComponents() { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{minCheckBox, minValueField}, |
|
|
|
new Component[]{minCheckBox, minValueField}, |
|
|
|
new Component[]{maxCheckBox, maxValueField}, |
|
|
|
new Component[]{maxCheckBox, maxValueField}, |
|
|
|
new Component[]{isCustomMainUnitBox, mainUnitField}, |
|
|
|
new Component[]{isCustomMainUnitBox, mainUnitField}, |
|
|
|
new Component[]{isCustomSecUnitBox, secUnitField}, |
|
|
|
new Component[]{isCustomSecUnitBox, secUnitField}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -100,7 +112,7 @@ public class MinMaxValuePane extends JPanel { |
|
|
|
if(axis.getMinValue() != null) { |
|
|
|
if(axis.getMinValue() != null) { |
|
|
|
minValueField.setText(axis.getMinValue().toString()); |
|
|
|
minValueField.setText(axis.getMinValue().toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 最大值
|
|
|
|
// 最大值
|
|
|
|
if (axis.isCustomMaxValue()) { |
|
|
|
if (axis.isCustomMaxValue()) { |
|
|
@ -108,7 +120,7 @@ public class MinMaxValuePane extends JPanel { |
|
|
|
if(axis.getMaxValue() != null) { |
|
|
|
if(axis.getMaxValue() != null) { |
|
|
|
maxValueField.setText(axis.getMaxValue().toString()); |
|
|
|
maxValueField.setText(axis.getMaxValue().toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 主次刻度单位
|
|
|
|
// 主次刻度单位
|
|
|
|
if (axis.isCustomMainUnit()) { |
|
|
|
if (axis.isCustomMainUnit()) { |
|
|
@ -116,7 +128,7 @@ public class MinMaxValuePane extends JPanel { |
|
|
|
if(axis.getMainUnit() != null) { |
|
|
|
if(axis.getMainUnit() != null) { |
|
|
|
mainUnitField.setText(axis.getMainUnit().toString()); |
|
|
|
mainUnitField.setText(axis.getMainUnit().toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(axis.isCustomSecUnit()) { |
|
|
|
if(axis.isCustomSecUnit()) { |
|
|
|
isCustomSecUnitBox.setSelected(true); |
|
|
|
isCustomSecUnitBox.setSelected(true); |
|
|
|