Class IconTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.pentaho.reporting.engine.classic.demo.ancient.demo.swingicons.IconTableModel
-
- All Implemented Interfaces:
Serializable
,TableModel
- Direct Known Subclasses:
SwingIconsDemoTableModel
public class IconTableModel extends AbstractTableModel
A simpleTableModel
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
Constructors Constructor Description IconTableModel()
Constructs a new IconTableModel, initially empty.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addIconEntry(String name, String category, Image icon, Long size)
Adds a new entry to the table model.void
clear()
Class
getColumnClass(int column)
Returns the class of the specified column.int
getColumnCount()
Returns the number of columns in the table model.String
getColumnName(int column)
Returns the name of the specified column.int
getRowCount()
Returns the number of rows in the table model.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
-
-
-
-
Method Detail
-
addIconEntry
protected void addIconEntry(String name, String category, Image icon, 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.
-
clear
public void clear()
-
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 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 Class getColumnClass(int column)
Returns the class of the specified column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
column
- The column index.- Returns:
- The column class.
-
getColumnName
public String getColumnName(int column)
Returns the name of the specified column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- The column.- Returns:
- The column name.
-
-