lt.monarch.chart.chart2D
Class MarkerRange

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<MarkerPaintTags>
      extended by lt.monarch.chart.AbstractChartMarker
          extended by lt.monarch.chart.chart2D.MarkerRange
All Implemented Interfaces:
java.io.Serializable, ChartObject, StyleEditorEntity
Direct Known Subclasses:
HorizontalMarkerRange, VerticalMarkerRange

public abstract class MarkerRange
extends AbstractChartMarker

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  java.awt.Image fillImage
           
protected  PlaneMapper mapper
          mapper, used to map output to a plane in a n-dimensional space
protected  java.lang.Object max
          Specifies marker range end position on some axis
protected  java.lang.Object min
          Specifies marker range start position on some axis
 
Fields inherited from class lt.monarch.chart.AbstractChartMarker
axisMapper, label, textStyle
 
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
MarkerRange(PlaneMapper mapper, AxisMapper axisMapper)
          Constructs a new MarkerRange with the specified plane and axis mappers.
 
Method Summary
Modifier and Type Method and Description
 void draw(AbstractGraphics g)
          Paints the horizontal marker line in the specified Graphics context.
protected  void drawLabel(AbstractGraphics g, Rectangle2D bounds, double min, double max)
          Draws marker range label
protected abstract  void drawRange(AbstractGraphics g, Rectangle2D bounds)
           
 Rectangle2D getChartObjectBounds()
          Gets bounds of chart object
protected abstract  Rectangle2D getLabelBounds(AbstractGraphics g, double min, double max, Point2D left, Point2D right, TextPainter painter)
          Gets label bounds
 java.lang.Object getMax()
          Gets range maximum value
 java.lang.Object getMin()
          Gets range minimum value
protected abstract  Rectangle2D setBounds(double min, double max)
          Sets normalized coordinates for the marker range
 void setLabelPosition(double position, Alignment align)
          Sets the alignment and position of the label.
 void setLabelPosition(double position, Alignment align, Orientation orientation)
          Sets the position, alignment and orientation of the label.
 void setRange(java.lang.Object min, java.lang.Object max)
          Sets the marker range position.
 
Methods inherited from class lt.monarch.chart.AbstractChartMarker
getAxisMapper, getLabel, getPaintMode, getParent, getSortPosition, getStyle, getTextStyle, isLabelEmpty, setLabel, setPaintMode
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
activate, chart, copy, deactivate, dispose, finalize, getChart, getPaintStyle, 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
mapper, used to map output to a plane in a n-dimensional space


min

protected java.lang.Object min
Specifies marker range start position on some axis


max

protected java.lang.Object max
Specifies marker range end position on some axis


fillImage

protected java.awt.Image fillImage
Constructor Detail

MarkerRange

public MarkerRange(PlaneMapper mapper,
                   AxisMapper axisMapper)
Constructs a new MarkerRange with the specified plane and axis mappers.

Parameters:
mapper - the plane mapper
axisMapper - the axis mapper
Method Detail

setLabelPosition

public void setLabelPosition(double position,
                             Alignment align)
Sets the alignment and position of the label.

Parameters:
position - label position on the line in range 0..1
align - label alignment

setLabelPosition

public void setLabelPosition(double position,
                             Alignment align,
                             Orientation orientation)
Sets the position, alignment and orientation of the label.

Parameters:
position - label position on the line in range 0..1
align - label alignment
orientation - label orientation

setRange

public void setRange(java.lang.Object min,
                     java.lang.Object max)
Sets the marker range position.

Parameters:
min - Minimum range value
max - Maximum range value

getLabelBounds

protected abstract Rectangle2D getLabelBounds(AbstractGraphics g,
                                              double min,
                                              double max,
                                              Point2D left,
                                              Point2D right,
                                              TextPainter painter)
Gets label bounds

Parameters:
g - graphics context
min - minimum value [0..1]
max - maximum value [0..1]
left - left point
right - right point
painter - painter
Returns:
bound rectangle

setBounds

protected abstract Rectangle2D setBounds(double min,
                                         double max)
Sets normalized coordinates for the marker range

Parameters:
min - minimum value [0..1]
max - maximum value [0..1]
Returns:
rectangle bounds

drawRange

protected abstract void drawRange(AbstractGraphics g,
                                  Rectangle2D bounds)

draw

public void draw(AbstractGraphics g)
Paints the horizontal marker line in the specified Graphics context.

Parameters:
g - the Graphics context in which to paint marker line

drawLabel

protected void drawLabel(AbstractGraphics g,
                         Rectangle2D bounds,
                         double min,
                         double max)
Draws marker range label

Parameters:
g - graphics context
bounds - label bounds
min - minimum range value (mapped)
max - maximum range value (mapped)

getMin

public java.lang.Object getMin()
Gets range minimum value

Returns:
range minimum value

getMax

public java.lang.Object getMax()
Gets range maximum value

Returns:
range maximum value

getChartObjectBounds

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

Specified by:
getChartObjectBounds in interface StyleEditorEntity
Overrides:
getChartObjectBounds in class AbstractChartObject<MarkerPaintTags>
Returns:
A rectangle indicating this chart object bounds