org.jgraph.example
Class IconExample.CustomCell

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.jgraph.graph.DefaultGraphCell
          extended by org.jgraph.example.IconExample.CustomCell
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, org.jgraph.graph.GraphCell
Enclosing class:
IconExample

public class IconExample.CustomCell
extends org.jgraph.graph.DefaultGraphCell

CustomCell that allows user to define an icon and a description for the graph vertex.

Author:
Dean Mao
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
IconExample.CustomCell(javax.swing.ImageIcon icon, java.lang.String description)
           
 
Method Summary
 java.lang.String getDescription()
           
 javax.swing.ImageIcon getIcon()
           
 void setUserObject(java.lang.Object obj)
          Sets the description on a cell.
 java.lang.String toString()
          Return the description of the cell so that it will be the initial value of the in-graph editor.
 
Methods inherited from class org.jgraph.graph.DefaultGraphCell
addPort, addPort, addPort, changeAttributes, clone, getAttributes, getChildren, setAttributes
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IconExample.CustomCell

public IconExample.CustomCell(javax.swing.ImageIcon icon,
                              java.lang.String description)
Method Detail

getDescription

public java.lang.String getDescription()

getIcon

public javax.swing.ImageIcon getIcon()

setUserObject

public void setUserObject(java.lang.Object obj)
Sets the description on a cell. This is called from the multi-lined editor.

Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode
Overrides:
setUserObject in class javax.swing.tree.DefaultMutableTreeNode

toString

public java.lang.String toString()
Return the description of the cell so that it will be the initial value of the in-graph editor.

Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode