Package org.cytoscape.util.swing
Class TreeTableModelAdapter
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.cytoscape.util.swing.TreeTableModelAdapter
-
- All Implemented Interfaces:
Serializable
,TableModel
public final class TreeTableModelAdapter extends AbstractTableModel
This is a wrapper class takes a TreeTableModel and implements the table model interface. The implementation is trivial, with all of the event dispatching support provided by the superclass: the AbstractTableModel.- Version:
- 1.2 10/27/98
- Author:
- Philip Milne, Scott Violet
- See Also:
- Serialized Form
Module:
swing-util-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>swing-util-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (Final Class): This class is final and therefore can't be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description TreeTableModelAdapter(TreeTableModel treeTableModel, JTree tree)
Creates a new TreeTableModelAdapter object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
delayedFireTableDataChanged()
Invokes fireTableDataChanged after all the pending events have been processed.Class
getColumnClass(int column)
Returns the class of the column at the given column number.int
getColumnCount()
Returns the number of columns in the TreeTabelModel.String
getColumnName(int column)
Returns the column name at the given column number.int
getRowCount()
Returns the number of rows in theJTree
.Object
getValueAt(int row, int column)
Returns the value at the given row and column.boolean
isCellEditable(int row, int column)
Returns whether the cell at the given location is editable.void
setValueAt(Object value, int row, int column)
Sets the value at the given row and column..-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Constructor Detail
-
TreeTableModelAdapter
public TreeTableModelAdapter(TreeTableModel treeTableModel, JTree tree)
Creates a new TreeTableModelAdapter object.- Parameters:
treeTableModel
- The tree table model.tree
- The tree itself.
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the TreeTabelModel.- Returns:
- the int number of columns in the TreeTabelModel.
-
getColumnName
public String getColumnName(int column)
Returns the column name at the given column number.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- The column number.- Returns:
- The name of the column,.
-
getColumnClass
public Class getColumnClass(int column)
Returns the class of the column at the given column number.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
column
- The column number.- Returns:
- The class of the column.
-
getRowCount
public int getRowCount()
Returns the number of rows in theJTree
.- Returns:
- The int number of rows in the JTree.
-
getValueAt
public Object getValueAt(int row, int column)
Returns the value at the given row and column.- Parameters:
row
- The row number.column
- The column number.- Returns:
- The value at the given location.
-
isCellEditable
public boolean isCellEditable(int row, int column)
Returns whether the cell at the given location is editable.- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
- Parameters:
row
- The row number.column
- The column number.- Returns:
- True if the cell is editable, false otherwise.
-
setValueAt
public void setValueAt(Object value, int row, int column)
Sets the value at the given row and column..- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
- Parameters:
value
- The value to set to.row
- The row number.column
- The column number.
-
delayedFireTableDataChanged
protected void delayedFireTableDataChanged()
Invokes fireTableDataChanged after all the pending events have been processed. SwingUtilities.invokeLater is used to handle this.
-
-