public ChartPropertyEditPanel(JFreeChart chart) {
setLayout(new BorderLayout());
JPanel other = new JPanel(new BorderLayout());
other.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
JPanel general = new JPanel(new BorderLayout());
general.setBorder(
BorderFactory.createTitledBorder(
BorderFactory.createEtchedBorder(),
localizationResources.getString("General")
)
);
JPanel interior = new JPanel(new LCBLayout(6));
interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
this.antialias = new JCheckBox(
localizationResources.getString("Draw_anti-aliased")
);
this.antialias.setSelected(chart.getAntiAlias());
interior.add(this.antialias);
interior.add(new JLabel(""));
interior.add(new JLabel(""));
interior.add(
new JLabel(localizationResources.getString("Background_paint"))
);
this.background = new PaintSample(chart.getBackgroundPaint());
interior.add(this.background);
JButton button = new JButton(
localizationResources.getString("Select...")
);
button.setActionCommand("BackgroundPaint");
button.addActionListener(this);
interior.add(button);
interior.add(
new JLabel(localizationResources.getString("Series_Paint"))
);
JTextField info = new JTextField(
localizationResources.getString("No_editor_implemented")
);
info.setEnabled(false);
interior.add(info);
button = new JButton(localizationResources.getString("Edit..."));
button.setEnabled(false);
interior.add(button);
interior.add(
new JLabel(localizationResources.getString("Series_Stroke"))
);
info = new JTextField(
localizationResources.getString("No_editor_implemented")
);
info.setEnabled(false);
interior.add(info);
button = new JButton(localizationResources.getString("Edit..."));
button.setEnabled(false);
interior.add(button);
interior.add(
new JLabel(localizationResources.getString("Series_Outline_Paint"))
);
info = new JTextField(
localizationResources.getString("No_editor_implemented")
);
info.setEnabled(false);
interior.add(info);
button = new JButton(localizationResources.getString("Edit..."));
button.setEnabled(false);
interior.add(button);
interior.add(
new JLabel(localizationResources.getString("Series_Outline_Stroke"))
);
info = new JTextField(
localizationResources.getString("No_editor_implemented")
);
info.setEnabled(false);
interior.add(info);
button = new JButton(localizationResources.getString("Edit..."));
button.setEnabled(false);
interior.add(button);
general.add(interior, BorderLayout.NORTH);
other.add(general, BorderLayout.NORTH);
JPanel parts = new JPanel(new BorderLayout());
Title title = chart.getTitle();
OldLegend legend = chart.getOldLegend();
Plot plot = chart.getPlot();
JTabbedPane tabs = new JTabbedPane();
this.titlePropertiesPanel = new TitlePropertyEditPanel(title);
this.titlePropertiesPanel.setBorder(
BorderFactory.createEmptyBorder(2, 2, 2, 2)
);
tabs.addTab(
localizationResources.getString("Title"), this.titlePropertiesPanel
);
this.legendPropertiesPanel = new LegendPropertyEditPanel(legend);
this.legendPropertiesPanel.setBorder(
BorderFactory.createEmptyBorder(2, 2, 2, 2)
);
tabs.addTab(
localizationResources.getString("Legend"),
this.legendPropertiesPanel
);
this.plotPropertiesPanel = new PlotPropertyEditPanel(plot);
this.plotPropertiesPanel.setBorder(
BorderFactory.createEmptyBorder(2, 2, 2, 2)
);
tabs.addTab(
localizationResources.getString("Plot"), this.plotPropertiesPanel
);
tabs.add(localizationResources.getString("Other"), other);
parts.add(tabs, BorderLayout.NORTH);
add(parts);
}
Standard constructor - the property panel is made up of a number of
sub-panels that are displayed in the tabbed pane. Parameters:
chart - the chart, whichs properties should be changed.
|