|
|
@ -42,24 +42,34 @@ 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}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected double[] getRowSize(double p) { |
|
|
|
|
|
|
|
return new double[]{p, p, p, p}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected void addComponentListener(Component[][] components) { |
|
|
|
for (int i = 0; i < components.length; i++) { |
|
|
|
for (int i = 0; i < components.length; i++) { |
|
|
|
((UICheckBox)components[i][0]).addActionListener(new ActionListener() { |
|
|
|
addListener((UICheckBox) components[i][0]); |
|
|
|
|
|
|
|
ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i][1]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void addListener(UICheckBox checkBox) { |
|
|
|
|
|
|
|
checkBox.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
checkBoxUse(); |
|
|
|
checkBoxUse(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getPanelComponents() { |
|
|
|
protected Component[][] getPanelComponents() { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{minCheckBox, minValueField}, |
|
|
|
new Component[]{minCheckBox, minValueField}, |
|
|
|