lt.monarch.chart.engine
Class AbstractChartObject<E extends AbstractPaintTags>

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<E>
All Implemented Interfaces:
java.io.Serializable, ChartObject, StyleEditorEntity
Direct Known Subclasses:
AbstractChartMarker, AbstractChartSeries, AbstractGrid, Axis, AxisTitle, BoxMarker, ChartBreakLine, Grid3D, RadarAxisSet, TextMarker

public abstract class AbstractChartObject<E extends AbstractPaintTags>
extends java.lang.Object
implements ChartObject, StyleEditorEntity, java.io.Serializable

Base implementation of the ChartObject interface.

See Also:
ChartObject, Serialized Form

Field Summary
Modifier and Type Field and Description
static int AXIS_SORT_POSITION
           
static int BREAK_LINE_POSITION
           
static int DEFAULT_SORT_POSITION
           
static int GRID_SORT_POSITION
           
static int MARKER_SERIES_SORT_POSITION
           
static int MARKERS_SORT_POSITION
           
protected  PaintStyle<E> paintStyle
          Color style object for getting and setting entityStyle to stylesheet
static int SERIES_SORT_POSITION
           
protected  int sortPosition
           
 Style style
          Local stylesheet.
 
Constructor Summary
Constructor and Description
AbstractChartObject()
          Sole constructor.
 
Method Summary
Modifier and Type Method and Description
protected  void activate()
          Prepares the chart object, when it is added to a chart
 Chart chart()
          Deprecated. use getChart();
 void copy(AbstractChartObject src)
          Copies chart object settings from source chart object (style)
protected  void deactivate()
          Cleanups the chart object, when it is removed from the chart
 void dispose()
          Cleanups this chart object.
protected  void finalize()
          Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
 Chart<? extends Projector> getChart()
          Returns chart associated with this chart object.
 Rectangle2D getChartObjectBounds()
          Gets bounds of chart object
 PaintStyle<E> getPaintStyle()
          Gets series paint style object
 java.lang.Object getParent()
          Return the parent chart object
 int getSortPosition()
          Returns chart object paint order index.
 Style getStyle()
          Local stylesheet.
 AbstractStyle getStyle(StyleType styleType)
          Gets style object for the stylesheet attributes specified by style type.
 void invalidate()
          Calls chart's invalidate method, if it is set for this chart object.
 boolean isVisible()
          Specifies if a chart object is drawn
 void layout(AbstractGraphics g)
          Dummy ChartObject interface's layout method implementation.
 void repaint()
          If chart for this object is set, clears chart from HotSpotMap and calls it's repaint method.
 void repaint(Rectangle2D r)
          If chart for this object is set, clears chart from HotSpotMap and calls it's repaint(Rectangle r) method.
 void setChart(Chart chart)
          Associates this object with a chart.
 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.ChartObject
draw
 

Field Detail

GRID_SORT_POSITION

public static final int GRID_SORT_POSITION
See Also:
Constant Field Values

SERIES_SORT_POSITION

public static final int SERIES_SORT_POSITION
See Also:
Constant Field Values

MARKERS_SORT_POSITION

public static final int MARKERS_SORT_POSITION
See Also:
Constant Field Values

DEFAULT_SORT_POSITION

public static final int DEFAULT_SORT_POSITION
See Also:
Constant Field Values

MARKER_SERIES_SORT_POSITION

public static final int MARKER_SERIES_SORT_POSITION
See Also:
Constant Field Values

AXIS_SORT_POSITION

public static final int AXIS_SORT_POSITION
See Also:
Constant Field Values

BREAK_LINE_POSITION

public static final int BREAK_LINE_POSITION
See Also:
Constant Field Values

style

public final Style style
Local stylesheet. All color and font information is stored here. Depreciated use getStyle(), getPaintStyle() instead


sortPosition

protected final int sortPosition

paintStyle

protected PaintStyle<E extends AbstractPaintTags> paintStyle
Color style object for getting and setting entityStyle to stylesheet

Constructor Detail

AbstractChartObject

public AbstractChartObject()
Sole constructor. (For invocation by subclass constructors).

Method Detail

isVisible

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

Specified by:
isVisible in interface ChartObject

setVisible

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


getSortPosition

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

Specified by:
getSortPosition in interface ChartObject
Returns:
object paint order index

layout

public void layout(AbstractGraphics g)
Dummy ChartObject interface's layout method implementation.

Specified by:
layout in interface ChartObject
Parameters:
g - the Graphics context in which chart object will be painted
See Also:
ChartObject.layout(lt.monarch.chart.engine.AbstractGraphics)

invalidate

public void invalidate()
Calls chart's invalidate method, if it is set for this chart object.

Specified by:
invalidate in interface ChartObject
See Also:
ChartObject.invalidate()

repaint

public void repaint()
If chart for this object is set, clears chart from HotSpotMap and calls it's repaint method.

Specified by:
repaint in interface ChartObject

repaint

public void repaint(Rectangle2D r)
If chart for this object is set, clears chart from HotSpotMap and calls it's repaint(Rectangle r) method.

Specified by:
repaint in interface ChartObject
Parameters:
r - chart object region to repaint

setChart

public void setChart(Chart chart)
Associates this object with a chart. This method is called automatically by a Chart object.

Specified by:
setChart in interface ChartObject
Parameters:
chart - chart

getChart

public Chart<? extends Projector> getChart()
Returns chart associated with this chart object.

Specified by:
getChart in interface ChartObject
Returns:
chart associated with this chart object

chart

@Deprecated
public Chart chart()
Deprecated. use getChart();

Returns chart associated with this chart object.

Returns:
chart associated with this chart object

activate

protected void activate()
Prepares the chart object, when it is added to a chart


deactivate

protected void deactivate()
Cleanups the chart object, when it is removed from the chart


dispose

public void dispose()
Cleanups this chart object. After this chart object is unusable can be garbage collected.

Specified by:
dispose in interface ChartObject

finalize

protected void finalize()
                 throws java.lang.Throwable
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. Calls cleanup method if it isn't called yet.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable - the Exception raised by this method

getPaintStyle

public PaintStyle<E> getPaintStyle()
Gets series paint style object

Returns:
the paintStyle object

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
Parameters:
styleType - style type attributes
Returns:
the style object

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

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

getStyle

public Style getStyle()
Local stylesheet. All color and font information is stored here.

Specified by:
getStyle in interface ChartObject

copy

public void copy(AbstractChartObject src)
Copies chart object settings from source chart object (style)

Parameters:
src - source chart object