JIDE 3.4.0

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

public abstract class AbstractDelegatingChartModel
extends Object
implements AnnotatedChartModel, ChartModelListener

An abstract super class 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()
           
 boolean equals(Object obj)
           
protected  void fireModelChanged()
           
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()
          The name of a ChartModel is important, as different chart models are assumed to have different names.
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
 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)
           
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()
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

setName

public void setName(String name)

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

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

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()
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.4.0