Class CategoryItemRendererState
- java.lang.Object
-
- org.jfree.chart.renderer.RendererState
-
- org.jfree.chart.renderer.category.CategoryItemRendererState
-
- Direct Known Subclasses:
CategoryStepRenderer.State
public class CategoryItemRendererState extends RendererState
An object that retains temporary state information for aCategoryItemRenderer
.
-
-
Field Summary
Fields Modifier and Type Field Description private double
barWidth
The bar width.private CategoryCrosshairState
crosshairState
State information for crosshairs in the plot (this is updated by the renderer, but may be passed to several renderers in one chart).private double
seriesRunningTotal
The series running total.private int[]
visibleSeries
The array with the indices of the visible series.
-
Constructor Summary
Constructors Constructor Description CategoryItemRendererState(PlotRenderingInfo info)
Creates a new object for recording temporary state information for a renderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getBarWidth()
Returns the bar width.CategoryCrosshairState
getCrosshairState()
Returns the crosshair state, if any.double
getSeriesRunningTotal()
Returns the series running total.int[]
getVisibleSeriesArray()
Returns a copy of the visible series array.int
getVisibleSeriesCount()
Returns the number of visible series or -1 if no visible series have been specified.int
getVisibleSeriesIndex(int rowIndex)
Returns the index of the row relative to the visible rows.void
setBarWidth(double width)
Sets the bar width.void
setCrosshairState(CategoryCrosshairState state)
Sets the crosshair state.(package private) void
setSeriesRunningTotal(double total)
Sets the series running total (this method is intended for the use of the renderer only).void
setVisibleSeriesArray(int[] visibleSeries)
Sets an array with the indices of the visible rows.-
Methods inherited from class org.jfree.chart.renderer.RendererState
getElementHinting, getEntityCollection, getInfo, setElementHinting
-
-
-
-
Field Detail
-
barWidth
private double barWidth
The bar width.
-
seriesRunningTotal
private double seriesRunningTotal
The series running total.
-
visibleSeries
private int[] visibleSeries
The array with the indices of the visible series.
-
crosshairState
private CategoryCrosshairState crosshairState
State information for crosshairs in the plot (this is updated by the renderer, but may be passed to several renderers in one chart).
-
-
Constructor Detail
-
CategoryItemRendererState
public CategoryItemRendererState(PlotRenderingInfo info)
Creates a new object for recording temporary state information for a renderer.- Parameters:
info
- the plot rendering info (null
permitted).
-
-
Method Detail
-
getBarWidth
public double getBarWidth()
Returns the bar width.- Returns:
- The bar width.
- See Also:
setBarWidth(double)
-
setBarWidth
public void setBarWidth(double width)
Sets the bar width. The renderer calculates this value and stores it here - it is not intended that users can manually set the bar width.- Parameters:
width
- the width.- See Also:
getBarWidth()
-
getSeriesRunningTotal
public double getSeriesRunningTotal()
Returns the series running total.- Returns:
- The running total.
- See Also:
setSeriesRunningTotal(double)
-
setSeriesRunningTotal
void setSeriesRunningTotal(double total)
Sets the series running total (this method is intended for the use of the renderer only).- Parameters:
total
- the new total.- See Also:
getSeriesRunningTotal()
-
getCrosshairState
public CategoryCrosshairState getCrosshairState()
Returns the crosshair state, if any.- Returns:
- The crosshair state (possibly
null
). - See Also:
setCrosshairState(CategoryCrosshairState)
-
setCrosshairState
public void setCrosshairState(CategoryCrosshairState state)
Sets the crosshair state.- Parameters:
state
- the new state (null
permitted).- See Also:
getCrosshairState()
-
getVisibleSeriesIndex
public int getVisibleSeriesIndex(int rowIndex)
Returns the index of the row relative to the visible rows. If no visible rows have been specified, the original row index is returned. If the row index is not included in the array of visible rows, -1 is returned.- Parameters:
rowIndex
- the row index.- Returns:
- The new row index or -1.
-
getVisibleSeriesCount
public int getVisibleSeriesCount()
Returns the number of visible series or -1 if no visible series have been specified.- Returns:
- The number or -1.
-
getVisibleSeriesArray
public int[] getVisibleSeriesArray()
Returns a copy of the visible series array.- Returns:
- The visible series array (possibly
null
).
-
setVisibleSeriesArray
public void setVisibleSeriesArray(int[] visibleSeries)
Sets an array with the indices of the visible rows.- Parameters:
visibleSeries
- the array (null
permitted).
-
-