JIDE 3.5.15

com.jidesoft.chart.model
Class FilterableChartModel

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

public class FilterableChartModel
extends AbstractDelegatingChartModel

A simple implementation of a FilteringChartModel. TODO: Not the best implementation, as it maintains a model of its own instead of delegating all calls

Author:
Simon White (swhite@catalysoft.com)

Constructor Summary
FilterableChartModel()
           
FilterableChartModel(AnnotatedChartModel delegate)
          Constructor
 
Method Summary
protected  void applyFilter()
           
 boolean equals(Object obj)
           
 Annotation getAnnotation(int n)
          Gets the nth annotation.
 int getAnnotationCount()
          Returns the number of annotations
 Filter<Chartable> getFilter()
           
 Chartable getPoint(int n)
          Gets the nth point.
 int getPointCount()
          Gets the number of points in the data set
 int hashCode()
           
 boolean isAnnotationsVisible()
          Use this method to discover whether annotations should be shown or hidden.
 void setAnnotationsVisible(boolean visible)
          Specify whether annotations should be shown
 void setFilter(Filter<Chartable> filter)
           
protected  void update()
           
 
Methods inherited from class com.jidesoft.chart.model.AbstractDelegatingChartModel
addChartModelListener, chartModelChanged, fireModelChanged, getDelegate, getDelegate, getDelegates, getName, init, isCyclical, iterator, removeChartModelListener, setDelegate, setDelegates, setDelegates, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterableChartModel

public FilterableChartModel()

FilterableChartModel

public FilterableChartModel(AnnotatedChartModel delegate)
Constructor

Parameters:
delegate - the delegate chart model
Method Detail

getAnnotationCount

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

Specified by:
getAnnotationCount in interface AnnotationModel
Specified by:
getAnnotationCount in class AbstractDelegatingChartModel
Returns:
the number of annotations
See Also:
AbstractDelegatingChartModel.getAnnotationCount()

getAnnotation

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

Specified by:
getAnnotation in interface AnnotationModel
Specified by:
getAnnotation in class AbstractDelegatingChartModel
Parameters:
n - the index.
Returns:
the nth annotation
See Also:
AbstractDelegatingChartModel.getAnnotation(int)

isAnnotationsVisible

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

Returns:
whether annotations should be shown

setAnnotationsVisible

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

Parameters:
visible - whether annotations should be shown

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
Specified by:
getPoint in class AbstractDelegatingChartModel
Parameters:
n - the index
Returns:
the nth point in the ChartModel.
See Also:
AbstractDelegatingChartModel.getPoint(int)

getPointCount

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

Specified by:
getPointCount in interface ChartModel
Specified by:
getPointCount in class AbstractDelegatingChartModel
Returns:
the number of points
See Also:
AbstractDelegatingChartModel.getPointCount()

getFilter

public Filter<Chartable> getFilter()

setFilter

public void setFilter(Filter<Chartable> filter)

applyFilter

protected void applyFilter()

update

protected void update()
Specified by:
update in class AbstractDelegatingChartModel
See Also:
AbstractDelegatingChartModel.update()

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractDelegatingChartModel

equals

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

JIDE 3.5.15