lt.monarch.chart.plugins
Class AbstractChartPlugin<ChartType extends Chart<?>>

java.lang.Object
  extended by lt.monarch.chart.plugins.AbstractChartPlugin<ChartType>
All Implemented Interfaces:
java.io.Serializable, ChartPlugin<ChartType>
Direct Known Subclasses:
ActiveChartPlugin, AutoAxisAdjuster, AxisLabelsURLSupport, AxisMarker, AxisRangeAdjuster, BoxZoomer, ChartProjectorZoomer, ChartResizer, ChartRotator, ChartZoomer, ClickZoom, ColorThemesPlugin, CursorChangerPlugin, DrillDown, ImagePlugin, LegendSelector, MarkerPainter, MarkerValuePlugin, PieChartExploder, PieChartRotator, PieChartZoomer, PointLineValue, ToolTipManager, TouchZoomer, ValueMarkerPainter

public abstract class AbstractChartPlugin<ChartType extends Chart<?>>
extends java.lang.Object
implements ChartPlugin<ChartType>, java.io.Serializable

Base implementation of ChartPlugin

See Also:
ChartPlugin, Serialized Form

Constructor Summary
Constructor and Description
AbstractChartPlugin()
           
 
Method Summary
Modifier and Type Method and Description
abstract  void activate()
          Prepares the plug-in, when it is installed.
 void adjustChart()
          Performs chart objects modifications.
protected  ChartType chart()
          Deprecated. use getChart()
abstract  void deactivate()
          Cleanups the plug-in, when it is uninstalled.
protected  ChartType getChart()
          Returns hosting chart.
 void install(ChartType chart)
          Prepares this plug-in for operation on the specified chart.
 boolean isActivated()
          Checks if the plug-in is activated
 void paint(AbstractGraphics g)
          Does nothing- must be overridden in extending classes.
 void uninstall(ChartType chart)
          Shuts down the plug-in by removing it from the chart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractChartPlugin

public AbstractChartPlugin()
Method Detail

install

public void install(ChartType chart)
Prepares this plug-in for operation on the specified chart. Registers ViewListener to listen when hosting chart is activated or deactivated. When this happens, plugin's activate and deactivate methods are called respectively.

Specified by:
install in interface ChartPlugin<ChartType extends Chart<?>>
Parameters:
chart - hosting chart

uninstall

public void uninstall(ChartType chart)
Shuts down the plug-in by removing it from the chart.

Specified by:
uninstall in interface ChartPlugin<ChartType extends Chart<?>>
Parameters:
chart - hosting chart

chart

@Deprecated
protected ChartType chart()
Deprecated. use getChart()

Returns hosting chart.

Returns:
hosting chart

getChart

protected ChartType getChart()
Returns hosting chart.

Returns:
hosting chart

paint

public void paint(AbstractGraphics g)
Does nothing- must be overridden in extending classes.

Specified by:
paint in interface ChartPlugin<ChartType extends Chart<?>>
Parameters:
g - the Graphics context in which chart is painted
See Also:
ChartPlugin.paint(lt.monarch.chart.engine.AbstractGraphics)

adjustChart

public void adjustChart()
Description copied from interface: ChartPlugin
Performs chart objects modifications. Is called before chart paint.

Specified by:
adjustChart in interface ChartPlugin<ChartType extends Chart<?>>

isActivated

public boolean isActivated()
Description copied from interface: ChartPlugin
Checks if the plug-in is activated

Specified by:
isActivated in interface ChartPlugin<ChartType extends Chart<?>>
Returns:
returns true if plug-in is activated

activate

public abstract void activate()
Prepares the plug-in, when it is installed. Also called when chart is activated.


deactivate

public abstract void deactivate()
Cleanups the plug-in, when it is uninstalled. Also called when chart is deactivated.