Package org.cytoscape.util.swing
Class TreeTableModelAdapter
java.lang.Object
javax.swing.table.AbstractTableModel
org.cytoscape.util.swing.TreeTableModelAdapter
- All Implemented Interfaces:
Serializable
,TableModel
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:
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.
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>
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ConstructorDescriptionTreeTableModelAdapter
(TreeTableModel treeTableModel, JTree tree) Creates a new TreeTableModelAdapter object. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Invokes fireTableDataChanged after all the pending events have been processed.getColumnClass
(int column) Returns the class of the column at the given column number.int
Returns the number of columns in the TreeTabelModel.getColumnName
(int column) Returns the column name at the given column number.int
Returns the number of rows in theJTree
.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 Details
-
TreeTableModelAdapter
Creates a new TreeTableModelAdapter object.- Parameters:
treeTableModel
- The tree table model.tree
- The tree itself.
-
-
Method Details
-
getColumnCount
public int getColumnCount()Returns the number of columns in the TreeTabelModel.- Returns:
- the int number of columns in the TreeTabelModel.
-
getColumnName
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
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
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
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.
-