JIDE 3.5.15

com.jidesoft.chart.model
Class ChartableTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.jidesoft.chart.model.ChartableTableModel
All Implemented Interfaces:
AnnotatedChartModel, AnnotationModel, ChartModel, Named, Serializable, Iterable<Chartable>, TableModel

public class ChartableTableModel
extends AbstractTableModel
implements AnnotatedChartModel

A simple class that is both chartable and can be displayed in a table

Author:
Simon White (swhite@catalysoft.com)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ChartableTableModel(String name, List<Chartable> chartables)
           
 
Method Summary
 void addChartModelListener(ChartModelListener listener)
          Register the listener's interest in this chart model.
protected  void fireModelChanged()
           
 Annotation getAnnotation(int n)
          Gets the nth annotation.
 int getAnnotationCount()
          Returns the number of annotations
 int getColumnCount()
           
 String getColumnName(int column)
           
 String getName()
          Models generally need a name so that they can be easily differentiated from one another without inspecting the data
 Chartable getPoint(int n)
          Gets the nth point.
 int getPointCount()
          Gets the number of points in the data set
 int getRowCount()
           
 Object getValueAt(int row, int column)
           
 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 update()
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartableTableModel

public ChartableTableModel(String name,
                           List<Chartable> chartables)
Method Detail

getName

public String getName()
Models generally need a name so that they can be easily differentiated from one another without inspecting the data

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

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 of the data set

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

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Specified by:
getValueAt in interface TableModel

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

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

iterator

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

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

update

public void update()

fireModelChanged

protected void fireModelChanged()

JIDE 3.5.15