com.jidesoft.chart.render
Class CylinderBarRenderer
java.lang.Object
com.jidesoft.chart.render.AbstractRenderer
com.jidesoft.chart.render.AbstractBarRenderer
com.jidesoft.chart.render.CylinderBarRenderer
- All Implemented Interfaces:
- BarRenderer, BarRenderer2D
public class CylinderBarRenderer
- extends AbstractBarRenderer
- implements BarRenderer2D
This renderer takes account of negative heights. If a negative height is supplied, then the y coordinate and height
are adjusted so that the height becomes positive and the shape is paintable.
NOTE: Widths are currently assumed to
be positive
Method Summary |
protected Color |
brighter(Color color)
|
protected Paint |
createFrontPaint(Orientation orientation,
Color color,
int x,
int y,
int width,
int height,
int depth)
|
protected Paint |
createTopPaint(Orientation orientation,
Color color,
int x,
int y,
int width,
int height,
int depth)
|
protected Color |
darker(Color color)
|
double |
getDepthRatio()
returns the depth of a cylinder as a proportion of its width |
int |
getMinimumBreadth()
|
Shape |
renderBar(Graphics2D g,
Chart chart,
ChartModel m,
Chartable p,
boolean isSelected,
boolean hasRollover,
boolean hasFocus,
double x,
double y,
double width,
double height)
There is one call to this method for each bar to be rendered in a bar chart. |
Shape |
renderBar(Graphics g,
Chart chart,
ChartModel m,
Chartable p,
boolean isSelected,
boolean hasRollover,
boolean hasFocus,
int x,
int y,
int width,
int height)
There is one call to this method for each bar to be rendered in a bar chart. |
void |
setDepthRatio(double depthRatio)
Specify the depth of the cylinder as a proportion of its width; default value is 0.23 |
Methods inherited from class com.jidesoft.chart.render.AbstractBarRenderer |
computeLabel, createBarPaint, getBarColor, getLabelStyle, getPointLabeler, isLabelsVisible, isZeroHeightBarsVisible, renderBarLabel, setLabelStyle, setLabelsVisible, setPointLabeler, setZeroHeightBarsVisible |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CylinderBarRenderer
public CylinderBarRenderer()
getDepthRatio
public double getDepthRatio()
- returns the depth of a cylinder as a proportion of its width
- Returns:
- the depth of a cylinder as a proportion of its width
setDepthRatio
public void setDepthRatio(double depthRatio)
- Specify the depth of the cylinder as a proportion of its width; default value is 0.23
- Parameters:
depthRatio
- the depth of the cylinder as a proportion of its width
renderBar
public Shape renderBar(Graphics2D g,
Chart chart,
ChartModel m,
Chartable p,
boolean isSelected,
boolean hasRollover,
boolean hasFocus,
double x,
double y,
double width,
double height)
- There is one call to this method for each bar to be rendered in a bar chart.
- Specified by:
renderBar
in interface BarRenderer2D
- Parameters:
g
- the graphics context onto which the bar is drawnchart
- the chart objectm
- the chart model from which the bar/point comesp
- the point of the model corresponding to the barisSelected
- whether the bar is currently selectedhasRollover
- whether the bar currently is under the mouse cursorhasFocus
- whether the bar currently has focus (not yet supported)x
- the x pixel coordinate for the top left of the bary
- the y pixel coordinate for the top left of the barwidth
- the width of the bar in pixelsheight
- the height of the bar in pixels
renderBar
public Shape renderBar(Graphics g,
Chart chart,
ChartModel m,
Chartable p,
boolean isSelected,
boolean hasRollover,
boolean hasFocus,
int x,
int y,
int width,
int height)
- There is one call to this method for each bar to be rendered in a bar chart.
- Specified by:
renderBar
in interface BarRenderer
- Parameters:
g
- the graphics context onto which the bar is drawnchart
- the chart objectm
- the chart model from which the bar/point comesp
- the point of the model corresponding to the barisSelected
- whether the bar is currently selectedhasRollover
- whether the bar currently is under the mouse cursorhasFocus
- whether the bar currently has focus (not yet supported)x
- the x pixel coordinate for the top left of the bary
- the y pixel coordinate for the top left of the barwidth
- the width of the bar in pixelsheight
- the height of the bar in pixels
createFrontPaint
protected Paint createFrontPaint(Orientation orientation,
Color color,
int x,
int y,
int width,
int height,
int depth)
createTopPaint
protected Paint createTopPaint(Orientation orientation,
Color color,
int x,
int y,
int width,
int height,
int depth)
darker
protected Color darker(Color color)
brighter
protected Color brighter(Color color)
getMinimumBreadth
public int getMinimumBreadth()
- Specified by:
getMinimumBreadth
in interface BarRenderer
- Specified by:
getMinimumBreadth
in interface BarRenderer2D