Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Field Summary
`private Vector<NodeBranchDataAdapter>` | `adapters`
`static int` | `COL_BRANCH_LENGTH_DATA_TYPE`
`static int` | `COL_UNIQUE_NAME_DATA_TYPE`
`static String` | `DECIMAL_COLUMN_HEADING`
`private Document` | `document`
`private 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(DocumentChangeEvent e)` Called every time changes were made to the document.
`private void` | `fillAdapterList(Node root)`
`private void` | `fillNodeList(Node root)`
`NodeBranchDataAdapter` | `getAdapter(int col)`
`Class<?>` | `getColumnClass(int col)`
`int` | `getColumnCount()`
`String` | `getColumnName(int col)`
`Document` | `getDocument()`
`int` | `getRow(Node node)`
`int` | `getRowCount()`
`ConcretePaintableElement` | `getTreeElement(int row, int col)`
`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(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 String DECIMAL_COLUMN_HEADING

See Also:
  Constant Field Values

### adapters

    private Vector<NodeBranchDataAdapter> adapters

### nodes

    private 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 itself 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 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)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD