info.bioinfweb.treegraph.gui.treeframe
Class DocumentTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
info.bioinfweb.treegraph.gui.treeframe.DocumentTableModel
- All Implemented Interfaces:
- DocumentListener, Serializable, TableModel
public class DocumentTableModel
- extends AbstractTableModel
- implements DocumentListener
Table modes to display the node/branch data of a document in a JTable
.
- Author:
- Ben Stöver
- See Also:
- Serialized Form
Constructor Summary |
DocumentTableModel(Document document)
Creates a new DocumentTableModel which shows the tree contained in document. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COL_UNIQUE_NAME_DATA_TYPE
public static final int COL_UNIQUE_NAME_DATA_TYPE
- See Also:
- Constant Field Values
COL_BRANCH_LENGTH_DATA_TYPE
public static final int COL_BRANCH_LENGTH_DATA_TYPE
- See Also:
- Constant Field Values
DECIMAL_COLUMN_HEADING
public static final String DECIMAL_COLUMN_HEADING
- See Also:
- Constant Field Values
adapters
private Vector<NodeBranchDataAdapter> adapters
nodes
private Vector<Node> nodes
document
private Document document
DocumentTableModel
public DocumentTableModel(Document document)
- Creates a new
DocumentTableModel
which shows the tree contained in document.
This class registers itself as a view at the given document.
- Parameters:
document
- the document to show
getDocument
public Document getDocument()
setDocument
public void setDocument(Document document)
- Sets this view to a new model and repaints the element using the data of the
new document. This view is automatically unregistered at the old and registered at
the new document.
- Parameters:
document
- the model to associate with
getTreeElement
public ConcretePaintableElement getTreeElement(int row,
int col)
changeHappened
public void changeHappened(DocumentChangeEvent e)
- Description copied from interface:
DocumentListener
- Called every time changes were made to the document.
- Specified by:
changeHappened
in interface DocumentListener
fillAdapterList
private void fillAdapterList(Node root)
fillNodeList
private void fillNodeList(Node root)
getColumnClass
public Class<?> getColumnClass(int col)
- Specified by:
getColumnClass
in interface TableModel
- Overrides:
getColumnClass
in class AbstractTableModel
getColumnName
public String getColumnName(int col)
- Specified by:
getColumnName
in interface TableModel
- Overrides:
getColumnName
in class AbstractTableModel
isCellEditable
public boolean isCellEditable(int row,
int col)
- Specified by:
isCellEditable
in interface TableModel
- Overrides:
isCellEditable
in class AbstractTableModel
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interface TableModel
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interface TableModel
getValueAt
public Object getValueAt(int row,
int col)
- Specified by:
getValueAt
in interface TableModel
setValueAt
public void setValueAt(Object value,
int row,
int col)
- Specified by:
setValueAt
in interface TableModel
- Overrides:
setValueAt
in class AbstractTableModel
getAdapter
public NodeBranchDataAdapter getAdapter(int col)
getRow
public int getRow(Node node)