use of org.jfree.chart.plot.PolarPlot in project SIMVA-SoS by SESoS.
the class DefaultPlotEditor method updatePlotProperties.
/**
* Updates the plot properties to match the properties defined on the panel.
*
* @param plot The plot.
*/
public void updatePlotProperties(Plot plot) {
// set the plot properties...
plot.setOutlinePaint(getOutlinePaint());
plot.setOutlineStroke(getOutlineStroke());
plot.setBackgroundPaint(getBackgroundPaint());
plot.setInsets(getPlotInsets());
// then the axis properties...
if (this.domainAxisPropertyPanel != null) {
Axis domainAxis = null;
if (plot instanceof CategoryPlot) {
CategoryPlot p = (CategoryPlot) plot;
domainAxis = p.getDomainAxis();
} else if (plot instanceof XYPlot) {
XYPlot p = (XYPlot) plot;
domainAxis = p.getDomainAxis();
}
if (domainAxis != null) {
this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
}
}
if (this.rangeAxisPropertyPanel != null) {
Axis rangeAxis = null;
if (plot instanceof CategoryPlot) {
CategoryPlot p = (CategoryPlot) plot;
rangeAxis = p.getRangeAxis();
} else if (plot instanceof XYPlot) {
XYPlot p = (XYPlot) plot;
rangeAxis = p.getRangeAxis();
} else if (plot instanceof PolarPlot) {
PolarPlot p = (PolarPlot) plot;
rangeAxis = p.getAxis();
}
if (rangeAxis != null) {
this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
}
}
if (this.plotOrientation != null) {
if (plot instanceof CategoryPlot) {
CategoryPlot p = (CategoryPlot) plot;
p.setOrientation(this.plotOrientation);
} else if (plot instanceof XYPlot) {
XYPlot p = (XYPlot) plot;
p.setOrientation(this.plotOrientation);
}
}
if (this.drawLines != null) {
if (plot instanceof CategoryPlot) {
CategoryPlot p = (CategoryPlot) plot;
CategoryItemRenderer r = p.getRenderer();
if (r instanceof LineAndShapeRenderer) {
((LineAndShapeRenderer) r).setLinesVisible(this.drawLines.booleanValue());
}
} else if (plot instanceof XYPlot) {
XYPlot p = (XYPlot) plot;
XYItemRenderer r = p.getRenderer();
if (r instanceof StandardXYItemRenderer) {
((StandardXYItemRenderer) r).setPlotLines(this.drawLines.booleanValue());
}
}
}
if (this.drawShapes != null) {
if (plot instanceof CategoryPlot) {
CategoryPlot p = (CategoryPlot) plot;
CategoryItemRenderer r = p.getRenderer();
if (r instanceof LineAndShapeRenderer) {
((LineAndShapeRenderer) r).setShapesVisible(this.drawShapes.booleanValue());
}
} else if (plot instanceof XYPlot) {
XYPlot p = (XYPlot) plot;
XYItemRenderer r = p.getRenderer();
if (r instanceof StandardXYItemRenderer) {
((StandardXYItemRenderer) r).setBaseShapesVisible(this.drawShapes.booleanValue());
}
}
}
// dmo: added this panel for colorbar control. (start dmo additions)
if (this.colorBarAxisPropertyPanel != null) {
ColorBar colorBar = null;
if (plot instanceof ContourPlot) {
ContourPlot p = (ContourPlot) plot;
colorBar = p.getColorBar();
}
if (colorBar != null) {
this.colorBarAxisPropertyPanel.setAxisProperties(colorBar);
}
}
// dmo: (end dmo additions)
}
use of org.jfree.chart.plot.PolarPlot in project SIMVA-SoS by SESoS.
the class PolarChartPanel method actionPerformed.
/**
* Handles action events generated by the popup menu.
*
* @param event the event.
*/
@Override
public void actionPerformed(ActionEvent event) {
String command = event.getActionCommand();
if (command.equals(POLAR_ZOOM_IN_ACTION_COMMAND)) {
PolarPlot plot = (PolarPlot) getChart().getPlot();
plot.zoom(0.5);
} else if (command.equals(POLAR_ZOOM_OUT_ACTION_COMMAND)) {
PolarPlot plot = (PolarPlot) getChart().getPlot();
plot.zoom(2.0);
} else if (command.equals(POLAR_AUTO_RANGE_ACTION_COMMAND)) {
PolarPlot plot = (PolarPlot) getChart().getPlot();
plot.getAxis().setAutoRange(true);
} else {
super.actionPerformed(event);
}
}
use of org.jfree.chart.plot.PolarPlot in project seng438-a3-R41Ryan by seng438-winter-2022.
the class DefaultPolarPlotEditor method updatePlotProperties.
@Override
public void updatePlotProperties(Plot plot) {
super.updatePlotProperties(plot);
PolarPlot pp = (PolarPlot) plot;
pp.setAngleTickUnit(new NumberTickUnit(this.manualTickUnitValue));
pp.setAngleOffset(this.angleOffsetValue);
}
use of org.jfree.chart.plot.PolarPlot in project seng438-a3-R41Ryan by seng438-winter-2022.
the class DefaultPlotEditor method createPlotTabs.
protected JTabbedPane createPlotTabs(Plot plot) {
JTabbedPane tabs = new JTabbedPane();
tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
Axis domainAxis = null;
if (plot instanceof CategoryPlot) {
domainAxis = ((CategoryPlot) plot).getDomainAxis();
} else if (plot instanceof XYPlot) {
domainAxis = ((XYPlot) plot).getDomainAxis();
}
this.domainAxisPropertyPanel = DefaultAxisEditor.getInstance(domainAxis);
if (this.domainAxisPropertyPanel != null) {
this.domainAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
tabs.add(localizationResources.getString("Domain_Axis"), this.domainAxisPropertyPanel);
}
Axis rangeAxis = null;
if (plot instanceof CategoryPlot) {
rangeAxis = ((CategoryPlot) plot).getRangeAxis();
} else if (plot instanceof XYPlot) {
rangeAxis = ((XYPlot) plot).getRangeAxis();
} else if (plot instanceof PolarPlot) {
rangeAxis = ((PolarPlot) plot).getAxis();
}
this.rangeAxisPropertyPanel = DefaultAxisEditor.getInstance(rangeAxis);
if (this.rangeAxisPropertyPanel != null) {
this.rangeAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
tabs.add(localizationResources.getString("Range_Axis"), this.rangeAxisPropertyPanel);
}
// dmo: added this panel for colorbar control. (start dmo additions)
ColorBar colorBar = null;
if (plot instanceof ContourPlot) {
colorBar = ((ContourPlot) plot).getColorBar();
}
this.colorBarAxisPropertyPanel = DefaultColorBarEditor.getInstance(colorBar);
if (this.colorBarAxisPropertyPanel != null) {
this.colorBarAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
tabs.add(localizationResources.getString("Color_Bar"), this.colorBarAxisPropertyPanel);
}
return tabs;
}
use of org.jfree.chart.plot.PolarPlot in project seng438-a3-R41Ryan by seng438-winter-2022.
the class DefaultPolarItemRenderer method getDrawingSupplier.
/**
* Returns the drawing supplier from the plot.
*
* @return The drawing supplier.
*/
@Override
public DrawingSupplier getDrawingSupplier() {
DrawingSupplier result = null;
PolarPlot p = getPlot();
if (p != null) {
result = p.getDrawingSupplier();
}
return result;
}
Aggregations