*/
public DefaultPlotEditor(Plot plot) {
this.plotInsets = plot.getInsets();
this.backgroundPaintSample = new PaintSample(plot.getBackgroundPaint());
this.outlineStrokeSample = new StrokeSample(plot.getOutlineStroke());
this.outlinePaintSample = new PaintSample(plot.getOutlinePaint());
if (plot instanceof CategoryPlot) {
this.plotOrientation = ((CategoryPlot) plot).getOrientation();
}
else if (plot instanceof XYPlot) {
this.plotOrientation = ((XYPlot) plot).getOrientation();
}
if (plot instanceof CategoryPlot) {
CategoryItemRenderer renderer = ((CategoryPlot) plot).getRenderer();
if (renderer instanceof LineAndShapeRenderer) {
LineAndShapeRenderer r = (LineAndShapeRenderer) renderer;
this.drawLines = BooleanUtilities.valueOf(
r.getBaseLinesVisible());
this.drawShapes = BooleanUtilities.valueOf(
r.getBaseShapesVisible());
}
}
else if (plot instanceof XYPlot) {
XYItemRenderer renderer = ((XYPlot) plot).getRenderer();
if (renderer instanceof StandardXYItemRenderer) {
StandardXYItemRenderer r = (StandardXYItemRenderer) renderer;
this.drawLines = BooleanUtilities.valueOf(r.getPlotLines());
this.drawShapes = BooleanUtilities.valueOf(
r.getBaseShapesVisible());
}
}
setLayout(new BorderLayout());
this.availableStrokeSamples = new StrokeSample[3];
this.availableStrokeSamples[0]
= new StrokeSample(new BasicStroke(1.0f));
this.availableStrokeSamples[1]
= new StrokeSample(new BasicStroke(2.0f));
this.availableStrokeSamples[2]
= new StrokeSample(new BasicStroke(3.0f));
// create a panel for the settings...
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(
BorderFactory.createTitledBorder(