ptolemy.vergil.tree
Class VisibleTreeModel
java.lang.Object
ptolemy.vergil.tree.EntityTreeModel
ptolemy.vergil.tree.ClassAndEntityTreeModel
ptolemy.vergil.tree.FullTreeModel
ptolemy.vergil.tree.VisibleTreeModel
- All Implemented Interfaces:
- javax.swing.tree.TreeModel
public class VisibleTreeModel
- extends FullTreeModel
A tree model for the Vergil library panel. This is a tree model that
shows all entities and some ports, relations, and attributes. The ports,
relations, and attributes that it shows are those that
contains an attribute of class EditorIcon, or that contain an
attribute named "_iconDescription" or "_smallIconDescription".
A composite entity that contains an attribute with name "_libraryMarker"
is treated as a sublibrary. A composite entity without such an attribute
is treated as an atomic entity.
This is designed for use with JTree, which renders the hierarchy.
- Since:
- Ptolemy II 1.0
- Version:
- $Id: VisibleTreeModel.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Steve Neuendorffer and Edward A. Lee
- Accepted Rating:
- Proposed Rating:
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 boolean |
_isVisible(NamedObj object)
Return true if the object contains either an attribute of
class EditorIcon or an attribute of any class named
"_iconDescription" or "_smallIconDescription". |
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. |
boolean |
isLeaf(java.lang.Object object)
Return true if the object is a leaf node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_workspace
private Workspace _workspace
_workspaceAttributeVersion
private long _workspaceAttributeVersion
_workspacePortVersion
private long _workspacePortVersion
_workspaceRelationVersion
private long _workspaceRelationVersion
_attributeListCache
private java.util.Map _attributeListCache
_portListCache
private java.util.Map _portListCache
_relationListCache
private java.util.Map _relationListCache
VisibleTreeModel
public VisibleTreeModel(CompositeEntity root)
- Create a new tree model with the specified root.
- Parameters:
root
- The root of the tree.
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 FullTreeModel
- 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.
- Overrides:
_attributes
in class FullTreeModel
- Parameters:
object
- The object.
- Returns:
- A list of attributes.
_isVisible
protected boolean _isVisible(NamedObj object)
- Return true if the object contains either an attribute of
class EditorIcon or an attribute of any class named
"_iconDescription" or "_smallIconDescription". This
will result in the object being rendered in the library.
- Parameters:
object
- The object.
- Returns:
- True if the object is to be rendered in the library.
_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.
- Overrides:
_ports
in class FullTreeModel
- 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.
- Overrides:
_relations
in class FullTreeModel
- Parameters:
object
- The object.
- Returns:
- A list of relations.