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.XYPlot
public class XYPlot
extends Plot
implements ValueAxisPlot, Zoomable, RendererChangeListener, Cloneable, PublicCloneable, Serializable
XYDataset
interface.
XYPlot
makes use of an XYItemRenderer
to draw each point
on the plot. By using different renderers, various chart types can be
produced.
The ChartFactory
class contains static methods for
creating pre-configured charts.
Field Summary | |
static Paint |
|
static Stroke |
|
static boolean |
|
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 |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected AxisSpace |
|
protected AxisSpace |
|
protected AxisSpace |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Object |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected Map |
|
void |
|
protected void |
|
protected void |
|
void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
void |
|
protected void |
|
protected void |
|
boolean |
|
List |
|
RectangleInsets |
|
Range |
|
XYDataset |
|
XYDataset |
|
int |
|
DatasetRenderingOrder |
|
ValueAxis |
|
ValueAxis |
|
int |
|
RectangleEdge |
|
RectangleEdge |
|
ValueAxis |
|
protected int |
|
AxisLocation |
|
AxisLocation |
|
Paint |
|
Stroke |
|
double |
|
Paint |
|
Stroke |
|
Collection |
|
Collection |
|
Paint |
|
AxisSpace |
|
LegendItemCollection |
|
AxisSpace |
|
int |
|
LegendItemCollection |
|
PlotOrientation |
|
String |
|
Point2D |
|
Paint |
|
ValueAxis |
|
ValueAxis |
|
int |
|
RectangleEdge |
|
RectangleEdge |
|
ValueAxis |
|
protected int |
|
AxisLocation |
|
AxisLocation |
|
Paint |
|
Stroke |
|
double |
|
Paint |
|
Stroke |
|
Collection |
|
Collection |
|
Paint |
|
Paint |
|
Stroke |
|
XYItemRenderer |
|
XYItemRenderer |
|
XYItemRenderer |
|
int |
|
SeriesRenderingOrder |
|
int |
|
void |
|
int | |
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public static final Paint DEFAULT_CROSSHAIR_PAINT
The default crosshair paint.
public static final Stroke DEFAULT_CROSSHAIR_STROKE
The default crosshair stroke.
public static final boolean DEFAULT_CROSSHAIR_VISIBLE
The default crosshair visibility.
- Field Value:
- false
public static final Stroke DEFAULT_GRIDLINE_STROKE
The default grid line stroke.
protected static ResourceBundle localizationResources
The resourceBundle for the localization.
public XYPlot(XYDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, XYItemRenderer renderer)
Creates a new plot.
- Parameters:
dataset
- the dataset (null
permitted).domainAxis
- the domain axis (null
permitted).rangeAxis
- the range axis (null
permitted).renderer
- the renderer (null
permitted).
public void addAnnotation(XYAnnotation annotation)
Adds an annotation to the plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
annotation
- the annotation (null
not permitted).
public void addDomainMarker(int index, Marker marker, Layer layer)
Adds a marker for a renderer and sends aPlotChangeEvent
to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis (that the renderer is mapped to), however this is entirely up to the renderer.
- Parameters:
index
- the renderer index.marker
- the marker.layer
- the layer (foreground or background).
public void addDomainMarker(Marker marker)
Adds a marker for the domain axis and sends aPlotChangeEvent
to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
marker
- the marker (null
not permitted).
public void addDomainMarker(Marker marker, Layer layer)
Adds a marker for the domain axis in the specified layer and sends aPlotChangeEvent
to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
marker
- the marker (null
not permitted).layer
- the layer (foreground or background).
public void addRangeMarker(int index, Marker marker, Layer layer)
Adds a marker for a renderer and sends aPlotChangeEvent
to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
index
- the renderer index.marker
- the marker.layer
- the layer (foreground or background).
public void addRangeMarker(Marker marker)
Adds a marker for the range axis and sends aPlotChangeEvent
to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
marker
- the marker (null
not permitted).
public void addRangeMarker(Marker marker, Layer layer)
Adds a marker for the range axis in the specified layer and sends aPlotChangeEvent
to all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
marker
- the marker (null
not permitted).layer
- the layer (foreground or background).
protected AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea)
Calculates the space required for all the axes in the plot.
- Parameters:
g2
- the graphics device.plotArea
- the plot area.
- Returns:
- The required space.
protected AxisSpace calculateDomainAxisSpace(Graphics2D g2, Rectangle2D plotArea, AxisSpace space)
Calculates the space required for the domain axis/axes.
- Parameters:
g2
- the graphics device.plotArea
- the plot area.space
- a carrier for the result (null
permitted).
- Returns:
- The required space.
protected AxisSpace calculateRangeAxisSpace(Graphics2D g2, Rectangle2D plotArea, AxisSpace space)
Calculates the space required for the range axis/axes.
- Parameters:
g2
- the graphics device.plotArea
- the plot area.space
- a carrier for the result (null
permitted).
- Returns:
- The required space.
public void clearAnnotations()
Clears all the annotations and sends aPlotChangeEvent
to all registered listeners.
public void clearDomainAxes()
Clears the domain axes from the plot and sends aPlotChangeEvent
to all registered listeners.
public void clearDomainMarkers()
Clears all the (foreground and background) domain markers and sends aPlotChangeEvent
to all registered listeners.
public void clearDomainMarkers(int index)
Clears the (foreground and background) domain markers for a particular renderer.
- Parameters:
index
- the renderer index.
public void clearRangeAxes()
Clears the range axes from the plot and sends aPlotChangeEvent
to all registered listeners.
public void clearRangeMarkers()
Clears all the range markers and sends aPlotChangeEvent
to all registered listeners.
public void clearRangeMarkers(int index)
Clears the (foreground and background) range markers for a particular renderer.
- Parameters:
index
- the renderer index.
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 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 within the specified area on a graphics device.
- Parameters:
g2
- the graphics device.area
- the plot area (in Java2D space).anchor
- an anchor point in Java2D space (null
permitted).parentState
- the state from the parent plot, if there is one (null
permitted).info
- collects chart drawing information (null
permitted).
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info)
Draws the annotations for the plot.
- Parameters:
g2
- the graphics device.dataArea
- the data area.info
- the chart rendering info.
protected Map drawAxes(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, PlotRenderingInfo plotState)
A utility method for drawing the axes.
- Parameters:
g2
- the graphics device (null
not permitted).plotArea
- the plot area (null
not permitted).dataArea
- the data area (null
not permitted).plotState
- collects information about the plot (null
permitted).
- Returns:
- A map containing the state for each axis drawn.
public void drawBackground(Graphics2D g2, Rectangle2D area)
Draws the background for the plot.
- Overrides:
- drawBackground in interface Plot
- Parameters:
g2
- the graphics device.area
- the area.
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks)
Draws the gridlines for the plot, if they are visible.
- Parameters:
g2
- the graphics device.dataArea
- the data area.ticks
- the ticks.
protected void drawDomainMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer)
Draws the domain markers (if any) for an axis and layer. This method is typically called from within the draw() method.
- Parameters:
g2
- the graphics device.dataArea
- the data area.index
- the renderer index.layer
- the layer (foreground or background).
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks)
Draws the domain tick bands, if any.
- Parameters:
g2
- the graphics device.dataArea
- the data area.ticks
- the ticks.
protected void drawHorizontalLine(Graphics2D g2, Rectangle2D dataArea, double value, Stroke stroke, Paint paint)
Utility method for drawing a horizontal line across the data area of the plot.
- Parameters:
g2
- the graphics device.dataArea
- the data area.value
- the coordinate, where to draw the line.stroke
- the stroke to use.paint
- the paint to use.
protected void drawQuadrants(Graphics2D g2, Rectangle2D area)
Draws the quadrants.
- Parameters:
g2
- the graphics device.area
- the area.
protected void drawRangeGridlines(Graphics2D g2, Rectangle2D area, List ticks)
Draws the gridlines for the plot's primary range axis, if they are visible.
- Parameters:
g2
- the graphics device.area
- the data area.ticks
- the ticks.
protected void drawRangeMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer)
Draws the range markers (if any) for a renderer and layer. This method is typically called from within the draw() method.
- Parameters:
g2
- the graphics device.dataArea
- the data area.index
- the renderer index.layer
- the layer (foreground or background).
public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks)
Draws the range tick bands, if any.
- Parameters:
g2
- the graphics device.dataArea
- the data area.ticks
- the ticks.
protected void drawVerticalLine(Graphics2D g2, Rectangle2D dataArea, double value, Stroke stroke, Paint paint)
Utility method for drawing a vertical line on the data area of the plot.
- Parameters:
g2
- the graphics device.dataArea
- the data area.value
- the coordinate, where to draw the line.stroke
- the stroke to use.paint
- the paint to use.
protected void drawZeroRangeBaseline(Graphics2D g2, Rectangle2D area)
Draws a base line across the chart at value zero on the range axis.
- Parameters:
g2
- the graphics device.area
- the data area.
public boolean equals(Object obj)
Tests this plot for equality with another object.
- Parameters:
obj
- the object (null
permitted).
- Returns:
true
orfalse
.
public List getAnnotations()
Returns the list of annotations.
- Returns:
- The list of annotations.
- Since:
- 1.0.1
public RectangleInsets getAxisOffset()
Returns the axis offset.
- Returns:
- The axis offset (never
null
).
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
).
public XYDataset getDataset(int index)
Returns a dataset.
- Parameters:
index
- the dataset index.
- Returns:
- The dataset (possibly
null
).
public int getDatasetCount()
Returns the number of datasets.
- Returns:
- The number of datasets.
public DatasetRenderingOrder getDatasetRenderingOrder()
Returns the dataset rendering order.
- Returns:
- The order (never
null
).
public ValueAxis getDomainAxis()
Returns the domain axis for the plot. If the domain axis for this plot is null, then the method will return the parent plot's domain axis (if there is a parent plot).
- Returns:
- The domain axis.
public ValueAxis getDomainAxis(int index)
Returns a domain axis.
- Parameters:
index
- the axis index.
- Returns:
- The axis (
null
possible).
public int getDomainAxisCount()
Returns the number of domain axes.
- Returns:
- The axis count.
public RectangleEdge getDomainAxisEdge()
Returns the edge for the primary domain axis (taking into account the plot's orientation.
- Returns:
- The edge.
public RectangleEdge getDomainAxisEdge(int index)
Returns the edge for a domain axis.
- Parameters:
index
- the axis index.
- Returns:
- The edge.
public ValueAxis getDomainAxisForDataset(int index)
Returns the domain axis for a dataset.
- Parameters:
index
- the dataset index.
- Returns:
- The axis.
protected int getDomainAxisIndex(ValueAxis axis)
Returns the index of the given domain axis.
- Parameters:
axis
- the axis.
- Returns:
- The axis index.
public AxisLocation getDomainAxisLocation()
Returns the location of the primary domain axis.
- Returns:
- The location (never
null
).
public AxisLocation getDomainAxisLocation(int index)
Returns the location for a domain axis. If this hasn't been set explicitly, the method returns the location that is opposite to the primary domain axis location.
- Parameters:
index
- the axis index.
- Returns:
- The location (never
null
).
public Paint getDomainCrosshairPaint()
Returns the domain crosshair color.
- Returns:
- The crosshair color.
public Stroke getDomainCrosshairStroke()
Returns theStroke
used to draw the crosshair (if visible).
- Returns:
- The crosshair stroke.
public double getDomainCrosshairValue()
Returns the domain crosshair value.
- Returns:
- The value.
public Paint getDomainGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the domain axis.
- Returns:
- The paint.
public Stroke getDomainGridlineStroke()
Returns the stroke for the grid-lines (if any) plotted against the domain axis.
- Returns:
- The stroke.
public Collection getDomainMarkers(Layer layer)
Returns the list of domain markers (read only) for the specified layer.
- Parameters:
layer
- the layer (foreground or background).
- Returns:
- The list of domain markers.
public Collection getDomainMarkers(int index, Layer layer)
Returns a collection of domain markers for a particular renderer and layer.
- Parameters:
index
- the renderer index.layer
- the layer.
- Returns:
- A collection of markers (possibly
null
).
public Paint getDomainTickBandPaint()
Returns the paint used for the domain tick bands. If this isnull
, no tick bands will be drawn.
- Returns:
- The paint (possibly
null
).
public AxisSpace getFixedDomainAxisSpace()
Returns the fixed domain axis space.
- Returns:
- The fixed domain axis space (possibly
null
).
public LegendItemCollection getFixedLegendItems()
Returns the fixed legend items, if any.
- Returns:
- The legend items (possibly
null
).
public AxisSpace getFixedRangeAxisSpace()
Returns the fixed range axis space.
- Returns:
- The fixed range axis space.
public int getIndexOf(XYItemRenderer renderer)
Returns the index of the specified renderer, or-1
if the renderer is not assigned to this plot.
- Parameters:
renderer
- the renderer (null
permitted).
- Returns:
- The renderer index.
public LegendItemCollection getLegendItems()
Returns the legend items for the plot. Each legend item is generated by the plot's renderer, since the 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 PlotOrientation getOrientation()
Returns the orientation of the plot.
- Specified by:
- getOrientation in interface Zoomable
- Returns:
- The orientation of the plot.
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 Point2D getQuadrantOrigin()
Returns the origin for the quadrants that can be displayed on the plot. This defaults to (0, 0).
- Returns:
- The origin point (never
null
).
public Paint getQuadrantPaint(int index)
Returns the paint used for the specified quadrant.
- Parameters:
index
- the quadrant index (0-3).
- Returns:
- The paint (possibly
null
).
public ValueAxis getRangeAxis()
Returns the range axis for the plot. If the range axis for this plot is null, then the method will return the parent plot's range axis (if there is a parent plot).
- Returns:
- The range axis.
public ValueAxis getRangeAxis(int index)
Returns a range axis.
- Parameters:
index
- the axis index.
- Returns:
- The axis (
null
possible).
public int getRangeAxisCount()
Returns the number of range axes.
- Returns:
- The axis count.
public RectangleEdge getRangeAxisEdge()
Returns the edge for the primary range axis.
- Returns:
- The range axis edge.
public RectangleEdge getRangeAxisEdge(int index)
Returns the edge for a range axis.
- Parameters:
index
- the axis index.
- Returns:
- The edge.
public ValueAxis getRangeAxisForDataset(int index)
Returns the range axis for a dataset.
- Parameters:
index
- the dataset index.
- Returns:
- The axis.
protected int getRangeAxisIndex(ValueAxis axis)
Returns the index of the given range axis.
- Parameters:
axis
- the axis.
- Returns:
- The axis index.
public AxisLocation getRangeAxisLocation()
Returns the location of the primary range axis.
- Returns:
- The location (never
null
).
public AxisLocation getRangeAxisLocation(int index)
Returns the location for a range axis. If this hasn't been set explicitly, the method returns the location that is opposite to the primary range axis location.
- Parameters:
index
- the axis index.
- Returns:
- The location (never
null
).
public Paint getRangeCrosshairPaint()
Returns the range crosshair color.
- Returns:
- The crosshair color.
public Stroke getRangeCrosshairStroke()
Returns the Stroke used to draw the crosshair (if visible).
- Returns:
- The crosshair stroke.
public double getRangeCrosshairValue()
Returns the range crosshair value.
- Returns:
- The value.
public Paint getRangeGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the range axis.
- Returns:
- The paint (never
null
).
public Stroke getRangeGridlineStroke()
Returns the stroke for the grid lines (if any) plotted against the range axis.
- Returns:
- The stroke (never
null
).
public Collection getRangeMarkers(Layer layer)
Returns the list of range markers (read only) for the specified layer.
- Parameters:
layer
- the layer (foreground or background).
- Returns:
- The list of range markers.
public Collection getRangeMarkers(int index, Layer layer)
Returns a collection of range markers for a particular renderer and layer.
- Parameters:
index
- the renderer index.layer
- the layer.
- Returns:
- A collection of markers (possibly
null
).
public Paint getRangeTickBandPaint()
Returns the paint used for the range tick bands. If this isnull
, no tick bands will be drawn.
- Returns:
- The paint (possibly
null
).
public Paint getRangeZeroBaselinePaint()
Returns the paint for the zero baseline (if any) plotted against the range axis.
- Returns:
- The paint (never
null
).
public Stroke getRangeZeroBaselineStroke()
Returns the stroke used for the zero baseline against the range axis.
- Returns:
- The stroke (never
null
).
public XYItemRenderer getRenderer()
Returns the renderer for the primary dataset.
- Returns:
- The item renderer (possibly
null
).
public XYItemRenderer getRenderer(int index)
Returns the renderer for a dataset, ornull
.
- Parameters:
index
- the renderer index.
- Returns:
- The renderer (possibly
null
).
public XYItemRenderer getRendererForDataset(XYDataset dataset)
Returns the renderer for the specified dataset. The code first determines the index of the dataset, then checks if there is a renderer with the same index (if not, the method returns renderer(0).
- Parameters:
dataset
- the dataset (null
permitted).
- Returns:
- The renderer (possibly
null
).
public int getSeriesCount()
Returns the number of series in the primary dataset for this plot. If the dataset isnull
, the method returns 0.
- Returns:
- The series count.
public SeriesRenderingOrder getSeriesRenderingOrder()
Returns the series rendering order.
- Returns:
- the order (never
null
).
public int getWeight()
Returns the weight for this plot when it is used as a subplot within a combined plot.
- Returns:
- The weight.
public void handleClick(int x, int y, PlotRenderingInfo info)
Handles a 'click' on the plot by updating the anchor values...
- Overrides:
- handleClick in interface Plot
- Parameters:
x
- the x-coordinate, where the click occurred, in Java2D space.y
- the y-coordinate, where the click occurred, in Java2D space.info
- object containing information about the plot dimensions.
public int indexOf(XYDataset dataset)
Returns the index of the specified dataset, or-1
if the dataset does not belong to the plot.
- Parameters:
dataset
- the dataset (null
not permitted).
- Returns:
- The index.
public boolean isDomainCrosshairLockedOnData()
Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.
- Returns:
- The flag.
public boolean isDomainCrosshairVisible()
Returns a flag indicating whether or not the domain crosshair is visible.
- Returns:
- The flag.
public boolean isDomainGridlinesVisible()
Returnstrue
if the domain gridlines are visible, andfalse
otherwise.
- Returns:
true
orfalse
.
public boolean isDomainZoomable()
Returnstrue
- Specified by:
- isDomainZoomable in interface Zoomable
- Returns:
- A boolean.
public boolean isRangeCrosshairLockedOnData()
Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.
- Returns:
- The flag.
public boolean isRangeCrosshairVisible()
Returns a flag indicating whether or not the range crosshair is visible.
- Returns:
- The flag.
public boolean isRangeGridlinesVisible()
Returnstrue
if the range axis grid is visible, andfalse
otherwise.
- Returns:
- A boolean.
public boolean isRangeZeroBaselineVisible()
Returns a flag that controls whether or not a zero baseline is displayed for the range axis.
- Returns:
- A boolean.
public boolean isRangeZoomable()
Returnstrue
- Specified by:
- isRangeZoomable in interface Zoomable
- Returns:
- A boolean.
public void mapDatasetToDomainAxis(int index, int axisIndex)
Maps a dataset to a particular domain axis. All data will be plotted against axis zero by default, no mapping is required for this case.
- Parameters:
index
- the dataset index (zero-based).axisIndex
- the axis index.
public void mapDatasetToRangeAxis(int index, int axisIndex)
Maps a dataset to a particular range axis. All data will be plotted against axis zero by default, no mapping is required for this case.
- Parameters:
index
- the dataset index (zero-based).axisIndex
- the axis index.
public boolean removeAnnotation(XYAnnotation annotation)
Removes an annotation from the plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
annotation
- the annotation (null
not permitted).
- Returns:
- A boolean (indicates whether or not the annotation was removed).
public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CrosshairState crosshairState)
Draws a representation of the data within the dataArea region, using the current renderer. Theinfo
andcrosshairState
arguments may benull
.
- Parameters:
g2
- the graphics device.dataArea
- the region in which the data is to be drawn.index
- the dataset index.info
- an optional object for collection dimension information.crosshairState
- collects crosshair information (null
permitted).
- Returns:
- A flag that indicates whether any data was actually rendered.
public void rendererChanged(RendererChangeEvent event)
Receives notification of a renderer change event.
- Specified by:
- rendererChanged in interface RendererChangeListener
- Parameters:
event
- the event.
public void setAxisOffset(RectangleInsets offset)
Sets the axis offsets (gap between the data area and the axes).
- Parameters:
offset
- the offset (null
not permitted).
public void setDataset(int index, XYDataset dataset)
Sets a dataset for the plot.
- Parameters:
index
- the dataset index.dataset
- the dataset (null
permitted).
public void setDataset(XYDataset dataset)
Sets the primary dataset for the plot, replacing the existing dataset if there is one.
- Parameters:
dataset
- the dataset (null
permitted).
public void setDatasetRenderingOrder(DatasetRenderingOrder order)
Sets the rendering order and sends aPlotChangeEvent
to all registered listeners. By default, the plot renders the primary dataset last (so that the primary dataset overlays the secondary datasets). You can reverse this if you want to.
- Parameters:
order
- the rendering order (null
not permitted).
public void setDomainAxes(ValueAxis[] axes)
Sets the domain axes for this plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
axes
- the axes.
public void setDomainAxis(int index, ValueAxis axis)
Sets a domain axis and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the axis index.axis
- the axis.
public void setDomainAxis(int index, ValueAxis axis, boolean notify)
Sets a domain axis and, if requested, sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the axis index.axis
- the axis.notify
- notify listeners?
public void setDomainAxis(ValueAxis axis)
Sets the domain axis for the plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
axis
- the new axis (null
permitted).
public void setDomainAxisLocation(int index, AxisLocation location)
Sets the location for a domain axis and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the axis index.location
- the location (null
permitted).
public void setDomainAxisLocation(AxisLocation location)
Sets the location of the domain axis and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
location
- the location (null
not permitted).
public void setDomainAxisLocation(AxisLocation location, boolean notify)
Sets the location of the domain axis and, if requested, sends aPlotChangeEvent
to all registered listeners.
- Parameters:
location
- the location (null
not permitted).notify
- notify listeners?
public void setDomainCrosshairLockedOnData(boolean flag)
Sets the flag indicating whether or not the domain crosshair should "lock-on" to actual data values.
- Parameters:
flag
- the flag.
public void setDomainCrosshairPaint(Paint paint)
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified.
- Parameters:
paint
- the new crosshair paint.
public void setDomainCrosshairStroke(Stroke stroke)
Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified.
- Parameters:
stroke
- the new crosshair stroke.
public void setDomainCrosshairValue(double value)
Sets the domain crosshair value and sends aPlotChangeEvent
to all registered listeners (provided that the domain crosshair is visible).
- Parameters:
value
- the value.
public void setDomainCrosshairValue(double value, boolean notify)
Sets the domain crosshair value and, if requested, sends aPlotChangeEvent
to all registered listeners (provided that the domain crosshair is visible).
- Parameters:
value
- the new value.notify
- notify listeners?
public void setDomainCrosshairVisible(boolean flag)
Sets the flag indicating whether or not the domain crosshair is visible.
- Parameters:
flag
- the new value of the flag.
public void setDomainGridlinePaint(Paint paint)
Sets the paint for the grid lines plotted against the domain axis. If you set this tonull
, no grid lines will be drawn.
- Parameters:
paint
- the paint (null
permitted).
public void setDomainGridlineStroke(Stroke stroke)
Sets the stroke for the grid lines plotted against the domain axis. If you set this tonull
, no grid lines will be drawn.
- Parameters:
stroke
- the stroke (null
permitted).
public void setDomainGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the domain 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.
public void setDomainTickBandPaint(Paint paint)
Sets the paint for the domain tick bands.
- Parameters:
paint
- the paint (null
permitted).
public void setFixedDomainAxisSpace(AxisSpace space)
Sets the fixed domain axis space.
- Parameters:
space
- the space.
public void setFixedLegendItems(LegendItemCollection items)
Sets the fixed legend items for the plot. Leave this set tonull
if you prefer the legend items to be created automatically.
- Parameters:
items
- the legend items (null
permitted).
public void setFixedRangeAxisSpace(AxisSpace space)
Sets the fixed range axis space.
- Parameters:
space
- the space.
public void setOrientation(PlotOrientation orientation)
Sets the orientation for the plot.
- Parameters:
orientation
- the orientation (null
not allowed).
public void setQuadrantOrigin(Point2D origin)
Sets the quadrant origin and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
origin
- the origin (null
not permitted).
public void setQuadrantPaint(int index, Paint paint)
Sets the paint used for the specified quadrant and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the quadrant index (0-3).paint
- the paint (null
permitted).
public void setRangeAxes(ValueAxis[] axes)
Sets the range axes for this plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
axes
- the axes.
public void setRangeAxis(int index, ValueAxis axis)
Sets a range axis and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the axis index.axis
- the axis (null
permitted).
public void setRangeAxis(int index, ValueAxis axis, boolean notify)
Sets a range axis and, if requested, sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the axis index.axis
- the axis (null
permitted).notify
- notify listeners?
public void setRangeAxis(ValueAxis axis)
Sets the range axis for the plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
axis
- the axis (null
permitted).
public void setRangeAxisLocation(int index, AxisLocation location)
Sets the location for a range axis and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the axis index.location
- the location (null
permitted).
public void setRangeAxisLocation(AxisLocation location)
Sets the location of the primary range axis and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
location
- the location (null
not permitted).
public void setRangeAxisLocation(AxisLocation location, boolean notify)
Sets the location of the primary range axis and, if requested, sends aPlotChangeEvent
to all registered listeners.
- Parameters:
location
- the location (null
not permitted).notify
- notify listeners?
public void setRangeCrosshairLockedOnData(boolean flag)
Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values.
- Parameters:
flag
- the flag.
public void setRangeCrosshairPaint(Paint paint)
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified.
- Parameters:
paint
- the new crosshair paint.
public void setRangeCrosshairStroke(Stroke stroke)
Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified.
- Parameters:
stroke
- the new crosshair stroke.
public void setRangeCrosshairValue(double value)
Sets the domain crosshair value. Registered listeners are notified that the plot has been modified, but only if the crosshair is visible.
- Parameters:
value
- the new value.
public void setRangeCrosshairValue(double value, boolean notify)
Sets the range crosshair value. Registered listeners are notified that the axis has been modified, but only if the crosshair is visible.
- Parameters:
value
- the new value.notify
- a flag that controls whether or not listeners are notified.
public void setRangeCrosshairVisible(boolean flag)
Sets the flag indicating whether or not the range crosshair is visible.
- Parameters:
flag
- the new value of the flag.
public void setRangeGridlinePaint(Paint paint)
Sets the paint for the grid lines plotted against the range axis and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
paint
- the paint (null
permitted).
public void setRangeGridlineStroke(Stroke stroke)
Sets the stroke for the grid lines plotted against the range axis, and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
stroke
- the stroke (null
not permitted).
public void setRangeGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the range 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.
public void setRangeTickBandPaint(Paint paint)
Sets the paint for the range tick bands.
- Parameters:
paint
- the paint (null
permitted).
public void setRangeZeroBaselinePaint(Paint paint)
Sets the paint for the zero baseline plotted against the range axis and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
paint
- the paint (null
permitted).
public void setRangeZeroBaselineStroke(Stroke stroke)
Sets the stroke for the zero baseline for the range axis, and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
stroke
- the stroke (null
not permitted).
public void setRangeZeroBaselineVisible(boolean visible)
Sets the flag that controls whether or not the zero baseline is displayed for the range axis, and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
visible
- the flag.
public void setRenderer(int index, XYItemRenderer renderer)
Sets a renderer and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the index.renderer
- the renderer.
public void setRenderer(int index, XYItemRenderer renderer, boolean notify)
Sets a renderer and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
index
- the index.renderer
- the renderer.notify
- notify listeners?
public void setRenderer(XYItemRenderer renderer)
Sets the renderer for the primary dataset and sends aPlotChangeEvent
to all registered listeners. If the renderer is set tonull
, no data will be displayed.
- Parameters:
renderer
- the renderer (null
permitted).
public void setRenderers(XYItemRenderer[] renderers)
Sets the renderers for this plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
renderers
- the renderers.
public void setSeriesRenderingOrder(SeriesRenderingOrder order)
Sets the series order and sends aPlotChangeEvent
to all registered listeners. By default, the plot renders the primary series last (so that the primary series appears to be on top). You can reverse this if you want to.
- Parameters:
order
- the rendering order (null
not permitted).
public void setWeight(int weight)
Sets the weight for the plot.
- Parameters:
weight
- the weight.
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)
Zooms in on the domain axis/axes. The new lower and upper bounds are specified as percentages of the current axis range, where 0 percent is the current lower bound and 100 percent is the current upper bound.
- Specified by:
- zoomDomainAxes in interface Zoomable
- Parameters:
lowerPercent
- a percentage that determines the new lower bound for the axis (e.g. 0.20 is twenty percent).upperPercent
- a percentage that determines the new upper bound for the axis (e.g. 0.80 is eighty percent).info
- the plot rendering info.source
- the source point.
public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source)
Multiplies the range on the domain axis/axes by the specified factor.
- Specified by:
- zoomDomainAxes in interface Zoomable
- Parameters:
factor
- the zoom factor.info
- the plot rendering info.source
- the source point.
public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)
Zooms in on the range axes.
- Specified by:
- zoomRangeAxes in interface Zoomable
- Parameters:
lowerPercent
- the lower bound.upperPercent
- the upper bound.info
- the plot rendering info.source
- the source point.
public void zoomRangeAxes(double factor, PlotRenderingInfo info, 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.info
- the plot rendering info.source
- the source point.