Home / Development / Documentation / 2.0.44 / ExportNodeDataTableModel
TreeGraph 2
 


info.bioinfweb.treegraph.gui.dialogs.io
Class ExportNodeDataTableModel

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

public class ExportNodeDataTableModel
extends AbstractTableModel

See Also:
Serialized Form

Nested Class Summary
static class ExportNodeDataTableModel.Nodes
           
 
Field Summary
private  Vector<NodeBranchDataAdapter> adapters
           
private  ExportNodeDataTableModel.Nodes nodes
           
private  OutputStreamWriter writer
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ExportNodeDataTableModel()
           
 
Method Summary
 boolean add(NodeBranchDataAdapter adapter)
           
 void clear()
           
 NodeBranchDataAdapter get(int index)
           
 Class<?> getColumnClass(int col)
           
 int getColumnCount()
           
 String getColumnName(int col)
           
 int getRowCount()
           
private  String getValue(NodeBranchDataAdapter adapter, Node node)
           
 Object getValueAt(int row, int col)
           
 boolean isEmpty()
           
 void moveDown(int index)
           
 void moveUp(int index)
           
 NodeBranchDataAdapter remove(int index)
           
 NodeBranchDataAdapter set(int index, NodeBranchDataAdapter adapter)
           
 int size()
           
 void writeData(File file, Node root, ExportNodeDataTableModel.Nodes nodes)
           
 void writeData(OutputStream stream, Node root, ExportNodeDataTableModel.Nodes nodes)
           
private  void writeSubtree(Node root)
          Writes the node data of the subtree under root as a text.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adapters

private Vector<NodeBranchDataAdapter> adapters

nodes

private ExportNodeDataTableModel.Nodes nodes

writer

private OutputStreamWriter writer
Constructor Detail

ExportNodeDataTableModel

public ExportNodeDataTableModel()
Method Detail

get

public NodeBranchDataAdapter get(int index)

add

public boolean add(NodeBranchDataAdapter adapter)

set

public NodeBranchDataAdapter set(int index,
                                 NodeBranchDataAdapter adapter)

remove

public NodeBranchDataAdapter remove(int index)

clear

public void clear()

moveUp

public void moveUp(int index)

moveDown

public void moveDown(int index)

size

public int size()

isEmpty

public boolean isEmpty()

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

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getValueAt

public Object getValueAt(int row,
                         int col)

getValue

private String getValue(NodeBranchDataAdapter adapter,
                        Node node)

writeSubtree

private void writeSubtree(Node root)
                   throws IOException
Writes the node data of the subtree under root as a text. Each node has its own line in which the values are separated by tabs.

Parameters:
writer - the writer to write the data with
root - the root node of the subtree to be written
Throws:
IOException

writeData

public void writeData(OutputStream stream,
                      Node root,
                      ExportNodeDataTableModel.Nodes nodes)
               throws IOException
Throws:
IOException

writeData

public void writeData(File file,
                      Node root,
                      ExportNodeDataTableModel.Nodes nodes)
               throws FileNotFoundException,
                      IOException
Parameters:
file -
root -
Throws:
FileNotFoundException
IOException