org.jgraph.graph
Class DefaultEdge
java.lang.Object
|
+--javax.swing.tree.DefaultMutableTreeNode
|
+--org.jgraph.graph.DefaultGraphCell
|
+--org.jgraph.graph.DefaultEdge
- All Implemented Interfaces:
- Cloneable, Edge, GraphCell, MutableTreeNode, Serializable, TreeNode
- public class DefaultEdge
- extends DefaultGraphCell
- implements Edge
A simple implementation for an edge.
- See Also:
- Serialized Form
Constructor Summary |
DefaultEdge()
Constructs an empty edge. |
DefaultEdge(Object userObject)
Constructs an edge that holds a reference to the specified user object. |
DefaultEdge(Object userObject,
boolean allowsChildren)
Constructs an edge that holds a reference to the specified user object
and sets default values for points and the label position. |
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, getPathToRoot, 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, toString |
center
protected static final int center
defaultLabel
protected static final Point defaultLabel
defaultPoints
public static final ArrayList defaultPoints
source
protected Object source
- Source and target of the edge.
target
protected Object target
- Source and target of the edge.
DefaultEdge
public DefaultEdge()
- Constructs an empty edge.
DefaultEdge
public DefaultEdge(Object userObject)
- Constructs an edge that holds a reference to the specified user object.
- Parameters:
userObject
- reference to the user object
DefaultEdge
public DefaultEdge(Object userObject,
boolean allowsChildren)
- Constructs an edge that holds a reference to the specified user object
and sets default values for points and the label position.
- Parameters:
userObject
- reference to the user object
changeAttributes
public Map changeAttributes(Map change)
- Override parent method to ensure non-null points.
- Specified by:
changeAttributes
in interface GraphCell
- Overrides:
changeAttributes
in class DefaultGraphCell
getSource
public Object getSource()
- Returns the source of the edge.
- Specified by:
getSource
in interface Edge
getTarget
public Object getTarget()
- Returns the target of the edge.
- Specified by:
getTarget
in interface Edge
setSource
public void setSource(Object port)
- Sets the source of the edge.
- Specified by:
setSource
in interface Edge
setTarget
public void setTarget(Object port)
- Returns the target of
edge
.
- Specified by:
setTarget
in interface Edge
clone
public Object clone()
- Create a clone of the cell. The cloning of the
user object is deferred to the cloneUserObject()
method.
- Overrides:
clone
in class DefaultGraphCell
- Returns:
- Object a clone of this object.
Copyright (C) 2001-2004 JGraph.org. All rights reserved.