info.bioinfweb.treegraph.gui.treeframe
Class DocumentTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by info.bioinfweb.treegraph.gui.treeframe.DocumentTableModel
All Implemented Interfaces:
DocumentView, java.io.Serializable, javax.swing.table.TableModel

public class DocumentTableModel
extends javax.swing.table.AbstractTableModel
implements DocumentView

See Also:
Serialized Form

Field Summary
private  java.util.Vector<NodeBranchDataAdapter> adapters
           
static int COL_BRANCH_LENGTH_DATA_TYPE
           
static int COL_UNIQUE_NAME_DATA_TYPE
           
static java.lang.String DECIMAL_COLUMN_HEADING
           
private  Document document
           
private  java.util.Vector<Node> nodes
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
DocumentTableModel(Document document)
          Creates a new DocumentTableModel which shows the tree contained in document.
 
Method Summary
 void changeHappened(javax.swing.event.ChangeEvent e)
           
private  void fillAdapterList(Node root)
           
private  void fillNodeList(Node root)
           
 NodeBranchDataAdapter getAdapter(int col)
           
 java.lang.Class<?> getColumnClass(int col)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 Document getDocument()
           
 int getRow(Node node)
           
 int getRowCount()
           
 ConcretePaintableElement getTreeElement(int row, int col)
           
 java.lang.Object getValueAt(int row, int col)
           
 boolean isCellEditable(int row, int col)
           
 void setDocument(Document document)
          Sets this view to a new model and repaints the element using the data of the new document.
 void setValueAt(java.lang.Object value, int row, int col)
           
 
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
 

Field Detail

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 java.lang.String DECIMAL_COLUMN_HEADING
See Also:
Constant Field Values

adapters

private java.util.Vector<NodeBranchDataAdapter> adapters

nodes

private java.util.Vector<Node> nodes

document

private Document document
Constructor Detail

DocumentTableModel

public DocumentTableModel(Document document)
Creates a new DocumentTableModel which shows the tree contained in document. This class registers itsself as a view at the given document.

Parameters:
document - the document to show
Method Detail

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 assiciate with

getTreeElement

public ConcretePaintableElement getTreeElement(int row,
                                               int col)

changeHappened

public void changeHappened(javax.swing.event.ChangeEvent e)
Specified by:
changeHappened in interface DocumentView

fillAdapterList

private void fillAdapterList(Node root)

fillNodeList

private void fillNodeList(Node root)

getColumnClass

public java.lang.Class<?> getColumnClass(int col)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Specified by:
getValueAt in interface javax.swing.table.TableModel

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getAdapter

public NodeBranchDataAdapter getAdapter(int col)

getRow

public int getRow(Node node)