| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.jfree.chart.renderer.AbstractRendererorg.jfree.chart.renderer.category.AbstractCategoryItemRendererorg.jfree.chart.renderer.category.BarRendererorg.jfree.chart.renderer.category.WaterfallBarRendererpublic class WaterfallBarRendererextends BarRendererimplements Cloneable, PublicCloneable, SerializableCategoryPlot class. Note that the bar colors are defined
using special methods in this class - the inherited methods (for example,
AbstractRenderer.setSeriesPaint(int,Paint)) are ignored.
Field Summary |
Fields inherited from class org.jfree.chart.renderer.category.BarRenderer | |
BAR_OUTLINE_WIDTH_THRESHOLD, DEFAULT_ITEM_MARGIN | |
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 | |
| |
| |
Method Summary | |
void |
|
boolean |
|
Range |
|
Paint |
|
Paint |
|
Paint |
|
Paint |
|
void |
|
void |
|
void |
|
void |
|
public WaterfallBarRenderer()
Constructs a new renderer with default values for the bar colors.
public WaterfallBarRenderer(Paint firstBarPaint, Paint positiveBarPaint, Paint negativeBarPaint, Paint lastBarPaint)
Constructs a new waterfall renderer.
- Parameters:
firstBarPaint- the color of the first bar (nullnot permitted).positiveBarPaint- the color for bars with positive values (nullnot permitted).negativeBarPaint- the color for bars with negative values (nullnot permitted).lastBarPaint- the color of the last bar (nullnot permitted).
public void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)
Draws the bar for a single (series, category) data item.
- Specified by:
- drawItem in interface CategoryItemRenderer
- Overrides:
- drawItem in interface BarRenderer
- Parameters:
g2- 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).pass- the pass index.
public boolean equals(Object obj)
Tests an object for equality with this instance.
- Overrides:
- equals in interface BarRenderer
- Parameters:
obj- the object (nullpermitted).
- Returns:
- A boolean.
public Range findRangeBounds(CategoryDataset dataset)
Returns the range of values the renderer requires to display all the items from the specified dataset.
- Specified by:
- findRangeBounds in interface CategoryItemRenderer
- Overrides:
- findRangeBounds in interface BarRenderer
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (or
nullif the dataset is empty).
public Paint getFirstBarPaint()
Returns the paint used to draw the first bar.
- Returns:
- The paint (never
null).
public Paint getLastBarPaint()
Returns the paint used to draw the last bar.
- Returns:
- The paint (never
null).
public Paint getNegativeBarPaint()
Returns the paint used to draw bars with negative values.
- Returns:
- The paint (never
null).
public Paint getPositiveBarPaint()
Returns the paint used to draw bars with positive values.
- Returns:
- The paint (never
null).
public void setFirstBarPaint(Paint paint)
Sets the paint that will be used to draw the first bar and sends aRendererChangeEventto all registered listeners.
- Parameters:
paint- the paint (nullnot permitted).
public void setLastBarPaint(Paint paint)
Sets the paint that will be used to draw the last bar.
- Parameters:
paint- the paint (nullnot permitted).
public void setNegativeBarPaint(Paint paint)
Sets the paint that will be used to draw bars having negative values.
- Parameters:
paint- the paint (nullnot permitted).
public void setPositiveBarPaint(Paint paint)
Sets the paint that will be used to draw bars having positive values.
- Parameters:
paint- the paint (nullnot permitted).