lt.monarch.chart.legend.symbols
Class LegendBoxSymbol

java.lang.Object
  extended by lt.monarch.chart.engine.LegendSymbol
      extended by lt.monarch.chart.legend.symbols.LegendBoxSymbol
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LegendPieSymbol

public class LegendBoxSymbol
extends LegendSymbol

Legend symbol to refer to the filled series. Draws a box, filled with the specified color.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  PaintMode paintMode
           
protected  Style style
          stylesheet of the legend box symbol
 
Fields inherited from class lt.monarch.chart.engine.LegendSymbol
paintStyle
 
Constructor Summary
Constructor and Description
LegendBoxSymbol(java.awt.Color color)
          Constructs a new symbol with explicit color constants.
LegendBoxSymbol(Style style)
          Constructs a new symbol from a stylesheet.
 
Method Summary
Modifier and Type Method and Description
 void draw(AbstractGraphics g, Style style, Rectangle2D bounds, PaintMode paintMode)
          Renders the symbol.
 int getPreferredHeight(AbstractGraphics g)
          Gets the preferred height of this legend symbol.
 int getPreferredWidth(AbstractGraphics g)
          Gets the preferred width of this legend symbol.
 Style getStyle()
           
 
Methods inherited from class lt.monarch.chart.engine.LegendSymbol
getReferencedEntity, setReferencedEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

style

protected Style style
stylesheet of the legend box symbol


paintMode

protected PaintMode paintMode
Constructor Detail

LegendBoxSymbol

public LegendBoxSymbol(Style style)
Constructs a new symbol from a stylesheet. Uses the background property to set background color.

Parameters:
style - stylesheet style sheet to set

LegendBoxSymbol

public LegendBoxSymbol(java.awt.Color color)
Constructs a new symbol with explicit color constants.

Parameters:
color - toFill color
Method Detail

getStyle

public Style getStyle()

getPreferredHeight

public int getPreferredHeight(AbstractGraphics g)
Gets the preferred height of this legend symbol.

Specified by:
getPreferredHeight in class LegendSymbol
Parameters:
g - graphics context for which the preferred height is to be calculated
Returns:
preferred height of the symbol

getPreferredWidth

public int getPreferredWidth(AbstractGraphics g)
Gets the preferred width of this legend symbol.

Specified by:
getPreferredWidth in class LegendSymbol
Parameters:
g - graphics context for which the preferred width is to be calculated
Returns:
this symbols's preferred width

draw

public void draw(AbstractGraphics g,
                 Style style,
                 Rectangle2D bounds,
                 PaintMode paintMode)
Description copied from class: LegendSymbol
Renders the symbol.

Specified by:
draw in class LegendSymbol
Parameters:
g - graphics context
style - legend stylesheet for common attributes, such a box symbol border
bounds - symbol bounds
paintMode - paint mode