lt.monarch.chart.marker
Class CrossMarker

java.lang.Object
  extended by lt.monarch.chart.marker.AbstractMarker
      extended by lt.monarch.chart.marker.SimpleCachableMarker
          extended by lt.monarch.chart.marker.CrossMarker
All Implemented Interfaces:
java.io.Serializable, Marker, StyleEditorEntity, SymetricMarker, StylesheetListener
Direct Known Subclasses:
PolygonMarker

public class CrossMarker
extends SimpleCachableMarker

Renders a cross shaped marker.

See Also:
Serialized Form

Nested Class Summary
Modifier and Type Class and Description
 
Nested classes/interfaces inherited from class lt.monarch.chart.marker.SimpleCachableMarker
SimpleCachableMarker.AWTImageFactory, SimpleCachableMarker.BufferedImageFactory, SimpleCachableMarker.ImageFactory
 
Field Summary
Modifier and Type Field and Description
 
Fields inherited from class lt.monarch.chart.marker.SimpleCachableMarker
cacheImage, cachingEnabled, imageFactory, markerSize
 
Fields inherited from class lt.monarch.chart.marker.AbstractMarker
dirty, map, metaModel, paintStyle, projectedLocation, style
 
Constructor Summary
Constructor and Description
CrossMarker()
          Default CrossMarker constructor.
 
Method Summary
Modifier and Type Method and Description
 void draw(AbstractGraphics g, SeriesPaintTags tag, Style style)
          Renders the marker on the Graphics context.
 Rectangle2D getBounds()
          Gets bounds of this marker.
protected  Polygon2D getMarkerPolygon(double centerX, double centerY)
          Returns polygon with points forming cross.
protected  double getRotatedX(double x, double y)
          Returns x coordinate rotated clockwise by given angle.
protected  double getRotatedY(double x, double y)
          Returns y coordinate rotated clockwise by given angle.
 double getRotationAngle()
          Returns rotation angle (in radians) of marker.
 void setRotationAngle(double rotationAngle)
          Sets rotation angle of marker.
 
Methods inherited from class lt.monarch.chart.marker.SimpleCachableMarker
dispose, getMarkerSize, isCachingEnabled, resetCache, setCachingEnabled, setMarkerSize, stylesheetChanged, stylesheetKeyChanged
 
Methods inherited from class lt.monarch.chart.marker.AbstractMarker
clearChartObjectsMap, draw, finalize, getChartObjectBounds, getMetaModel, getPaintStyle, getParent, getStyle, getTransparencyValue, isVisible, mapChartObject, prepare, reset, setChartObjectsMap, setEntity, setLocation, setMetaModel, setTextAlignment, setTransparencyValue, setVisible
 
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
clearChartObjectsMap, draw, getMetaModel, getPaintStyle, getTransparencyValue, isVisible, prepare, reset, setChartObjectsMap, setEntity, setLocation, setMetaModel, setTextAlignment, setTransparencyValue
 
Methods inherited from interface lt.monarch.chart.engine.StyleEditorEntity
getChartObjectBounds, getParent, getStyle
 

Constructor Detail

CrossMarker

public CrossMarker()
Default CrossMarker constructor.

Method Detail

getBounds

public Rectangle2D getBounds()
Gets bounds of this marker.

Returns:
A rectangle indicating this marker's bounds

draw

public void draw(AbstractGraphics g,
                 SeriesPaintTags tag,
                 Style style)
Description copied from interface: Marker
Renders the marker on the Graphics context. Uses style colors.

Parameters:
g - graphics context
tag - painting tag
style - drawing style

getRotationAngle

public double getRotationAngle()
Returns rotation angle (in radians) of marker.

Returns:
Rotation angle in radians

setRotationAngle

public void setRotationAngle(double rotationAngle)
Sets rotation angle of marker. Given angle has to be in radians.

Parameters:
rotationAngle - Rotation angle of marker

getRotatedX

protected double getRotatedX(double x,
                             double y)
Returns x coordinate rotated clockwise by given angle.

Parameters:
x - Old x coordinate
y - Old y coordinate
Returns:
New rotated x coordinate
See Also:
getRotatedY(double, double)

getRotatedY

protected double getRotatedY(double x,
                             double y)
Returns y coordinate rotated clockwise by given angle.

Parameters:
x - Old x coordinate
y - Old y coordinate
Returns:
New rotated y coordinate
See Also:
getRotatedX(double, double)

getMarkerPolygon

protected Polygon2D getMarkerPolygon(double centerX,
                                     double centerY)
Returns polygon with points forming cross.

Parameters:
centerX - Center x coordinate of cross
centerY - Center y coordinate of cross
Returns:
Polygon forming cross