com.jidesoft.chart.render
Class AbstractBarRenderer
java.lang.Object
com.jidesoft.chart.render.AbstractRenderer
com.jidesoft.chart.render.AbstractBarRenderer
- All Implemented Interfaces:
- BarRenderer
- Direct Known Subclasses:
- Bar3DRenderer, CylinderBarRenderer, DefaultBarRenderer, RaisedBarRenderer
public abstract class AbstractBarRenderer
- extends AbstractRenderer
- implements BarRenderer
An abstract super-class that can be sub-classed to write a bar renderer.
Method Summary |
protected String |
computeLabel(Chartable chartable)
|
protected Paint |
createBarPaint(Chart chart,
Chartable p,
ChartStyle style,
boolean isSelected,
boolean hasRollover,
boolean hasFocus,
int x,
int y,
int width,
int height)
You can override this method to create a custom Paint that uses the dimensions of the bar. |
protected Paint |
getBarColor(Chart chart,
Chartable p,
ChartStyle style,
boolean isSelected,
boolean hasRollover,
boolean hasFocus)
|
LabelStyle |
getLabelStyle()
|
PointLabeler |
getPointLabeler()
|
boolean |
isLabelsVisible()
|
boolean |
isZeroHeightBarsVisible()
Returns a boolean value to indicate whether a bar with a zero height will be shown |
protected void |
renderBarLabel(Graphics2D g2d,
Chart chart,
ChartModel m,
Chartable p,
boolean isSelected,
boolean hasRollover,
boolean hasFocus,
double x,
double y,
double width,
double height)
|
void |
setLabelStyle(LabelStyle labelStyle)
|
void |
setLabelsVisible(boolean labelsVisible)
|
void |
setPointLabeler(PointLabeler pointLabeler)
Calling this method allows you to specify exactly how you would like the labels for the bars to appear. |
void |
setZeroHeightBarsVisible(boolean zeroHeightBarsVisible)
Specify whether to show bars with a height of zero. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractBarRenderer
public AbstractBarRenderer()
isLabelsVisible
public boolean isLabelsVisible()
setLabelsVisible
public void setLabelsVisible(boolean labelsVisible)
getLabelStyle
public LabelStyle getLabelStyle()
setLabelStyle
public void setLabelStyle(LabelStyle labelStyle)
getPointLabeler
public PointLabeler getPointLabeler()
setPointLabeler
public void setPointLabeler(PointLabeler pointLabeler)
- Calling this method allows you to specify exactly how you would like the labels for the bars to appear.
For example you can set up a formatting for numeric variables or, in general, generate any text that you like.
- Parameters:
pointLabeler
- a function that maps a Chartable to a String to use as a label
isZeroHeightBarsVisible
public boolean isZeroHeightBarsVisible()
- Returns a boolean value to indicate whether a bar with a zero height will be shown
- Returns:
- a boolean value to indicate whether a bar with a zero height will be shown
setZeroHeightBarsVisible
public void setZeroHeightBarsVisible(boolean zeroHeightBarsVisible)
- Specify whether to show bars with a height of zero. Default value is false.
- Parameters:
zeroHeightBarsVisible
- boolean to indicate whether bars of zero height should be visible (with a line
or flat plane in the case of a 3D rendering).
renderBarLabel
protected void renderBarLabel(Graphics2D g2d,
Chart chart,
ChartModel m,
Chartable p,
boolean isSelected,
boolean hasRollover,
boolean hasFocus,
double x,
double y,
double width,
double height)
computeLabel
protected String computeLabel(Chartable chartable)
createBarPaint
protected Paint createBarPaint(Chart chart,
Chartable p,
ChartStyle style,
boolean isSelected,
boolean hasRollover,
boolean hasFocus,
int x,
int y,
int width,
int height)
- You can override this method to create a custom Paint that uses the dimensions of the bar. For example,
you can create a gradient fill that always ranges from, say, red to yellow, regardless of the height of the bar.
getBarColor
protected Paint getBarColor(Chart chart,
Chartable p,
ChartStyle style,
boolean isSelected,
boolean hasRollover,
boolean hasFocus)