lt.monarch.chart.marker
Class AbstractMarker

java.lang.Object
  extended by lt.monarch.chart.marker.AbstractMarker
All Implemented Interfaces:
java.io.Serializable, Marker, StyleEditorEntity
Direct Known Subclasses:
AbstractTextMarker, EmptyMarker, ImageMarker, NullMarker, SimpleCachableMarker

public abstract class AbstractMarker
extends java.lang.Object
implements Marker, java.io.Serializable

An abstract adapter class for creating markers. The methods in this class are empty.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  boolean dirty
          Is object dirty
protected  ChartObjectsMap map
           
protected  MetaDataModel metaModel
          Meta data model
protected  PaintStyle<AbstractPaintTags> paintStyle
          Color style object, used to set the entityStyle to the style-sheet
protected  Point2D projectedLocation
          location point of the marker
 Style style
          Local style-sheet.
 
Constructor Summary
Constructor and Description
AbstractMarker()
           
 
Method Summary
Modifier and Type Method and Description
 void clearChartObjectsMap()
          Deprecated. now all maps are cleared before drawing
 void dispose()
          Disposes object
 void draw(AbstractGraphics g, SeriesPaintTags tag)
          Renders the marker on the Graphics context.
protected  void finalize()
           
 Rectangle2D getChartObjectBounds()
          Gets bounds of chart object
 MetaDataModel getMetaModel()
          Returns Meta data model
 PaintStyle<AbstractPaintTags> getPaintStyle()
          Gets the paint style of the marker
 java.lang.Object getParent()
          Return the parent chart object
 AbstractStyle getStyle(StyleType styleType)
          Gets style object for the stylesheet attributes specified by style type.
 int getTransparencyValue()
          Gets the transparency value for the marker
 boolean isVisible()
          Specifies if a chart object is drawn
protected  void mapChartObject(AbstractPaintTags tag, java.awt.Shape shape)
          Maps the marker & tag to the specified shape.
 void prepare(AbstractGraphics g)
          Prepares the marker for drawing.
 void reset()
          Resets marker after use.
 void setChartObjectsMap(ChartObjectsMap map)
          Set chart object map
 void setEntity(ChartEntity entity)
          References the entity object, for which the marker is being painted.
 void setLocation(Projector projector, GeneralPoint npt)
          Sets location of the marker.
 void setMetaModel(MetaDataModel metaModel)
          Sets meta data model
 void setTextAlignment(Alignment hAlign, Alignment vAlign)
          Sets text alignment for labeled marker.
 void setTransparencyValue(int transparencyValue)
          Sets the transparency value for the marker
 void setVisible(boolean visible)
          Specifies if a chart object is drawn
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lt.monarch.chart.engine.Marker
draw, getBounds
 

Field Detail

dirty

protected boolean dirty
Is object dirty


metaModel

protected MetaDataModel metaModel
Meta data model


style

public final Style style
Local style-sheet. All color and font information is stored here


paintStyle

protected PaintStyle<AbstractPaintTags> paintStyle
Color style object, used to set the entityStyle to the style-sheet


projectedLocation

protected Point2D projectedLocation
location point of the marker


map

protected ChartObjectsMap map
Constructor Detail

AbstractMarker

public AbstractMarker()
Method Detail

setEntity

public void setEntity(ChartEntity entity)
References the entity object, for which the marker is being painted. Empty implementation.

Specified by:
setEntity in interface Marker
Parameters:
entity - the chart entity

prepare

public void prepare(AbstractGraphics g)
Prepares the marker for drawing. Empty implementation.

Specified by:
prepare in interface Marker
Parameters:
g - he Graphics context in which entity will be painted

draw

public void draw(AbstractGraphics g,
                 SeriesPaintTags tag)
Description copied from interface: Marker
Renders the marker on the Graphics context. Uses current color set in the Graphics object for marker outline. Or Style object colors.

Specified by:
draw in interface Marker
Parameters:
g - graphics context
tag - painting tag

reset

public void reset()
Resets marker after use. Empty implementation.

Specified by:
reset in interface Marker

setTextAlignment

public void setTextAlignment(Alignment hAlign,
                             Alignment vAlign)
Sets text alignment for labeled marker. Empty implementation.

Specified by:
setTextAlignment in interface Marker
Parameters:
hAlign - horizontal alignment
vAlign - vertical alignment

getMetaModel

public MetaDataModel getMetaModel()
Description copied from interface: Marker
Returns Meta data model

Specified by:
getMetaModel in interface Marker
Returns:
meta data model

setMetaModel

public void setMetaModel(MetaDataModel metaModel)
Description copied from interface: Marker
Sets meta data model

Specified by:
setMetaModel in interface Marker
Parameters:
metaModel - meta data model

getPaintStyle

public PaintStyle<AbstractPaintTags> getPaintStyle()
Description copied from interface: Marker
Gets the paint style of the marker

Specified by:
getPaintStyle in interface Marker
Returns:
marker color style object, to set the entityStyle there.

setLocation

public void setLocation(Projector projector,
                        GeneralPoint npt)
Sets location of the marker.

Specified by:
setLocation in interface Marker
Parameters:
projector - projector used to project the normalized point
npt - normalized point that specifies marker position

dispose

public void dispose()
Disposes object

Specified by:
dispose in interface Marker

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setTransparencyValue

public void setTransparencyValue(int transparencyValue)
Description copied from interface: Marker
Sets the transparency value for the marker

Specified by:
setTransparencyValue in interface Marker
Parameters:
transparencyValue - Transparency value from 0 to 255

getTransparencyValue

public int getTransparencyValue()
Description copied from interface: Marker
Gets the transparency value for the marker

Specified by:
getTransparencyValue in interface Marker
Returns:
transparencyValue Transparency value from 0 to 255

getStyle

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

Specified by:
getStyle in interface StyleEditorEntity
Parameters:
styleType - style type attributes
Returns:
the style object

getChartObjectBounds

public Rectangle2D getChartObjectBounds()
Description copied from interface: StyleEditorEntity
Gets bounds of chart object

Specified by:
getChartObjectBounds in interface StyleEditorEntity
Returns:
A rectangle indicating this chart object bounds

getParent

public java.lang.Object getParent()
Description copied from interface: StyleEditorEntity
Return the parent chart object

Specified by:
getParent in interface StyleEditorEntity
Returns:
the parent

setChartObjectsMap

public void setChartObjectsMap(ChartObjectsMap map)
Description copied from interface: Marker
Set chart object map

Specified by:
setChartObjectsMap in interface Marker
Parameters:
map - of chart object

clearChartObjectsMap

public void clearChartObjectsMap()
Deprecated. now all maps are cleared before drawing

Does nothing.

Specified by:
clearChartObjectsMap in interface Marker

mapChartObject

protected void mapChartObject(AbstractPaintTags tag,
                              java.awt.Shape shape)
Maps the marker & tag to the specified shape.

Parameters:
tag - the paint tag
shape - the shape

isVisible

public boolean isVisible()
Specifies if a chart object is drawn

Specified by:
isVisible in interface Marker

setVisible

public void setVisible(boolean visible)
Specifies if a chart object is drawn