JIDE 3.5.15

com.jidesoft.gauge
Class BarIndicatorRenderer

java.lang.Object
  extended by com.jidesoft.gauge.AbstractIndicatorRenderer<Bullet>
      extended by com.jidesoft.gauge.BarIndicatorRenderer
All Implemented Interfaces:
IndicatorRenderer<Bullet>

public class BarIndicatorRenderer
extends AbstractIndicatorRenderer<Bullet>

A renderer to be used with the Bullet class and which renders its value as a horizontal or vertical bar whose length indicates the value.


Field Summary
 
Fields inherited from class com.jidesoft.gauge.AbstractIndicatorRenderer
labelColor, labelFont
 
Constructor Summary
BarIndicatorRenderer()
           
 
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)
           
 double getBarBreadth()
           
 double getBarPosition()
           
 Border getBorder()
          Returns the border to be applied to the Indicator, or null if no border is defined
 BarLabelPlacement getLabelPlacement()
           
 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 setBarBreadth(double barBreadth)
           
 void setBarPosition(double barPosition)
           
 void setBorder(Border border)
          If a border is defined, it overrides any outline defined in the IndicatorStyle
 void setLabelPlacement(BarLabelPlacement labelPlacement)
           
 
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
 

Constructor Detail

BarIndicatorRenderer

public BarIndicatorRenderer()
Method Detail

getLabelPlacement

public BarLabelPlacement getLabelPlacement()

setLabelPlacement

public void setLabelPlacement(BarLabelPlacement labelPlacement)

getBarBreadth

public double getBarBreadth()

setBarBreadth

public void setBarBreadth(double barBreadth)

getBarPosition

public double getBarPosition()

setBarPosition

public void setBarPosition(double barPosition)

getBorder

public Border getBorder()
Returns the border to be applied to the Indicator, or null if no border is defined

Returns:
the Border to be applied to the Indicator

setBorder

public void setBorder(Border border)
If a border is defined, it overrides any outline defined in the IndicatorStyle

Parameters:
border - the Border to be applied to the bar indicator

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 Bullet
value - 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 paint
bullet - the Gauge component (e.g. a Bullet)
style - the specified IndicatorStyle that may influence the painting
w - the width of the legend item to be painted
h - the height of the legend item to be painted
Returns:
the Shape of the painted item (can be null)

JIDE 3.5.15