org.jfree.report.demo
Class IconTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.jfree.report.demo.IconTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
SwingIconsDemoTableModel

public class IconTableModel
extends javax.swing.table.AbstractTableModel

A simple TableModel implementation used for demonstration purposes.

Author:
David Gilbert
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
IconTableModel()
          Constructs a new IconTableModel, initially empty.
 
Method Summary
protected  void addIconEntry(java.lang.String name, java.lang.String category, java.awt.Image icon, java.lang.Long size)
          Adds a new entry to the table model.
 java.lang.Class getColumnClass(int column)
          Returns the class of the specified column.
 int getColumnCount()
          Returns the number of columns in the table model.
 java.lang.String getColumnName(int column)
          Returns the name of the specified column.
 int getRowCount()
          Returns the number of rows in the table model.
 java.lang.Object getValueAt(int row, int column)
          Returns the data item at the specified row and column.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, 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

IconTableModel

public IconTableModel()
Constructs a new IconTableModel, initially empty.

Method Detail

addIconEntry

protected void addIconEntry(java.lang.String name,
                            java.lang.String category,
                            java.awt.Image icon,
                            java.lang.Long size)
Adds a new entry to the table model.

Parameters:
name - The icon name.
category - The category name.
icon - The icon.
size - The size of the icon image in bytes.

getRowCount

public int getRowCount()
Returns the number of rows in the table model.

Returns:
The row count.

getColumnCount

public int getColumnCount()
Returns the number of columns in the table model.

Returns:
The column count.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Returns the data item at the specified row and column.

Parameters:
row - The row index.
column - The column index.
Returns:
The data item.

getColumnClass

public java.lang.Class getColumnClass(int column)
Returns the class of the specified column.

Parameters:
column - The column index.
Returns:
The column class.

getColumnName

public java.lang.String getColumnName(int column)
Returns the name of the specified column.

Parameters:
column - The column.
Returns:
The column name.