JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.treetable
Class NodeChildrenTable

java.lang.Object
  |
  +--com.klg.jclass.util.treetable.NodeChildrenTable
All Implemented Interfaces:
Serializable, TableModel

public class NodeChildrenTable
extends Object
implements TableModel, Serializable

Class to map the children of a particular node in a JCTreeTableModel into a standard Swing TableModel.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.util.JCListenerList listeners
           
protected  TreePath path
           
protected  com.klg.jclass.util.treetable.JCTreeTableModel treetable
           
 
Constructor Summary
NodeChildrenTable(com.klg.jclass.util.treetable.JCTreeTableModel treetable)
          Creates a NodeChildrenTable based on the specified treetable.
NodeChildrenTable(com.klg.jclass.util.treetable.JCTreeTableModel treetable, TreePath path)
          Creates a NodeChildrenTable based on the specified treetable and parent node.
 
Method Summary
 void addTableModelListener(TableModelListener l)
          Adds a standard table model listener.
 Class getColumnClass(int column)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 TreePath getParentPath()
          Returns the path of the parent node.
 int getRowCount()
           
 Object getValueAt(int row, int column)
           
 boolean isCellEditable(int row, int column)
           
 boolean isLeaf(int row)
          Return whether the specified row in the TableModel mapping is a Leaf or not.
 void removeTableModelListener(TableModelListener l)
          Removes the table model listener
 void setParentPath(TreePath path)
          Sets the path of the node whose children are to be mapped into TableModel.
 void setValueAt(Object value, int row, int column)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected com.klg.jclass.util.JCListenerList listeners

path

protected TreePath path

treetable

protected com.klg.jclass.util.treetable.JCTreeTableModel treetable
Constructor Detail

NodeChildrenTable

public NodeChildrenTable(com.klg.jclass.util.treetable.JCTreeTableModel treetable)
Creates a NodeChildrenTable based on the specified treetable. Note that the parent node must be set before this model is considered "non-empty"

Parameters:
treetable - The tree table model
See Also:
setParentPath(javax.swing.tree.TreePath)

NodeChildrenTable

public NodeChildrenTable(com.klg.jclass.util.treetable.JCTreeTableModel treetable,
                         TreePath path)
Creates a NodeChildrenTable based on the specified treetable and parent node. To change the parent node call setParentPath().

Parameters:
treetable - The tree table model
path - The parent path node
Method Detail

getParentPath

public TreePath getParentPath()
Returns the path of the parent node.

Returns:
The current parent path node

setParentPath

public void setParentPath(TreePath path)
Sets the path of the node whose children are to be mapped into TableModel.

Parameters:
path - The new parent path node

isLeaf

public boolean isLeaf(int row)
Return whether the specified row in the TableModel mapping is a Leaf or not.

Parameters:
row - The row to check
Returns:
Whether the row is a leaf

addTableModelListener

public void addTableModelListener(TableModelListener l)
Adds a standard table model listener. This class will listen for appropriate changes to the tree and pass them on via this listener.

Specified by:
addTableModelListener in interface TableModel
Parameters:
l - The listener to add

removeTableModelListener

public void removeTableModelListener(TableModelListener l)
Removes the table model listener

Specified by:
removeTableModelListener in interface TableModel
Parameters:
l - The listener to remove

getColumnClass

public Class getColumnClass(int column)
Specified by:
getColumnClass in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getValueAt

public Object getValueAt(int row,
                         int column)
Specified by:
getValueAt in interface TableModel

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in interface TableModel

setValueAt

public void setValueAt(Object value,
                       int row,
                       int column)
Specified by:
setValueAt in interface TableModel

Copyright © 2004 Quest Software Inc..
All rights reserved.