Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.treetable
Class TreeTableRow

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.citra.treetable.TreeTableRow
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode, TreeNode
Direct Known Subclasses:
AggregateRow, DataRow

public abstract class TreeTableRow
extends DefaultMutableTreeNode

A TreeTableRow represents a node in the tree data structure of a TreeTableModel. TreeTableRows are classified into data rows and aggregate rows.

Datarows are nodes that cannot have children and that are linked to the actual tabular data. This can be done via the modelIndex attribute or the userObject that is inherited by its DefaultMutableTreeNode superclass.

Aggregate rows can either correspond to the group rows of the TreeTable (header rows, that can be expanded), or to rows that are placed at the bottom of each tree hierarchy, so called footer rows. An aggregate row is usually used to provide information about the rows that are below it or above it (header or footer row respectively). This is done with the help of an Aggregator.

See Also:
Serialized Form

Field Summary
protected  Object[] aggregateValues
          The object array which is used to store aggregate information.
protected  int modelIndex
          an integer that can be used for various purposes.
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
TreeTableRow(Object o, int modelIndex)
          Constructs a TreeTableRow object having o as the userObject and modelIndex as the model index.
 
Method Summary
 void clear()
          Clear the aggregate values that are stored.
 Object getAggregateValue(int columnIndex)
          Returns the aggregate value at columnIndex.
 Object[] getAggregateValues()
          Returns the aggregate values.
 int getModelIndex()
          Returns the model index attribute which can be used for various purposes in this library.
abstract  boolean isAggregate()
          Returns true if this node represents an aggregate row in the tree data structure created by TreeTableModel.
abstract  boolean isFooter()
          Returns true if this node represents a footer row in the tree data structure created by TreeTableModel.
abstract  boolean isHeader()
          Returns true if this node represents a header row in the tree data structure created by TreeTableModel.
 void setAggregateValue(Object value, int columnIndex)
          Sets the aggregate value at columnIndex.
 void setAggregateValues(Object[] values)
          Assigns the aggregates values.
 void setModelIndex(int modelIndex)
          Assigns a new model index attribute.
 String toString()
          Returns the result of sending toString() to this node's user object, or null if this node has no user object.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modelIndex

protected int modelIndex
an integer that can be used for various purposes.


aggregateValues

protected Object[] aggregateValues
The object array which is used to store aggregate information.

Constructor Detail

TreeTableRow

public TreeTableRow(Object o,
                    int modelIndex)
Constructs a TreeTableRow object having o as the userObject and modelIndex as the model index.

Method Detail

clear

public void clear()
Clear the aggregate values that are stored.


getAggregateValue

public Object getAggregateValue(int columnIndex)
Returns the aggregate value at columnIndex. This method will return null by default.

Parameters:
columnIndex - the index of the column
Returns:
the aggregate value at columnIndex

getModelIndex

public int getModelIndex()
Returns the model index attribute which can be used for various purposes in this library.

Returns:
an index

isAggregate

public abstract boolean isAggregate()
Returns true if this node represents an aggregate row in the tree data structure created by TreeTableModel.

Returns:
true if this node is an aggregate row, false otherwise.

isFooter

public abstract boolean isFooter()
Returns true if this node represents a footer row in the tree data structure created by TreeTableModel.

Returns:
true if this node is a footer row, false otherwise.

isHeader

public abstract boolean isHeader()
Returns true if this node represents a header row in the tree data structure created by TreeTableModel.

Returns:
true if this node is a header row, false otherwise.

setAggregateValue

public void setAggregateValue(Object value,
                              int columnIndex)
Sets the aggregate value at columnIndex.

Parameters:
value - the aggregate value to set
columnIndex - the index of the column

setAggregateValues

public void setAggregateValues(Object[] values)
Assigns the aggregates values.

Parameters:
values - the aggregate values to set

getAggregateValues

public Object[] getAggregateValues()
Returns the aggregate values.

Returns:
the aggregate values as an object array.

toString

public String toString()
Returns the result of sending toString() to this node's user object, or null if this node has no user object.

Overrides:
toString in class DefaultMutableTreeNode
Returns:
a string representation of the object.
See Also:
DefaultMutableTreeNode.getUserObject()

setModelIndex

public void setModelIndex(int modelIndex)
Assigns a new model index attribute.

Parameters:
modelIndex - the new index

Copyright © 2011 Citra Technologies. All Rights Reserved.