|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.AbstractRenderer | +--com.jrefinery.chart.AbstractCategoryItemRenderer | +--com.jrefinery.chart.BarRenderer
A base class for category item renderers that draw bars.
Field Summary | |
protected static double |
BAR_OUTLINE_WIDTH_THRESHOLD
Constant that controls the minimum width before a bar has an outline drawn. |
protected double |
categoryGapSpan
The total width of the category gaps. |
protected double |
categorySpan
The total width of the categories. |
protected double |
itemGapSpan
The total width of the item gaps. |
protected double |
itemSpan
The total width of the items within a category. |
protected double |
itemWidth
The width of a single item. |
protected double |
lowerClip
The lower clip (axis) value. |
protected double |
upperClip
The upper clip (axis) value. |
protected double |
zeroInJava2D
The data value ZERO translated to Java2D user space. |
Constructor Summary | |
protected |
BarRenderer(CategoryToolTipGenerator toolTipGenerator,
CategoryURLGenerator urlGenerator)
Constructs a bar renderer. |
Method Summary | |
abstract int |
barWidthsPerCategory(CategoryDataset data)
Returns the number of bar widths per category, which depends on whether or not the renderer stacks bars. |
protected void |
calculateCategoryAndItemSpans(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
CategoryDataset data,
double span)
Calculates some dimensions required for plotting the bars. |
abstract boolean |
hasItemGaps()
Returns true if there are gaps between items within a category. |
void |
initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
ValueAxis axis,
CategoryDataset data,
ChartRenderingInfo info)
Initialises the renderer. |
boolean |
isStacked()
Returns a flag indicating whether or not the renderer stacks values within each category. |
Methods inherited from class com.jrefinery.chart.AbstractCategoryItemRenderer |
drawPlotBackground, getAxisArea, getCategoriesPaint, getCategoryPaint, getDataClipRegion, getLegendItem, getPlot, getToolTipGenerator, getURLGenerator, getUseCategoriesPaint, setCategoriesPaint, setPlot, setToolTipGenerator, setURLGenerator |
Methods inherited from class com.jrefinery.chart.AbstractRenderer |
addPropertyChangeListener, firePropertyChanged, getInfo, removePropertyChangeListener, setInfo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jrefinery.chart.CategoryItemRenderer |
drawCategoryItem, drawRangeMarker |
Field Detail |
protected static final double BAR_OUTLINE_WIDTH_THRESHOLD
protected double categorySpan
protected double categoryGapSpan
protected double itemSpan
protected double itemGapSpan
protected double itemWidth
protected double zeroInJava2D
protected double upperClip
protected double lowerClip
Constructor Detail |
protected BarRenderer(CategoryToolTipGenerator toolTipGenerator, CategoryURLGenerator urlGenerator)
toolTipGenerator
- the tool tip generator.urlGenerator
- the URL generator.Method Detail |
public void initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, ValueAxis axis, CategoryDataset data, ChartRenderingInfo info)
This method gets called once at the start of the process of drawing a chart.
initialise
in class AbstractCategoryItemRenderer
g2
- the graphics device.dataArea
- the area in which the data is to be plotted.plot
- the plot.axis
- the range axis.data
- the data.info
- collects chart rendering information for return to caller.public abstract int barWidthsPerCategory(CategoryDataset data)
data
- the dataset.public abstract boolean hasItemGaps()
true
if there are gaps between items within a category.public boolean isStacked()
Subclasses should override this method as necessary.
isStacked
in class AbstractCategoryItemRenderer
false
.protected void calculateCategoryAndItemSpans(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, CategoryDataset data, double span)
g2
- the graphics device.dataArea
- the area within the axes.plot
- the plot.data
- the data.span
- the available width.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |