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

ptolemy.vergil.tree
Class FullTreeModel

java.lang.Object
 extended byptolemy.vergil.tree.EntityTreeModel
 extended byptolemy.vergil.tree.ClassAndEntityTreeModel
 extended byptolemy.vergil.tree.FullTreeModel
All Implemented Interfaces:
javax.swing.tree.TreeModel
Direct Known Subclasses:
VisibleTreeModel

public class FullTreeModel
extends ClassAndEntityTreeModel

A tree model for Ptolemy II models. Nodes in this tree contain the following child elements, in this order:

The indexes of the attributes are 0 to a-1, where a is the number of attributes. The indexes of the ports are a to a+p-1, where p is the number of ports, and so on. Subclasses may return a subset of the attributes, ports, and relations by overriding the protected methods that list these contained objects.

Since:
Ptolemy II 1.0
Version:
$Id: FullTreeModel.java,v 1.28 2006年03月29日 00:03:52 cxh Exp $
Author:
Steve Neuendorffer and Edward A. Lee
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Nested Class Summary
Nested classes inherited from class ptolemy.vergil.tree.EntityTreeModel
EntityTreeModel.TreeUpdateListener
Field Summary
Fields inherited from class ptolemy.vergil.tree.EntityTreeModel
_root
Constructor Summary
FullTreeModel(CompositeEntity root)
Create a new tree model with the specified root.
Method Summary
protected java.util.List _attributes(java.lang.Object object)
Return the list of attributes, or an empty list if there are none.
protected java.util.List _ports(java.lang.Object object)
Return the list of ports, or an empty list if there are none.
protected java.util.List _relations(java.lang.Object object)
Return the list of relations, or an empty list if there are none.
java.lang.Object getChild(java.lang.Object parent, int index)
Get the child of the given parent at the given index.
int getChildCount(java.lang.Object parent)
Return the number of children of the given parent.
int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
Return the index of the given child within the given parent.
boolean isLeaf(java.lang.Object object)
Return true if the object is a leaf node.
Methods inherited from class ptolemy.vergil.tree.ClassAndEntityTreeModel
_classes
Methods inherited from class ptolemy.vergil.tree.EntityTreeModel
addTreeModelListener, getRoot, removeTreeModelListener, setRoot, valueForPathChanged
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

FullTreeModel

public FullTreeModel(CompositeEntity root)
Create a new tree model with the specified root.

Parameters:
root - The root of the tree.
Method Detail

getChild

public java.lang.Object getChild(java.lang.Object parent,
 int index)
Get the child of the given parent at the given index. If the child does not exist, then return null.

Specified by:
getChild in interface javax.swing.tree.TreeModel
Overrides:
getChild in class ClassAndEntityTreeModel
Parameters:
parent - A node in the tree.
index - The index of the desired child.
Returns:
A node, or null if there is no such child.

getChildCount

public int getChildCount(java.lang.Object parent)
Return the number of children of the given parent. This is the number attributes, ports, relations, and contained entities, filtered by the filter specified by setFilter(), if any has been specified.

Specified by:
getChildCount in interface javax.swing.tree.TreeModel
Overrides:
getChildCount in class ClassAndEntityTreeModel
Parameters:
parent - A parent node.
Returns:
The number of children.

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
 java.lang.Object child)
Return the index of the given child within the given parent. If the parent is not contained in the child, return -1.

Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel
Overrides:
getIndexOfChild in class ClassAndEntityTreeModel
Parameters:
parent - The parent.
child - The child.
Returns:
The index of the specified child.

isLeaf

public boolean isLeaf(java.lang.Object object)
Return true if the object is a leaf node. An object is a leaf node if it has no children that are instances of one of the classes specified by setFilter(), if a filter has been specified.

Specified by:
isLeaf in interface javax.swing.tree.TreeModel
Overrides:
isLeaf in class ClassAndEntityTreeModel
Parameters:
object - The object.
Returns:
True if the node has no children.

_attributes

protected java.util.List _attributes(java.lang.Object object)
Return the list of attributes, or an empty list if there are none. Override this method if you wish to show only a subset of the attributes.

Parameters:
object - The object.
Returns:
A list of attributes.

_ports

protected java.util.List _ports(java.lang.Object object)
Return the list of ports, or an empty list if there are none. Override this method if you wish to show only a subset of the ports.

Parameters:
object - The object.
Returns:
A list of ports.

_relations

protected java.util.List _relations(java.lang.Object object)
Return the list of relations, or an empty list if there are none. Override this method if you wish to show only a subset of the relations.

Parameters:
object - The object.
Returns:
A list of relations.

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

AltStyle によって変換されたページ (->オリジナル) /