Class CategoryPlot
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,AxisChangeListener,RendererChangeListener,ValueAxisPlot,DatasetChangeListener,org.jfree.util.PublicCloneable
- Direct Known Subclasses:
CombinedDomainCategoryPlot,CombinedRangeCategoryPlot
public class CategoryPlot extends Plot implements ValueAxisPlot, RendererChangeListener, Cloneable, org.jfree.util.PublicCloneable, Serializable
CategoryDataset and
renders each data item using a CategoryItemRenderer.- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_DOMAIN_GRIDLINES_VISIBLEThe default visibility of the grid lines plotted against the domain axis.static PaintDEFAULT_GRIDLINE_PAINTThe default grid line paint.static StrokeDEFAULT_GRIDLINE_STROKEThe default grid line stroke.static booleanDEFAULT_RANGE_GRIDLINES_VISIBLEThe default visibility of the grid lines plotted against the range axis.static FontDEFAULT_VALUE_LABEL_FONTThe default value label font.Fields inherited from class org.jfree.chart.plot.Plot
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO -
Constructor Summary
Constructors Constructor Description CategoryPlot()Default constructor.CategoryPlot(CategoryDataset dataset, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer)Creates a new plot. -
Method Summary
Modifier and Type Method Description voidaddAnnotation(CategoryAnnotation annotation)Adds an annotation to the plot.voidaddRangeMarker(int index, Marker marker, org.jfree.ui.Layer layer)Adds a marker for display by a particular renderer.voidaddRangeMarker(Marker marker)Adds a marker for display (in the foreground) against the range axis and sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(Marker marker, org.jfree.ui.Layer layer)Adds a marker for display against the range axis and sends aPlotChangeEventto all registered listeners.voidclearDomainAxes()Clears the domain axes from the plot and sends aPlotChangeEventto all registered listeners.voidclearRangeAxes()Clears the range axes from the plot and sends aPlotChangeEventto all registered listeners.voidclearRangeMarkers()Clears all the range markers for the plot and sends aPlotChangeEventto all registered listeners.voidclearRangeMarkers(int index)Clears all the range markers for the specified renderer.Objectclone()Returns a clone of the plot.voidconfigureDomainAxes()Configures the domain axes.voidconfigureRangeAxes()Configures the range axes.voiddatasetChanged(DatasetChangeEvent event)Receives notification of a change to the plot's dataset.voiddraw(Graphics2D g2, Rectangle2D plotArea, PlotState parentState, PlotRenderingInfo state)Draws the plot on a Java 2D graphics device (such as the screen or a printer).booleanequals(Object object)Tests the plot for equality with an arbitrary object.doublegetAnchorValue()Returns the anchor value.ListgetAnnotations()Returns the list of annotations.org.jfree.ui.SpacergetAxisOffset()Returns the axis offset.ListgetCategories()Returns a list of the categories for the plot.org.jfree.util.SortOrdergetColumnRenderingOrder()Returns the order in which the columns are rendered.RangegetDataRange(ValueAxis axis)Returns the range of data values that will be plotted against the range axis.CategoryDatasetgetDataset()Returns the primary dataset for the plot.CategoryDatasetgetDataset(int index)Returns a dataset.DatasetRenderingOrdergetDatasetRenderingOrder()Returns the dataset rendering order.CategoryAxisgetDomainAxis()Returns the domain axis for the plot.CategoryAxisgetDomainAxis(int index)Returns a domain axis.org.jfree.ui.RectangleEdgegetDomainAxisEdge()Returns the domain axis edge.org.jfree.ui.RectangleEdgegetDomainAxisEdge(int index)Returns the edge for a domain axis.CategoryAxisgetDomainAxisForDataset(int index)Returns the domain axis for a dataset.AxisLocationgetDomainAxisLocation()Returns the domain axis location.AxisLocationgetDomainAxisLocation(int index)Returns the location for a domain axis.PaintgetDomainGridlinePaint()Returns the paint used to draw grid-lines against the domain axis.CategoryAnchorgetDomainGridlinePosition()Returns the position used for the domain gridlines.StrokegetDomainGridlineStroke()Returns the stroke used to draw grid-lines against the domain axis.booleangetDrawSharedDomainAxis()Returns the flag that controls whether or not the shared domain axis is drawn for each subplot.AxisSpacegetFixedDomainAxisSpace()Returns the fixed domain axis space.LegendItemCollectiongetFixedLegendItems()Returns the fixed legend items, if any.AxisSpacegetFixedRangeAxisSpace()Returns the fixed range axis space.LegendItemCollectiongetLegendItems()Returns the legend items for the plot.PlotOrientationgetOrientation()Returns the orientation of the plot.StringgetPlotType()Returns a string describing the type of plot.ValueAxisgetRangeAxis()Returns the range axis for the plot.ValueAxisgetRangeAxis(int index)Returns a range axis.org.jfree.ui.RectangleEdgegetRangeAxisEdge()Returns the edge where the primary range axis is located.org.jfree.ui.RectangleEdgegetRangeAxisEdge(int index)Returns the edge for a range axis.ValueAxisgetRangeAxisForDataset(int index)Returns the range axis for a dataset.AxisLocationgetRangeAxisLocation()Returns the range axis location.AxisLocationgetRangeAxisLocation(int index)Returns the location for a range axis.PaintgetRangeCrosshairPaint()Returns the range crosshair color.StrokegetRangeCrosshairStroke()Returns the pen-style (Stroke) used to draw the crosshair (if visible).doublegetRangeCrosshairValue()Returns the range crosshair value.PaintgetRangeGridlinePaint()Returns the paint used to draw the grid-lines against the range axis.StrokegetRangeGridlineStroke()Returns the stroke used to draw the grid-lines against the range axis.CollectiongetRangeMarkers(int index, org.jfree.ui.Layer layer)Returns a collection of range markers for a particular renderer and layer.CollectiongetRangeMarkers(org.jfree.ui.Layer layer)Returns the list of range markers (read only) for the specified layer.CategoryItemRenderergetRenderer()Returns a reference to the renderer for the plot.CategoryItemRenderergetRenderer(int index)Returns a renderer.CategoryItemRenderergetRendererForDataset(CategoryDataset d)Returns the renderer for the specified dataset.org.jfree.util.SortOrdergetRowRenderingOrder()Returns the order in which the rows should be rendered.intgetWeight()Returns the weight for this plot when it is used as a subplot within a combined plot.voidhandleClick(int x, int y, PlotRenderingInfo info)Handles a 'click' on the plot by updating the anchor value.booleanisDomainGridlinesVisible()Returns the flag that controls whether the domain grid-lines are visible.booleanisRangeCrosshairLockedOnData()Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.booleanisRangeCrosshairVisible()Returns a flag indicating whether or not the range crosshair is visible.booleanisRangeGridlinesVisible()Returns the flag that controls whether the range grid-lines are visible.voidmapDatasetToDomainAxis(int index, int axisIndex)Maps a dataset to a particular domain axis.voidmapDatasetToRangeAxis(int index, int axisIndex)Maps a dataset to a particular range axis.booleanrender(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info)Draws a representation of a dataset within the dataArea region using the appropriate renderer.voidrendererChanged(RendererChangeEvent event)Receives notification of a renderer change event.voidsetAnchorValue(double value)Sets the anchor value.voidsetAnchorValue(double value, boolean notify)Sets the anchor value.voidsetAxisOffset(org.jfree.ui.Spacer offset)Sets the axis offsets (gap between the data area and the axes).voidsetCategoryBackgroundPaint(Color color)voidsetCategoryBackgroundPaintA(int index, Color color)voidsetCategoryBackgroundPaintC(int index, Color color)voidsetColumnRenderingOrder(org.jfree.util.SortOrder order)Sets the order in which the columns should be rendered.voidsetDataset(int index, CategoryDataset dataset)Sets a dataset for the plot.voidsetDataset(CategoryDataset dataset)Sets the dataset for the plot, replacing the existing dataset, if there is one.voidsetDatasetRenderingOrder(DatasetRenderingOrder order)Sets the rendering order and sends aPlotChangeEventto all registered listeners.voidsetDomainAxis(int index, CategoryAxis axis)Sets a domain axis.voidsetDomainAxis(CategoryAxis axis)Sets the domain axis for the plot and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(int index, AxisLocation location)Sets the location for a domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(AxisLocation location)Sets the location of the domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(AxisLocation location, boolean notify)Sets the location of the domain axis.voidsetDomainGridlinePaint(Paint paint)Sets the paint used to draw the grid-lines (if any) against the domain axis.voidsetDomainGridlinePosition(CategoryAnchor position)Sets the position used for the domain gridlines.voidsetDomainGridlineStroke(Stroke stroke)Sets the stroke used to draw grid-lines against the domain axis.voidsetDomainGridlinesVisible(boolean visible)Sets the flag that controls whether or not grid-lines are drawn against the domain axis.voidsetDrawSharedDomainAxis(boolean draw)Sets the flag that controls whether the shared domain axis is drawn when this plot is being used as a subplot.voidsetFixedDomainAxisSpace(AxisSpace space)Sets the fixed domain axis space.voidsetFixedLegendItems(LegendItemCollection items)Sets the fixed legend items for the plot.voidsetFixedRangeAxisSpace(AxisSpace space)Sets the fixed range axis space.voidsetOrientation(PlotOrientation orientation)Sets the orientation for the plot and sends aPlotChangeEventto all registered listeners.voidsetRangeAxis(int index, ValueAxis axis)Sets a range axis.voidsetRangeAxis(ValueAxis axis)Sets the range axis for the plot and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(int index, AxisLocation location)Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(int index, AxisLocation location, boolean notify)Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(AxisLocation location)Sets the location of the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(AxisLocation location, boolean notify)Sets the location of the range axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairLockedOnData(boolean flag)Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values.voidsetRangeCrosshairPaint(Paint paint)Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified.voidsetRangeCrosshairStroke(Stroke stroke)Sets the pen-style (Stroke) used to draw the crosshairs (if visible).voidsetRangeCrosshairValue(double value)Sets the domain crosshair value.voidsetRangeCrosshairValue(double value, boolean notify)Sets the range crosshair value.voidsetRangeCrosshairVisible(boolean flag)Sets the flag indicating whether or not the range crosshair is visible.voidsetRangeGridlinePaint(Paint paint)Sets the paint used to draw the grid lines against the range axis.voidsetRangeGridlineStroke(Stroke stroke)Sets the stroke used to draw the grid-lines against the range axis.voidsetRangeGridlinesVisible(boolean visible)Sets the flag that controls whether or not grid-lines are drawn against the range axis.voidsetRenderer(int index, CategoryItemRenderer renderer)Sets the renderer at the specified index and sends aPlotChangeEventto all registered listeners.voidsetRenderer(int index, CategoryItemRenderer renderer, boolean notify)Sets a renderer.voidsetRenderer(CategoryItemRenderer renderer)Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and sends aPlotChangeEventto all registered listeners.voidsetRenderer(CategoryItemRenderer renderer, boolean notify)Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and, if requested, sends aPlotChangeEventto all registered listeners.voidsetRowRenderingOrder(org.jfree.util.SortOrder order)Sets the order in which the rows should be rendered.voidsetSkipLabels(int skipValue)voidsetWeight(int weight)Sets the weight for the plot.voidzoom(double percent)Zooms (in or out) on the plot's value axis.voidzoomHorizontalAxes(double factor)Multiplies the range on the horizontal axis/axes by the specified factor.voidzoomHorizontalAxes(double lowerPercent, double upperPercent)Zooms in on the horizontal axes.voidzoomVerticalAxes(double factor)Multiplies the range on the vertical axis/axes by the specified factor.voidzoomVerticalAxes(double lowerPercent, double upperPercent)Zooms in on the vertical axes.Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, axisChanged, draw, drawBackground, drawOutline, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundPaint, getDataAreaRatio, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRootPlot, isPlotShowing, isSubplot, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundPaint, setDataAreaRatio, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setOutlinePaint, setOutlineStroke, setParent, setPlotShowing
-
Field Details
-
DEFAULT_DOMAIN_GRIDLINES_VISIBLE
public static final boolean DEFAULT_DOMAIN_GRIDLINES_VISIBLEThe default visibility of the grid lines plotted against the domain axis.- See Also:
- Constant Field Values
-
DEFAULT_RANGE_GRIDLINES_VISIBLE
public static final boolean DEFAULT_RANGE_GRIDLINES_VISIBLEThe default visibility of the grid lines plotted against the range axis.- See Also:
- Constant Field Values
-
DEFAULT_GRIDLINE_STROKE
The default grid line stroke. -
DEFAULT_GRIDLINE_PAINT
The default grid line paint. -
DEFAULT_VALUE_LABEL_FONT
The default value label font.
-
-
Constructor Details
-
CategoryPlot
public CategoryPlot()Default constructor. -
CategoryPlot
public CategoryPlot(CategoryDataset dataset, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer)Creates a new plot.- Parameters:
dataset- the dataset (nullpermitted).domainAxis- the domain axis (nullpermitted).rangeAxis- the range axis (nullpermitted).renderer- the item renderer (nullpermitted).
-
-
Method Details
-
getPlotType
Returns a string describing the type of plot.- Specified by:
getPlotTypein classPlot- Returns:
- The type.
-
getOrientation
Returns the orientation of the plot.- Returns:
- The orientation of the plot.
-
setOrientation
Sets the orientation for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
orientation- the orientation (nullnot permitted).
-
getAxisOffset
public org.jfree.ui.Spacer getAxisOffset()Returns the axis offset.- Returns:
- the axis offset.
-
setAxisOffset
public void setAxisOffset(org.jfree.ui.Spacer offset)Sets the axis offsets (gap between the data area and the axes).- Parameters:
offset- the offset.
-
getDomainAxis
Returns the domain axis for the plot. If the domain axis for this plot isnull, then the method will return the parent plot's domain axis (if there is a parent plot).- Returns:
- The domain axis (
nullpermitted).
-
getDomainAxis
Returns a domain axis.- Parameters:
index- the axis index.- Returns:
- The axis (
nullpossible).
-
setDomainAxis
Sets the domain axis for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axis- the axis (nullpermitted).
-
setDomainAxis
Sets a domain axis.- Parameters:
index- the axis index.axis- the axis.
-
getDomainAxisLocation
Returns the domain axis location.- Returns:
- The location (never
null).
-
getDomainAxisLocation
Returns the location for a domain axis.- Parameters:
index- the axis index.- Returns:
- The location.
-
setDomainAxisLocation
Sets the location of the domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
location- the axis location (nullnot permitted).
-
setDomainAxisLocation
Sets the location of the domain axis.- Parameters:
location- the axis location (nullnot permitted).notify- a flag that controls whether listeners are notified.
-
setDomainAxisLocation
Sets the location for a domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location.
-
getDomainAxisEdge
public org.jfree.ui.RectangleEdge getDomainAxisEdge()Returns the domain axis edge. This is derived from the axis location and the plot orientation.- Returns:
- the edge (never
null).
-
getDomainAxisEdge
public org.jfree.ui.RectangleEdge getDomainAxisEdge(int index)Returns the edge for a domain axis.- Parameters:
index- the axis index.- Returns:
- The edge (never
null).
-
clearDomainAxes
public void clearDomainAxes()Clears the domain axes from the plot and sends aPlotChangeEventto all registered listeners. -
configureDomainAxes
public void configureDomainAxes()Configures the domain axes. -
getRangeAxis
Returns the range axis for the plot. If the range axis for this plot is null, then the method will return the parent plot's range axis (if there is a parent plot).- Returns:
- The range axis (possibly
null).
-
getRangeAxis
Returns a range axis.- Parameters:
index- the axis index.- Returns:
- The axis (
nullpossible).
-
setRangeAxis
Sets the range axis for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axis- the axis (nullpermitted).
-
setRangeAxis
Sets a range axis.- Parameters:
index- the axis index.axis- the axis.
-
getRangeAxisLocation
Returns the range axis location.- Returns:
- the location (never
null).
-
getRangeAxisLocation
Returns the location for a range axis.- Parameters:
index- the axis index.- Returns:
- The location.
-
setRangeAxisLocation
Sets the location of the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).
-
setRangeAxisLocation
Sets the location of the range axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).notify- notify listeners?
-
setRangeAxisLocation
Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location.
-
setRangeAxisLocation
Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location.notify- notify listeners?
-
getRangeAxisEdge
public org.jfree.ui.RectangleEdge getRangeAxisEdge()Returns the edge where the primary range axis is located.- Returns:
- The edge (never
null).
-
getRangeAxisEdge
public org.jfree.ui.RectangleEdge getRangeAxisEdge(int index)Returns the edge for a range axis.- Parameters:
index- the axis index.- Returns:
- The edge.
-
clearRangeAxes
public void clearRangeAxes()Clears the range axes from the plot and sends aPlotChangeEventto all registered listeners. -
configureRangeAxes
public void configureRangeAxes()Configures the range axes. -
getDataset
Returns the primary dataset for the plot.- Returns:
- The primary dataset (possibly
null).
-
getDataset
Returns a dataset.- Parameters:
index- the dataset index.- Returns:
- The dataset (possibly
null).
-
setDataset
Sets the dataset for the plot, replacing the existing dataset, if there is one. This method also calls thedatasetChanged(DatasetChangeEvent)method, which adjusts the axis ranges if necessary and sends aPlotChangeEventto all registered listeners.- Parameters:
dataset- the dataset (nullpermitted).
-
setDataset
Sets a dataset for the plot.- Parameters:
index- the dataset index.dataset- the dataset (nullpermitted).
-
mapDatasetToDomainAxis
public void mapDatasetToDomainAxis(int index, int axisIndex)Maps a dataset to a particular domain axis.- Parameters:
index- the dataset index (zero-based).axisIndex- the axis index (zero-based).
-
getDomainAxisForDataset
Returns the domain axis for a dataset. You can change the axis for a dataset using the mapDatasetToDomainAxis() method.- Parameters:
index- the dataset index.- Returns:
- The domain axis.
-
mapDatasetToRangeAxis
public void mapDatasetToRangeAxis(int index, int axisIndex)Maps a dataset to a particular range axis.- Parameters:
index- the dataset index (zero-based).axisIndex- the axis index (zero-based).
-
getRangeAxisForDataset
Returns the range axis for a dataset. You can change the axis for a dataset using the mapDatasetToRangeAxis() method.- Parameters:
index- the dataset index.- Returns:
- The range axis.
-
getRenderer
Returns a reference to the renderer for the plot.- Returns:
- The renderer.
-
getRenderer
Returns a renderer.- Parameters:
index- the renderer index.- Returns:
- The renderer (possibly
null).
-
setRenderer
Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and sends aPlotChangeEventto all registered listeners.- Parameters:
renderer- the renderer (nullpermitted.
-
setRenderer
Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and, if requested, sends aPlotChangeEventto all registered listeners.You can set the renderer to
null, but this is not recommended because:- no data will be displayed;
- the plot background will not be painted;
- Parameters:
renderer- the renderer (nullpermitted).notify- notify listeners?
-
setRenderer
Sets the renderer at the specified index and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the index.renderer- the renderer (nullpermitted).
-
setRenderer
Sets a renderer. APlotChangeEventis sent to all registered listeners.- Parameters:
index- the index.renderer- the renderer (nullpermitted).notify- notify listeners?
-
getRendererForDataset
Returns the renderer for the specified dataset.- Parameters:
d- the dataset (nullpermitted).- Returns:
- the renderer (possibly
null).
-
getDatasetRenderingOrder
Returns the dataset rendering order.- Returns:
- The order (never
null).
-
setDatasetRenderingOrder
Sets the rendering order and sends aPlotChangeEventto all registered listeners. By default, the plot renders the primary dataset last (so that the primary dataset overlays the secondary datasets). You can reverse this if you want to.- Parameters:
order- the rendering order (nullnot permitted).
-
getColumnRenderingOrder
public org.jfree.util.SortOrder getColumnRenderingOrder()Returns the order in which the columns are rendered.- Returns:
- The order.
-
setColumnRenderingOrder
public void setColumnRenderingOrder(org.jfree.util.SortOrder order)Sets the order in which the columns should be rendered.- Parameters:
order- the order.
-
getRowRenderingOrder
public org.jfree.util.SortOrder getRowRenderingOrder()Returns the order in which the rows should be rendered.- Returns:
- the order (never
null).
-
setRowRenderingOrder
public void setRowRenderingOrder(org.jfree.util.SortOrder order)Sets the order in which the rows should be rendered.- Parameters:
order- the order (nullnot allowed).
-
isDomainGridlinesVisible
public boolean isDomainGridlinesVisible()Returns the flag that controls whether the domain grid-lines are visible.- Returns:
- the
trueorfalse.
-
setDomainGridlinesVisible
public void setDomainGridlinesVisible(boolean visible)Sets the flag that controls whether or not grid-lines are drawn against the domain axis.If the flag value changes, a
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.
-
getDomainGridlinePosition
Returns the position used for the domain gridlines.- Returns:
- The gridline position.
-
setDomainGridlinePosition
Sets the position used for the domain gridlines.- Parameters:
position- the position.
-
getDomainGridlineStroke
Returns the stroke used to draw grid-lines against the domain axis.- Returns:
- the stroke.
-
setDomainGridlineStroke
Sets the stroke used to draw grid-lines against the domain axis. APlotChangeEventis sent to all registered listeners.- Parameters:
stroke- the stroke.
-
getDomainGridlinePaint
Returns the paint used to draw grid-lines against the domain axis.- Returns:
- the paint.
-
setDomainGridlinePaint
Sets the paint used to draw the grid-lines (if any) against the domain axis. APlotChangeEventis sent to all registered listeners.- Parameters:
paint- the paint.
-
isRangeGridlinesVisible
public boolean isRangeGridlinesVisible()Returns the flag that controls whether the range grid-lines are visible.- Returns:
- the flag.
-
setRangeGridlinesVisible
public void setRangeGridlinesVisible(boolean visible)Sets the flag that controls whether or not grid-lines are drawn against the range axis. If the flag changes value, aPlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.
-
getRangeGridlineStroke
Returns the stroke used to draw the grid-lines against the range axis.- Returns:
- the stroke.
-
setRangeGridlineStroke
Sets the stroke used to draw the grid-lines against the range axis. APlotChangeEventis sent to all registered listeners.- Parameters:
stroke- the stroke.
-
getRangeGridlinePaint
Returns the paint used to draw the grid-lines against the range axis.- Returns:
- the paint.
-
setRangeGridlinePaint
Sets the paint used to draw the grid lines against the range axis. APlotChangeEventis sent to all registered listeners.- Parameters:
paint- the paint.
-
getFixedLegendItems
Returns the fixed legend items, if any.- Returns:
- The legend items (possibly
null).
-
setFixedLegendItems
Sets the fixed legend items for the plot. Leave this set tonullif you prefer the legend items to be created automatically.- Parameters:
items- the legend items (nullpermitted).
-
getLegendItems
Returns the legend items for the plot. By default, this method creates a legend item for each series in each of the datasets. You can change this behaviour by overriding this method.- Overrides:
getLegendItemsin classPlot- Returns:
- The legend items.
-
handleClick
Handles a 'click' on the plot by updating the anchor value.- Overrides:
handleClickin classPlot- Parameters:
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.
-
zoom
public void zoom(double percent)Zooms (in or out) on the plot's value axis.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).
-
datasetChanged
Receives notification of a change to the plot's dataset.The range axis bounds will be recalculated if necessary.
- Specified by:
datasetChangedin interfaceDatasetChangeListener- Overrides:
datasetChangedin classPlot- Parameters:
event- information about the event (not used here).
-
rendererChanged
Receives notification of a renderer change event.- Specified by:
rendererChangedin interfaceRendererChangeListener- Parameters:
event- the event.
-
addRangeMarker
Adds a marker for display (in the foreground) against the range axis and sends aPlotChangeEventto all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.- Parameters:
marker- the marker (nullnot permitted).
-
addRangeMarker
Adds a marker for display against the range axis and sends aPlotChangeEventto all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background) (nullnot permitted).
-
addRangeMarker
Adds a marker for display by a particular renderer.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.
- Parameters:
index- the renderer index.marker- the marker.layer- the layer.
-
clearRangeMarkers
public void clearRangeMarkers()Clears all the range markers for the plot and sends aPlotChangeEventto all registered listeners. -
getRangeMarkers
Returns the list of range markers (read only) for the specified layer.- Parameters:
layer- the layer (foreground or background).- Returns:
- The list of range markers.
-
getRangeMarkers
Returns a collection of range markers for a particular renderer and layer.- Parameters:
index- the renderer index.layer- the layer.- Returns:
- A collection of markers (possibly
null).
-
clearRangeMarkers
public void clearRangeMarkers(int index)Clears all the range markers for the specified renderer.- Parameters:
index- the renderer index.
-
isRangeCrosshairVisible
public boolean isRangeCrosshairVisible()Returns a flag indicating whether or not the range crosshair is visible.- Returns:
- the flag.
-
setRangeCrosshairVisible
public void setRangeCrosshairVisible(boolean flag)Sets the flag indicating whether or not the range crosshair is visible.- Parameters:
flag- the new value of the flag.
-
isRangeCrosshairLockedOnData
public boolean isRangeCrosshairLockedOnData()Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.- Returns:
- the flag.
-
setRangeCrosshairLockedOnData
public void setRangeCrosshairLockedOnData(boolean flag)Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values.- Parameters:
flag- the flag.
-
getRangeCrosshairValue
public double getRangeCrosshairValue()Returns the range crosshair value.- Returns:
- The value.
-
setRangeCrosshairValue
public void setRangeCrosshairValue(double value)Sets the domain crosshair value.Registered listeners are notified that the plot has been modified, but only if the crosshair is visible.
- Parameters:
value- the new value.
-
setRangeCrosshairValue
public void setRangeCrosshairValue(double value, boolean notify)Sets the range crosshair value.Registered listeners are notified that the axis has been modified, but only if the crosshair is visible.
- Parameters:
value- the new value.notify- a flag that controls whether or not listeners are notified.
-
getRangeCrosshairStroke
Returns the pen-style (Stroke) used to draw the crosshair (if visible).- Returns:
- the crosshair stroke.
-
setRangeCrosshairStroke
Sets the pen-style (Stroke) used to draw the crosshairs (if visible). APlotChangeEventis sent to all registered listeners.- Parameters:
stroke- the new crosshair stroke.
-
getRangeCrosshairPaint
Returns the range crosshair color.- Returns:
- the crosshair color.
-
setRangeCrosshairPaint
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified.- Parameters:
paint- the new crosshair paint.
-
getAnnotations
Returns the list of annotations.- Returns:
- The list of annotations.
-
addAnnotation
Adds an annotation to the plot.- Parameters:
annotation- the annotation.
-
draw
public void draw(Graphics2D g2, Rectangle2D plotArea, PlotState parentState, PlotRenderingInfo state)Draws the plot on a Java 2D graphics device (such as the screen or a printer).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. -
render
Draws a representation of a dataset within the dataArea region using the appropriate renderer.- Parameters:
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.- Returns:
- A boolean that indicates whether or not real data was found.
-
setSkipLabels
public void setSkipLabels(int skipValue) -
setCategoryBackgroundPaintA
-
setCategoryBackgroundPaint
-
setCategoryBackgroundPaintC
-
getDataRange
Returns the range of data values that will be plotted against the range axis. If the dataset isnull, this method returnsnull.- Specified by:
getDataRangein interfaceValueAxisPlot- Parameters:
axis- the axis.- Returns:
- The data range.
-
getWeight
public int getWeight()Returns the weight for this plot when it is used as a subplot within a combined plot.- Returns:
- the weight.
-
setWeight
public void setWeight(int weight)Sets the weight for the plot.- Parameters:
weight- the weight.
-
getFixedDomainAxisSpace
Returns the fixed domain axis space.- Returns:
- The fixed domain axis space (possibly
null).
-
setFixedDomainAxisSpace
Sets the fixed domain axis space.- Parameters:
space- the space.
-
getFixedRangeAxisSpace
Returns the fixed range axis space.- Returns:
- The fixed range axis space.
-
setFixedRangeAxisSpace
Sets the fixed range axis space.- Parameters:
space- the space.
-
getCategories
Returns a list of the categories for the plot.- Returns:
- A list of the categories for the plot.
-
zoomHorizontalAxes
public void zoomHorizontalAxes(double factor)Multiplies the range on the horizontal axis/axes by the specified factor.- Specified by:
zoomHorizontalAxesin interfaceValueAxisPlot- Parameters:
factor- the zoom factor.
-
zoomHorizontalAxes
public void zoomHorizontalAxes(double lowerPercent, double upperPercent)Zooms in on the horizontal axes.- Specified by:
zoomHorizontalAxesin interfaceValueAxisPlot- Parameters:
lowerPercent- the lower bound.upperPercent- the upper bound.
-
zoomVerticalAxes
public void zoomVerticalAxes(double factor)Multiplies the range on the vertical axis/axes by the specified factor.- Specified by:
zoomVerticalAxesin interfaceValueAxisPlot- Parameters:
factor- the zoom factor.
-
zoomVerticalAxes
public void zoomVerticalAxes(double lowerPercent, double upperPercent)Zooms in on the vertical axes.- Specified by:
zoomVerticalAxesin interfaceValueAxisPlot- Parameters:
lowerPercent- the lower bound.upperPercent- the upper bound.
-
getAnchorValue
public double getAnchorValue()Returns the anchor value.- Returns:
- The anchor value.
-
setAnchorValue
public void setAnchorValue(double value)Sets the anchor value.- Parameters:
value- the anchor value.
-
setAnchorValue
public void setAnchorValue(double value, boolean notify)Sets the anchor value.- Parameters:
value- the value.notify- notify listeners?
-
equals
Tests the plot for equality with an arbitrary object. -
clone
Returns a clone of the plot.- Specified by:
clonein interfaceorg.jfree.util.PublicCloneable- Overrides:
clonein classPlot- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the cloning is not supported.
-