org.objectweb.jac.aspects.gui
Class RelationNode

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byorg.objectweb.jac.aspects.gui.AbstractNode
          extended byorg.objectweb.jac.aspects.gui.RelationNode
All Implemented Interfaces:
Cloneable, CollectionUpdate, MutableTreeNode, Serializable, TreeNode

public class RelationNode
extends AbstractNode
implements CollectionUpdate

This tree node represents a relation.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
RelationNode(TreeView model, Object substance, FieldItem relation)
          Constructs the node.
 
Method Summary
 void onAdd(Object substance, CollectionItem collection, Object value, Object added, Object param)
          Upcalled when an item is added in a collection.
 void onChange(Object substance, CollectionItem collection, Object value, Object param)
          Upcalled when the collection is changed (with a set or other methods such as clear, removeAll, addAll, ...).
 void onRemove(Object substance, CollectionItem collection, Object value, Object removed, Object param)
          Upcalled when an item is removed from a collection.
protected  void rebuildData()
          Rebuild the node's data.
 String toString()
           
 void unregisterEvents()
          Unregister all the events this node is listening to.
 
Methods inherited from class org.objectweb.jac.aspects.gui.AbstractNode
areChildrenUptodate, getIcon, getText, getToolTip, isLeaf, setChildrenUptodate, setLeaf, setModel, setParent
 
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, 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
 

Constructor Detail

RelationNode

public RelationNode(TreeView model,
                    Object substance,
                    FieldItem relation)
Constructs the node.

Parameters:
model - the tree model
substance - the object that holds the relation
relation - the substance relation
Method Detail

rebuildData

protected void rebuildData()
Rebuild the node's data.


unregisterEvents

public void unregisterEvents()
Unregister all the events this node is listening to.

Specified by:
unregisterEvents in class AbstractNode

onChange

public void onChange(Object substance,
                     CollectionItem collection,
                     Object value,
                     Object param)
Description copied from interface: CollectionUpdate
Upcalled when the collection is changed (with a set or other methods such as clear, removeAll, addAll, ...).

Specified by:
onChange in interface CollectionUpdate
Parameters:
substance - the object of which a field was updated
collection - the updated collection
value - the new collection
param - extra data
See Also:
ViewControlWrapper.registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)

onAdd

public void onAdd(Object substance,
                  CollectionItem collection,
                  Object value,
                  Object added,
                  Object param)
Description copied from interface: CollectionUpdate
Upcalled when an item is added in a collection.

Specified by:
onAdd in interface CollectionUpdate
Parameters:
substance - the object of which a collection was updated
collection - the updated collection
value - the collection's value
added - the value added to the collection
param - extra data (e.g. index)
See Also:
ViewControlWrapper.registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)

onRemove

public void onRemove(Object substance,
                     CollectionItem collection,
                     Object value,
                     Object removed,
                     Object param)
Description copied from interface: CollectionUpdate
Upcalled when an item is removed from a collection.

Specified by:
onRemove in interface CollectionUpdate
Parameters:
substance - the object of which a collection was updated
collection - the updated collection
value - the collection's value
removed - the removed item
param - extra data (e.g. index)
See Also:
ViewControlWrapper.registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)

toString

public String toString()