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
A simple
TableModel implementation used for demonstration purposes.- Author:
- David Gilbert
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddIconEntry(String name, String category, Image icon, Long size) Adds a new entry to the table model.voidclear()getColumnClass(int column) Returns the class of the specified column.intReturns the number of columns in the table model.getColumnName(int column) Returns the name of the specified column.intReturns the number of rows in the table model.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
-
Constructor Details
-
IconTableModel
public IconTableModel()Constructs a new IconTableModel, initially empty.
-
-
Method Details
-
addIconEntry
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
Returns the data item at the specified row and column.- Parameters:
row- The row index.column- The column index.- Returns:
- The data item.
-
getColumnClass
Returns the class of the specified column.- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel- Parameters:
column- The column index.- Returns:
- The column class.
-
getColumnName
Returns the name of the specified column.- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel- Parameters:
column- The column.- Returns:
- The column name.
-