com.jidesoft.gauge
Class LineIndicatorRenderer
java.lang.Object
com.jidesoft.gauge.AbstractIndicatorRenderer<Bullet>
com.jidesoft.gauge.LineIndicatorRenderer
- All Implemented Interfaces:
- IndicatorRenderer<Bullet>
public class LineIndicatorRenderer
- extends AbstractIndicatorRenderer<Bullet>
A marker class for a specific value along a Bullet.
Method Summary |
protected Shape |
calculateShape(Bullet bullet,
Double value)
Calculates the shape of the indicator. |
protected void |
drawIndicator(Graphics2D g,
Bullet bullet,
Shape shape,
IndicatorStyle style)
|
Border |
getBorder()
|
double |
getBreadth()
Returns the value that determines how much of the breadth of the bullet is covered by this marker |
LineLabelPlacement |
getLabelPlacement()
|
double |
getLength()
|
double |
getLinePosition()
|
void |
paintLabel(Graphics2D g2d,
Bullet bullet,
Double value,
IndicatorStyle style)
|
Shape |
paintLegendItem(Graphics g,
Bullet bullet,
IndicatorStyle style,
int w,
int h)
Paints a LegendItem onto the supplied Graphics context using the other supplied parameters to help size and
style the LegendItem appropriately. |
void |
setBorder(Border border)
|
void |
setBreadth(double breadth)
Specify how much of the breadth of the bullet should be taken up by this marker. |
void |
setLabelPlacement(LineLabelPlacement labelPlacement)
|
void |
setLength(double length)
|
void |
setLinePosition(double linePosition)
|
Methods inherited from class com.jidesoft.gauge.AbstractIndicatorRenderer |
generateLabel, getLabelColor, getLabeler, getLabelFont, getLabelText, getShadowRenderer, paintIndicator, setLabelColor, setLabeler, setLabelFont, setLabelText, setShadowRenderer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineIndicatorRenderer
public LineIndicatorRenderer()
getBreadth
public double getBreadth()
- Returns the value that determines how much of the breadth of the bullet is covered by this marker
- Returns:
- a value between 0 and 1
setBreadth
public void setBreadth(double breadth)
- Specify how much of the breadth of the bullet should be taken up by this marker. By default this is 0.75
- Parameters:
breadth
- a value between 0 and 1 (inclusive) (default 0.75)
getLength
public double getLength()
setLength
public void setLength(double length)
getBorder
public Border getBorder()
setBorder
public void setBorder(Border border)
getLabelPlacement
public LineLabelPlacement getLabelPlacement()
setLabelPlacement
public void setLabelPlacement(LineLabelPlacement labelPlacement)
getLinePosition
public double getLinePosition()
setLinePosition
public void setLinePosition(double linePosition)
calculateShape
protected Shape calculateShape(Bullet bullet,
Double value)
- Description copied from class:
AbstractIndicatorRenderer
- Calculates the shape of the indicator. This is needed so that we can create a BufferedImage of the right
size when generating shadows
- Specified by:
calculateShape
in class AbstractIndicatorRenderer<Bullet>
- Parameters:
bullet
- the gauge, such as an instance of Bulletvalue
- the value to be represented by the indicator
drawIndicator
protected void drawIndicator(Graphics2D g,
Bullet bullet,
Shape shape,
IndicatorStyle style)
- Specified by:
drawIndicator
in class AbstractIndicatorRenderer<Bullet>
paintLabel
public void paintLabel(Graphics2D g2d,
Bullet bullet,
Double value,
IndicatorStyle style)
- Specified by:
paintLabel
in class AbstractIndicatorRenderer<Bullet>
paintLegendItem
public Shape paintLegendItem(Graphics g,
Bullet bullet,
IndicatorStyle style,
int w,
int h)
- Description copied from interface:
IndicatorRenderer
- Paints a LegendItem onto the supplied Graphics context using the other supplied parameters to help size and
style the LegendItem appropriately.
- Parameters:
g
- the Graphics context onto which we paintbullet
- the Gauge component (e.g. a Bullet)style
- the specified IndicatorStyle that may influence the paintingw
- the width of the legend item to be paintedh
- the height of the legend item to be painted
- Returns:
- the Shape of the painted item (can be null)