JLabel lrangemin, lrangemax, lnrangemin, lnrangemax, lwrangemin, lwrangemax, lcrangemin, lcrangemax;
JTextField tfTitle;
public BoundsPanel() {
setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
Box p1 = new Box(BoxLayout.Y_AXIS);
setName(resources.getString("Properties"));
JPanel panel;
Box section;
// Create the title section
section=Box.createHorizontalBox();
section.add(new JLabel(resources.getString("PlotTitle:")));
section.add(tfTitle = new JTextField());
tfTitle.setText(chart.getTitle().getText());
p1.add(section);
DatasetDelegatedMeterPlot plot = (DatasetDelegatedMeterPlot)chart.getPlot();
SourceMeterDataset dst = (SourceMeterDataset)plot.getDataset();
section = new Box(BoxLayout.Y_AXIS);
section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("OverallRange")));
panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT));
panel.add(cbautorange = new ActionCheckBox(resources.getString("Auto-update"), plot.isAutorange()) {
public void actionPerformed(ActionEvent e) {
lrangemin.setEnabled(!isSelected());
lrangemax.setEnabled(!isSelected());
tfrangemin.setEnabled(!isSelected());
tfrangemax.setEnabled(!isSelected());
}
});
panel.add(lrangemin = new JLabel(resources.getString("minLabel")));
panel.add(tfrangemin = new NumberField(10));
tfrangemin.setValue(plot.getRange().getLowerBound());
panel.add(lrangemax = new JLabel(resources.getString("maxLabel")));
panel.add(tfrangemax = new NumberField(10));
tfrangemax.setValue(plot.getRange().getUpperBound());
section.add(panel);
cbautorange.apply();
p1.add(section);
section = new Box(BoxLayout.Y_AXIS);
section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("'Normal'Range")));
panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT));
panel.add(cbnrange = new ActionCheckBox(resources.getString("Enable"), plot.getNormalRange()!=null) {
public void actionPerformed(ActionEvent e) {
lnrangemin.setEnabled(isSelected());
lnrangemax.setEnabled(isSelected());
tfnrangemin.setEnabled(isSelected());
tfnrangemax.setEnabled(isSelected());
}
});
panel.add(lnrangemin = new JLabel(resources.getString("minLabel")));
panel.add(tfnrangemin = new NumberField(10));
if (plot.getNormalRange()!=null) tfnrangemin.setValue(plot.getNormalRange().getLowerBound());
panel.add(lnrangemax = new JLabel(resources.getString("maxLabel")));
panel.add(tfnrangemax = new NumberField(10));
if (plot.getNormalRange()!=null) tfnrangemax.setValue(plot.getNormalRange().getUpperBound());
section.add(panel);
cbnrange.apply();
p1.add(section);
section = new Box(BoxLayout.Y_AXIS);
section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("'Warning'Range")));
panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT));
panel.add(cbwrange = new ActionCheckBox(resources.getString("Enable"), plot.getWarningRange()!=null) {
public void actionPerformed(ActionEvent e) {
lwrangemin.setEnabled(isSelected());
lwrangemax.setEnabled(isSelected());
tfwrangemin.setEnabled(isSelected());
tfwrangemax.setEnabled(isSelected());
}
});
panel.add(lwrangemin = new JLabel(resources.getString("minLabel")));
panel.add(tfwrangemin = new NumberField(10));
if (plot.getWarningRange()!=null) tfwrangemin.setValue(plot.getWarningRange().getLowerBound());
panel.add(lwrangemax = new JLabel(resources.getString("maxLabel")));
panel.add(tfwrangemax = new NumberField(10));
if (plot.getWarningRange()!=null) tfwrangemax.setValue(plot.getWarningRange().getUpperBound());
section.add(panel);
cbwrange.apply();
p1.add(section);
section = new Box(BoxLayout.Y_AXIS);
section.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),resources.getString("'Critical'Range")));
panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT));
panel.add(cbcrange = new ActionCheckBox(resources.getString("Enable"), plot.getCriticalRange()!=null) {
public void actionPerformed(ActionEvent e) {
lcrangemin.setEnabled(isSelected());
lcrangemax.setEnabled(isSelected());
tfcrangemin.setEnabled(isSelected());
tfcrangemax.setEnabled(isSelected());
}
});
panel.add(lcrangemin = new JLabel(resources.getString("minLabel")));
panel.add(tfcrangemin = new NumberField(10));
if (plot.getCriticalRange()!=null) tfcrangemin.setValue(plot.getCriticalRange().getLowerBound());
panel.add(lcrangemax = new JLabel(resources.getString("maxLabel")));
panel.add(tfcrangemax = new NumberField(10));
if (plot.getCriticalRange()!=null) tfcrangemax.setValue(plot.getCriticalRange().getUpperBound());
section.add(panel);
cbcrange.apply();
p1.add(section);
add(p1);