se.entitymanager.presentation.swing
Class EntityTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by se.entitymanager.presentation.swing.EntityTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class EntityTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

A DefaultMutableTreeNode for entities.

See Also:
Serialized Form

Field Summary
private  boolean childrenLoaded
          Flag that indicates whether the children of this node have been loaded.
private  LogicFacade logicFacade
          The logic facade to access the entities.
private  SwingPresentationFacade presentationFacade
          The presentation facade object, this object belongs to.
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
EntityTreeNode(SwingPresentationFacade presentationFacade, EntityInterface entity)
          Constructs a tree node for entity for a presentationFacade.
 
Method Summary
 EntityInterface getEntity()
          Returns the entity the node is displaying
 boolean isLeaf()
          Returns whether this node is a leaf.
protected  void loadChildren()
          Loads the children of this entity.
 
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, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

presentationFacade

private SwingPresentationFacade presentationFacade
The presentation facade object, this object belongs to.


childrenLoaded

private boolean childrenLoaded
Flag that indicates whether the children of this node have been loaded.


logicFacade

private LogicFacade logicFacade
The logic facade to access the entities.

Constructor Detail

EntityTreeNode

public EntityTreeNode(SwingPresentationFacade presentationFacade,
                      EntityInterface entity)
Constructs a tree node for entity for a presentationFacade.

Parameters:
presentationFacade - the presentation facade
entity - the entity
Method Detail

loadChildren

protected void loadChildren()
Loads the children of this entity.

This is known as "lazy loading" and improves performance.


isLeaf

public boolean isLeaf()
Returns whether this node is a leaf.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Overrides:
isLeaf in class javax.swing.tree.DefaultMutableTreeNode
Returns:
true if this node is a leaf, false otherwise

getEntity

public EntityInterface getEntity()
Returns the entity the node is displaying

Returns:
entity the entity