|
|
|
@ -39,16 +39,23 @@ public class MinMaxValuePane extends JPanel {
|
|
|
|
|
mainUnitField = new UITextField(6); |
|
|
|
|
isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit")); |
|
|
|
|
secUnitField = new UITextField(6); |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
double[] rowSize = { p, p, p, p}; |
|
|
|
|
|
|
|
|
|
Component[][] components = getPanelComponents(); |
|
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); |
|
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, getRowSize(p), columnSize); |
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
this.add(panel, BorderLayout.CENTER); |
|
|
|
|
addComponentListener(components); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected double[] getRowSize(double p) { |
|
|
|
|
return new double[]{p, p, p, p}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void addComponentListener(Component[][] components) { |
|
|
|
|
for (int i = 0; i < components.length; i++) { |
|
|
|
|
((UICheckBox) components[i][0]).addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
|
@ -60,6 +67,7 @@ public class MinMaxValuePane extends JPanel {
|
|
|
|
|
ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected Component[][] getPanelComponents() { |
|
|
|
|
return new Component[][]{ |
|
|
|
|
new Component[]{minCheckBox, minValueField}, |
|
|
|
@ -69,7 +77,7 @@ public class MinMaxValuePane extends JPanel {
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkBoxUse() { |
|
|
|
|
protected void checkBoxUse() { |
|
|
|
|
minValueField.setEnabled(minCheckBox.isSelected()); |
|
|
|
|
maxValueField.setEnabled(maxCheckBox.isSelected()); |
|
|
|
|
|
|
|
|
|