JIDE 3.5.15

com.jidesoft.chart.model
Class AbstractDelegatingChartModel

java.lang.Object
  extended by com.jidesoft.chart.model.AbstractDelegatingChartModel
All Implemented Interfaces:
AnnotatedChartModel, AnnotationModel, ChartModel, ChartModelListener, Named, Iterable<Chartable>
Direct Known Subclasses:
AverageChartModel, FilterableChartModel, SamplingModel, SelectableChartModel, SummingChartModel, TransformingChartModel, TransposingChartModel, WaterfallModelAdapter

public abstract class AbstractDelegatingChartModel
extends Object
implements AnnotatedChartModel, ChartModelListener

An abstract superclass that implements many of the methods necessary in a delegating ChartModel.


Constructor Summary
AbstractDelegatingChartModel()
           
AbstractDelegatingChartModel(ChartModel... delegates)
           
AbstractDelegatingChartModel(Collection<ChartModel> delegates)
           
 
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
 boolean equals(Object obj)
           
protected  void fireModelChanged()
          Notify registered listeners that the chart model has changed
abstract  Annotation getAnnotation(int n)
          Gets the nth annotation.
abstract  int getAnnotationCount()
          Returns the number of annotations
 AnnotatedChartModel getDelegate()
           
 AnnotatedChartModel getDelegate(int i)
           
 AnnotatedChartModel[] getDelegates()
           
 String getName()
          Returns the name of the model.
abstract  Chartable getPoint(int n)
          Gets the nth point.
abstract  int getPointCount()
          Gets the number of points in the data set
 int hashCode()
           
protected  void init()
           
 boolean isCyclical()
          Cyclical models are quite rare so we return a value of false here as a default.
 Iterator<Chartable> iterator()
           
 void removeChartModelListener(ChartModelListener listener)
          De-register the listener's interest in this chart model.
 void setDelegate(ChartModel chartModel)
           
 void setDelegates(ChartModel... chartModels)
           
 void setDelegates(Collection<ChartModel> chartModels, boolean wireListeners)
           
 void setName(String name)
          Sets the name of the model instance to the supplied string.
protected abstract  void update()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jidesoft.chart.model.AnnotationModel
isAnnotationsVisible, setAnnotationsVisible
 

Constructor Detail

AbstractDelegatingChartModel

public AbstractDelegatingChartModel()

AbstractDelegatingChartModel

public AbstractDelegatingChartModel(ChartModel... delegates)

AbstractDelegatingChartModel

public AbstractDelegatingChartModel(Collection<ChartModel> delegates)
Method Detail

init

protected void init()

getAnnotationCount

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

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

getAnnotation

public abstract 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

getPoint

public abstract 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 abstract 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

update

protected abstract void update()

getName

public String getName()
Returns the name of the model.

Specified by:
getName in interface ChartModel
Specified by:
getName in interface Named
Returns:
the name of the model

setName

public void setName(String name)
Sets the name of the model instance to the supplied string.

Note that you should not change the name of a ChartModel after it has already been added to a Chart, as the name is used to identify the instance.

Parameters:
name - the name of the model instance

getDelegate

public AnnotatedChartModel getDelegate()

getDelegate

public AnnotatedChartModel getDelegate(int i)

getDelegates

public AnnotatedChartModel[] getDelegates()

setDelegate

public void setDelegate(ChartModel chartModel)

setDelegates

public void setDelegates(Collection<ChartModel> chartModels,
                         boolean wireListeners)

setDelegates

public void setDelegates(ChartModel... chartModels)

isCyclical

public boolean isCyclical()
Cyclical models are quite rare so we return a value of false here as a default. Subclasses can override this if appropriate.

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

addChartModelListener

public void addChartModelListener(ChartModelListener listener)
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)
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()
Notify registered listeners that the chart model has changed


chartModelChanged

public void chartModelChanged()
Call-back method to notify the listener that the chart model has changed

Specified by:
chartModelChanged in interface ChartModelListener

iterator

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

JIDE 3.5.15