lt.monarch.chart.legend.symbols
Class LegendSegmentSymbol

java.lang.Object
  extended by lt.monarch.chart.engine.LegendSymbol
      extended by lt.monarch.chart.legend.symbols.LegendSegmentSymbol
All Implemented Interfaces:
java.io.Serializable

public class LegendSegmentSymbol
extends LegendSymbol

Legend symbol with a line segment and markers on each side

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  Style style
          stylesheet of the legend symbol
 
Fields inherited from class lt.monarch.chart.engine.LegendSymbol
paintStyle
 
Constructor Summary
Constructor and Description
LegendSegmentSymbol(java.awt.Color color, Marker startMarker, Marker endMarker)
          Constructs a new symbol with explicit colors.
LegendSegmentSymbol(java.awt.Color color, java.awt.Stroke stroke, Marker startMarker, Marker endMarker)
          Constructs a new symbol with explicit colors.
LegendSegmentSymbol(Style style)
          Constructs a new symbol from a stylesheet.
 
Method Summary
Modifier and Type Method and Description
 void draw(AbstractGraphics g, Style legendStyle, 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.
 
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 final Style style
stylesheet of the legend symbol

Constructor Detail

LegendSegmentSymbol

public LegendSegmentSymbol(Style style)
Constructs a new symbol from a stylesheet. Uses stylesheet stroke, foreground and marker attributes to render the symbol

Parameters:
style - stylesheet

LegendSegmentSymbol

public LegendSegmentSymbol(java.awt.Color color,
                           java.awt.Stroke stroke,
                           Marker startMarker,
                           Marker endMarker)
Constructs a new symbol with explicit colors.

Parameters:
color - color
stroke - line stroke
startMarker - start marker
endMarker - end marker

LegendSegmentSymbol

public LegendSegmentSymbol(java.awt.Color color,
                           Marker startMarker,
                           Marker endMarker)
Constructs a new symbol with explicit colors.

Parameters:
color - color
startMarker - start marker
endMarker - end marker
Method Detail

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:
this symbols's preferred height

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 legendStyle,
                 Rectangle2D bounds,
                 PaintMode paintMode)
Description copied from class: LegendSymbol
Renders the symbol.

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