com.odesys.chart.barchart
Class DefaultBarChartModel

java.lang.Object
  |
  +--com.odesys.chart.DefaultChartModel
        |
        +--com.odesys.chart.barchart.DefaultBarChartModel
All Implemented Interfaces:
BarChartModel, ChartModel

public class DefaultBarChartModel
extends DefaultChartModel
implements BarChartModel

DefaultBarChartModel is a default implementation of the BarChartModel interface.


Field Summary
protected  java.util.Vector m_categories
           
 
Fields inherited from class com.odesys.chart.DefaultChartModel
m_series, m_seriesData
 
Fields inherited from interface com.odesys.chart.ChartModel
COLOR, LABEL, SERIES, VALUE
 
Constructor Summary
DefaultBarChartModel()
          Creates a new DefaultBarChartModel instance.
 
Method Summary
 Series addCategory()
          Adds a new data category to this DefaultChartModel
 java.util.Enumeration categories()
          Returns an Enumeration of the data Categories of this model
 Series createCategory()
          Factory method for data category instances for this DefaultBarChartModel.
 ChartElement createChartElement(Series series)
          Throws an Error, because this method is not allowed in DefaultBarChartModel.
 ChartElement createChartElement(Series series, Series category)
          Factory method that creates ChartElement instances for this DefaultBarChartModel.
 java.util.Vector createSeriesElements(Series series)
          Factory method used to create a Vector of BarData instances for the specified Series.
 java.util.Enumeration elementsOf(Series series)
          Returns an Enumeration of the BarData instances in the specified series.
 int getCategoriesSize()
          Gets the number of data Categories of this ChartModel
 Series getCategoryAt(int index)
          Gets the data category at the specified index.
 ChartElement getElementAt(Series series, int index)
          Gets the BarData instance at the specified index in the specified series.
 int getSizeOf(Series series)
          Returns the number of the BarData elements in the specified series.
 Series insertCategoryAt(int index)
          Inserts a new data category to this DefaultChartModel at the specified index.
 void removeCategoryAt(int index)
          Removes the data category at the specified index.
 void removeElementAt(Series series, int index)
          Throws an Error, because this method is not allowed in DefaultBarChartModel.
 
Methods inherited from class com.odesys.chart.DefaultChartModel
addElement, addModelChangeListener, addSeries, createSeries, fireModelChanged, getSeriesAt, getSeriesSize, insertElementAt, insertSeriesAt, nextColor, removeModelChangeListener, removeSeriesAt, series, setUpdateLocked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.odesys.chart.ChartModel
addModelChangeListener, fireModelChanged, getSeriesSize, removeModelChangeListener, series
 

Field Detail

m_categories

protected java.util.Vector m_categories
Constructor Detail

DefaultBarChartModel

public DefaultBarChartModel()
Creates a new DefaultBarChartModel instance.
Method Detail

getCategoriesSize

public int getCategoriesSize()
Gets the number of data Categories of this ChartModel
Specified by:
getCategoriesSize in interface BarChartModel

categories

public java.util.Enumeration categories()
Returns an Enumeration of the data Categories of this model
Specified by:
categories in interface BarChartModel

getSizeOf

public int getSizeOf(Series series)
Returns the number of the BarData elements in the specified series. The parameter series can either be a data Series or a data Category.
Overrides:
getSizeOf in class DefaultChartModel
Following copied from class: com.odesys.chart.DefaultChartModel
Returns:
The number of the elements in the specified Series

elementsOf

public java.util.Enumeration elementsOf(Series series)
Returns an Enumeration of the BarData instances in the specified series. The parameter series can either be a data Series or a data Category.
Overrides:
elementsOf in class DefaultChartModel
Following copied from class: com.odesys.chart.DefaultChartModel
Returns:
Enumeration of the elements of the specified Series

getElementAt

public ChartElement getElementAt(Series series,
                                 int index)
Gets the BarData instance at the specified index in the specified series. The parameter series can either be a data Series or a data Category.
Overrides:
getElementAt in class DefaultChartModel
Following copied from class: com.odesys.chart.DefaultChartModel
Returns:
The ChartElement at the specified index in the specified Series

addCategory

public Series addCategory()
Adds a new data category to this DefaultChartModel

insertCategoryAt

public Series insertCategoryAt(int index)
Inserts a new data category to this DefaultChartModel at the specified index.

getCategoryAt

public Series getCategoryAt(int index)
Gets the data category at the specified index.

removeCategoryAt

public void removeCategoryAt(int index)
Removes the data category at the specified index.

createCategory

public Series createCategory()
Factory method for data category instances for this DefaultBarChartModel. The data category should implement the Series interface. This method returns a DefaultSeries instance.

createSeriesElements

public java.util.Vector createSeriesElements(Series series)
Factory method used to create a Vector of BarData instances for the specified Series. This method uses createChartElement() to create each element in the returned Vector.
Overrides:
createSeriesElements in class DefaultChartModel
Following copied from class: com.odesys.chart.DefaultChartModel
Returns:
The new Vector of ChartElements

createChartElement

public ChartElement createChartElement(Series series,
                                       Series category)
Factory method that creates ChartElement instances for this DefaultBarChartModel. This method returns a DefaultBarData instance.

createChartElement

public ChartElement createChartElement(Series series)
Throws an Error, because this method is not allowed in DefaultBarChartModel.
Overrides:
createChartElement in class DefaultChartModel

removeElementAt

public void removeElementAt(Series series,
                            int index)
Throws an Error, because this method is not allowed in DefaultBarChartModel. The reason is that an entire category or an entire series should be removed, rather than a single element.
Overrides:
removeElementAt in class DefaultChartModel