Box content = Box.createVerticalBox();
setName(resources.getString("PlotProperties"));
PiePlot plot = (PiePlot)chart.getPlot();
SourcePieDataset dst = (SourcePieDataset)plot.getDataset();
// Create the title section
section=Box.createHorizontalBox();
section.add(new JLabel(resources.getString("PlotTitle:")));
section.add(tfTitle = new JTextField());
tfTitle.setText(chart.getTitle().getText());
content.add(section);
section=Box.createVerticalBox();
section.setBorder(BorderFactory.createTitledBorder(resources.getString("Series")));
Box box = Box.createHorizontalBox();
box.add(pcbxcurves = new JComboBox());
box.add(pcurvecolor = new JButton(" "));
box.add(pcurvedelete = new JButton(resources.getString("Delete")));
section.add(box);
box = Box.createHorizontalBox();
box.add(new JLabel(resources.getString("ExplodedRatio(>=1)")));
box.add(tfRatio = new NumberField(1.0));
// So long as this does not work for 3D pies, do not show it
if (!(plot instanceof Pie3DPlot)) section.add(box);
content.add(section);
pcbxcurves.setEditable(true);
Color noCurveColor = pcurvecolor.getBackground();
pcurvecolor.setFocusPainted(false);
int n = dst.getItemCount();
double factor = 1.0 / plot.getRadius() - 1.0; // may be null
// Now initialize entries
for (int i=0; i<n; ++i) {
DataSource ds = (DataSource)mapperSources.get(i);
if (ds==null) ds = dst.getSource(i); // take the datasource associated with this series by default
pcbxcurves.addItem(new CbxEntry(
i,
dst.getName(i),
(Color)plot.getSectionPaint(i),
ds,
(ColorMapper)mappers.get(i),
plot.getExplodePercent(i) * factor + 1.0
));
}
pcbxeditortf = (JTextField)pcbxcurves.getEditor().getEditorComponent();
pupdateForEntry(pcbxcurves.getSelectedItem());