public class XYPlot extends Plot implements ValueAxisPlot, Pannable, 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.
Modifier and Type | Field and Description |
---|---|
static Paint |
DEFAULT_CROSSHAIR_PAINT
The default crosshair paint.
|
static Stroke |
DEFAULT_CROSSHAIR_STROKE
The default crosshair stroke.
|
static boolean |
DEFAULT_CROSSHAIR_VISIBLE
The default crosshair visibility.
|
static Paint |
DEFAULT_GRIDLINE_PAINT
The default grid line paint.
|
static Stroke |
DEFAULT_GRIDLINE_STROKE
The default grid line stroke.
|
protected static ResourceBundle |
localizationResources
The resourceBundle for the localization.
|
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 and Description |
---|
XYPlot()
Creates a new
XYPlot instance with no dataset, no axes and
no renderer. |
XYPlot(XYDataset dataset,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYItemRenderer renderer)
Creates a new plot with the specified dataset, axes and renderer.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(XYAnnotation annotation)
Adds an annotation to the plot and sends a
PlotChangeEvent to
all registered listeners. |
void |
addAnnotation(XYAnnotation annotation,
boolean notify)
Adds an annotation to the plot and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
addDomainMarker(int index,
Marker marker,
Layer layer)
Adds a marker for a specific dataset/renderer and sends a
PlotChangeEvent to all registered listeners. |
void |
addDomainMarker(int index,
Marker marker,
Layer layer,
boolean notify)
Adds a marker for a specific dataset/renderer and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
addDomainMarker(Marker marker)
Adds a marker for the domain axis and sends a
PlotChangeEvent
to all registered listeners. |
void |
addDomainMarker(Marker marker,
Layer layer)
Adds a marker for the domain axis in the specified layer and sends a
PlotChangeEvent to all registered listeners. |
void |
addRangeMarker(int index,
Marker marker,
Layer layer)
Adds a marker for a specific dataset/renderer and sends a
PlotChangeEvent to all registered listeners. |
void |
addRangeMarker(int index,
Marker marker,
Layer layer,
boolean notify)
Adds a marker for a specific dataset/renderer and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
addRangeMarker(Marker marker)
Adds a marker for the range axis and sends a
PlotChangeEvent to
all registered listeners. |
void |
addRangeMarker(Marker marker,
Layer layer)
Adds a marker for the range axis in the specified layer and sends a
PlotChangeEvent to all registered listeners. |
void |
annotationChanged(AnnotationChangeEvent event)
Receives notification of a change to an
Annotation added to
this plot. |
protected AxisSpace |
calculateAxisSpace(Graphics2D g2,
Rectangle2D plotArea)
Calculates the space required for all the axes in the plot.
|
protected AxisSpace |
calculateDomainAxisSpace(Graphics2D g2,
Rectangle2D plotArea,
AxisSpace space)
Calculates the space required for the domain axis/axes.
|
protected AxisSpace |
calculateRangeAxisSpace(Graphics2D g2,
Rectangle2D plotArea,
AxisSpace space)
Calculates the space required for the range axis/axes.
|
void |
clearAnnotations()
Clears all the annotations and sends a
PlotChangeEvent to all
registered listeners. |
void |
clearDomainAxes()
Clears the domain axes from the plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
clearDomainMarkers()
Clears all the (foreground and background) domain markers and sends a
PlotChangeEvent to all registered listeners. |
void |
clearDomainMarkers(int index)
Clears the (foreground and background) domain markers for a particular
renderer and sends a
PlotChangeEvent to all registered listeners. |
void |
clearRangeAxes()
Clears the range axes from the plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
clearRangeMarkers()
Clears all the range markers and sends a
PlotChangeEvent to all
registered listeners. |
void |
clearRangeMarkers(int index)
Clears the (foreground and background) range markers for a particular
renderer.
|
Object |
clone()
Returns a clone of the plot.
|
void |
configureDomainAxes()
Configures the domain axes.
|
void |
configureRangeAxes()
Configures the range axes.
|
void |
datasetChanged(DatasetChangeEvent event)
Receives notification of a change to the plot's dataset.
|
void |
draw(Graphics2D g2,
Rectangle2D area,
Point2D anchor,
PlotState parentState,
PlotRenderingInfo info)
Draws the plot within the specified area on a graphics device.
|
void |
drawAnnotations(Graphics2D g2,
Rectangle2D dataArea,
PlotRenderingInfo info)
Draws the annotations for the plot.
|
protected Map<Axis,AxisState> |
drawAxes(Graphics2D g2,
Rectangle2D plotArea,
Rectangle2D dataArea,
PlotRenderingInfo plotState)
A utility method for drawing the axes.
|
void |
drawBackground(Graphics2D g2,
Rectangle2D area)
Draws the background for the plot.
|
protected void |
drawDomainCrosshair(Graphics2D g2,
Rectangle2D dataArea,
PlotOrientation orientation,
double value,
ValueAxis axis,
Stroke stroke,
Paint paint)
Draws a domain crosshair.
|
protected void |
drawDomainGridlines(Graphics2D g2,
Rectangle2D dataArea,
List ticks)
Draws the gridlines for the plot, if they are visible.
|
protected void |
drawDomainMarkers(Graphics2D g2,
Rectangle2D dataArea,
int index,
Layer layer)
Draws the domain markers (if any) for an axis and layer.
|
void |
drawDomainTickBands(Graphics2D g2,
Rectangle2D dataArea,
List ticks)
Draws the domain tick bands, if any.
|
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.
|
protected void |
drawQuadrants(Graphics2D g2,
Rectangle2D area)
Draws the quadrants.
|
protected void |
drawRangeCrosshair(Graphics2D g2,
Rectangle2D dataArea,
PlotOrientation orientation,
double value,
ValueAxis axis,
Stroke stroke,
Paint paint)
Draws a range crosshair.
|
protected void |
drawRangeGridlines(Graphics2D g2,
Rectangle2D area,
List ticks)
Draws the gridlines for the plot's primary range axis, if they are
visible.
|
protected void |
drawRangeMarkers(Graphics2D g2,
Rectangle2D dataArea,
int index,
Layer layer)
Draws the range markers (if any) for a renderer and layer.
|
void |
drawRangeTickBands(Graphics2D g2,
Rectangle2D dataArea,
List ticks)
Draws the range tick bands, if any.
|
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.
|
protected void |
drawZeroDomainBaseline(Graphics2D g2,
Rectangle2D area)
Draws a base line across the chart at value zero on the domain axis.
|
protected void |
drawZeroRangeBaseline(Graphics2D g2,
Rectangle2D area)
Draws a base line across the chart at value zero on the range axis.
|
boolean |
equals(Object obj)
Tests this plot for equality with another object.
|
List |
getAnnotations()
Returns the list of annotations.
|
RectangleInsets |
getAxisOffset()
Returns the axis offset.
|
Range |
getDataRange(ValueAxis axis)
Returns the range for the specified axis.
|
XYDataset |
getDataset()
Returns the primary dataset for the plot.
|
XYDataset |
getDataset(int index)
Returns the dataset with the specified index, or
null if there
is no dataset with that index. |
int |
getDatasetCount()
Returns the number of datasets.
|
DatasetRenderingOrder |
getDatasetRenderingOrder()
Returns the dataset rendering order.
|
ValueAxis |
getDomainAxis()
Returns the domain axis with index 0.
|
ValueAxis |
getDomainAxis(int index)
Returns the domain axis with the specified index, or
null if
there is no axis with that index. |
int |
getDomainAxisCount()
Returns the number of domain axes.
|
RectangleEdge |
getDomainAxisEdge()
Returns the edge for the primary domain axis (taking into account the
plot's orientation).
|
RectangleEdge |
getDomainAxisEdge(int index)
Returns the edge for a domain axis.
|
ValueAxis |
getDomainAxisForDataset(int index)
Returns the domain axis for a dataset.
|
int |
getDomainAxisIndex(ValueAxis axis)
Returns the index of the given domain axis.
|
AxisLocation |
getDomainAxisLocation()
Returns the location of the primary domain axis.
|
AxisLocation |
getDomainAxisLocation(int index)
Returns the location for a domain axis.
|
Paint |
getDomainCrosshairPaint()
Returns the domain crosshair paint.
|
Stroke |
getDomainCrosshairStroke()
Returns the
Stroke used to draw the crosshair (if visible). |
double |
getDomainCrosshairValue()
Returns the domain crosshair value.
|
Paint |
getDomainGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the domain
axis.
|
Stroke |
getDomainGridlineStroke()
Returns the stroke for the grid-lines (if any) plotted against the
domain axis.
|
Collection |
getDomainMarkers(int index,
Layer layer)
Returns a collection of domain markers for a particular renderer and
layer.
|
Collection |
getDomainMarkers(Layer layer)
Returns the list of domain markers (read only) for the specified layer.
|
Paint |
getDomainMinorGridlinePaint()
Returns the paint for the minor grid lines (if any) plotted against the
domain axis.
|
Stroke |
getDomainMinorGridlineStroke()
Returns the stroke for the minor grid-lines (if any) plotted against the
domain axis.
|
Paint |
getDomainTickBandPaint()
Returns the paint used for the domain tick bands.
|
Paint |
getDomainZeroBaselinePaint()
Returns the paint for the zero baseline (if any) plotted against the
domain axis.
|
Stroke |
getDomainZeroBaselineStroke()
Returns the stroke used for the zero baseline against the domain axis.
|
AxisSpace |
getFixedDomainAxisSpace()
Returns the fixed domain axis space.
|
LegendItemCollection |
getFixedLegendItems()
Returns the fixed legend items, if any.
|
AxisSpace |
getFixedRangeAxisSpace()
Returns the fixed range axis space.
|
int |
getIndexOf(XYItemRenderer renderer)
Returns the index of the specified renderer, or
-1 if the
renderer is not assigned to this plot. |
LegendItemCollection |
getLegendItems()
Returns the legend items for the plot.
|
PlotOrientation |
getOrientation()
Returns the orientation of the plot.
|
String |
getPlotType()
Returns the plot type as a string.
|
Point2D |
getQuadrantOrigin()
Returns the origin for the quadrants that can be displayed on the plot.
|
Paint |
getQuadrantPaint(int index)
Returns the paint used for the specified quadrant.
|
ValueAxis |
getRangeAxis()
Returns the range axis for the plot.
|
ValueAxis |
getRangeAxis(int index)
Returns the range axis with the specified index, or
null if
there is no axis with that index. |
int |
getRangeAxisCount()
Returns the number of range axes.
|
RectangleEdge |
getRangeAxisEdge()
Returns the edge for the primary range axis.
|
RectangleEdge |
getRangeAxisEdge(int index)
Returns the edge for a range axis.
|
ValueAxis |
getRangeAxisForDataset(int index)
Returns the range axis for a dataset.
|
int |
getRangeAxisIndex(ValueAxis axis)
Returns the index of the given range axis.
|
AxisLocation |
getRangeAxisLocation()
Returns the location of the primary range axis.
|
AxisLocation |
getRangeAxisLocation(int index)
Returns the location for a range axis.
|
Paint |
getRangeCrosshairPaint()
Returns the range crosshair paint.
|
Stroke |
getRangeCrosshairStroke()
Returns the stroke used to draw the crosshair (if visible).
|
double |
getRangeCrosshairValue()
Returns the range crosshair value.
|
Paint |
getRangeGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the range
axis.
|
Stroke |
getRangeGridlineStroke()
Returns the stroke for the grid lines (if any) plotted against the
range axis.
|
Collection |
getRangeMarkers(int index,
Layer layer)
Returns a collection of range markers for a particular renderer and
layer.
|
Collection |
getRangeMarkers(Layer layer)
Returns the list of range markers (read only) for the specified layer.
|
Paint |
getRangeMinorGridlinePaint()
Returns the paint for the minor grid lines (if any) plotted against the
range axis.
|
Stroke |
getRangeMinorGridlineStroke()
Returns the stroke for the minor grid lines (if any) plotted against the
range axis.
|
Paint |
getRangeTickBandPaint()
Returns the paint used for the range tick bands.
|
Paint |
getRangeZeroBaselinePaint()
Returns the paint for the zero baseline (if any) plotted against the
range axis.
|
Stroke |
getRangeZeroBaselineStroke()
Returns the stroke used for the zero baseline against the range axis.
|
XYItemRenderer |
getRenderer()
Returns the renderer for the primary dataset.
|
XYItemRenderer |
getRenderer(int index)
Returns the renderer with the specified index, or
null . |
int |
getRendererCount()
Returns the number of renderer slots for this plot.
|
XYItemRenderer |
getRendererForDataset(XYDataset dataset)
Returns the renderer for the specified dataset (this is either the
renderer with the same index as the dataset or, if there isn't a
renderer with the same index, the default renderer).
|
int |
getSeriesCount()
Returns the number of series in the primary dataset for this plot.
|
SeriesRenderingOrder |
getSeriesRenderingOrder()
Returns the series rendering order.
|
ShadowGenerator |
getShadowGenerator()
Returns the shadow generator for the plot, if any.
|
int |
getWeight()
Returns the weight for this plot when it is used as a subplot within a
combined plot.
|
void |
handleClick(int x,
int y,
PlotRenderingInfo info)
Handles a 'click' on the plot by updating the anchor values.
|
int |
indexOf(XYDataset dataset)
Returns the index of the specified dataset, or
-1 if the
dataset does not belong to the plot. |
boolean |
isDomainCrosshairLockedOnData()
Returns a flag indicating whether or not the crosshair should "lock-on"
to actual data values.
|
boolean |
isDomainCrosshairVisible()
Returns a flag indicating whether or not the domain crosshair is visible.
|
boolean |
isDomainGridlinesVisible()
Returns
true if the domain gridlines are visible, and
false otherwise. |
boolean |
isDomainMinorGridlinesVisible()
Returns
true if the domain minor gridlines are visible, and
false otherwise. |
boolean |
isDomainPannable()
Returns
true if panning is enabled for the domain axes,
and false otherwise. |
boolean |
isDomainZeroBaselineVisible()
Returns a flag that controls whether or not a zero baseline is
displayed for the domain axis.
|
boolean |
isDomainZoomable()
Returns
true , indicating that the domain axis/axes for this
plot are zoomable. |
boolean |
isRangeCrosshairLockedOnData()
Returns a flag indicating whether or not the crosshair should "lock-on"
to actual data values.
|
boolean |
isRangeCrosshairVisible()
Returns a flag indicating whether or not the range crosshair is visible.
|
boolean |
isRangeGridlinesVisible()
Returns
true if the range axis grid is visible, and
false otherwise. |
boolean |
isRangeMinorGridlinesVisible()
Returns
true if the range axis minor grid is visible, and
false otherwise. |
boolean |
isRangePannable()
Returns
true if panning is enabled for the range axis/axes,
and false otherwise. |
boolean |
isRangeZeroBaselineVisible()
Returns a flag that controls whether or not a zero baseline is
displayed for the range axis.
|
boolean |
isRangeZoomable()
Returns
true , indicating that the range axis/axes for this
plot are zoomable. |
void |
mapDatasetToDomainAxes(int index,
List axisIndices)
Maps the specified dataset to the axes in the list.
|
void |
mapDatasetToDomainAxis(int index,
int axisIndex)
Maps a dataset to a particular domain axis.
|
void |
mapDatasetToRangeAxes(int index,
List axisIndices)
Maps the specified dataset to the axes in the list.
|
void |
mapDatasetToRangeAxis(int index,
int axisIndex)
Maps a dataset to a particular range axis.
|
void |
panDomainAxes(double percent,
PlotRenderingInfo info,
Point2D source)
Pans the domain axes by the specified percentage.
|
void |
panRangeAxes(double percent,
PlotRenderingInfo info,
Point2D source)
Pans the range axes by the specified percentage.
|
boolean |
removeAnnotation(XYAnnotation annotation)
Removes an annotation from the plot and sends a
PlotChangeEvent
to all registered listeners. |
boolean |
removeAnnotation(XYAnnotation annotation,
boolean notify)
Removes an annotation from the plot and sends a
PlotChangeEvent
to all registered listeners. |
boolean |
removeDomainMarker(int index,
Marker marker,
Layer layer)
Removes a marker for a specific dataset/renderer and sends a
PlotChangeEvent to all registered listeners. |
boolean |
removeDomainMarker(int index,
Marker marker,
Layer layer,
boolean notify)
Removes a marker for a specific dataset/renderer and, if requested,
sends a
PlotChangeEvent to all registered listeners. |
boolean |
removeDomainMarker(Marker marker)
Removes a marker for the domain axis and sends a
PlotChangeEvent
to all registered listeners. |
boolean |
removeDomainMarker(Marker marker,
Layer layer)
Removes a marker for the domain axis in the specified layer and sends a
PlotChangeEvent to all registered listeners. |
boolean |
removeRangeMarker(int index,
Marker marker,
Layer layer)
Removes a marker for a specific dataset/renderer and sends a
PlotChangeEvent to all registered listeners. |
boolean |
removeRangeMarker(int index,
Marker marker,
Layer layer,
boolean notify)
Removes a marker for a specific dataset/renderer and sends a
PlotChangeEvent to all registered listeners. |
boolean |
removeRangeMarker(Marker marker)
Removes a marker for the range axis and sends a
PlotChangeEvent
to all registered listeners. |
boolean |
removeRangeMarker(Marker marker,
Layer layer)
Removes a marker for the range axis in the specified layer and sends a
PlotChangeEvent to all registered listeners. |
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.
|
void |
rendererChanged(RendererChangeEvent event)
Receives notification of a renderer change event.
|
void |
setAxisOffset(RectangleInsets offset)
Sets the axis offsets (gap between the data area and the axes) and sends
a
PlotChangeEvent to all registered listeners. |
void |
setDataset(int index,
XYDataset dataset)
Sets a dataset for the plot and sends a change event to all registered
listeners.
|
void |
setDataset(XYDataset dataset)
Sets the primary dataset for the plot, replacing the existing dataset if
there is one.
|
void |
setDatasetRenderingOrder(DatasetRenderingOrder order)
Sets the rendering order and sends a
PlotChangeEvent to all
registered listeners. |
void |
setDomainAxes(ValueAxis[] axes)
Sets the domain axes for this plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
setDomainAxis(int index,
ValueAxis axis)
Sets a domain axis and sends a
PlotChangeEvent to all
registered listeners. |
void |
setDomainAxis(int index,
ValueAxis axis,
boolean notify)
Sets a domain axis and, if requested, sends a
PlotChangeEvent to
all registered listeners. |
void |
setDomainAxis(ValueAxis axis)
Sets the domain axis for the plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
setDomainAxisLocation(AxisLocation location)
Sets the location of the primary domain axis and sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainAxisLocation(AxisLocation location,
boolean notify)
Sets the location of the domain axis and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainAxisLocation(int index,
AxisLocation location)
Sets the location for a domain axis and sends a
PlotChangeEvent
to all registered listeners. |
void |
setDomainAxisLocation(int index,
AxisLocation location,
boolean notify)
Sets the axis location for a domain axis and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainCrosshairLockedOnData(boolean flag)
Sets the flag indicating whether or not the domain crosshair should
"lock-on" to actual data values.
|
void |
setDomainCrosshairPaint(Paint paint)
Sets the paint used to draw the crosshairs (if visible) and sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainCrosshairStroke(Stroke stroke)
Sets the Stroke used to draw the crosshairs (if visible) and notifies
registered listeners that the axis has been modified.
|
void |
setDomainCrosshairValue(double value)
Sets the domain crosshair value and sends a
PlotChangeEvent to
all registered listeners (provided that the domain crosshair is visible). |
void |
setDomainCrosshairValue(double value,
boolean notify)
Sets the domain crosshair value and, if requested, sends a
PlotChangeEvent to all registered listeners (provided that the
domain crosshair is visible). |
void |
setDomainCrosshairVisible(boolean flag)
Sets the flag indicating whether or not the domain crosshair is visible
and, if the flag changes, sends a
PlotChangeEvent to all
registered listeners. |
void |
setDomainGridlinePaint(Paint paint)
Sets the paint for the grid lines plotted against the domain axis, and
sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainGridlineStroke(Stroke stroke)
Sets the stroke for the grid lines plotted against the domain axis, and
sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the domain grid-lines are
visible.
|
void |
setDomainMinorGridlinePaint(Paint paint)
Sets the paint for the minor grid lines plotted against the domain axis,
and sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainMinorGridlineStroke(Stroke stroke)
Sets the stroke for the minor grid lines plotted against the domain
axis, and sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainMinorGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the domain minor grid-lines
are visible.
|
void |
setDomainPannable(boolean pannable)
Sets the flag that enables or disables panning of the plot along the
domain axes.
|
void |
setDomainTickBandPaint(Paint paint)
Sets the paint for the domain tick bands.
|
void |
setDomainZeroBaselinePaint(Paint paint)
Sets the paint for the zero baseline plotted against the domain axis and
sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainZeroBaselineStroke(Stroke stroke)
Sets the stroke for the zero baseline for the domain axis,
and sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainZeroBaselineVisible(boolean visible)
Sets the flag that controls whether or not the zero baseline is
displayed for the domain axis, and sends a
PlotChangeEvent to
all registered listeners. |
void |
setFixedDomainAxisSpace(AxisSpace space)
Sets the fixed domain axis space and sends a
PlotChangeEvent to
all registered listeners. |
void |
setFixedDomainAxisSpace(AxisSpace space,
boolean notify)
Sets the fixed domain axis space and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
setFixedLegendItems(LegendItemCollection items)
Sets the fixed legend items for the plot.
|
void |
setFixedRangeAxisSpace(AxisSpace space)
Sets the fixed range axis space and sends a
PlotChangeEvent to
all registered listeners. |
void |
setFixedRangeAxisSpace(AxisSpace space,
boolean notify)
Sets the fixed range axis space and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
setOrientation(PlotOrientation orientation)
Sets the orientation for the plot and sends a
PlotChangeEvent to
all registered listeners. |
void |
setQuadrantOrigin(Point2D origin)
Sets the quadrant origin and sends a
PlotChangeEvent to all
registered listeners. |
void |
setQuadrantPaint(int index,
Paint paint)
Sets the paint used for the specified quadrant and sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeAxes(ValueAxis[] axes)
Sets the range axes for this plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
setRangeAxis(int index,
ValueAxis axis)
Sets a range axis and sends a
PlotChangeEvent to all registered
listeners. |
void |
setRangeAxis(int index,
ValueAxis axis,
boolean notify)
Sets a range axis and, if requested, sends a
PlotChangeEvent to
all registered listeners. |
void |
setRangeAxis(ValueAxis axis)
Sets the range axis for the plot and sends a
PlotChangeEvent to
all registered listeners. |
void |
setRangeAxisLocation(AxisLocation location)
Sets the location of the primary range axis and sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeAxisLocation(AxisLocation location,
boolean notify)
Sets the location of the primary range axis and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeAxisLocation(int index,
AxisLocation location)
Sets the location for a range axis and sends a
PlotChangeEvent
to all registered listeners. |
void |
setRangeAxisLocation(int index,
AxisLocation location,
boolean notify)
Sets the axis location for a domain axis and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeCrosshairLockedOnData(boolean flag)
Sets the flag indicating whether or not the range crosshair should
"lock-on" to actual data values.
|
void |
setRangeCrosshairPaint(Paint paint)
Sets the paint used to color the crosshairs (if visible) and sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeCrosshairStroke(Stroke stroke)
Sets the stroke used to draw the crosshairs (if visible) and sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeCrosshairValue(double value)
Sets the range crosshair value.
|
void |
setRangeCrosshairValue(double value,
boolean notify)
Sets the range crosshair value and sends a
PlotChangeEvent to
all registered listeners, but only if the crosshair is visible. |
void |
setRangeCrosshairVisible(boolean flag)
Sets the flag indicating whether or not the range crosshair is visible.
|
void |
setRangeGridlinePaint(Paint paint)
Sets the paint for the grid lines plotted against the range axis and
sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeGridlineStroke(Stroke stroke)
Sets the stroke for the grid lines plotted against the range axis,
and sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the range axis grid lines
are visible.
|
void |
setRangeMinorGridlinePaint(Paint paint)
Sets the paint for the minor grid lines plotted against the range axis
and sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeMinorGridlineStroke(Stroke stroke)
Sets the stroke for the minor grid lines plotted against the range axis,
and sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeMinorGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the range axis minor grid
lines are visible.
|
void |
setRangePannable(boolean pannable)
Sets the flag that enables or disables panning of the plot along
the range axis/axes.
|
void |
setRangeTickBandPaint(Paint paint)
Sets the paint for the range tick bands.
|
void |
setRangeZeroBaselinePaint(Paint paint)
Sets the paint for the zero baseline plotted against the range axis and
sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeZeroBaselineStroke(Stroke stroke)
Sets the stroke for the zero baseline for the range axis,
and sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeZeroBaselineVisible(boolean visible)
Sets the flag that controls whether or not the zero baseline is
displayed for the range axis, and sends a
PlotChangeEvent to
all registered listeners. |
void |
setRenderer(int index,
XYItemRenderer renderer)
Sets the renderer for the dataset with the specified index and sends a
change event to all registered listeners.
|
void |
setRenderer(int index,
XYItemRenderer renderer,
boolean notify)
Sets the renderer for the dataset with the specified index and, if
requested, sends a change event to all registered listeners.
|
void |
setRenderer(XYItemRenderer renderer)
Sets the renderer for the primary dataset and sends a change event to
all registered listeners.
|
void |
setRenderers(XYItemRenderer[] renderers)
Sets the renderers for this plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
setSeriesRenderingOrder(SeriesRenderingOrder order)
Sets the series order and sends a
PlotChangeEvent to all
registered listeners. |
void |
setShadowGenerator(ShadowGenerator generator)
Sets the shadow generator for the plot and sends a
PlotChangeEvent to all registered listeners. |
void |
setWeight(int weight)
Sets the weight for the plot and sends a
PlotChangeEvent to all
registered listeners. |
void |
zoomDomainAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo info,
Point2D source)
Zooms in on the domain axis/axes.
|
void |
zoomDomainAxes(double factor,
PlotRenderingInfo info,
Point2D source)
Multiplies the range on the domain axis/axes by the specified factor.
|
void |
zoomDomainAxes(double factor,
PlotRenderingInfo info,
Point2D source,
boolean useAnchor)
Multiplies the range on the domain axis/axes by the specified factor.
|
void |
zoomRangeAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo info,
Point2D source)
Zooms in on the range axes.
|
void |
zoomRangeAxes(double factor,
PlotRenderingInfo info,
Point2D source)
Multiplies the range on the range axis/axes by the specified factor.
|
void |
zoomRangeAxes(double factor,
PlotRenderingInfo info,
Point2D source,
boolean useAnchor)
Multiplies the range on the range axis/axes by the specified factor.
|
addChangeListener, axisChanged, createAndAddEntity, drawBackgroundImage, drawNoDataMessage, drawOutline, fetchElementHintingFlag, fillBackground, fillBackground, fireChangeEvent, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getChart, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRectX, getRectY, getRootPlot, isNotify, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setChart, setDatasetGroup, setDrawingSupplier, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setNotify, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParent, zoom
public static final Stroke DEFAULT_GRIDLINE_STROKE
public static final Paint DEFAULT_GRIDLINE_PAINT
public static final boolean DEFAULT_CROSSHAIR_VISIBLE
public static final Stroke DEFAULT_CROSSHAIR_STROKE
public static final Paint DEFAULT_CROSSHAIR_PAINT
protected static ResourceBundle localizationResources
public XYPlot()
XYPlot
instance with no dataset, no axes and
no renderer. You should specify these items before using the plot.public XYPlot(XYDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, XYItemRenderer renderer)
null
, but in that case you should
take care to specify the value before using the plot (otherwise a
NullPointerException
may be thrown).dataset
- the dataset (null
permitted).domainAxis
- the domain axis (null
permitted).rangeAxis
- the range axis (null
permitted).renderer
- the renderer (null
permitted).public String getPlotType()
getPlotType
in class Plot
public PlotOrientation getOrientation()
getOrientation
in interface Pannable
getOrientation
in interface Zoomable
null
).setOrientation(PlotOrientation)
public void setOrientation(PlotOrientation orientation)
PlotChangeEvent
to
all registered listeners.orientation
- the orientation (null
not allowed).getOrientation()
public RectangleInsets getAxisOffset()
null
).setAxisOffset(RectangleInsets)
public void setAxisOffset(RectangleInsets offset)
PlotChangeEvent
to all registered listeners.offset
- the offset (null
not permitted).getAxisOffset()
public ValueAxis getDomainAxis()
null
, then the method will return the parent plot's
domain axis (if there is a parent plot).null
).getDomainAxis(int)
,
setDomainAxis(ValueAxis)
public ValueAxis getDomainAxis(int index)
null
if
there is no axis with that index.index
- the axis index.null
possible).setDomainAxis(int, ValueAxis)
public void setDomainAxis(ValueAxis axis)
PlotChangeEvent
to all registered listeners.axis
- the new axis (null
permitted).getDomainAxis()
,
setDomainAxis(int, ValueAxis)
public void setDomainAxis(int index, ValueAxis axis)
PlotChangeEvent
to all
registered listeners.index
- the axis index.axis
- the axis (null
permitted).getDomainAxis(int)
,
setRangeAxis(int, ValueAxis)
public void setDomainAxis(int index, ValueAxis axis, boolean notify)
PlotChangeEvent
to
all registered listeners.index
- the axis index.axis
- the axis.notify
- notify listeners?getDomainAxis(int)
public void setDomainAxes(ValueAxis[] axes)
PlotChangeEvent
to all registered listeners.axes
- the axes (null
not permitted).setRangeAxes(ValueAxis[])
public AxisLocation getDomainAxisLocation()
null
).setDomainAxisLocation(AxisLocation)
public void setDomainAxisLocation(AxisLocation location)
PlotChangeEvent
to all registered listeners.location
- the location (null
not permitted).getDomainAxisLocation()
public void setDomainAxisLocation(AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.location
- the location (null
not permitted).notify
- notify listeners?getDomainAxisLocation()
public RectangleEdge getDomainAxisEdge()
getDomainAxisLocation()
,
getOrientation()
public int getDomainAxisCount()
getRangeAxisCount()
public void clearDomainAxes()
PlotChangeEvent
to all registered listeners.clearRangeAxes()
public void configureDomainAxes()
public AxisLocation getDomainAxisLocation(int index)
index
- the axis index (must be >= 0).null
).setDomainAxisLocation(int, AxisLocation)
public void setDomainAxisLocation(int index, AxisLocation location)
PlotChangeEvent
to all registered listeners.index
- the axis index.location
- the location (null
not permitted for index
0).getDomainAxisLocation(int)
public void setDomainAxisLocation(int index, AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.index
- the axis index (must be >= 0).location
- the location (null
not permitted for
index 0).notify
- notify listeners?getDomainAxisLocation(int)
,
setRangeAxisLocation(int, AxisLocation, boolean)
public RectangleEdge getDomainAxisEdge(int index)
index
- the axis index.getRangeAxisEdge(int)
public ValueAxis getRangeAxis()
null
, then the method will return the parent plot's range
axis (if there is a parent plot).getRangeAxis(int)
,
setRangeAxis(ValueAxis)
public void setRangeAxis(ValueAxis axis)
PlotChangeEvent
to
all registered listeners.axis
- the axis (null
permitted).getRangeAxis()
,
setRangeAxis(int, ValueAxis)
public AxisLocation getRangeAxisLocation()
null
).setRangeAxisLocation(AxisLocation)
public void setRangeAxisLocation(AxisLocation location)
PlotChangeEvent
to all registered listeners.location
- the location (null
not permitted).getRangeAxisLocation()
public void setRangeAxisLocation(AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.location
- the location (null
not permitted).notify
- notify listeners?getRangeAxisLocation()
public RectangleEdge getRangeAxisEdge()
getRangeAxisLocation()
,
getOrientation()
public ValueAxis getRangeAxis(int index)
null
if
there is no axis with that index.index
- the axis index (must be >= 0).null
possible).setRangeAxis(int, ValueAxis)
public void setRangeAxis(int index, ValueAxis axis)
PlotChangeEvent
to all registered
listeners.index
- the axis index.axis
- the axis (null
permitted).getRangeAxis(int)
public void setRangeAxis(int index, ValueAxis axis, boolean notify)
PlotChangeEvent
to
all registered listeners.index
- the axis index.axis
- the axis (null
permitted).notify
- notify listeners?getRangeAxis(int)
public void setRangeAxes(ValueAxis[] axes)
PlotChangeEvent
to all registered listeners.axes
- the axes (null
not permitted).setDomainAxes(ValueAxis[])
public int getRangeAxisCount()
getDomainAxisCount()
public void clearRangeAxes()
PlotChangeEvent
to all registered listeners.clearDomainAxes()
public void configureRangeAxes()
configureDomainAxes()
public AxisLocation getRangeAxisLocation(int index)
index
- the axis index (must be >= 0).null
).setRangeAxisLocation(int, AxisLocation)
public void setRangeAxisLocation(int index, AxisLocation location)
PlotChangeEvent
to all registered listeners.index
- the axis index.location
- the location (null
permitted).getRangeAxisLocation(int)
public void setRangeAxisLocation(int index, AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.index
- the axis index.location
- the location (null
not permitted for
index 0).notify
- notify listeners?getRangeAxisLocation(int)
,
setDomainAxisLocation(int, AxisLocation, boolean)
public RectangleEdge getRangeAxisEdge(int index)
index
- the axis index.getRangeAxisLocation(int)
,
getOrientation()
public XYDataset getDataset()
null
).getDataset(int)
,
setDataset(XYDataset)
public XYDataset getDataset(int index)
null
if there
is no dataset with that index.index
- the dataset index (must be >= 0).null
).setDataset(int, XYDataset)
public void setDataset(XYDataset dataset)
dataset
- the dataset (null
permitted).getDataset()
,
setDataset(int, XYDataset)
public void setDataset(int index, XYDataset dataset)
index
- the dataset index (must be >= 0).dataset
- the dataset (null
permitted).getDataset(int)
public int getDatasetCount()
public int indexOf(XYDataset dataset)
-1
if the
dataset does not belong to the plot.dataset
- the dataset (null
not permitted).public void mapDatasetToDomainAxis(int index, int axisIndex)
index
- the dataset index (zero-based).axisIndex
- the axis index.mapDatasetToRangeAxis(int, int)
public void mapDatasetToDomainAxes(int index, List axisIndices)
index
- the dataset index (zero-based).axisIndices
- the axis indices (null
permitted).public void mapDatasetToRangeAxis(int index, int axisIndex)
index
- the dataset index (zero-based).axisIndex
- the axis index.mapDatasetToDomainAxis(int, int)
public void mapDatasetToRangeAxes(int index, List axisIndices)
index
- the dataset index (zero-based).axisIndices
- the axis indices (null
permitted).public int getRendererCount()
public XYItemRenderer getRenderer()
null
).setRenderer(XYItemRenderer)
public XYItemRenderer getRenderer(int index)
null
.index
- the renderer index (must be >= 0).null
).setRenderer(int, XYItemRenderer)
public void setRenderer(XYItemRenderer renderer)
null
,
no data will be displayed.renderer
- the renderer (null
permitted).getRenderer()
public void setRenderer(int index, XYItemRenderer renderer)
index
- the index (must be >= 0).renderer
- the renderer.getRenderer(int)
public void setRenderer(int index, XYItemRenderer renderer, boolean notify)
index
- the index (must be >= 0).renderer
- the renderer.notify
- notify listeners?getRenderer(int)
public void setRenderers(XYItemRenderer[] renderers)
PlotChangeEvent
to all registered listeners.renderers
- the renderers (null
not permitted).public DatasetRenderingOrder getDatasetRenderingOrder()
null
).setDatasetRenderingOrder(DatasetRenderingOrder)
public void setDatasetRenderingOrder(DatasetRenderingOrder order)
PlotChangeEvent
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.order
- the rendering order (null
not permitted).getDatasetRenderingOrder()
public SeriesRenderingOrder getSeriesRenderingOrder()
null
).setSeriesRenderingOrder(SeriesRenderingOrder)
public void setSeriesRenderingOrder(SeriesRenderingOrder order)
PlotChangeEvent
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.order
- the rendering order (null
not permitted).getSeriesRenderingOrder()
public int getIndexOf(XYItemRenderer renderer)
-1
if the
renderer is not assigned to this plot.renderer
- the renderer (null
permitted).public XYItemRenderer getRendererForDataset(XYDataset dataset)
null
.dataset
- the dataset (null
permitted).null
).public int getWeight()
setWeight(int)
public void setWeight(int weight)
PlotChangeEvent
to all
registered listeners.weight
- the weight.getWeight()
public boolean isDomainGridlinesVisible()
true
if the domain gridlines are visible, and
false
otherwise.true
or false
.setDomainGridlinesVisible(boolean)
public void setDomainGridlinesVisible(boolean visible)
If the flag value is changed, a PlotChangeEvent
is sent to all
registered listeners.
visible
- the new value of the flag.isDomainGridlinesVisible()
public boolean isDomainMinorGridlinesVisible()
true
if the domain minor gridlines are visible, and
false
otherwise.true
or false
.setDomainMinorGridlinesVisible(boolean)
public void setDomainMinorGridlinesVisible(boolean visible)
If the flag value is changed, a PlotChangeEvent
is sent to all
registered listeners.
visible
- the new value of the flag.isDomainMinorGridlinesVisible()
public Stroke getDomainGridlineStroke()
null
).setDomainGridlineStroke(Stroke)
public void setDomainGridlineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).IllegalArgumentException
- if stroke
is
null
.getDomainGridlineStroke()
public Stroke getDomainMinorGridlineStroke()
null
).setDomainMinorGridlineStroke(Stroke)
public void setDomainMinorGridlineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).IllegalArgumentException
- if stroke
is
null
.getDomainMinorGridlineStroke()
public Paint getDomainGridlinePaint()
null
).setDomainGridlinePaint(Paint)
public void setDomainGridlinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).IllegalArgumentException
- if Paint
is
null
.getDomainGridlinePaint()
public Paint getDomainMinorGridlinePaint()
null
).setDomainMinorGridlinePaint(Paint)
public void setDomainMinorGridlinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).IllegalArgumentException
- if Paint
is
null
.getDomainMinorGridlinePaint()
public boolean isRangeGridlinesVisible()
true
if the range axis grid is visible, and
false
otherwise.setRangeGridlinesVisible(boolean)
public void setRangeGridlinesVisible(boolean visible)
If the flag value is changed, a PlotChangeEvent
is sent to all
registered listeners.
visible
- the new value of the flag.isRangeGridlinesVisible()
public Stroke getRangeGridlineStroke()
null
).setRangeGridlineStroke(Stroke)
public void setRangeGridlineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getRangeGridlineStroke()
public Paint getRangeGridlinePaint()
null
).setRangeGridlinePaint(Paint)
public void setRangeGridlinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getRangeGridlinePaint()
public boolean isRangeMinorGridlinesVisible()
true
if the range axis minor grid is visible, and
false
otherwise.setRangeMinorGridlinesVisible(boolean)
public void setRangeMinorGridlinesVisible(boolean visible)
If the flag value is changed, a PlotChangeEvent
is sent to all
registered listeners.
visible
- the new value of the flag.isRangeMinorGridlinesVisible()
public Stroke getRangeMinorGridlineStroke()
null
).setRangeMinorGridlineStroke(Stroke)
public void setRangeMinorGridlineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getRangeMinorGridlineStroke()
public Paint getRangeMinorGridlinePaint()
null
).setRangeMinorGridlinePaint(Paint)
public void setRangeMinorGridlinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getRangeMinorGridlinePaint()
public boolean isDomainZeroBaselineVisible()
setDomainZeroBaselineVisible(boolean)
public void setDomainZeroBaselineVisible(boolean visible)
PlotChangeEvent
to
all registered listeners.visible
- the flag.isDomainZeroBaselineVisible()
public Stroke getDomainZeroBaselineStroke()
null
).setDomainZeroBaselineStroke(Stroke)
public void setDomainZeroBaselineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getRangeZeroBaselineStroke()
public Paint getDomainZeroBaselinePaint()
null
).setDomainZeroBaselinePaint(Paint)
public void setDomainZeroBaselinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getDomainZeroBaselinePaint()
public boolean isRangeZeroBaselineVisible()
setRangeZeroBaselineVisible(boolean)
public void setRangeZeroBaselineVisible(boolean visible)
PlotChangeEvent
to
all registered listeners.visible
- the flag.isRangeZeroBaselineVisible()
public Stroke getRangeZeroBaselineStroke()
null
).setRangeZeroBaselineStroke(Stroke)
public void setRangeZeroBaselineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getRangeZeroBaselineStroke()
public Paint getRangeZeroBaselinePaint()
null
).setRangeZeroBaselinePaint(Paint)
public void setRangeZeroBaselinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getRangeZeroBaselinePaint()
public Paint getDomainTickBandPaint()
null
, no tick bands will be drawn.null
).setDomainTickBandPaint(Paint)
public void setDomainTickBandPaint(Paint paint)
paint
- the paint (null
permitted).getDomainTickBandPaint()
public Paint getRangeTickBandPaint()
null
, no tick bands will be drawn.null
).setRangeTickBandPaint(Paint)
public void setRangeTickBandPaint(Paint paint)
paint
- the paint (null
permitted).getRangeTickBandPaint()
public Point2D getQuadrantOrigin()
null
).setQuadrantOrigin(Point2D)
public void setQuadrantOrigin(Point2D origin)
PlotChangeEvent
to all
registered listeners.origin
- the origin (null
not permitted).getQuadrantOrigin()
public Paint getQuadrantPaint(int index)
index
- the quadrant index (0-3).null
).setQuadrantPaint(int, Paint)
public void setQuadrantPaint(int index, Paint paint)
PlotChangeEvent
to all registered listeners.index
- the quadrant index (0-3).paint
- the paint (null
permitted).getQuadrantPaint(int)
public void addDomainMarker(Marker marker)
PlotChangeEvent
to all registered listeners.
Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer.
marker
- the marker (null
not permitted).addDomainMarker(Marker, Layer)
,
clearDomainMarkers()
public void addDomainMarker(Marker marker, Layer layer)
PlotChangeEvent
to all registered listeners.
Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer.
marker
- the marker (null
not permitted).layer
- the layer (foreground or background).addDomainMarker(int, Marker, Layer)
public void clearDomainMarkers()
PlotChangeEvent
to all registered listeners.addDomainMarker(int, Marker, Layer)
public void clearDomainMarkers(int index)
PlotChangeEvent
to all registered listeners.index
- the renderer index.clearRangeMarkers(int)
public void addDomainMarker(int index, Marker marker, Layer layer)
PlotChangeEvent
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.
index
- the dataset/renderer index.marker
- the marker.layer
- the layer (foreground or background).clearDomainMarkers(int)
,
addRangeMarker(int, Marker, Layer)
public void addDomainMarker(int index, Marker marker, Layer layer, boolean notify)
PlotChangeEvent
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.
index
- the dataset/renderer index.marker
- the marker.layer
- the layer (foreground or background).notify
- notify listeners?public boolean removeDomainMarker(Marker marker)
PlotChangeEvent
to all registered listeners.marker
- the marker.public boolean removeDomainMarker(Marker marker, Layer layer)
PlotChangeEvent
to all registered listeners.marker
- the marker (null
not permitted).layer
- the layer (foreground or background).public boolean removeDomainMarker(int index, Marker marker, Layer layer)
PlotChangeEvent
to all registered listeners.index
- the dataset/renderer index.marker
- the marker.layer
- the layer (foreground or background).public boolean removeDomainMarker(int index, Marker marker, Layer layer, boolean notify)
PlotChangeEvent
to all registered listeners.index
- the dataset/renderer index.marker
- the marker.layer
- the layer (foreground or background).notify
- notify listeners?public void addRangeMarker(Marker marker)
PlotChangeEvent
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.
marker
- the marker (null
not permitted).addRangeMarker(Marker, Layer)
public void addRangeMarker(Marker marker, Layer layer)
PlotChangeEvent
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.
marker
- the marker (null
not permitted).layer
- the layer (foreground or background).addRangeMarker(int, Marker, Layer)
public void clearRangeMarkers()
PlotChangeEvent
to all
registered listeners.clearRangeMarkers()
public void addRangeMarker(int index, Marker marker, Layer layer)
PlotChangeEvent
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.
index
- the dataset/renderer index.marker
- the marker.layer
- the layer (foreground or background).clearRangeMarkers(int)
,
addDomainMarker(int, Marker, Layer)
public void addRangeMarker(int index, Marker marker, Layer layer, boolean notify)
PlotChangeEvent
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.
index
- the dataset/renderer index.marker
- the marker.layer
- the layer (foreground or background).notify
- notify listeners?public void clearRangeMarkers(int index)
index
- the renderer index.public boolean removeRangeMarker(Marker marker)
PlotChangeEvent
to all registered listeners.marker
- the marker.public boolean removeRangeMarker(Marker marker, Layer layer)
PlotChangeEvent
to all registered listeners.marker
- the marker (null
not permitted).layer
- the layer (foreground or background).public boolean removeRangeMarker(int index, Marker marker, Layer layer)
PlotChangeEvent
to all registered listeners.index
- the dataset/renderer index.marker
- the marker (null
not permitted).layer
- the layer (foreground or background).public boolean removeRangeMarker(int index, Marker marker, Layer layer, boolean notify)
PlotChangeEvent
to all registered listeners.index
- the dataset/renderer index.marker
- the marker (null
not permitted).layer
- the layer (foreground or background) (null
not permitted).notify
- notify listeners?public void addAnnotation(XYAnnotation annotation)
PlotChangeEvent
to
all registered listeners.annotation
- the annotation (null
not permitted).getAnnotations()
,
removeAnnotation(XYAnnotation)
public void addAnnotation(XYAnnotation annotation, boolean notify)
PlotChangeEvent
to all registered listeners.annotation
- the annotation (null
not permitted).notify
- notify listeners?public boolean removeAnnotation(XYAnnotation annotation)
PlotChangeEvent
to all registered listeners.annotation
- the annotation (null
not permitted).addAnnotation(XYAnnotation)
,
getAnnotations()
public boolean removeAnnotation(XYAnnotation annotation, boolean notify)
PlotChangeEvent
to all registered listeners.annotation
- the annotation (null
not permitted).notify
- notify listeners?public List getAnnotations()
addAnnotation(XYAnnotation)
public void clearAnnotations()
PlotChangeEvent
to all
registered listeners.addAnnotation(XYAnnotation)
public ShadowGenerator getShadowGenerator()
null
).public void setShadowGenerator(ShadowGenerator generator)
PlotChangeEvent
to all registered listeners.generator
- the generator (null
permitted).protected AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea)
g2
- the graphics device.plotArea
- the plot area.protected AxisSpace calculateDomainAxisSpace(Graphics2D g2, Rectangle2D plotArea, AxisSpace space)
g2
- the graphics device.plotArea
- the plot area.space
- a carrier for the result (null
permitted).protected AxisSpace calculateRangeAxisSpace(Graphics2D g2, Rectangle2D plotArea, AxisSpace space)
g2
- the graphics device.plotArea
- the plot area.space
- a carrier for the result (null
permitted).public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)
draw
in class Plot
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 drawBackground(Graphics2D g2, Rectangle2D area)
drawBackground
in class Plot
g2
- the graphics device.area
- the area.protected void drawQuadrants(Graphics2D g2, Rectangle2D area)
g2
- the graphics device.area
- the area.setQuadrantOrigin(Point2D)
,
setQuadrantPaint(int, Paint)
public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks)
g2
- the graphics device.dataArea
- the data area.ticks
- the ticks.setDomainTickBandPaint(Paint)
public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks)
g2
- the graphics device.dataArea
- the data area.ticks
- the ticks.setRangeTickBandPaint(Paint)
protected Map<Axis,AxisState> drawAxes(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, PlotRenderingInfo plotState)
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).public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CrosshairState crosshairState)
The info
and crosshairState
arguments may be
null
.
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).public ValueAxis getDomainAxisForDataset(int index)
index
- the dataset index (must be >= 0).public ValueAxis getRangeAxisForDataset(int index)
index
- the dataset index (must be >= 0).protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks)
g2
- the graphics device.dataArea
- the data area.ticks
- the ticks.drawRangeGridlines(Graphics2D, Rectangle2D, List)
protected void drawRangeGridlines(Graphics2D g2, Rectangle2D area, List ticks)
g2
- the graphics device.area
- the data area.ticks
- the ticks.drawDomainGridlines(Graphics2D, Rectangle2D, List)
protected void drawZeroDomainBaseline(Graphics2D g2, Rectangle2D area)
g2
- the graphics device.area
- the data area.setDomainZeroBaselineVisible(boolean)
protected void drawZeroRangeBaseline(Graphics2D g2, Rectangle2D area)
g2
- the graphics device.area
- the data area.setRangeZeroBaselineVisible(boolean)
public void drawAnnotations(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info)
g2
- the graphics device.dataArea
- the data area.info
- the chart rendering info.protected void drawDomainMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer)
g2
- the graphics device.dataArea
- the data area.index
- the dataset/renderer index.layer
- the layer (foreground or background).protected void drawRangeMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer)
g2
- the graphics device.dataArea
- the data area.index
- the renderer index.layer
- the layer (foreground or background).public Collection getDomainMarkers(Layer layer)
layer
- the layer (foreground or background).getRangeMarkers(Layer)
public Collection getRangeMarkers(Layer layer)
layer
- the layer (foreground or background).getDomainMarkers(Layer)
public Collection getDomainMarkers(int index, Layer layer)
index
- the renderer index.layer
- the layer.null
).getRangeMarkers(int, Layer)
public Collection getRangeMarkers(int index, Layer layer)
index
- the renderer index.layer
- the layer.null
).getDomainMarkers(int, Layer)
protected void drawHorizontalLine(Graphics2D g2, Rectangle2D dataArea, double value, Stroke stroke, Paint paint)
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 drawDomainCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, double value, ValueAxis axis, Stroke stroke, Paint paint)
g2
- the graphics target.dataArea
- the data area.orientation
- the plot orientation.value
- the crosshair value.axis
- the axis against which the value is measured.stroke
- the stroke used to draw the crosshair line.paint
- the paint used to draw the crosshair line.protected void drawVerticalLine(Graphics2D g2, Rectangle2D dataArea, double value, Stroke stroke, Paint paint)
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 drawRangeCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, double value, ValueAxis axis, Stroke stroke, Paint paint)
g2
- the graphics target.dataArea
- the data area.orientation
- the plot orientation.value
- the crosshair value.axis
- the axis against which the value is measured.stroke
- the stroke used to draw the crosshair line.paint
- the paint used to draw the crosshair line.public void handleClick(int x, int y, PlotRenderingInfo info)
handleClick
in class Plot
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 getDomainAxisIndex(ValueAxis axis)
axis
- the axis.getRangeAxisIndex(ValueAxis)
public int getRangeAxisIndex(ValueAxis axis)
axis
- the axis.getDomainAxisIndex(ValueAxis)
public Range getDataRange(ValueAxis axis)
getDataRange
in interface ValueAxisPlot
axis
- the axis.public void annotationChanged(AnnotationChangeEvent event)
Annotation
added to
this plot.annotationChanged
in interface AnnotationChangeListener
annotationChanged
in class Plot
event
- information about the event (not used here).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)
rendererChanged
in interface RendererChangeListener
event
- the event.public boolean isDomainCrosshairVisible()
setDomainCrosshairVisible(boolean)
public void setDomainCrosshairVisible(boolean flag)
PlotChangeEvent
to all
registered listeners.flag
- the new value of the flag.isDomainCrosshairVisible()
public boolean isDomainCrosshairLockedOnData()
setDomainCrosshairLockedOnData(boolean)
public void setDomainCrosshairLockedOnData(boolean flag)
PlotChangeEvent
to all registered listeners.flag
- the flag.isDomainCrosshairLockedOnData()
public double getDomainCrosshairValue()
setDomainCrosshairValue(double)
public void setDomainCrosshairValue(double value)
PlotChangeEvent
to
all registered listeners (provided that the domain crosshair is visible).value
- the value.getDomainCrosshairValue()
public void setDomainCrosshairValue(double value, boolean notify)
PlotChangeEvent
to all registered listeners (provided that the
domain crosshair is visible).value
- the new value.notify
- notify listeners?getDomainCrosshairValue()
public Stroke getDomainCrosshairStroke()
Stroke
used to draw the crosshair (if visible).null
).setDomainCrosshairStroke(Stroke)
,
isDomainCrosshairVisible()
,
getDomainCrosshairPaint()
public void setDomainCrosshairStroke(Stroke stroke)
stroke
- the new crosshair stroke (null
not
permitted).getDomainCrosshairStroke()
public Paint getDomainCrosshairPaint()
null
).setDomainCrosshairPaint(Paint)
,
isDomainCrosshairVisible()
,
getDomainCrosshairStroke()
public void setDomainCrosshairPaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the new crosshair paint (null
not permitted).getDomainCrosshairPaint()
public boolean isRangeCrosshairVisible()
setRangeCrosshairVisible(boolean)
,
isDomainCrosshairVisible()
public void setRangeCrosshairVisible(boolean flag)
PlotChangeEvent
to all registered listeners.flag
- the new value of the flag.isRangeCrosshairVisible()
public boolean isRangeCrosshairLockedOnData()
setRangeCrosshairLockedOnData(boolean)
public void setRangeCrosshairLockedOnData(boolean flag)
PlotChangeEvent
to all registered listeners.flag
- the flag.isRangeCrosshairLockedOnData()
public double getRangeCrosshairValue()
setRangeCrosshairValue(double)
public void setRangeCrosshairValue(double value)
Registered listeners are notified that the plot has been modified, but only if the crosshair is visible.
value
- the new value.getRangeCrosshairValue()
public void setRangeCrosshairValue(double value, boolean notify)
PlotChangeEvent
to
all registered listeners, but only if the crosshair is visible.value
- the new value.notify
- a flag that controls whether or not listeners are
notified.getRangeCrosshairValue()
public Stroke getRangeCrosshairStroke()
null
).setRangeCrosshairStroke(Stroke)
,
isRangeCrosshairVisible()
,
getRangeCrosshairPaint()
public void setRangeCrosshairStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the new crosshair stroke (null
not
permitted).getRangeCrosshairStroke()
public Paint getRangeCrosshairPaint()
null
).setRangeCrosshairPaint(Paint)
,
isRangeCrosshairVisible()
,
getRangeCrosshairStroke()
public void setRangeCrosshairPaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the new crosshair paint (null
not permitted).getRangeCrosshairPaint()
public AxisSpace getFixedDomainAxisSpace()
null
).setFixedDomainAxisSpace(AxisSpace)
public void setFixedDomainAxisSpace(AxisSpace space)
PlotChangeEvent
to
all registered listeners.space
- the space (null
permitted).getFixedDomainAxisSpace()
public void setFixedDomainAxisSpace(AxisSpace space, boolean notify)
PlotChangeEvent
to all registered listeners.space
- the space (null
permitted).notify
- notify listeners?getFixedDomainAxisSpace()
public AxisSpace getFixedRangeAxisSpace()
null
).setFixedRangeAxisSpace(AxisSpace)
public void setFixedRangeAxisSpace(AxisSpace space)
PlotChangeEvent
to
all registered listeners.space
- the space (null
permitted).getFixedRangeAxisSpace()
public void setFixedRangeAxisSpace(AxisSpace space, boolean notify)
PlotChangeEvent
to all registered listeners.space
- the space (null
permitted).notify
- notify listeners?getFixedRangeAxisSpace()
public boolean isDomainPannable()
true
if panning is enabled for the domain axes,
and false
otherwise.isDomainPannable
in interface Pannable
public void setDomainPannable(boolean pannable)
pannable
- the new flag value.public boolean isRangePannable()
true
if panning is enabled for the range axis/axes,
and false
otherwise. The default value is false
.isRangePannable
in interface Pannable
public void setRangePannable(boolean pannable)
pannable
- the new flag value.public void panDomainAxes(double percent, PlotRenderingInfo info, Point2D source)
panDomainAxes
in interface Pannable
percent
- the distance to pan (as a percentage of the axis length).info
- the plot infosource
- the source point where the pan action started.public void panRangeAxes(double percent, PlotRenderingInfo info, Point2D source)
panRangeAxes
in interface Pannable
percent
- the distance to pan (as a percentage of the axis length).info
- the plot infosource
- the source point where the pan action started.public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source)
zoomDomainAxes
in interface Zoomable
factor
- the zoom factor.info
- the plot rendering info.source
- the source point (in Java2D space).zoomRangeAxes(double, PlotRenderingInfo, Point2D)
public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
zoomDomainAxes
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?zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)
zoomDomainAxes
in interface Zoomable
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 (ignored).zoomRangeAxes(double, double, PlotRenderingInfo, Point2D)
public void zoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source)
zoomRangeAxes
in interface Zoomable
factor
- the zoom factor.info
- the plot rendering info.source
- the source point.zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
public void zoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
zoomRangeAxes
in interface Zoomable
factor
- the zoom factor.info
- the plot rendering info.source
- the source point.useAnchor
- a flag that controls whether or not the source point
is used for the zoom anchor.zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source)
zoomRangeAxes
in interface Zoomable
lowerPercent
- the lower bound.upperPercent
- the upper bound.info
- the plot rendering info.source
- the source point.zoomDomainAxes(double, double, PlotRenderingInfo, Point2D)
public boolean isDomainZoomable()
true
, indicating that the domain axis/axes for this
plot are zoomable.isDomainZoomable
in interface Zoomable
isRangeZoomable()
public boolean isRangeZoomable()
true
, indicating that the range axis/axes for this
plot are zoomable.isRangeZoomable
in interface Zoomable
isDomainZoomable()
public int getSeriesCount()
null
, the method returns 0.public LegendItemCollection getFixedLegendItems()
null
).setFixedLegendItems(LegendItemCollection)
public void setFixedLegendItems(LegendItemCollection items)
null
if you prefer the legend items to be created
automatically.items
- the legend items (null
permitted).getFixedLegendItems()
public LegendItemCollection getLegendItems()
getLegendItems
in interface LegendItemSource
getLegendItems
in class Plot
public boolean equals(Object obj)
public Object clone() throws CloneNotSupportedException
clone
in interface PublicCloneable
clone
in class Plot
CloneNotSupportedException
- this can occur if some component of
the plot cannot be cloned.Copyright © 2001–2017 JFree.org. All rights reserved.