|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.plot.Plot
org.jfree.chart.plot.CategoryPlot
A general plotting class that uses data from a CategoryDataset
and
renders each data item using a CategoryItemRenderer
.
Field Summary | |
static boolean |
DEFAULT_DOMAIN_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the domain axis. |
static java.awt.Paint |
DEFAULT_GRIDLINE_PAINT
The default grid line paint. |
static java.awt.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 java.awt.Font |
DEFAULT_VALUE_LABEL_FONT
The default value label font. |
protected static java.util.ResourceBundle |
localizationResources
The resourceBundle for the localization. |
Fields inherited from class org.jfree.chart.plot.Plot |
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_LEGEND_ITEM_BOX, DEFAULT_LEGEND_ITEM_CIRCLE, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO |
Constructor Summary | |
CategoryPlot()
Default constructor. |
|
CategoryPlot(CategoryDataset dataset,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
CategoryItemRenderer renderer)
Creates a new plot. |
Method Summary | |
void |
addAnnotation(CategoryAnnotation annotation)
Adds an annotation to the plot. |
void |
addRangeMarker(int index,
Marker marker,
Layer layer)
Adds a marker for display by a particular renderer. |
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. |
protected AxisSpace |
calculateAxisSpace(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea)
Calculates the space required for the axes. |
protected AxisSpace |
calculateDomainAxisSpace(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
AxisSpace space)
Calculates the space required for the domain axis/axes. |
protected AxisSpace |
calculateRangeAxisSpace(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
AxisSpace space)
Calculates the space required for the range axis/axes. |
void |
clearDomainAxes()
Clears the domain axes from the plot 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 for the plot and sends a PlotChangeEvent to all registered listeners. |
void |
clearRangeMarkers(int index)
Clears all the range markers for the specified renderer. |
java.lang.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(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
PlotState parentState,
PlotRenderingInfo state)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
protected void |
drawAnnotations(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea)
Draws the annotations... |
protected java.util.Map |
drawAxes(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo plotState)
A utility method for drawing the plot's axes. |
protected void |
drawDomainGridlines(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea)
Draws the gridlines for the plot. |
protected void |
drawRangeGridlines(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
java.util.List ticks)
Draws the gridlines for the plot. |
protected void |
drawRangeLine(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
double value,
java.awt.Stroke stroke,
java.awt.Paint paint)
Utility method for drawing a line perpendicular to the range axis (used for crosshairs). |
protected void |
drawRangeMarkers(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
int index,
Layer layer)
Draws the range markers (if any) for an axis and layer. |
protected void |
drawRangeMarkers(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
Layer layer)
Draws the range markers (if any) for the specified layer. |
boolean |
equals(java.lang.Object obj)
Tests the plot for equality with an arbitrary object. |
double |
getAnchorValue()
Returns the anchor value. |
java.util.List |
getAnnotations()
Returns the list of annotations. |
RectangleInsets |
getAxisOffset()
Returns the axis offset. |
java.util.List |
getCategories()
Returns a list of the categories for the plot. |
SortOrder |
getColumnRenderingOrder()
Returns the order in which the columns are rendered. |
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 at the given index. |
DatasetRenderingOrder |
getDatasetRenderingOrder()
Returns the dataset rendering order. |
CategoryAxis |
getDomainAxis()
Returns the domain axis for the plot. |
CategoryAxis |
getDomainAxis(int index)
Returns a domain axis. |
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. |
AxisLocation |
getDomainAxisLocation()
Returns the domain axis location. |
AxisLocation |
getDomainAxisLocation(int index)
Returns the location for a domain axis. |
java.awt.Paint |
getDomainGridlinePaint()
Returns the paint used to draw grid-lines against the domain axis. |
CategoryAnchor |
getDomainGridlinePosition()
Returns the position used for the domain gridlines. |
java.awt.Stroke |
getDomainGridlineStroke()
Returns the stroke used to draw grid-lines against the domain axis. |
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. |
java.lang.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. |
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. |
AxisLocation |
getRangeAxisLocation()
Returns the range axis location. |
AxisLocation |
getRangeAxisLocation(int index)
Returns the location for a range axis. |
java.awt.Paint |
getRangeCrosshairPaint()
Returns the range crosshair color. |
java.awt.Stroke |
getRangeCrosshairStroke()
Returns the pen-style ( Stroke ) used to draw the crosshair
(if visible). |
double |
getRangeCrosshairValue()
Returns the range crosshair value. |
java.awt.Paint |
getRangeGridlinePaint()
Returns the paint used to draw the grid-lines against the range axis. |
java.awt.Stroke |
getRangeGridlineStroke()
Returns the stroke used to draw the grid-lines against the range axis. |
java.util.Collection |
getRangeMarkers(int index,
Layer layer)
Returns a collection of range markers for a particular renderer and layer. |
java.util.Collection |
getRangeMarkers(Layer layer)
Returns the list of range markers (read only) for the specified layer. |
CategoryItemRenderer |
getRenderer()
Returns a reference to the renderer for the plot. |
CategoryItemRenderer |
getRenderer(int index)
Returns the renderer at the given index. |
CategoryItemRenderer |
getRendererForDataset(CategoryDataset dataset)
Returns the renderer for the specified dataset. |
SortOrder |
getRowRenderingOrder()
Returns the order in which the rows should be rendered. |
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. |
boolean |
isDomainGridlinesVisible()
Returns the flag that controls whether the domain grid-lines are visible. |
boolean |
isDomainZoomable()
Returns false . |
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 |
isRangeZoomable()
Returns false . |
void |
mapDatasetToDomainAxis(int index,
int axisIndex)
Maps a dataset to a particular domain axis. |
void |
mapDatasetToRangeAxis(int index,
int axisIndex)
Maps a dataset to a particular range axis. |
boolean |
render(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
int index,
PlotRenderingInfo info)
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. |
void |
setAnchorValue(double value,
boolean notify)
Sets the anchor value. |
void |
setAxisOffset(RectangleInsets offset)
Sets the axis offsets (gap between the data area and the axes). |
void |
setColumnRenderingOrder(SortOrder order)
Sets the order in which the columns should be rendered. |
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. |
void |
setDatasetRenderingOrder(DatasetRenderingOrder order)
Sets the rendering order 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. |
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. |
void |
setDomainAxisLocation(int index,
AxisLocation location)
Sets the location for a domain axis and sends a PlotChangeEvent
to all registered listeners. |
void |
setDomainGridlinePaint(java.awt.Paint paint)
Sets the paint used to draw the grid-lines (if any) against the domain axis. |
void |
setDomainGridlinePosition(CategoryAnchor position)
Sets the position used for the domain gridlines. |
void |
setDomainGridlineStroke(java.awt.Stroke stroke)
Sets the stroke used to draw grid-lines against the domain axis. |
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. |
void |
setFixedLegendItems(LegendItemCollection items)
Sets the fixed legend items for the plot. |
void |
setFixedRangeAxisSpace(AxisSpace space)
Sets the fixed range axis space. |
void |
setOrientation(PlotOrientation orientation)
Sets the orientation for the plot and sends a PlotChangeEvent to
all registered listeners. |
void |
setRangeAxis(int index,
ValueAxis axis)
Sets a range axis. |
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. |
void |
setRangeCrosshairPaint(java.awt.Paint paint)
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified. |
void |
setRangeCrosshairStroke(java.awt.Stroke stroke)
Sets the pen-style ( Stroke ) used to draw the crosshairs
(if visible). |
void |
setRangeCrosshairValue(double value)
Sets the domain crosshair value. |
void |
setRangeCrosshairValue(double value,
boolean notify)
Sets the range crosshair value. |
void |
setRangeCrosshairVisible(boolean flag)
Sets the flag indicating whether or not the range crosshair is visible. |
void |
setRangeGridlinePaint(java.awt.Paint paint)
Sets the paint used to draw the grid lines against the range axis. |
void |
setRangeGridlineStroke(java.awt.Stroke stroke)
Sets the stroke used to draw the grid-lines against the range axis. |
void |
setRangeGridlinesVisible(boolean visible)
Sets the flag that controls whether or not grid-lines are drawn against the range axis. |
void |
setRenderer(CategoryItemRenderer renderer)
Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and sends a PlotChangeEvent 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 PlotChangeEvent to all
registered listeners. |
void |
setRenderer(int index,
CategoryItemRenderer renderer)
Sets the renderer at the specified index and sends a PlotChangeEvent to all registered listeners. |
void |
setRenderer(int index,
CategoryItemRenderer renderer,
boolean notify)
Sets a renderer. |
void |
setRowRenderingOrder(SortOrder order)
Sets the order in which the rows should be rendered. |
void |
setWeight(int weight)
Sets the weight for the plot. |
void |
zoom(double percent)
Zooms (in or out) on the plot's value axis. |
void |
zoomDomainAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo state,
java.awt.geom.Point2D source)
This method does nothing, because CategoryPlot doesn't
support zooming on the domain. |
void |
zoomDomainAxes(double factor,
PlotRenderingInfo state,
java.awt.geom.Point2D source)
This method does nothing, because CategoryPlot doesn't
support zooming on the domain. |
void |
zoomRangeAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo state,
java.awt.geom.Point2D source)
Zooms in on the range axes. |
void |
zoomRangeAxes(double factor,
PlotRenderingInfo state,
java.awt.geom.Point2D source)
Multiplies the range on the range axis/axes by the specified factor. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean DEFAULT_DOMAIN_GRIDLINES_VISIBLE
public static final boolean DEFAULT_RANGE_GRIDLINES_VISIBLE
public static final java.awt.Stroke DEFAULT_GRIDLINE_STROKE
public static final java.awt.Paint DEFAULT_GRIDLINE_PAINT
public static final java.awt.Font DEFAULT_VALUE_LABEL_FONT
protected static java.util.ResourceBundle localizationResources
Constructor Detail |
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).Method Detail |
public java.lang.String getPlotType()
getPlotType
in class Plot
public PlotOrientation getOrientation()
getOrientation
in interface Zoomable
public void setOrientation(PlotOrientation orientation)
PlotChangeEvent
to
all registered listeners.
orientation
- the orientation (null
not permitted).public RectangleInsets getAxisOffset()
null
).public void setAxisOffset(RectangleInsets offset)
offset
- the offset (null
not permitted).public CategoryAxis getDomainAxis()
null
, then the method will return the parent plot's
domain axis (if there is a parent plot).
null
permitted).public CategoryAxis getDomainAxis(int index)
index
- the axis index.
null
possible).public void setDomainAxis(CategoryAxis axis)
PlotChangeEvent
to
all registered listeners.
axis
- the axis (null
permitted).public void setDomainAxis(int index, CategoryAxis axis)
index
- the axis index.axis
- the axis.public AxisLocation getDomainAxisLocation()
null
).public AxisLocation getDomainAxisLocation(int index)
index
- the axis index.
public void setDomainAxisLocation(AxisLocation location)
PlotChangeEvent
to all registered listeners.
location
- the axis location (null
not permitted).public void setDomainAxisLocation(AxisLocation location, boolean notify)
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.public RectangleEdge getDomainAxisEdge()
null
).public RectangleEdge getDomainAxisEdge(int index)
index
- the axis index.
null
).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)
index
- the axis index.axis
- the axis.public AxisLocation getRangeAxisLocation()
null
).public AxisLocation getRangeAxisLocation(int index)
index
- the axis index.
public void setRangeAxisLocation(AxisLocation location)
PlotChangeEvent
to all registered listeners.
location
- the location (null
not permitted).public void setRangeAxisLocation(AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.
location
- the location (null
not permitted).notify
- notify listeners?public void setRangeAxisLocation(int index, AxisLocation location)
PlotChangeEvent
to all registered listeners.
index
- the axis index.location
- the location.public void setRangeAxisLocation(int index, AxisLocation location, boolean notify)
PlotChangeEvent
to all registered listeners.
index
- the axis index.location
- the location.notify
- notify listeners?public RectangleEdge getRangeAxisEdge()
null
).public RectangleEdge getRangeAxisEdge(int index)
index
- the axis index.
public void clearRangeAxes()
PlotChangeEvent
to all registered listeners.
public void configureRangeAxes()
public CategoryDataset getDataset()
null
).public CategoryDataset getDataset(int index)
index
- the dataset index.
null
).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).public void setDataset(int index, CategoryDataset dataset)
index
- the dataset index.dataset
- the dataset (null
permitted).public void mapDatasetToDomainAxis(int index, int axisIndex)
index
- the dataset index (zero-based).axisIndex
- the axis index (zero-based).public CategoryAxis getDomainAxisForDataset(int index)
mapDatasetToDomainAxis(int, int)
method.
index
- the dataset index.
public void mapDatasetToRangeAxis(int index, int axisIndex)
index
- the dataset index (zero-based).axisIndex
- the axis index (zero-based).public ValueAxis getRangeAxisForDataset(int index)
mapDatasetToRangeAxis(int, int)
method.
index
- the dataset index.
public CategoryItemRenderer getRenderer()
public CategoryItemRenderer getRenderer(int index)
index
- the renderer index.
null
).public void setRenderer(CategoryItemRenderer renderer)
PlotChangeEvent
to all registered
listeners.
renderer
- the renderer (null
permitted.public void setRenderer(CategoryItemRenderer renderer, boolean notify)
PlotChangeEvent
to all
registered listeners.
You can set the renderer to null
, but this is not
recommended because:
renderer
- the renderer (null
permitted).notify
- notify listeners?public void setRenderer(int index, CategoryItemRenderer renderer)
PlotChangeEvent
to all registered listeners.
index
- the index.renderer
- the renderer (null
permitted).public void setRenderer(int index, CategoryItemRenderer renderer, boolean notify)
PlotChangeEvent
is sent to all registered
listeners.
index
- the index.renderer
- the renderer (null
permitted).notify
- notify listeners?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
).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).public SortOrder getColumnRenderingOrder()
public void setColumnRenderingOrder(SortOrder order)
order
- the order.public SortOrder getRowRenderingOrder()
null
).public void setRowRenderingOrder(SortOrder order)
order
- the order (null
not allowed).public boolean isDomainGridlinesVisible()
true
or false
.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.public CategoryAnchor getDomainGridlinePosition()
public void setDomainGridlinePosition(CategoryAnchor position)
position
- the position.public java.awt.Stroke getDomainGridlineStroke()
public void setDomainGridlineStroke(java.awt.Stroke stroke)
PlotChangeEvent
is sent to all registered listeners.
stroke
- the stroke.public java.awt.Paint getDomainGridlinePaint()
public void setDomainGridlinePaint(java.awt.Paint paint)
PlotChangeEvent
is sent to all registered listeners.
paint
- the paint.public boolean isRangeGridlinesVisible()
public void setRangeGridlinesVisible(boolean visible)
PlotChangeEvent
is
sent to all registered listeners.
visible
- the new value of the flag.public java.awt.Stroke getRangeGridlineStroke()
public void setRangeGridlineStroke(java.awt.Stroke stroke)
PlotChangeEvent
is sent to all registered listeners.
stroke
- the stroke.public java.awt.Paint getRangeGridlinePaint()
public void setRangeGridlinePaint(java.awt.Paint paint)
PlotChangeEvent
is sent to all registered listeners.
paint
- the paint.public LegendItemCollection getFixedLegendItems()
null
).public void setFixedLegendItems(LegendItemCollection items)
null
if you prefer the legend items to be created
automatically.
items
- the legend items (null
permitted).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).
zoom
in class Plot
percent
- the zoom amount.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 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).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).public void addRangeMarker(int index, Marker marker, Layer layer)
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.public void clearRangeMarkers()
PlotChangeEvent
to all registered listeners.
public java.util.Collection getRangeMarkers(Layer layer)
layer
- the layer (foreground or background).
public java.util.Collection getRangeMarkers(int index, Layer layer)
index
- the renderer index.layer
- the layer.
null
).public void clearRangeMarkers(int index)
index
- the renderer index.public boolean isRangeCrosshairVisible()
public void setRangeCrosshairVisible(boolean flag)
flag
- the new value of the flag.public boolean isRangeCrosshairLockedOnData()
public void setRangeCrosshairLockedOnData(boolean flag)
flag
- the flag.public double getRangeCrosshairValue()
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.public void setRangeCrosshairValue(double value, boolean notify)
Registered listeners are notified that the axis has been modified, but only if the crosshair is visible.
value
- the new value.notify
- a flag that controls whether or not listeners are
notified.public java.awt.Stroke getRangeCrosshairStroke()
Stroke
) used to draw the crosshair
(if visible).
public void setRangeCrosshairStroke(java.awt.Stroke stroke)
Stroke
) used to draw the crosshairs
(if visible). A PlotChangeEvent
is sent to all registered
listeners.
stroke
- the new crosshair stroke.public java.awt.Paint getRangeCrosshairPaint()
public void setRangeCrosshairPaint(java.awt.Paint paint)
paint
- the new crosshair paint.public java.util.List getAnnotations()
public void addAnnotation(CategoryAnnotation annotation)
annotation
- the annotation.protected AxisSpace calculateDomainAxisSpace(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, AxisSpace space)
g2
- the graphics device.plotArea
- the plot area.space
- a carrier for the result (null
permitted).
protected AxisSpace calculateRangeAxisSpace(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, AxisSpace space)
g2
- the graphics device.plotArea
- the plot area.space
- a carrier for the result (null
permitted).
protected AxisSpace calculateAxisSpace(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea)
g2
- the graphics device.plotArea
- the plot area.
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, 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.plotArea
- the area within which the plot (including axes) should
be drawn.parentState
- the state from the parent plot, if there is one.state
- collects info as the chart is drawn (possibly
null
).protected java.util.Map drawAxes(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.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(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, int index, PlotRenderingInfo info)
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.
protected void drawDomainGridlines(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea)
g2
- the graphics device.dataArea
- the area inside the axes.protected void drawRangeGridlines(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, java.util.List ticks)
g2
- the graphics device.dataArea
- the area inside the axes.ticks
- the ticks.protected void drawAnnotations(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea)
g2
- the graphics device.dataArea
- the data area.protected void drawRangeMarkers(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, Layer layer)
g2
- the graphics device.dataArea
- the data area.layer
- the layer (foreground or background).protected void drawRangeMarkers(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, int index, Layer layer)
g2
- the graphics device.dataArea
- the data area.index
- the renderer index.layer
- the layer (foreground or background).protected void drawRangeLine(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, double value, java.awt.Stroke stroke, java.awt.Paint paint)
g2
- the graphics device.dataArea
- the area defined by the axes.value
- the data value.stroke
- the line stroke.paint
- the line paint.public Range getDataRange(ValueAxis axis)
null
, this method returns
null
.
getDataRange
in interface ValueAxisPlot
axis
- the axis.
public int getWeight()
public void setWeight(int weight)
weight
- the weight.public AxisSpace getFixedDomainAxisSpace()
null
).public void setFixedDomainAxisSpace(AxisSpace space)
space
- the space (null
permitted).public AxisSpace getFixedRangeAxisSpace()
null
).public void setFixedRangeAxisSpace(AxisSpace space)
space
- the space (null
permitted).public java.util.List getCategories()
public boolean getDrawSharedDomainAxis()
public void setDrawSharedDomainAxis(boolean draw)
draw
- a boolean.public boolean isDomainZoomable()
false
.
isDomainZoomable
in interface Zoomable
public boolean isRangeZoomable()
false
.
isRangeZoomable
in interface Zoomable
public void zoomDomainAxes(double factor, PlotRenderingInfo state, java.awt.geom.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.public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, java.awt.geom.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.public void zoomRangeAxes(double factor, PlotRenderingInfo state, java.awt.geom.Point2D source)
zoomRangeAxes
in interface Zoomable
factor
- the zoom factor.state
- the plot state.source
- the source point (in Java2D space) for the zoom.public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, java.awt.geom.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.public double getAnchorValue()
public void setAnchorValue(double value)
value
- the anchor value.public void setAnchorValue(double value, boolean notify)
value
- the value.notify
- notify listeners?public boolean equals(java.lang.Object obj)
equals
in class Plot
obj
- the object to test against (null
permitted).
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class Plot
java.lang.CloneNotSupportedException
- if the cloning is not supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |