Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.chart.plot.Plot
org.jfree.chart.plot.PolarPlot
public class PolarPlot
extends Plot
implements ValueAxisPlot, Zoomable, RendererChangeListener, Cloneable, Serializable
Field Summary | |
static Paint |
|
static Stroke |
|
protected static ResourceBundle |
|
Fields inherited from class org.jfree.chart.plot.Plot | |
DEFAULT_BACKGROUND_ALPHA , DEFAULT_BACKGROUND_PAINT , DEFAULT_FOREGROUND_ALPHA , DEFAULT_INSETS , DEFAULT_LEGEND_ITEM_BOX , DEFAULT_LEGEND_ITEM_CIRCLE , DEFAULT_OUTLINE_PAINT , DEFAULT_OUTLINE_STROKE , MINIMUM_HEIGHT_TO_DRAW , MINIMUM_WIDTH_TO_DRAW , ZERO |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
Object |
|
void |
|
void |
|
protected AxisState |
|
protected void |
|
protected void |
|
boolean |
|
Paint |
|
Stroke |
|
Font |
|
Paint |
|
ValueAxis |
|
Range |
|
XYDataset |
|
LegendItemCollection |
|
double |
|
PlotOrientation |
|
String |
|
Paint |
|
Stroke |
|
PolarItemRenderer |
|
int |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Point |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public static final Stroke DEFAULT_GRIDLINE_STROKE
The default grid line stroke.
protected static ResourceBundle localizationResources
The resourceBundle for the localization.
public PolarPlot(XYDataset dataset, ValueAxis radiusAxis, PolarItemRenderer renderer)
Creates a new plot.
- Parameters:
dataset
- the dataset (null
permitted).radiusAxis
- the radius axis (null
permitted).renderer
- the renderer (null
permitted).
public void addCornerTextItem(String text)
Add text to be displayed in the lower right hand corner and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
text
- the text to display (null
not permitted).
- See Also:
removeCornerTextItem(String)
public void clearCornerTextItems()
Clear the list of corner text items and sends aPlotChangeEvent
to all registered listeners.
public Object clone() throws CloneNotSupportedException
Returns a clone of the plot.
- Returns:
- A clone.
public void datasetChanged(DatasetChangeEvent event)
Receives notification of a change to the plot's m_Dataset. The axis ranges are updated if necessary.
- Specified by:
- datasetChanged in interface DatasetChangeListener
- Overrides:
- datasetChanged in interface Plot
- Parameters:
event
- information about the event (not used here).
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). This plot relies on aPolarItemRenderer
to draw each item in the plot. This allows the visual representation of the data to be changed easily. The optional info argument collects information about the rendering of the plot (dimensions, tooltip information etc). Just pass innull
if you do not need this information.
- Parameters:
g2
- the graphics device.area
- the area within which the plot (including axes and labels) should be drawn.anchor
- the anchor point (null
permitted).parentState
- ignored.info
- collects chart drawing information (null
permitted).
protected AxisState drawAxis(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea)
A utility method for drawing the axes.
- Parameters:
g2
- the graphics device.plotArea
- the plot area.dataArea
- the data area.
- Returns:
- A map containing the axis states.
protected void drawCornerTextItems(Graphics2D g2, Rectangle2D area)
Draws the corner text items.
- Parameters:
g2
- the drawing surface.area
- the area.
protected void drawGridlines(Graphics2D g2, Rectangle2D dataArea, List angularTicks, List radialTicks)
Draws the gridlines for the plot, if they are visible.
- Parameters:
g2
- the graphics device.dataArea
- the data area.angularTicks
- the ticks for the angular axis.radialTicks
- the ticks for the radial axis.
public boolean equals(Object obj)
Tests this plot for equality with another object.
- Parameters:
obj
- the object (null
permitted).
- Returns:
true
orfalse
.
public Paint getAngleGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the angular axis.
- Returns:
- The paint (possibly
null
).
- See Also:
setAngleGridlinePaint(Paint)
public Stroke getAngleGridlineStroke()
Returns the stroke for the grid-lines (if any) plotted against the angular axis.
- Returns:
- The stroke (possibly
null
).
- See Also:
setAngleGridlineStroke(Stroke)
public Font getAngleLabelFont()
Returns the font used to display the angle labels.
- Returns:
- A font (never
null
).
- See Also:
setAngleLabelFont(Font)
public Paint getAngleLabelPaint()
Returns the paint used to display the angle labels.
- Returns:
- A paint (never
null
).
- See Also:
setAngleLabelPaint(Paint)
public ValueAxis getAxis()
Returns the axis for the plot.
- Returns:
- The radius axis (possibly
null
).
- See Also:
setAxis(ValueAxis)
public Range getDataRange(ValueAxis axis)
Returns the range for the specified axis.
- Specified by:
- getDataRange in interface ValueAxisPlot
- Parameters:
axis
- the axis.
- Returns:
- The range.
public XYDataset getDataset()
Returns the primary dataset for the plot.
- Returns:
- The primary dataset (possibly
null
).
- See Also:
setDataset(XYDataset)
public LegendItemCollection getLegendItems()
Returns the legend items for the plot. Each legend item is generated by the plot's m_Renderer, since the m_Renderer is responsible for the visual representation of the data.
- Specified by:
- getLegendItems in interface LegendItemSource
- Overrides:
- getLegendItems in interface Plot
- Returns:
- The legend items.
public double getMaxRadius()
Returns the upper bound of the radius axis.
- Returns:
- The upper bound.
public PlotOrientation getOrientation()
Returns the orientation of the plot.
- Specified by:
- getOrientation in interface Zoomable
- Returns:
- The orientation.
public String getPlotType()
Returns the plot type as a string.
- Overrides:
- getPlotType in interface Plot
- Returns:
- A short string describing the type of plot.
public Paint getRadiusGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the radius axis.
- Returns:
- The paint (possibly
null
).
- See Also:
setRadiusGridlinePaint(Paint)
public Stroke getRadiusGridlineStroke()
Returns the stroke for the grid lines (if any) plotted against the radius axis.
- Returns:
- The stroke (possibly
null
).
- See Also:
setRadiusGridlineStroke(Stroke)
public PolarItemRenderer getRenderer()
Returns the item renderer.
- Returns:
- The renderer (possibly
null
).
- See Also:
setRenderer(PolarItemRenderer)
public int getSeriesCount()
Returns the number of series in the dataset for this plot. If the dataset isnull
, the method returns 0.
- Returns:
- The series count.
public boolean isAngleGridlinesVisible()
Returnstrue
if the angular gridlines are visible, andfalse
otherwise.
- Returns:
true
orfalse
.
- See Also:
setAngleGridlinesVisible(boolean)
public boolean isAngleLabelsVisible()
Returns a flag that controls whether or not the angle labels are visible.
- Returns:
- A boolean.
- See Also:
setAngleLabelsVisible(boolean)
public boolean isDomainZoomable()
Returnsfalse
always.
- Specified by:
- isDomainZoomable in interface Zoomable
- Returns:
false
always.
public boolean isRadiusGridlinesVisible()
Returnstrue
if the radius axis grid is visible, andfalse
otherwise.
- Returns:
true
orfalse
.
- See Also:
setRadiusGridlinesVisible(boolean)
public boolean isRangeZoomable()
Returnstrue
to indicate that the range axis is zoomable.
- Specified by:
- isRangeZoomable in interface Zoomable
- Returns:
true
.
public void removeCornerTextItem(String text)
Remove the given text from the list of corner text items and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
text
- the text to remove (null
ignored).
- See Also:
addCornerTextItem(String)
protected void render(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info)
Draws a representation of the data within the dataArea region, using the current m_Renderer.
- Parameters:
g2
- the graphics device.dataArea
- the region in which the data is to be drawn.info
- an optional object for collection dimension information (null
permitted).
public void rendererChanged(RendererChangeEvent event)
Notifies all registered listeners of a property change. One source of property change events is the plot's m_Renderer.
- Specified by:
- rendererChanged in interface RendererChangeListener
- Parameters:
event
- information about the property change.
public void setAngleGridlinePaint(Paint paint)
Sets the paint for the grid lines plotted against the angular axis. If you set this tonull
, no grid lines will be drawn.
- Parameters:
paint
- the paint (null
permitted).
- See Also:
getAngleGridlinePaint()
public void setAngleGridlineStroke(Stroke stroke)
Sets the stroke for the grid lines plotted against the angular axis and sends aPlotChangeEvent
to all registered listeners. If you set this tonull
, no grid lines will be drawn.
- Parameters:
stroke
- the stroke (null
permitted).
- See Also:
getAngleGridlineStroke()
public void setAngleGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the angular grid-lines are visible. If the flag value is changed, aPlotChangeEvent
is sent to all registered listeners.
- Parameters:
visible
- the new value of the flag.
- See Also:
isAngleGridlinesVisible()
public void setAngleLabelFont(Font font)
Sets the font used to display the angle labels and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
font
- the font (null
not permitted).
- See Also:
getAngleLabelFont()
public void setAngleLabelPaint(Paint paint)
Sets the paint used to display the angle labels and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
paint
- the paint (null
not permitted).
public void setAngleLabelsVisible(boolean visible)
Sets the flag that controls whether or not the angle labels are visible, and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
visible
- the flag.
- See Also:
isAngleLabelsVisible()
public void setAxis(ValueAxis axis)
Sets the axis for the plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
axis
- the new axis (null
permitted).
public void setDataset(XYDataset dataset)
Sets the dataset for the plot, replacing the existing dataset if there is one.
- Parameters:
dataset
- the dataset (null
permitted).
- See Also:
getDataset()
public void setRadiusGridlinePaint(Paint paint)
Sets the paint for the grid lines plotted against the radius axis and sends aPlotChangeEvent
to all registered listeners. If you set this tonull
, no grid lines will be drawn.
- Parameters:
paint
- the paint (null
permitted).
- See Also:
getRadiusGridlinePaint()
public void setRadiusGridlineStroke(Stroke stroke)
Sets the stroke for the grid lines plotted against the radius axis and sends aPlotChangeEvent
to all registered listeners. If you set this tonull
, no grid lines will be drawn.
- Parameters:
stroke
- the stroke (null
permitted).
- See Also:
getRadiusGridlineStroke()
public void setRadiusGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the radius axis grid lines are visible. If the flag value is changed, aPlotChangeEvent
is sent to all registered listeners.
- Parameters:
visible
- the new value of the flag.
- See Also:
isRadiusGridlinesVisible()
public void setRenderer(PolarItemRenderer renderer)
Sets the item renderer, and notifies all listeners of a change to the plot. If the renderer is set tonull
, no chart will be drawn.
- Parameters:
renderer
- the new renderer (null
permitted).
- See Also:
getRenderer()
public Point translateValueThetaRadiusToJava2D(double angleDegrees, double radius, Rectangle2D dataArea)
Translates a (theta, radius) pair into Java2D coordinates. Ifradius
is less than the lower bound of the axis, then this method returns the centre point.
- Parameters:
angleDegrees
- the angle in degrees.radius
- the radius.dataArea
- the data area.
- Returns:
- A point in Java2D space.
public void zoom(double percent)
Zooms the axis ranges by the specified percentage about the anchor point.
- Parameters:
percent
- the amount of the zoom.
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
This method is required by theZoomable
interface, but since the plot does not have any domain axes, it does nothing.
- Specified by:
- zoomDomainAxes in interface Zoomable
- Parameters:
lowerPercent
- the new lower bound.upperPercent
- the new upper bound.state
- the plot state.source
- the source point (in Java2D coordinates).
public void zoomDomainAxes(double factor, PlotRenderingInfo state, Point2D source)
This method is required by theZoomable
interface, but since the plot does not have any domain axes, it does nothing.
- Specified by:
- zoomDomainAxes in interface Zoomable
- Parameters:
factor
- the zoom factor.state
- the plot state.source
- the source point (in Java2D coordinates).
public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
Zooms in on the range axes.
- Specified by:
- zoomRangeAxes in interface Zoomable
- Parameters:
lowerPercent
- the new lower bound.upperPercent
- the new upper bound.state
- the plot state.source
- the source point (in Java2D coordinates).
public void zoomRangeAxes(double factor, PlotRenderingInfo state, Point2D source)
Multiplies the range on the range axis/axes by the specified factor.
- Specified by:
- zoomRangeAxes in interface Zoomable
- Parameters:
factor
- the zoom factor.state
- the plot state.source
- the source point (in Java2D coordinates).