|
Header
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.plot.Plot
org.jfree.chart.plot.PolarPlot
public class PolarPlot
Plots data that is in (theta, radius) pairs where theta equal to zero is due north and increases clockwise.
Field Summary | |
---|---|
static double |
DEFAULT_ANGLE_TICK_UNIT_SIZE
The default angle tick unit size. |
static java.awt.Paint |
DEFAULT_GRIDLINE_PAINT
The default grid line paint. |
static java.awt.Stroke |
DEFAULT_GRIDLINE_STROKE
The default grid line stroke. |
protected static java.util.ResourceBundle |
localizationResources
The resourceBundle for the localization. |
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 | |
---|---|
PolarPlot()
Default constructor. |
|
PolarPlot(XYDataset dataset,
ValueAxis radiusAxis,
PolarItemRenderer renderer)
Creates a new plot. |
Method Summary | |
---|---|
void |
addCornerTextItem(java.lang.String text)
Add text to be displayed in the lower right hand corner and sends a PlotChangeEvent to all registered listeners. |
void |
clearCornerTextItems()
Clear the list of corner text items and sends a PlotChangeEvent
to all registered listeners. |
java.lang.Object |
clone()
Returns a clone of the plot. |
void |
datasetChanged(DatasetChangeEvent event)
Receives notification of a change to the plot's m_Dataset. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
java.awt.geom.Point2D anchor,
PlotState parentState,
PlotRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
protected AxisState |
drawAxis(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D dataArea)
A utility method for drawing the axes. |
protected void |
drawCornerTextItems(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draws the corner text items. |
protected void |
drawGridlines(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
java.util.List angularTicks,
java.util.List radialTicks)
Draws the gridlines for the plot, if they are visible. |
boolean |
equals(java.lang.Object obj)
Tests this plot for equality with another object. |
java.awt.Paint |
getAngleGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the angular axis. |
java.awt.Stroke |
getAngleGridlineStroke()
Returns the stroke for the grid-lines (if any) plotted against the angular axis. |
java.awt.Font |
getAngleLabelFont()
Returns the font used to display the angle labels. |
java.awt.Paint |
getAngleLabelPaint()
Returns the paint used to display the angle labels. |
TickUnit |
getAngleTickUnit()
Returns the tick unit that controls the spacing of the angular grid lines. |
ValueAxis |
getAxis()
Returns the axis for the plot. |
Range |
getDataRange(ValueAxis axis)
Returns the range for the specified axis. |
XYDataset |
getDataset()
Returns the primary dataset for the plot. |
LegendItemCollection |
getLegendItems()
Returns the legend items for the plot. |
double |
getMaxRadius()
Returns the upper bound of the radius axis. |
PlotOrientation |
getOrientation()
Returns the orientation of the plot. |
java.lang.String |
getPlotType()
Returns the plot type as a string. |
java.awt.Paint |
getRadiusGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the radius axis. |
java.awt.Stroke |
getRadiusGridlineStroke()
Returns the stroke for the grid lines (if any) plotted against the radius axis. |
PolarItemRenderer |
getRenderer()
Returns the item renderer. |
int |
getSeriesCount()
Returns the number of series in the dataset for this plot. |
boolean |
isAngleGridlinesVisible()
Returns true if the angular gridlines are visible, and
false |
boolean |
isAngleLabelsVisible()
Returns a flag that controls whether or not the angle labels are visible. |
boolean |
isDomainZoomable()
Returns false always. |
boolean |
isRadiusGridlinesVisible()
Returns true if the radius axis grid is visible, and
false |
boolean |
isRangeZoomable()
Returns true to indicate that the range axis is zoomable. |
protected java.util.List |
refreshAngleTicks()
Generates a list of tick values for the angular tick marks. |
void |
removeCornerTextItem(java.lang.String text)
Remove the given text from the list of corner text items and sends a PlotChangeEvent to all registered listeners. |
protected void |
render(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info)
Draws a representation of the data within the dataArea region, using the current m_Renderer. |
void |
rendererChanged(RendererChangeEvent event)
Notifies all registered listeners of a property change. |
void |
setAngleGridlinePaint(java.awt.Paint paint)
Sets the paint for the grid lines plotted against the angular axis. |
void |
setAngleGridlineStroke(java.awt.Stroke stroke)
Sets the stroke for the grid lines plotted against the angular axis and sends a PlotChangeEvent to all registered listeners. |
void |
setAngleGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the angular grid-lines are visible. |
void |
setAngleLabelFont(java.awt.Font font)
Sets the font used to display the angle labels and sends a PlotChangeEvent to all registered listeners. |
void |
setAngleLabelPaint(java.awt.Paint paint)
Sets the paint used to display the angle labels and sends a PlotChangeEvent to all registered listeners. |
void |
setAngleLabelsVisible(boolean visible)
Sets the flag that controls whether or not the angle labels are visible, and sends a PlotChangeEvent to all registered listeners. |
void |
setAngleTickUnit(TickUnit unit)
Sets the tick unit that controls the spacing of the angular grid lines, and sends a PlotChangeEvent to all registered listeners. |
void |
setAxis(ValueAxis axis)
Sets the axis for the plot and sends a PlotChangeEvent to all
registered listeners. |
void |
setDataset(XYDataset dataset)
Sets the dataset for the plot, replacing the existing dataset if there is one. |
void |
setRadiusGridlinePaint(java.awt.Paint paint)
Sets the paint for the grid lines plotted against the radius axis and sends a PlotChangeEvent to all registered listeners. |
void |
setRadiusGridlineStroke(java.awt.Stroke stroke)
Sets the stroke for the grid lines plotted against the radius axis and sends a PlotChangeEvent to all registered listeners. |
void |
setRadiusGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the radius axis grid lines are visible. |
void |
setRenderer(PolarItemRenderer renderer)
Sets the item renderer, and notifies all listeners of a change to the plot. |
java.awt.Point |
translateValueThetaRadiusToJava2D(double angleDegrees,
double radius,
java.awt.geom.Rectangle2D dataArea)
Translates a (theta, radius) pair into Java2D coordinates. |
void |
zoom(double percent)
Zooms the axis ranges by the specified percentage about the anchor point. |
void |
zoomDomainAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo state,
java.awt.geom.Point2D source)
This method is required by the Zoomable interface, but since
the plot does not have any domain axes, it does nothing. |
void |
zoomDomainAxes(double factor,
PlotRenderingInfo state,
java.awt.geom.Point2D source)
This method is required by the Zoomable interface, but since
the plot does not have any domain axes, it does nothing. |
void |
zoomDomainAxes(double factor,
PlotRenderingInfo state,
java.awt.geom.Point2D source,
boolean useAnchor)
This method is required by the Zoomable interface, but since
the plot does not have any domain axes, it does nothing. |
void |
zoomRangeAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo state,
java.awt.geom.Point2D source)
Zooms in on the range axes. |
void |
zoomRangeAxes(double factor,
PlotRenderingInfo state,
java.awt.geom.Point2D source)
Multiplies the range on the range axis/axes by the specified factor. |
void |
zoomRangeAxes(double factor,
PlotRenderingInfo info,
java.awt.geom.Point2D source,
boolean useAnchor)
Multiplies the range on the range axis by the specified factor. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_ANGLE_TICK_UNIT_SIZE
public static final java.awt.Stroke DEFAULT_GRIDLINE_STROKE
public static final java.awt.Paint DEFAULT_GRIDLINE_PAINT
protected static java.util.ResourceBundle localizationResources
Constructor Detail |
---|
public PolarPlot()
public PolarPlot(XYDataset dataset, ValueAxis radiusAxis, PolarItemRenderer renderer)
dataset
- the dataset (null
permitted).radiusAxis
- the radius axis (null
permitted).renderer
- the renderer (null
permitted).Method Detail |
---|
public void addCornerTextItem(java.lang.String text)
PlotChangeEvent
to all registered listeners.
text
- the text to display (null
not permitted).removeCornerTextItem(String)
public void removeCornerTextItem(java.lang.String text)
PlotChangeEvent
to all registered listeners.
text
- the text to remove (null
ignored).addCornerTextItem(String)
public void clearCornerTextItems()
PlotChangeEvent
to all registered listeners.
addCornerTextItem(String)
,
removeCornerTextItem(String)
public java.lang.String getPlotType()
getPlotType
in class Plot
public ValueAxis getAxis()
null
).setAxis(ValueAxis)
public void setAxis(ValueAxis axis)
PlotChangeEvent
to all
registered listeners.
axis
- the new axis (null
permitted).public XYDataset getDataset()
null
).setDataset(XYDataset)
public void setDataset(XYDataset dataset)
dataset
- the dataset (null
permitted).getDataset()
public PolarItemRenderer getRenderer()
null
).setRenderer(PolarItemRenderer)
public void setRenderer(PolarItemRenderer renderer)
If the renderer is set to null
, no chart will be drawn.
renderer
- the new renderer (null
permitted).getRenderer()
public TickUnit getAngleTickUnit()
null
).public void setAngleTickUnit(TickUnit unit)
PlotChangeEvent
to all registered listeners.
unit
- the tick unit (null
not permitted).public boolean isAngleLabelsVisible()
setAngleLabelsVisible(boolean)
public void setAngleLabelsVisible(boolean visible)
PlotChangeEvent
to all registered listeners.
visible
- the flag.isAngleLabelsVisible()
public java.awt.Font getAngleLabelFont()
null
).setAngleLabelFont(Font)
public void setAngleLabelFont(java.awt.Font font)
PlotChangeEvent
to all registered listeners.
font
- the font (null
not permitted).getAngleLabelFont()
public java.awt.Paint getAngleLabelPaint()
null
).setAngleLabelPaint(Paint)
public void setAngleLabelPaint(java.awt.Paint paint)
PlotChangeEvent
to all registered listeners.
paint
- the paint (null
not permitted).public boolean isAngleGridlinesVisible()
true
if the angular gridlines are visible, and
false otherwise.
- Returns:
true
or false
.- See Also:
setAngleGridlinesVisible(boolean)
public void setAngleGridlinesVisible(boolean visible)
If the flag value is changed, a PlotChangeEvent
is sent to all
registered listeners.
visible
- the new value of the flag.isAngleGridlinesVisible()
public java.awt.Stroke getAngleGridlineStroke()
null
).setAngleGridlineStroke(Stroke)
public void setAngleGridlineStroke(java.awt.Stroke stroke)
PlotChangeEvent
to all registered listeners.
If you set this to null
, no grid lines will be drawn.
stroke
- the stroke (null
permitted).getAngleGridlineStroke()
public java.awt.Paint getAngleGridlinePaint()
null
).setAngleGridlinePaint(Paint)
public void setAngleGridlinePaint(java.awt.Paint paint)
If you set this to null
, no grid lines will be drawn.
paint
- the paint (null
permitted).getAngleGridlinePaint()
public boolean isRadiusGridlinesVisible()
true
if the radius axis grid is visible, and
false otherwise.
- Returns:
true
or false
.- See Also:
setRadiusGridlinesVisible(boolean)
public void setRadiusGridlinesVisible(boolean visible)
If the flag value is changed, a PlotChangeEvent
is sent to all
registered listeners.
visible
- the new value of the flag.isRadiusGridlinesVisible()
public java.awt.Stroke getRadiusGridlineStroke()
null
).setRadiusGridlineStroke(Stroke)
public void setRadiusGridlineStroke(java.awt.Stroke stroke)
PlotChangeEvent
to all registered listeners.
If you set this to null
, no grid lines will be drawn.
stroke
- the stroke (null
permitted).getRadiusGridlineStroke()
public java.awt.Paint getRadiusGridlinePaint()
null
).setRadiusGridlinePaint(Paint)
public void setRadiusGridlinePaint(java.awt.Paint paint)
PlotChangeEvent
to all registered listeners.
If you set this to null
, no grid lines will be drawn.
paint
- the paint (null
permitted).getRadiusGridlinePaint()
protected java.util.List refreshAngleTicks()
NumberTick
instances.public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area, java.awt.geom.Point2D anchor, PlotState parentState, PlotRenderingInfo info)
This plot relies on a PolarItemRenderer
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 in
null
if you do not need this information.
draw
in class Plot
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 void drawCornerTextItems(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
g2
- the drawing surface.area
- the area.protected AxisState drawAxis(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D dataArea)
g2
- the graphics device.plotArea
- the plot area.dataArea
- the data area.
protected void render(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info)
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).protected void drawGridlines(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, java.util.List angularTicks, java.util.List radialTicks)
g2
- the graphics device.dataArea
- the data area.angularTicks
- the ticks for the angular axis.radialTicks
- the ticks for the radial axis.public void zoom(double percent)
zoom
in class Plot
percent
- the amount of the zoom.public Range getDataRange(ValueAxis axis)
getDataRange
in interface ValueAxisPlot
axis
- the axis.
public void datasetChanged(DatasetChangeEvent event)
The axis ranges are updated if necessary.
datasetChanged
in interface DatasetChangeListener
datasetChanged
in class Plot
event
- information about the event (not used here).public void rendererChanged(RendererChangeEvent event)
One source of property change events is the plot's m_Renderer.
rendererChanged
in interface RendererChangeListener
event
- information about the property change.public int getSeriesCount()
null
, the method returns 0.
public LegendItemCollection getLegendItems()
getLegendItems
in interface LegendItemSource
getLegendItems
in class Plot
public boolean equals(java.lang.Object obj)
equals
in class Plot
obj
- the object (null
permitted).
true
or false
.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class Plot
java.lang.CloneNotSupportedException
- this can occur if some component of
the plot cannot be cloned.public void zoomDomainAxes(double factor, PlotRenderingInfo state, java.awt.geom.Point2D source)
Zoomable
interface, but since
the plot does not have any domain axes, it does nothing.
zoomDomainAxes
in interface Zoomable
factor
- the zoom factor.state
- the plot state.source
- the source point (in Java2D coordinates).Zoomable.zoomRangeAxes(double, PlotRenderingInfo, Point2D)
public void zoomDomainAxes(double factor, PlotRenderingInfo state, java.awt.geom.Point2D source, boolean useAnchor)
Zoomable
interface, but since
the plot does not have any domain axes, it does nothing.
zoomDomainAxes
in interface Zoomable
factor
- the zoom factor.state
- the plot state.source
- the source point (in Java2D coordinates).useAnchor
- use source point as zoom anchor?Zoomable.zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, java.awt.geom.Point2D source)
Zoomable
interface, but since
the plot does not have any domain axes, it does nothing.
zoomDomainAxes
in interface Zoomable
lowerPercent
- the new lower bound.upperPercent
- the new upper bound.state
- the plot state.source
- the source point (in Java2D coordinates).Zoomable.zoomRangeAxes(double, double, PlotRenderingInfo, Point2D)
public void zoomRangeAxes(double factor, PlotRenderingInfo state, java.awt.geom.Point2D source)
zoomRangeAxes
in interface Zoomable
factor
- the zoom factor.state
- the plot state.source
- the source point (in Java2D coordinates).Zoomable.zoomDomainAxes(double, PlotRenderingInfo, Point2D)
public void zoomRangeAxes(double factor, PlotRenderingInfo info, java.awt.geom.Point2D source, boolean useAnchor)
zoomRangeAxes
in interface Zoomable
factor
- the zoom factor.info
- the plot rendering info.source
- the source point (in Java2D space).useAnchor
- use source point as zoom anchor?zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, java.awt.geom.Point2D source)
zoomRangeAxes
in interface Zoomable
lowerPercent
- the new lower bound.upperPercent
- the new upper bound.state
- the plot state.source
- the source point (in Java2D coordinates).Zoomable.zoomDomainAxes(double, double, PlotRenderingInfo, Point2D)
public boolean isDomainZoomable()
false
always.
isDomainZoomable
in interface Zoomable
false
always.Zoomable.isRangeZoomable()
public boolean isRangeZoomable()
true
to indicate that the range axis is zoomable.
isRangeZoomable
in interface Zoomable
true
.Zoomable.isDomainZoomable()
public PlotOrientation getOrientation()
getOrientation
in interface Zoomable
public double getMaxRadius()
public java.awt.Point translateValueThetaRadiusToJava2D(double angleDegrees, double radius, java.awt.geom.Rectangle2D dataArea)
radius
is less than the lower bound of the axis, then
this method returns the centre point.
angleDegrees
- the angle in degrees.radius
- the radius.dataArea
- the data area.
|
Footer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |