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.dialogs.datatable
Class NodeDataTableModel

    java.lang.Object
      javax.swing.table.AbstractTableModel
          info.bioinfweb.treegraph.gui.dialogs.datatable.NodeDataTableModel

All Implemented Interfaces:
  java.io.Serializable, javax.swing.table.TableModel

    public class NodeDataTableModel

extends javax.swing.table.AbstractTableModel

This table model allows to display all branch and node data in a table. The unique node names, the node names and the branch lengths are always listed. Furthermore the table can contain labels and hidden data with a specified ID where ervery ID gets its own column.

Additionally every second column contains information about the data type (decimal or string) of the listes data which can also be edited if the data structure allows it. (Therefore the data type of unique names and branch lengths cannot be changed.)

Author:
  Ben Stöver
See Also:
  Serialized Form

Field Summary
`private java.util.Vector<NodeDataAdapter>` | `adapters`
`static int` | `COL_BRANCH_LENGTH_DATA_TYPE`
`static int` | `COL_UNIQUE_NAME_DATA_TYPE`
`private Document` | `document`
`private java.util.Vector<Node>` | `nodes`

Fields inherited from class javax.swing.table.AbstractTableModel
`listenerList`

Constructor Summary
`NodeDataTableModel()`

Method Summary
`void` | `assignTree(Node root)` Assigns the node data in the subtree under root to this model.
`void` | `copyColumn(boolean includeLeafs, NodeDataAdapter src, NodeDataAdapter dest)`
`private void` | `copySubtree(Node root, boolean includeLeafs, NodeDataAdapter src, NodeDataAdapter dest)`
`void` | `deleteColumn(int col)`
`private void` | `deleteSubtree(Node root, NodeDataAdapter adapter)`
`private void` | `fillAdapterList(Node root)`
`private void` | `fillNodeList(Node root)`
`NodeDataAdapter` | `getAdapter(int col)`
`java.lang.Class<?>` | `getColumnClass(int col)`
`int` | `getColumnCount()`
`java.lang.String` | `getColumnName(int col)`
`Document` | `getDocument()`
`int` | `getRowCount()`
`ConcretePaintableElement` | `getTreeElement(int row, int col)`
`java.lang.Object` | `getValueAt(int row, int col)`
`boolean` | `importData(NodeDataAdapter[] adapters, java.lang.String[][] data)`
`boolean` | `isCellEditable(int row, int col)`
`private void` | `registerChange()`
`void` | `rescaleColumn(int col, NodeDataCalculator calculator)`
`private void` | `rescaleSubtree(Node root, NodeDataAdapter adapter, NodeDataCalculator calculator)`
`void` | `setDataType(int col, boolean decimal)`
`private void` | `setDataTypeInSubtree(Node root, TextElementDataAdapter adapter, boolean decimal)`
`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

### adapters

    private java.util.Vector<NodeDataAdapter> adapters

### nodes

    private java.util.Vector<Node> nodes

### document

    private Document document

Constructor Detail

### NodeDataTableModel

    public NodeDataTableModel()

Method Detail

### getDocument

    public Document getDocument()

### fillAdapterList

    private void fillAdapterList(Node root)

### fillNodeList

    private void fillNodeList(Node root)

### assignTree

    public void assignTree(Node root)

  Assigns the node data in the subtree under root to this model. Previous values are deleted.

  Parameters:
    `root` - - the root od the tree to fetch the data from

### registerChange

    private void registerChange()

### copySubtree

    private void copySubtree(Node root,
                             boolean includeLeafs,
                             NodeDataAdapter src,
                             NodeDataAdapter dest)

### copyColumn

    public void copyColumn(boolean includeLeafs,
                           NodeDataAdapter src,
                           NodeDataAdapter dest)

### deleteSubtree

    private void deleteSubtree(Node root,
                               NodeDataAdapter adapter)

### deleteColumn

    public void deleteColumn(int col)

### rescaleSubtree

    private void rescaleSubtree(Node root,
                                NodeDataAdapter adapter,
                                NodeDataCalculator calculator)

### rescaleColumn

    public void rescaleColumn(int col,
                              NodeDataCalculator calculator)

### importData

    public boolean importData(NodeDataAdapter[] adapters,
                              java.lang.String[][] data)

  Parameters:
    `adapters` -
    `data` -
  Returns:
    `true`, if all data has been imported, `false`, if one or more unique node name was not found in the current tree

### setDataTypeInSubtree

    private void setDataTypeInSubtree(Node root,
                                      TextElementDataAdapter adapter,
                                      boolean decimal)

### setDataType

    public void setDataType(int col,
                            boolean decimal)

### getTreeElement

    public ConcretePaintableElement getTreeElement(int row,
                                                   int col)

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

### getRowCount

    public int getRowCount()

### getValueAt

    public java.lang.Object getValueAt(int row,
                                       int col)

### 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 NodeDataAdapter getAdapter(int col)

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