lt.monarch.chart.marker
Class TextMarker

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<MarkerTextPaintTags>
      extended by lt.monarch.chart.marker.TextMarker
All Implemented Interfaces:
java.io.Serializable, ChartObject, StyleEditorEntity

public class TextMarker
extends AbstractChartObject<MarkerTextPaintTags>

Draws the rectangle with text. The rectangle is bound to the a given coordinate space value.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  PlaneMapper mapper
           
protected  AbstractTextPainter textPainter
           
protected  TextStyle<MarkerTextPaintTags> textStyle
          Text style object for getting and setting entityStyle to style-sheet
protected  Alignment xAlignment
           
protected  AxisMapper xMapper
           
protected  java.lang.Object xPos
           
protected  Alignment yAlignment
           
protected  AxisMapper yMapper
           
protected  java.lang.Object yPos
           
 
Fields inherited from class lt.monarch.chart.engine.AbstractChartObject
AXIS_SORT_POSITION, BREAK_LINE_POSITION, DEFAULT_SORT_POSITION, GRID_SORT_POSITION, MARKER_SERIES_SORT_POSITION, MARKERS_SORT_POSITION, paintStyle, SERIES_SORT_POSITION, sortPosition, style
 
Constructor Summary
Constructor and Description
TextMarker(java.lang.String s, Axis xAxis, Axis yAxis)
          Constructs a text marker with given text.
TextMarker(java.lang.String s, PlaneMapper mapper, AxisMapper xMapper, AxisMapper yMapper)
          Constructs a TextMarker with given text, plane mapper and axis mappers.
 
Method Summary
Modifier and Type Method and Description
 void draw(AbstractGraphics g)
          Paints the text box using current style Font, foreground and background colors.
 Alignment getHAlignment()
          Returns horizontal text alignment value.
 Projector getProjector()
          Returns modified projector.
 int getSortPosition()
          Returns chart object paint order index.
 AbstractStyle getStyle(StyleType styleType)
          Gets style object for the stylesheet attributes specified by style type.
 TextStyle<MarkerTextPaintTags> getTextStyle()
          Get text style object.
 Alignment getVAlignment()
          Returns vertical text alignment value.
 void setAlignment(Alignment hAlign, Alignment vAlign)
          Sets text alignment.
 void setPosition(java.lang.Object x, java.lang.Object y)
          Sets rectangle position.
 void setText(java.lang.String s)
          Sets text to be displayed inside rectangle.
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
activate, chart, copy, deactivate, dispose, finalize, getChart, getChartObjectBounds, getPaintStyle, getParent, getStyle, invalidate, isVisible, layout, repaint, repaint, setChart, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapper

protected final PlaneMapper mapper

xMapper

protected final AxisMapper xMapper

yMapper

protected final AxisMapper yMapper

textPainter

protected AbstractTextPainter textPainter

xPos

protected java.lang.Object xPos

yPos

protected java.lang.Object yPos

xAlignment

protected Alignment xAlignment

yAlignment

protected Alignment yAlignment

textStyle

protected TextStyle<MarkerTextPaintTags> textStyle
Text style object for getting and setting entityStyle to style-sheet

Constructor Detail

TextMarker

public TextMarker(java.lang.String s,
                  Axis xAxis,
                  Axis yAxis)
Constructs a text marker with given text.

Parameters:
s - text for the text marker
xAxis - X axis
yAxis - Y axis

TextMarker

public TextMarker(java.lang.String s,
                  PlaneMapper mapper,
                  AxisMapper xMapper,
                  AxisMapper yMapper)
Constructs a TextMarker with given text, plane mapper and axis mappers.

Parameters:
s - text for the text marker
mapper - plane mapper
xMapper - X axis mapper
yMapper - Y axis mapper
Method Detail

setText

public void setText(java.lang.String s)
Sets text to be displayed inside rectangle.

Parameters:
s - text for the text marker

setPosition

public void setPosition(java.lang.Object x,
                        java.lang.Object y)
Sets rectangle position. Values are given in user coordinates.

Parameters:
x - X position value
y - Y position value

setAlignment

public void setAlignment(Alignment hAlign,
                         Alignment vAlign)
Sets text alignment.

Parameters:
hAlign - new horizontal alignment. Possible values are : CENTER, LEFT, RIGHT.
vAlign - new vertical alignment. Possible values are : CENTER, TOP, BOTTOM.

getHAlignment

public Alignment getHAlignment()
Returns horizontal text alignment value.

Returns:
xAlignment horizontal position

getVAlignment

public Alignment getVAlignment()
Returns vertical text alignment value.

Returns:
vertical alignment.

getProjector

public Projector getProjector()
Returns modified projector.

Returns:
projector

draw

public void draw(AbstractGraphics g)
Paints the text box using current style Font, foreground and background colors.

Parameters:
g - Graphics context

getTextStyle

public TextStyle<MarkerTextPaintTags> getTextStyle()
Get text style object.

Returns:
text style object

getSortPosition

public int getSortPosition()
Description copied from interface: ChartObject
Returns chart object paint order index.

Specified by:
getSortPosition in interface ChartObject
Overrides:
getSortPosition in class AbstractChartObject<MarkerTextPaintTags>
Returns:
object paint order index

getStyle

public AbstractStyle getStyle(StyleType styleType)
Description copied from interface: ChartObject
Gets style object for the stylesheet attributes specified by style type.

Specified by:
getStyle in interface ChartObject
Specified by:
getStyle in interface StyleEditorEntity
Overrides:
getStyle in class AbstractChartObject<MarkerTextPaintTags>
Parameters:
styleType - style type attributes
Returns:
the style object