JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.swing.treetable
Interface TreeTableModel<R,T>

All Known Implementing Classes:
AbstractTreeTableModel, KeyStrokeTreeTableModel

public interface TreeTableModel<R,T>

The TreeTableModel interface specifies the methods the JTreeTable will use to interrogate a tabular tree data model.

The JTreeTable can be set up to display any data model which implements the TreeTableModel interface with a couple of lines of code:

      TreeTableModel myData = new MyTreeTableModel();
      JTreeTable treeTable = new JTreeTable(myData);
 

Author:
Christian Hujer

Method Summary
 T getChild(T parent, int index)
          Returns a child with a certain index.
 int getChildCount(T node)
          Returns the number of available children.
 Class<?> getColumnClass(int column)
          Returns the type for column number column.
 int getColumnCount()
          Returns the number of availible columns.
 String getColumnName(int column)
          Returns the name for column number column.
 R getRoot()
          Returns the root of the treetable.
 Object getValueAt(T node, int column)
          Returns the value to be displayed for node node at column number column.
 boolean isCellEditable(T node, int column)
          Indicates whether the the value for node node at column number column is editable.
 boolean isLeaf(T node)
          Returns if node is a leaf.
 void setValueAt(Object value, T node, int column)
          Sets the value for node node at column number column.
 

Method Detail

getChild

T getChild(T parent,
           int index)
Returns a child with a certain index.

Parameters:
parent - Node to return child for
index - Index of child
Returns:
child node with index from parent or null if no child was found
See Also:
TreeModel.getChild(Object, int)

getChildCount

int getChildCount(T node)
Returns the number of available children.

Returns:
number of available children
See Also:
TreeModel.getChildCount(Object)

getColumnClass

Class<?> getColumnClass(int column)
Returns the type for column number column.

Parameters:
column - Column to get type for
Returns:
type of column
See Also:
TableModel.getColumnClass(int)

getColumnCount

int getColumnCount()
Returns the number of availible columns.

Returns:
number of available columns
See Also:
TableModel.getColumnCount()

getColumnName

String getColumnName(int column)
Returns the name for column number column.

Parameters:
column - Column to get name for
Returns:
name of column
See Also:
TableModel.getColumnName(int)

getRoot

R getRoot()
Returns the root of the treetable.

Returns:
root of the treetable

getValueAt

Object getValueAt(T node,
                  int column)
Returns the value to be displayed for node node at column number column.

Parameters:
node - Node to get value of
column - Column to get value of
Returns:
object
See Also:
TableModel.getValueAt(int, int)

isCellEditable

boolean isCellEditable(T node,
                       int column)
Indicates whether the the value for node node at column number column is editable.

Parameters:
node - Node to check
column - Column to check
Returns:
true if the cell is editable, otherwise false
See Also:
TableModel.isCellEditable(int, int)

isLeaf

boolean isLeaf(T node)
Returns if node is a leaf.

Parameters:
node - Node
Returns:
true if node is a leaf, otherwise false

setValueAt

void setValueAt(Object value,
                T node,
                int column)
Sets the value for node node at column number column.

Parameters:
value - Value to be set
node - Node to set value at
column - Column of value in the node
See Also:
TableModel.setValueAt(Object, int, int)

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright