|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.AbstractCategoryItemRenderer
org.jfree.chart.renderer.LevelRenderer
A CategoryItemRenderer that draws individual data items as horizontal lines,
spaced in the same way as bars in a bar chart.
| Field Summary | |
static double |
DEFAULT_ITEM_MARGIN
The default item margin percentage. |
| Fields inherited from class org.jfree.chart.renderer.AbstractRenderer |
DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO |
| Constructor Summary | |
LevelRenderer()
Creates a new renderer with default settings. |
|
| Method Summary | |
protected double |
calculateBarW0(CategoryPlot plot,
PlotOrientation orientation,
java.awt.geom.Rectangle2D dataArea,
CategoryAxis domainAxis,
CategoryItemRendererState state,
int row,
int column)
Calculates the coordinate of the first "side" of a bar. |
protected void |
calculateItemWidth(CategoryPlot plot,
java.awt.geom.Rectangle2D dataArea,
int rendererIndex,
CategoryItemRendererState state)
Calculates the bar width and stores it in the renderer state. |
protected double |
calculateSeriesWidth(double space,
CategoryAxis axis,
int categories,
int series)
Calculates the available space for each series. |
void |
drawItem(java.awt.Graphics2D g2,
CategoryItemRendererState state,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
CategoryDataset dataset,
int row,
int column)
Draws the bar for a single (series, category) data item. |
boolean |
equals(java.lang.Object object)
Tests an object for equality with this instance. |
double |
getItemMargin()
Returns the item margin. |
double |
getMaxItemWidth()
Returns the maximum width, as a percentage of the available drawing space. |
CategoryItemRendererState |
initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
int rendererIndex,
PlotRenderingInfo info)
Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method. |
void |
setItemMargin(double percent)
Sets the item margin. |
void |
setMaxItemWidth(double percent)
Sets the maximum item width, which is specified as a percentage of the available space for all items, and sends a RendererChangeEvent to all registered listeners. |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jfree.util.PublicCloneable |
clone |
| Field Detail |
public static final double DEFAULT_ITEM_MARGIN
| Constructor Detail |
public LevelRenderer()
| Method Detail |
public double getItemMargin()
public void setItemMargin(double percent)
percent - the new margin.public double getMaxItemWidth()
public void setMaxItemWidth(double percent)
RendererChangeEvent to all registered listeners.
percent - the percent.
public CategoryItemRendererState initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
int rendererIndex,
PlotRenderingInfo info)
This method gets called once at the start of the process of drawing a chart.
initialise in interface CategoryItemRendererinitialise in class AbstractCategoryItemRendererg2 - the graphics device.dataArea - the area in which the data is to be plotted.plot - the plot.rendererIndex - the renderer index.info - collects chart rendering information for return to caller.
protected void calculateItemWidth(CategoryPlot plot,
java.awt.geom.Rectangle2D dataArea,
int rendererIndex,
CategoryItemRendererState state)
plot - the plot.dataArea - the data area.rendererIndex - the renderer index.state - the renderer state.
protected double calculateBarW0(CategoryPlot plot,
PlotOrientation orientation,
java.awt.geom.Rectangle2D dataArea,
CategoryAxis domainAxis,
CategoryItemRendererState state,
int row,
int column)
plot - the plot.orientation - the plot orientation.dataArea - the data area.domainAxis - the domain axis.state - the renderer state (has the bar width precalculated).row - the row index.column - the column index.
public void drawItem(java.awt.Graphics2D g2,
CategoryItemRendererState state,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
CategoryAxis domainAxis,
ValueAxis rangeAxis,
CategoryDataset dataset,
int row,
int column)
drawItem in interface CategoryItemRendererg2 - the graphics device.state - the renderer state.dataArea - the data area.plot - the plot.domainAxis - the domain axis.rangeAxis - the range axis.dataset - the dataset.row - the row index (zero-based).column - the column index (zero-based).
protected double calculateSeriesWidth(double space,
CategoryAxis axis,
int categories,
int series)
space - the space along the entire axis (in Java2D units).axis - the category axis.categories - the number of categories.series - the number of series.
public boolean equals(java.lang.Object object)
equals in class AbstractCategoryItemRendererobject - the object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||