|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
org.jgraph.graph.DefaultGraphCell
public class DefaultGraphCell
The default implementation for the GraphCell interface.
Nested Class Summary | |
---|---|
static interface |
DefaultGraphCell.ValueChangeHandler
|
Field Summary | |
---|---|
protected Map |
attributes
Hashtable for properties. |
static Rectangle |
defaultBounds
|
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
DefaultGraphCell()
Creates an empty cell. |
|
DefaultGraphCell(Object userObject)
Creates a graph cell and initializes it with the specified user object. |
|
DefaultGraphCell(Object userObject,
boolean allowsChildren)
Creates a graph cell and initializes it with the specified user object. |
|
DefaultGraphCell(Object userObject,
MutableTreeNode[] children)
Constructs a cell that holds a reference to the specified user object and contains the specified array of children and sets default values for the bounds attribute. |
Method Summary | |
---|---|
Map |
changeAttributes(Map change)
Apply change to the cell and sync userObject. |
Object |
clone()
Create a clone of the cell. |
protected Object |
cloneUserObject()
Create a clone of the user object. |
Map |
getAttributes()
Returns the properies of the cell. |
List |
getChildren()
Provides access to the children list to change ordering. |
void |
setAttributes(Map attributes)
Sets the attributes. |
void |
setUserObject(Object obj)
Override parent method to synchronize value property and userObject. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Rectangle defaultBounds
protected Map attributes
Constructor Detail |
---|
public DefaultGraphCell()
public DefaultGraphCell(Object userObject)
userObject
- an Object provided by the user that constitutes
the cell's datapublic DefaultGraphCell(Object userObject, MutableTreeNode[] children)
userObject
- reference to the user objectchildren
- array of childrenpublic DefaultGraphCell(Object userObject, boolean allowsChildren)
userObject
- an Object provided by the user that constitutes
the cell's dataMethod Detail |
---|
public void setUserObject(Object obj)
GraphConstants.getValue(c.getAttributes()) == c.getUserObject()
Note: A cell's userObject can be set using GraphModel.edit() with a propertyMap that carries a value entry for that cell.
setUserObject
in interface MutableTreeNode
setUserObject
in class DefaultMutableTreeNode
public List getChildren()
Collections.EMPTY_LIST
if the list of childrenpoints to null
.
public Map getAttributes()
getAttributes
in interface GraphCell
public Map changeAttributes(Map change)
change
to the cell and sync userObject.
changeAttributes
in interface GraphCell
public void setAttributes(Map attributes)
setAttributes
in interface GraphCell
attributes
- The attributes to setpublic Object clone()
clone
in class DefaultMutableTreeNode
protected Object cloneUserObject()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |