public class CategoryPlot extends Plot implements ValueAxisPlot, Pannable, Zoomable, AnnotationChangeListener, RendererChangeListener, Cloneable, PublicCloneable, Serializable
CategoryDataset
and
renders each data item using a CategoryItemRenderer
.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 boolean |
DEFAULT_DOMAIN_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the domain
axis.
|
static Paint |
DEFAULT_GRIDLINE_PAINT
The default grid line paint.
|
static Stroke |
DEFAULT_GRIDLINE_STROKE
The default grid line stroke.
|
static boolean |
DEFAULT_RANGE_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the range
axis.
|
static Font |
DEFAULT_VALUE_LABEL_FONT
The default value label font.
|
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 |
---|
CategoryPlot()
Default constructor.
|
CategoryPlot(CategoryDataset dataset,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
CategoryItemRenderer renderer)
Creates a new plot.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(CategoryAnnotation annotation)
Adds an annotation to the plot and sends a
PlotChangeEvent to all
registered listeners. |
void |
addAnnotation(CategoryAnnotation annotation,
boolean notify)
Adds an annotation to the plot and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
addDomainMarker(CategoryMarker marker)
Adds a marker for display (in the foreground) against the domain axis and
sends a
PlotChangeEvent to all registered listeners. |
void |
addDomainMarker(CategoryMarker marker,
Layer layer)
Adds a marker for display against the domain axis and sends a
PlotChangeEvent to all registered listeners. |
void |
addDomainMarker(int index,
CategoryMarker marker,
Layer layer)
Adds a marker for display by a particular renderer and sends a
PlotChangeEvent to all registered listeners. |
void |
addDomainMarker(int index,
CategoryMarker marker,
Layer layer,
boolean notify)
Adds a marker for display by a particular renderer and, if requested,
sends a
PlotChangeEvent to all registered listeners. |
void |
addRangeMarker(int index,
Marker marker,
Layer layer)
Adds a marker for display by a particular renderer and sends a
PlotChangeEvent to all registered listeners. |
void |
addRangeMarker(int index,
Marker marker,
Layer layer,
boolean notify)
Adds a marker for display by a particular renderer and sends a
PlotChangeEvent to all registered listeners. |
void |
addRangeMarker(Marker marker)
Adds a marker for display (in the foreground) against the range axis and
sends a
PlotChangeEvent to all registered listeners. |
void |
addRangeMarker(Marker marker,
Layer layer)
Adds a marker for display against the range axis 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 the axes.
|
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 domain markers for the plot and sends a
PlotChangeEvent to all registered listeners. |
void |
clearDomainMarkers(int index)
Clears all the domain markers for the specified renderer.
|
void |
clearRangeAxes()
Clears the range axes from the plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
clearRangeMarkers()
Clears all the range markers for the plot and sends a
PlotChangeEvent to all registered listeners. |
void |
clearRangeMarkers(int index)
Clears all the range markers for the specified 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 state)
Draws the plot on a Java 2D graphics device (such as the screen or a
printer).
|
protected void |
drawAnnotations(Graphics2D g2,
Rectangle2D dataArea)
Draws the annotations.
|
protected Map |
drawAxes(Graphics2D g2,
Rectangle2D plotArea,
Rectangle2D dataArea,
PlotRenderingInfo plotState)
A utility method for drawing the plot's axes.
|
void |
drawBackground(Graphics2D g2,
Rectangle2D area)
Draws the plot background (the background color and/or image).
|
protected void |
drawDomainCrosshair(Graphics2D g2,
Rectangle2D dataArea,
PlotOrientation orientation,
int datasetIndex,
Comparable rowKey,
Comparable columnKey,
Stroke stroke,
Paint paint)
Draws a domain crosshair.
|
protected void |
drawDomainGridlines(Graphics2D g2,
Rectangle2D dataArea)
Draws the domain 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.
|
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 dataArea,
List ticks)
Draws the range gridlines for the plot, if they are visible.
|
protected void |
drawRangeLine(Graphics2D g2,
Rectangle2D dataArea,
double value,
Stroke stroke,
Paint paint)
Utility method for drawing a line perpendicular to the range axis (used
for crosshairs).
|
protected void |
drawRangeMarkers(Graphics2D g2,
Rectangle2D dataArea,
int index,
Layer layer)
Draws the range markers (if any) for an axis and layer.
|
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 the plot for equality with an arbitrary object.
|
double |
getAnchorValue()
Returns the anchor value.
|
List |
getAnnotations()
Returns the list of annotations.
|
RectangleInsets |
getAxisOffset()
Returns the axis offset.
|
List |
getCategories()
Returns a list of the categories in the plot's primary dataset.
|
List |
getCategoriesForAxis(CategoryAxis axis)
Returns a list of the categories that should be displayed for the
specified axis.
|
SortOrder |
getColumnRenderingOrder()
Returns the order in which the columns are rendered.
|
int |
getCrosshairDatasetIndex()
Returns the dataset index for the crosshair.
|
Range |
getDataRange(ValueAxis axis)
Returns the range of data values that will be plotted against the range
axis.
|
CategoryDataset |
getDataset()
Returns the primary dataset for the plot.
|
CategoryDataset |
getDataset(int index)
Returns the dataset with the given index, or
null if there is
no dataset. |
int |
getDatasetCount()
Returns the number of datasets.
|
DatasetRenderingOrder |
getDatasetRenderingOrder()
Returns the dataset rendering order.
|
CategoryAxis |
getDomainAxis()
Returns the domain axis for the plot.
|
CategoryAxis |
getDomainAxis(int index)
Returns a domain axis.
|
int |
getDomainAxisCount()
Returns the number of domain axes.
|
RectangleEdge |
getDomainAxisEdge()
Returns the domain axis edge.
|
RectangleEdge |
getDomainAxisEdge(int index)
Returns the edge for a domain axis.
|
CategoryAxis |
getDomainAxisForDataset(int index)
Returns the domain axis for a dataset.
|
int |
getDomainAxisIndex(CategoryAxis axis)
Returns the index of the specified axis, or
-1 if the axis
is not assigned to the plot. |
AxisLocation |
getDomainAxisLocation()
Returns the domain axis location for the primary domain axis.
|
AxisLocation |
getDomainAxisLocation(int index)
Returns the location for a domain axis.
|
Comparable |
getDomainCrosshairColumnKey()
Returns the column key for the domain crosshair.
|
Paint |
getDomainCrosshairPaint()
Returns the paint used to draw the domain crosshair.
|
Comparable |
getDomainCrosshairRowKey()
Returns the row key for the domain crosshair.
|
Stroke |
getDomainCrosshairStroke()
Returns the stroke used to draw the domain crosshair.
|
Paint |
getDomainGridlinePaint()
Returns the paint used to draw grid-lines against the domain axis.
|
CategoryAnchor |
getDomainGridlinePosition()
Returns the position used for the domain gridlines.
|
Stroke |
getDomainGridlineStroke()
Returns the stroke used to draw grid-lines 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.
|
boolean |
getDrawSharedDomainAxis()
Returns the flag that controls whether or not the shared domain axis is
drawn for each subplot.
|
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(CategoryItemRenderer 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 a string describing the type of plot.
|
ValueAxis |
getRangeAxis()
Returns the range axis for the plot.
|
ValueAxis |
getRangeAxis(int index)
Returns a range axis.
|
int |
getRangeAxisCount()
Returns the number of range axes.
|
RectangleEdge |
getRangeAxisEdge()
Returns the edge where the primary range axis is located.
|
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 specified axis, or
-1 if the axis
is not assigned to the plot. |
AxisLocation |
getRangeAxisLocation()
Returns the range axis location.
|
AxisLocation |
getRangeAxisLocation(int index)
Returns the location for a range axis.
|
Paint |
getRangeCrosshairPaint()
Returns the paint used to draw the range crosshair.
|
Stroke |
getRangeCrosshairStroke()
Returns the pen-style (
Stroke ) used to draw the crosshair
(if visible). |
double |
getRangeCrosshairValue()
Returns the range crosshair value.
|
Paint |
getRangeGridlinePaint()
Returns the paint used to draw the grid-lines against the range axis.
|
Stroke |
getRangeGridlineStroke()
Returns the stroke used to draw the grid-lines 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 |
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.
|
CategoryItemRenderer |
getRenderer()
Returns a reference to the renderer for the plot.
|
CategoryItemRenderer |
getRenderer(int index)
Returns the renderer at the given index.
|
int |
getRendererCount()
Returns the number of renderer slots for this plot.
|
CategoryItemRenderer |
getRendererForDataset(CategoryDataset dataset)
Returns the renderer for the specified dataset.
|
SortOrder |
getRowRenderingOrder()
Returns the order in which the rows should be rendered.
|
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 value.
|
int |
indexOf(CategoryDataset dataset)
Returns the index of the specified dataset, or
-1 if the
dataset does not belong to the plot. |
boolean |
isDomainCrosshairVisible()
Returns the flag that controls whether or not the domain crosshair is
displayed by the plot.
|
boolean |
isDomainGridlinesVisible()
Returns the flag that controls whether the domain grid-lines are visible.
|
boolean |
isDomainPannable()
Returns
false always, because the plot cannot be panned
along the domain axis/axes. |
boolean |
isDomainZoomable()
Returns
false to indicate that the domain axes are not
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 the flag that controls whether the range grid-lines are visible.
|
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 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 to indicate that the range axes 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(CategoryAnnotation annotation)
Removes an annotation from the plot and sends a
PlotChangeEvent
to all registered listeners. |
boolean |
removeAnnotation(CategoryAnnotation annotation,
boolean notify)
Removes an annotation from the plot and, if requested, 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,
CategoryCrosshairState crosshairState)
Draws a representation of a dataset within the dataArea region using the
appropriate renderer.
|
void |
rendererChanged(RendererChangeEvent event)
Receives notification of a renderer change event.
|
void |
setAnchorValue(double value)
Sets the anchor value and sends a
PlotChangeEvent to all
registered listeners. |
void |
setAnchorValue(double value,
boolean notify)
Sets the anchor value and, if requested, sends a
PlotChangeEvent
to all registered listeners. |
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 |
setColumnRenderingOrder(SortOrder order)
Sets the column order in which the items in each dataset should be
rendered and sends a
PlotChangeEvent to all registered
listeners. |
void |
setCrosshairDatasetIndex(int index)
Sets the dataset index for the crosshair and sends a
PlotChangeEvent to all registered listeners. |
void |
setCrosshairDatasetIndex(int index,
boolean notify)
Sets the dataset index for the crosshair and, if requested, sends a
PlotChangeEvent to all registered listeners. |
void |
setDataset(CategoryDataset dataset)
Sets the dataset for the plot, replacing the existing dataset, if there
is one.
|
void |
setDataset(int index,
CategoryDataset dataset)
Sets a dataset for the plot and sends a change notification to all
registered listeners.
|
void |
setDatasetRenderingOrder(DatasetRenderingOrder order)
Sets the rendering order and sends a
PlotChangeEvent to all
registered listeners. |
void |
setDomainAxes(CategoryAxis[] axes)
Sets the domain axes for this plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
setDomainAxis(CategoryAxis axis)
Sets the domain axis for the plot and sends a
PlotChangeEvent to
all registered listeners. |
void |
setDomainAxis(int index,
CategoryAxis axis)
Sets a domain axis and sends a
PlotChangeEvent to all
registered listeners. |
void |
setDomainAxis(int index,
CategoryAxis axis,
boolean notify)
Sets a domain axis and, if requested, sends a
PlotChangeEvent to
all registered listeners. |
void |
setDomainAxisLocation(AxisLocation location)
Sets the location of the 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 location for a domain axis and sends a
PlotChangeEvent
to all registered listeners. |
void |
setDomainCrosshairColumnKey(Comparable key)
Sets the column key for the domain crosshair and sends
a
PlotChangeEvent to all registered listeners. |
void |
setDomainCrosshairColumnKey(Comparable key,
boolean notify)
Sets the column key for the domain crosshair and, if requested, sends
a
PlotChangeEvent to all registered listeners. |
void |
setDomainCrosshairPaint(Paint paint)
Sets the paint used to draw the domain crosshair.
|
void |
setDomainCrosshairRowKey(Comparable key)
Sets the row key for the domain crosshair and sends a
{PlotChangeEvent} to all registered listeners.
|
void |
setDomainCrosshairRowKey(Comparable key,
boolean notify)
Sets the row key for the domain crosshair and, if requested, sends a
{PlotChangeEvent} to all registered listeners.
|
void |
setDomainCrosshairStroke(Stroke stroke)
Sets the stroke used to draw the domain crosshair, and sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainCrosshairVisible(boolean flag)
Sets the flag that controls whether or not the domain crosshair is
displayed by the plot, and sends a
PlotChangeEvent to all
registered listeners. |
void |
setDomainGridlinePaint(Paint paint)
Sets the paint used to draw the grid-lines (if any) against the domain
axis and sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainGridlinePosition(CategoryAnchor position)
Sets the position used for the domain gridlines and sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainGridlineStroke(Stroke stroke)
Sets the stroke used to draw grid-lines against the domain axis and
sends a
PlotChangeEvent to all registered listeners. |
void |
setDomainGridlinesVisible(boolean visible)
Sets the flag that controls whether or not grid-lines are drawn against
the domain axis.
|
void |
setDrawSharedDomainAxis(boolean draw)
Sets the flag that controls whether the shared domain axis is drawn when
this plot is being used as a subplot.
|
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 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 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 |
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 range axis and sends a
PlotChangeEvent
to all registered listeners. |
void |
setRangeAxisLocation(AxisLocation location,
boolean notify)
Sets the location of the 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 location for a range axis and 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, and sends a
PlotChangeEvent
to all registered listeners. |
void |
setRangeCrosshairPaint(Paint paint)
Sets the paint used to draw the range crosshair (if visible) and
sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeCrosshairStroke(Stroke stroke)
Sets the pen-style (
Stroke ) used to draw the range
crosshair (if visible), and sends a PlotChangeEvent to all
registered listeners. |
void |
setRangeCrosshairValue(double value)
Sets the range crosshair value and, if the crosshair is visible, sends
a
PlotChangeEvent to all registered listeners. |
void |
setRangeCrosshairValue(double value,
boolean notify)
Sets the range crosshair value and, if requested, 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 used to draw the grid lines against the range axis and
sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeGridlineStroke(Stroke stroke)
Sets the stroke used to draw the grid-lines against the range axis and
sends a
PlotChangeEvent to all registered listeners. |
void |
setRangeGridlinesVisible(boolean visible)
Sets the flag that controls whether or not grid-lines are drawn against
the range axis.
|
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 axes.
|
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(CategoryItemRenderer renderer)
Sets the renderer at index 0 (sometimes referred to as the "primary"
renderer) and sends a change event to all registered listeners.
|
void |
setRenderer(CategoryItemRenderer renderer,
boolean notify)
Sets the renderer at index 0 (sometimes referred to as the "primary"
renderer) and, if requested, sends a change event to all registered
listeners.
|
void |
setRenderer(int index,
CategoryItemRenderer renderer)
Sets the renderer to use for the dataset with the specified index and
sends a change event to all registered listeners.
|
void |
setRenderer(int index,
CategoryItemRenderer renderer,
boolean notify)
Sets the renderer to use for the dataset with the specified index and,
if requested, sends a change event to all registered listeners.
|
void |
setRenderers(CategoryItemRenderer[] renderers)
Sets the renderers for this plot and sends a
PlotChangeEvent
to all registered listeners. |
void |
setRowRenderingOrder(SortOrder order)
Sets the row order in which the items in each dataset should be
rendered 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 |
zoom(double percent)
Zooms (in or out) on the plot's value axis.
|
void |
zoomDomainAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo state,
Point2D source)
This method does nothing, because
CategoryPlot doesn't
support zooming on the domain. |
void |
zoomDomainAxes(double factor,
PlotRenderingInfo state,
Point2D source)
This method does nothing, because
CategoryPlot doesn't
support zooming on the domain. |
void |
zoomDomainAxes(double factor,
PlotRenderingInfo info,
Point2D source,
boolean useAnchor)
This method does nothing, because
CategoryPlot doesn't
support zooming on the domain. |
void |
zoomRangeAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo state,
Point2D source)
Zooms in on the range axes.
|
void |
zoomRangeAxes(double factor,
PlotRenderingInfo state,
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
public static final boolean DEFAULT_DOMAIN_GRIDLINES_VISIBLE
public static final boolean DEFAULT_RANGE_GRIDLINES_VISIBLE
public static final Stroke DEFAULT_GRIDLINE_STROKE
public static final Paint DEFAULT_GRIDLINE_PAINT
public static final Font DEFAULT_VALUE_LABEL_FONT
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 CategoryPlot()
public CategoryPlot(CategoryDataset dataset, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer)
dataset
- the dataset (null
permitted).domainAxis
- the domain axis (null
permitted).rangeAxis
- the range axis (null
permitted).renderer
- the item 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 permitted).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 CategoryAxis getDomainAxis()
null
, then the method will return the parent plot's
domain axis (if there is a parent plot).null
permitted).setDomainAxis(CategoryAxis)
public CategoryAxis getDomainAxis(int index)
index
- the axis index.null
possible).setDomainAxis(int, CategoryAxis)
public void setDomainAxis(CategoryAxis axis)
PlotChangeEvent
to
all registered listeners.axis
- the axis (null
permitted).getDomainAxis()
public void setDomainAxis(int index, CategoryAxis axis)
PlotChangeEvent
to all
registered listeners.index
- the axis index.axis
- the axis (null
permitted).getDomainAxis(int)
public void setDomainAxis(int index, CategoryAxis axis, boolean notify)
PlotChangeEvent
to
all registered listeners.index
- the axis index.axis
- the axis (null
permitted).notify
- notify listeners?public void setDomainAxes(CategoryAxis[] axes)
PlotChangeEvent
to all registered listeners.axes
- the axes (null
not permitted).setRangeAxes(ValueAxis[])
public int getDomainAxisIndex(CategoryAxis axis)
-1
if the axis
is not assigned to the plot.axis
- the axis (null
not permitted).getDomainAxis(int)
,
getRangeAxisIndex(ValueAxis)
public AxisLocation getDomainAxisLocation()
null
).getRangeAxisLocation()
public AxisLocation getDomainAxisLocation(int index)
index
- the axis index.setDomainAxisLocation(int, AxisLocation)
public void setDomainAxisLocation(AxisLocation location)
PlotChangeEvent
to all registered listeners.location
- the axis location (null
not permitted).getDomainAxisLocation()
,
setDomainAxisLocation(int, AxisLocation)
public void setDomainAxisLocation(AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.location
- the axis location (null
not permitted).notify
- a flag that controls whether listeners are notified.public void setDomainAxisLocation(int index, AxisLocation location)
PlotChangeEvent
to all registered listeners.index
- the axis index.location
- the location.getDomainAxisLocation(int)
,
setRangeAxisLocation(int, AxisLocation)
public void setDomainAxisLocation(int index, AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.index
- the axis index.location
- the location.notify
- notify listeners?getDomainAxisLocation(int)
,
setRangeAxisLocation(int, AxisLocation, boolean)
public RectangleEdge getDomainAxisEdge()
null
).public RectangleEdge getDomainAxisEdge(int index)
index
- the axis index.null
).public int getDomainAxisCount()
public void clearDomainAxes()
PlotChangeEvent
to all registered listeners.public void configureDomainAxes()
public ValueAxis getRangeAxis()
null
).public ValueAxis getRangeAxis(int index)
index
- the axis index.null
possible).public void setRangeAxis(ValueAxis axis)
PlotChangeEvent
to
all registered listeners.axis
- the axis (null
permitted).public void setRangeAxis(int index, ValueAxis axis)
PlotChangeEvent
to all registered
listeners.index
- the axis index.axis
- the axis.public void setRangeAxis(int index, ValueAxis axis, boolean notify)
PlotChangeEvent
to
all registered listeners.index
- the axis index.axis
- the axis.notify
- notify listeners?public void setRangeAxes(ValueAxis[] axes)
PlotChangeEvent
to all registered listeners.axes
- the axes (null
not permitted).setDomainAxes(CategoryAxis[])
public int getRangeAxisIndex(ValueAxis axis)
-1
if the axis
is not assigned to the plot.axis
- the axis (null
not permitted).getRangeAxis(int)
,
getDomainAxisIndex(CategoryAxis)
public AxisLocation getRangeAxisLocation()
null
).public AxisLocation getRangeAxisLocation(int index)
index
- the axis index.setRangeAxisLocation(int, AxisLocation)
public void setRangeAxisLocation(AxisLocation location)
PlotChangeEvent
to all registered listeners.location
- the location (null
not permitted).setRangeAxisLocation(AxisLocation, boolean)
,
setDomainAxisLocation(AxisLocation)
public void setRangeAxisLocation(AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.location
- the location (null
not permitted).notify
- notify listeners?setDomainAxisLocation(AxisLocation, boolean)
public void setRangeAxisLocation(int index, AxisLocation location)
PlotChangeEvent
to all registered listeners.index
- the axis index.location
- the location.getRangeAxisLocation(int)
,
setRangeAxisLocation(int, AxisLocation, boolean)
public void setRangeAxisLocation(int index, AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.index
- the axis index.location
- the location.notify
- notify listeners?getRangeAxisLocation(int)
,
setDomainAxisLocation(int, AxisLocation, boolean)
public RectangleEdge getRangeAxisEdge()
null
).public RectangleEdge getRangeAxisEdge(int index)
index
- the axis index.public int getRangeAxisCount()
public void clearRangeAxes()
PlotChangeEvent
to all registered listeners.public void configureRangeAxes()
public CategoryDataset getDataset()
null
).setDataset(CategoryDataset)
public CategoryDataset getDataset(int index)
null
if there is
no dataset.index
- the dataset index (must be >= 0).null
).setDataset(int, CategoryDataset)
public void setDataset(CategoryDataset dataset)
datasetChanged(DatasetChangeEvent)
method, which adjusts the
axis ranges if necessary and sends a PlotChangeEvent
to all
registered listeners.dataset
- the dataset (null
permitted).getDataset()
public void setDataset(int index, CategoryDataset dataset)
index
- the dataset index (must be >= 0).dataset
- the dataset (null
permitted).getDataset(int)
public int getDatasetCount()
public int indexOf(CategoryDataset 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 (zero-based).getDomainAxisForDataset(int)
public void mapDatasetToDomainAxes(int index, List axisIndices)
index
- the dataset index (zero-based).axisIndices
- the axis indices (null
permitted).public CategoryAxis getDomainAxisForDataset(int index)
mapDatasetToDomainAxis(int, int)
method.index
- the dataset index (must be >= 0).mapDatasetToDomainAxis(int, int)
public void mapDatasetToRangeAxis(int index, int axisIndex)
index
- the dataset index (zero-based).axisIndex
- the axis index (zero-based).getRangeAxisForDataset(int)
public void mapDatasetToRangeAxes(int index, List axisIndices)
index
- the dataset index (zero-based).axisIndices
- the axis indices (null
permitted).public ValueAxis getRangeAxisForDataset(int index)
mapDatasetToRangeAxis(int, int)
method.index
- the dataset index (must be >= 0).mapDatasetToRangeAxis(int, int)
public int getRendererCount()
public CategoryItemRenderer getRenderer()
setRenderer(CategoryItemRenderer)
public CategoryItemRenderer getRenderer(int index)
index
- the renderer index.null
).setRenderer(int, CategoryItemRenderer)
public void setRenderer(CategoryItemRenderer renderer)
renderer
- the renderer (null
permitted.getRenderer()
public void setRenderer(CategoryItemRenderer renderer, boolean notify)
You can set the renderer to null
, but this is not
recommended because:
renderer
- the renderer (null
permitted).notify
- notify listeners?getRenderer()
public void setRenderer(int index, CategoryItemRenderer renderer)
index
- the index.renderer
- the renderer (null
permitted).getRenderer(int)
,
setRenderer(int, CategoryItemRenderer, boolean)
public void setRenderer(int index, CategoryItemRenderer renderer, boolean notify)
index
- the index.renderer
- the renderer (null
permitted).notify
- notify listeners?getRenderer(int)
public void setRenderers(CategoryItemRenderer[] renderers)
PlotChangeEvent
to all registered listeners.renderers
- the renderers.public CategoryItemRenderer getRendererForDataset(CategoryDataset dataset)
null
.dataset
- the dataset (null
permitted).null
).public int getIndexOf(CategoryItemRenderer renderer)
-1
if the
renderer is not assigned to this plot.renderer
- the renderer (null
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 SortOrder getColumnRenderingOrder()
SortOrder.ASCENDING
.null
).setColumnRenderingOrder(SortOrder)
public void setColumnRenderingOrder(SortOrder order)
PlotChangeEvent
to all registered
listeners. Note that this affects the order in which items are drawn,
NOT their position in the chart.order
- the order (null
not permitted).getColumnRenderingOrder()
,
setRowRenderingOrder(SortOrder)
public SortOrder getRowRenderingOrder()
SortOrder.ASCENDING
.null
).setRowRenderingOrder(SortOrder)
public void setRowRenderingOrder(SortOrder order)
PlotChangeEvent
to all registered
listeners. Note that this affects the order in which items are drawn,
NOT their position in the chart.order
- the order (null
not permitted).getRowRenderingOrder()
,
setColumnRenderingOrder(SortOrder)
public boolean isDomainGridlinesVisible()
true
or false
.setDomainGridlinesVisible(boolean)
public void setDomainGridlinesVisible(boolean visible)
If the flag value changes, a PlotChangeEvent
is sent to all
registered listeners.
visible
- the new value of the flag.isDomainGridlinesVisible()
public CategoryAnchor getDomainGridlinePosition()
null
).setDomainGridlinePosition(CategoryAnchor)
public void setDomainGridlinePosition(CategoryAnchor position)
PlotChangeEvent
to all registered listeners.position
- the position (null
not permitted).getDomainGridlinePosition()
public Stroke getDomainGridlineStroke()
null
).setDomainGridlineStroke(Stroke)
public void setDomainGridlineStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getDomainGridlineStroke()
public Paint getDomainGridlinePaint()
null
).setDomainGridlinePaint(Paint)
public void setDomainGridlinePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getDomainGridlinePaint()
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 boolean isRangeGridlinesVisible()
setRangeGridlinesVisible(boolean)
public void setRangeGridlinesVisible(boolean visible)
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 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 void handleClick(int x, int y, PlotRenderingInfo info)
handleClick
in class Plot
x
- x-coordinate of the click (in Java2D space).y
- y-coordinate of the click (in Java2D space).info
- information about the plot's dimensions.public void zoom(double percent)
If the value 0.0 is passed in as the zoom percent, the auto-range calculation for the axis is restored (which sets the range to include the minimum and maximum data values, thus displaying all the data).
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 range axis bounds will be recalculated 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 void addDomainMarker(CategoryMarker 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).removeDomainMarker(Marker)
public void addDomainMarker(CategoryMarker 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) (null
not permitted).removeDomainMarker(Marker, Layer)
public void addDomainMarker(int index, CategoryMarker marker, Layer layer)
PlotChangeEvent
to all registered listeners.
Typically a marker will be drawn by the renderer as a line perpendicular to a domain axis, however this is entirely up to the renderer.
index
- the renderer index.marker
- the marker (null
not permitted).layer
- the layer (null
not permitted).removeDomainMarker(int, Marker, Layer)
public void addDomainMarker(int index, CategoryMarker marker, Layer layer, boolean notify)
PlotChangeEvent
to all registered listeners.
Typically a marker will be drawn by the renderer as a line perpendicular to a domain axis, however this is entirely up to the renderer.
index
- the renderer index.marker
- the marker (null
not permitted).layer
- the layer (null
not permitted).notify
- notify listeners?removeDomainMarker(int, Marker, Layer, boolean)
public void clearDomainMarkers()
PlotChangeEvent
to all registered listeners.clearRangeMarkers()
public Collection getDomainMarkers(Layer layer)
layer
- the layer (foreground or background).public Collection getDomainMarkers(int index, Layer layer)
index
- the renderer index.layer
- the layer.null
).public void clearDomainMarkers(int index)
index
- the renderer index.clearRangeMarkers(int)
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).removeRangeMarker(Marker)
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) (null
not permitted).removeRangeMarker(Marker, Layer)
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 a range axis, however this is entirely up to the renderer.
index
- the renderer index.marker
- the marker.layer
- the layer.removeRangeMarker(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 a range axis, however this is entirely up to the renderer.
index
- the renderer index.marker
- the marker.layer
- the layer.notify
- notify listeners?removeRangeMarker(int, Marker, Layer, boolean)
public void clearRangeMarkers()
PlotChangeEvent
to all registered listeners.clearDomainMarkers()
public Collection getRangeMarkers(Layer layer)
layer
- the layer (foreground or background).getRangeMarkers(int, Layer)
public Collection getRangeMarkers(int index, Layer layer)
index
- the renderer index.layer
- the layer.null
).public void clearRangeMarkers(int index)
index
- the renderer index.clearDomainMarkers(int)
public boolean removeRangeMarker(Marker marker)
PlotChangeEvent
to all registered listeners.marker
- the marker.addRangeMarker(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).addRangeMarker(Marker, Layer)
public boolean removeRangeMarker(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).addRangeMarker(int, Marker, Layer)
public boolean removeRangeMarker(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.addRangeMarker(int, Marker, Layer, boolean)
public boolean isDomainCrosshairVisible()
setDomainCrosshairVisible(boolean)
public void setDomainCrosshairVisible(boolean flag)
PlotChangeEvent
to all
registered listeners.flag
- the new flag value.isDomainCrosshairVisible()
,
setRangeCrosshairVisible(boolean)
public Comparable getDomainCrosshairRowKey()
public void setDomainCrosshairRowKey(Comparable key)
key
- the key.public void setDomainCrosshairRowKey(Comparable key, boolean notify)
key
- the key.notify
- notify listeners?public Comparable getDomainCrosshairColumnKey()
public void setDomainCrosshairColumnKey(Comparable key)
PlotChangeEvent
to all registered listeners.key
- the key.public void setDomainCrosshairColumnKey(Comparable key, boolean notify)
PlotChangeEvent
to all registered listeners.key
- the key.notify
- notify listeners?public int getCrosshairDatasetIndex()
public void setCrosshairDatasetIndex(int index)
PlotChangeEvent
to all registered listeners.index
- the index.public void setCrosshairDatasetIndex(int index, boolean notify)
PlotChangeEvent
to all registered listeners.index
- the index.notify
- notify listeners?public Paint getDomainCrosshairPaint()
null
).setDomainCrosshairPaint(Paint)
,
getDomainCrosshairStroke()
public void setDomainCrosshairPaint(Paint paint)
paint
- the paint (null
not permitted).getDomainCrosshairPaint()
public Stroke getDomainCrosshairStroke()
null
).setDomainCrosshairStroke(Stroke)
,
getDomainCrosshairPaint()
public void setDomainCrosshairStroke(Stroke stroke)
PlotChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getDomainCrosshairStroke()
public boolean isRangeCrosshairVisible()
setRangeCrosshairVisible(boolean)
public void setRangeCrosshairVisible(boolean flag)
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)
PlotChangeEvent
to all registered listeners.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()
Stroke
) used to draw the crosshair
(if visible).null
).setRangeCrosshairStroke(Stroke)
,
isRangeCrosshairVisible()
,
getRangeCrosshairPaint()
public void setRangeCrosshairStroke(Stroke stroke)
Stroke
) used to draw the range
crosshair (if visible), and sends a 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 paint (null
not permitted).getRangeCrosshairPaint()
public List getAnnotations()
null
).addAnnotation(CategoryAnnotation)
,
clearAnnotations()
public void addAnnotation(CategoryAnnotation annotation)
PlotChangeEvent
to all
registered listeners.annotation
- the annotation (null
not permitted).removeAnnotation(CategoryAnnotation)
public void addAnnotation(CategoryAnnotation annotation, boolean notify)
PlotChangeEvent
to all registered listeners.annotation
- the annotation (null
not permitted).notify
- notify listeners?public boolean removeAnnotation(CategoryAnnotation annotation)
PlotChangeEvent
to all registered listeners.annotation
- the annotation (null
not permitted).addAnnotation(CategoryAnnotation)
public boolean removeAnnotation(CategoryAnnotation annotation, boolean notify)
PlotChangeEvent
to all registered listeners.annotation
- the annotation (null
not permitted).notify
- notify listeners?public void clearAnnotations()
PlotChangeEvent
to all
registered listeners.public ShadowGenerator getShadowGenerator()
null
).public void setShadowGenerator(ShadowGenerator generator)
PlotChangeEvent
to all registered listeners.generator
- the generator (null
permitted).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).protected AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea)
g2
- the graphics device.plotArea
- the plot area.public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo state)
At your option, you may supply an instance of PlotRenderingInfo
.
If you do, it will be populated with information about the drawing,
including various plot dimensions and tooltip info.
draw
in class Plot
g2
- the graphics device.area
- the area within which the plot (including axes) should
be drawn.anchor
- the anchor point (null
permitted).parentState
- the state from the parent plot, if there is one.state
- collects info as the chart is drawn (possibly
null
).public void drawBackground(Graphics2D g2, Rectangle2D area)
This method will be called during the chart drawing process and is declared public so that it can be accessed by the renderers used by certain subclasses. You shouldn't need to call this method directly.
drawBackground
in class Plot
g2
- the graphics device.area
- the area within which the plot should be drawn.protected Map drawAxes(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, PlotRenderingInfo plotState)
g2
- the graphics device.plotArea
- the plot area.dataArea
- the data area.plotState
- collects information about the plot (null
permitted).public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CategoryCrosshairState crosshairState)
g2
- the graphics device.dataArea
- the region in which the data is to be drawn.index
- the dataset and renderer index.info
- an optional object for collection dimension information.crosshairState
- a state object for tracking crosshair info
(null
permitted).protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea)
g2
- the graphics device.dataArea
- the area inside the axes.drawRangeGridlines(Graphics2D, Rectangle2D, List)
protected void drawRangeGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks)
g2
- the graphics device (null
not permitted).dataArea
- the area inside the axes (null
not permitted).ticks
- the ticks.drawDomainGridlines(Graphics2D, Rectangle2D)
protected void drawZeroRangeBaseline(Graphics2D g2, Rectangle2D area)
g2
- the graphics device.area
- the data area.setRangeZeroBaselineVisible(boolean)
protected void drawAnnotations(Graphics2D g2, Rectangle2D dataArea)
g2
- the graphics device.dataArea
- the data area.protected void drawDomainMarkers(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).drawRangeMarkers(Graphics2D, Rectangle2D, int, Layer)
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).drawDomainMarkers(Graphics2D, Rectangle2D, int, Layer)
protected void drawRangeLine(Graphics2D g2, Rectangle2D dataArea, double value, Stroke stroke, Paint paint)
g2
- the graphics device.dataArea
- the area defined by the axes.value
- the data value.stroke
- the line stroke (null
not permitted).paint
- the line paint (null
not permitted).protected void drawDomainCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, int datasetIndex, Comparable rowKey, Comparable columnKey, Stroke stroke, Paint paint)
g2
- the graphics target.dataArea
- the data area.orientation
- the plot orientation.datasetIndex
- the dataset index.rowKey
- the row key.columnKey
- the column key.stroke
- the stroke used to draw the crosshair line.paint
- the paint used to draw the crosshair line.drawRangeCrosshair(Graphics2D, Rectangle2D, PlotOrientation,
double, ValueAxis, Stroke, Paint)
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.drawDomainCrosshair(Graphics2D, Rectangle2D, PlotOrientation, int,
Comparable, Comparable, Stroke, Paint)
public Range getDataRange(ValueAxis axis)
null
, this method returns
null
.getDataRange
in interface ValueAxisPlot
axis
- the axis.public int getWeight()
setWeight(int)
public void setWeight(int weight)
PlotChangeEvent
to all
registered listeners.weight
- the weight.getWeight()
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 List getCategories()
getCategoriesForAxis(CategoryAxis)
public List getCategoriesForAxis(CategoryAxis axis)
axis
- the axis (null
not permitted)public boolean getDrawSharedDomainAxis()
setDrawSharedDomainAxis(boolean)
public void setDrawSharedDomainAxis(boolean draw)
draw
- a boolean.getDrawSharedDomainAxis()
public boolean isDomainPannable()
false
always, because the plot cannot be panned
along the domain axis/axes.isDomainPannable
in interface Pannable
isRangePannable()
public boolean isRangePannable()
true
if panning is enabled for the range axes,
and false
otherwise.isRangePannable
in interface Pannable
setRangePannable(boolean)
,
isDomainPannable()
public void setRangePannable(boolean pannable)
pannable
- the new flag value.isRangePannable()
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 boolean isDomainZoomable()
false
to indicate that the domain axes are not
zoomable.isDomainZoomable
in interface Zoomable
isRangeZoomable()
public boolean isRangeZoomable()
true
to indicate that the range axes are zoomable.isRangeZoomable
in interface Zoomable
isDomainZoomable()
public void zoomDomainAxes(double factor, PlotRenderingInfo state, Point2D source)
CategoryPlot
doesn't
support zooming on the domain.zoomDomainAxes
in interface Zoomable
factor
- the zoom factor.state
- the plot state.source
- the source point (in Java2D space) for the zoom.Zoomable.zoomRangeAxes(double, PlotRenderingInfo, Point2D)
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
CategoryPlot
doesn't
support zooming on the domain.zoomDomainAxes
in interface Zoomable
lowerPercent
- the lower bound.upperPercent
- the upper bound.state
- the plot state.source
- the source point (in Java2D space) for the zoom.Zoomable.zoomRangeAxes(double, double, PlotRenderingInfo, Point2D)
public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
CategoryPlot
doesn't
support zooming on the domain.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 zoomRangeAxes(double factor, PlotRenderingInfo state, Point2D source)
zoomRangeAxes
in interface Zoomable
factor
- the zoom factor.state
- the plot state.source
- the source point (in Java2D space) for the zoom.Zoomable.zoomDomainAxes(double, PlotRenderingInfo, Point2D)
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 state, Point2D source)
zoomRangeAxes
in interface Zoomable
lowerPercent
- the lower bound.upperPercent
- the upper bound.state
- the plot state.source
- the source point (in Java2D space) for the zoom.Zoomable.zoomDomainAxes(double, double, PlotRenderingInfo, Point2D)
public double getAnchorValue()
setAnchorValue(double)
public void setAnchorValue(double value)
PlotChangeEvent
to all
registered listeners.value
- the anchor value.getAnchorValue()
public void setAnchorValue(double value, boolean notify)
PlotChangeEvent
to all registered listeners.value
- the value.notify
- notify listeners?getAnchorValue()
public boolean equals(Object obj)
public Object clone() throws CloneNotSupportedException
clone
in interface PublicCloneable
clone
in class Plot
CloneNotSupportedException
- if the cloning is not supported.Copyright © 2001–2017 JFree.org. All rights reserved.