JIDE 3.5.15

com.jidesoft.chart.model
Class AnnotatedChartModelAdapter

java.lang.Object
  extended by com.jidesoft.chart.model.AnnotatedChartModelAdapter
All Implemented Interfaces:
AnnotatedChartModel, AnnotationModel, ChartModel, ChartModelListener, Named, Iterable<Chartable>

public class AnnotatedChartModelAdapter
extends Object
implements AnnotatedChartModel, ChartModelListener

A class that accepts a regular ChartModel and exposes the interface of an Annotated ChartModel


Constructor Summary
AnnotatedChartModelAdapter(ChartModel delegate)
           
 
Method Summary
 void addChartModelListener(ChartModelListener listener)
          Register the listener's interest in this chart model.
 void chartModelChanged()
          Call-back method to notify the listener that the chart model has changed
protected  void fireModelChanged()
           
 Annotation getAnnotation(int n)
          Gets the nth annotation.
 int getAnnotationCount()
          Returns the number of annotations
 ChartModel getDelegate()
           
 String getName()
          The name of a ChartModel is important, as different chart models are assumed to have different names.
 Chartable getPoint(int n)
          Gets the nth point.
 int getPointCount()
          Gets the number of points in the data set
 boolean isAnnotationsVisible()
          Use this method to discover whether annotations should be shown or hidden.
 boolean isCyclical()
          Should a line be drawn from the last to the first point?
 Iterator<Chartable> iterator()
           
 void removeChartModelListener(ChartModelListener listener)
          De-register the listener's interest in this chart model.
 void setAnnotationsVisible(boolean visible)
          Specify whether annotations should be shown
 void setDelegate(ChartModel newDelegate)
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedChartModelAdapter

public AnnotatedChartModelAdapter(ChartModel delegate)
Method Detail

getDelegate

public ChartModel getDelegate()

setDelegate

public void setDelegate(ChartModel newDelegate)

addChartModelListener

public void addChartModelListener(ChartModelListener listener)
Description copied from interface: ChartModel
Register the listener's interest in this chart model.

Specified by:
addChartModelListener in interface ChartModel
Parameters:
listener - the listener that will receive events

removeChartModelListener

public void removeChartModelListener(ChartModelListener listener)
Description copied from interface: ChartModel
De-register the listener's interest in this chart model.

Specified by:
removeChartModelListener in interface ChartModel
Parameters:
listener - the listener that will no longer receive events

fireModelChanged

protected void fireModelChanged()

chartModelChanged

public void chartModelChanged()
Description copied from interface: ChartModelListener
Call-back method to notify the listener that the chart model has changed

Specified by:
chartModelChanged in interface ChartModelListener

update

public void update()

getName

public String getName()
Description copied from interface: ChartModel
The name of a ChartModel is important, as different chart models are assumed to have different names. If you're adding multiple models to a Chart, make sure they have different names.

Specified by:
getName in interface ChartModel
Specified by:
getName in interface Named
Returns:
a distinct name for this data set

getPoint

public Chartable getPoint(int n)
Description copied from interface: ChartModel
Gets the nth point. The first point has index 0.

Specified by:
getPoint in interface ChartModel
Parameters:
n - the index
Returns:
the nth point in the ChartModel.

getPointCount

public int getPointCount()
Description copied from interface: ChartModel
Gets the number of points in the data set

Specified by:
getPointCount in interface ChartModel
Returns:
the number of points

isCyclical

public boolean isCyclical()
Description copied from interface: ChartModel
Should a line be drawn from the last to the first point?

Specified by:
isCyclical in interface ChartModel
Returns:
whether the model represents a cycle of values

iterator

public Iterator<Chartable> iterator()
Specified by:
iterator in interface Iterable<Chartable>

getAnnotation

public Annotation getAnnotation(int n)
Description copied from interface: AnnotationModel
Gets the nth annotation.

Specified by:
getAnnotation in interface AnnotationModel
Parameters:
n - the index.
Returns:
the nth annotation

getAnnotationCount

public int getAnnotationCount()
Description copied from interface: AnnotationModel
Returns the number of annotations

Specified by:
getAnnotationCount in interface AnnotationModel
Returns:
the number of annotations

isAnnotationsVisible

public boolean isAnnotationsVisible()
Description copied from interface: AnnotationModel
Use this method to discover whether annotations should be shown or hidden.

Specified by:
isAnnotationsVisible in interface AnnotationModel
Returns:
whether annotations should be shown

setAnnotationsVisible

public void setAnnotationsVisible(boolean visible)
Description copied from interface: AnnotationModel
Specify whether annotations should be shown

Specified by:
setAnnotationsVisible in interface AnnotationModel
Parameters:
visible - whether annotations should be shown

JIDE 3.5.15