org.jgraph.graph
Class DefaultGraphCell
DefaultMutableTreeNode
org.jgraph.graph.DefaultGraphCell
- Cloneable, GraphCell
public class DefaultGraphCell
extends DefaultMutableTreeNode
The default implementation for the GraphCell interface.
DefaultGraphCell() - Creates an empty cell.
|
DefaultGraphCell(Object userObject) - Creates a graph cell and initializes it with the specified user object.
|
DefaultGraphCell(Object userObject, AttributeMap storageMap) - 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.
|
DefaultGraphCell(Object userObject, AttributeMap storageMap, MutableTreeNode[] children) - Creates a graph cell and initializes it with the specified user object.
|
void | addPort() - Utility method to create a port for this cell.
|
void | addPort(Point2D offset) - Utility method to create a port for this cell.
|
void | addPort(Point2D offset, Object userObject) - Utility method to create a port for this cell.
|
Map | changeAttributes(Map change) - Use getAttributes().applyMap
|
Object | clone() - Create a clone of the cell.
|
AttributeMap | getAttributes() - Returns the properies of the cell.
|
List | getChildren() - Provides access to the children list to change ordering.
|
void | setAttributes(AttributeMap attributes) - Sets the attributes.
|
attributes
protected AttributeMap attributes
Hashtable for properties. Initially empty
DefaultGraphCell
public DefaultGraphCell()
Creates an empty cell.
DefaultGraphCell
public DefaultGraphCell(Object userObject)
Creates a graph cell and initializes it with the specified user object.
userObject
- an Object provided by the user that constitutes
the cell's data
DefaultGraphCell
public DefaultGraphCell(Object userObject,
AttributeMap storageMap)
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.
userObject
- reference to the user objectstorageMap
- the storage attribute map for this cell
DefaultGraphCell
public DefaultGraphCell(Object userObject,
AttributeMap storageMap,
MutableTreeNode[] children)
Creates a graph cell and initializes it with the specified user object.
The GraphCell allows children only if specified.
userObject
- an Object provided by the user that constitutes
the cell's datastorageMap
- the storage attribute map for this cellchildren
- array of children
addPort
public void addPort()
Utility method to create a port for this cell. This method adds
a floating port.
addPort
public void addPort(Point2D offset)
Utility method to create a port for this cell. The method adds a port
at a fixed relative offset within the cell. If the offset is null
then a floating port is added.
offset
- the offset of the port within the cell
addPort
public void addPort(Point2D offset,
Object userObject)
Utility method to create a port for this cell. The method adds a port
at a fixed relative offset within the cell. If the offset is null
then a floating port is added.
offset
- the offset of the port within the celluserObject
- the user object of the port cell
changeAttributes
public Map changeAttributes(Map change)
Use getAttributes().applyMap
Changes the attributes
of the cell.
- changeAttributes in interface GraphCell
clone
public Object clone()
Create a clone of the cell. This method uses the superclass
implementation (which does not clone the children), then
uses clone on the attribute map. This method does not
clone the user object. You should override the
cloneUserObject in the graph model to implement cloning
of custom user objects.
- Object a clone of this object.
getChildren
public List getChildren()
Provides access to the children list to change ordering.
This method returns a Collections.EMPTY_LIST
if the list of childrenpoints to null
.
Copyright (C) 2001-2006 Gaudenz Alder. All rights reserved.