Package org.jgraph.graph
Class DefaultPort
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
org.jgraph.graph.DefaultGraphCell
org.jgraph.graph.DefaultPort
- All Implemented Interfaces:
Serializable
,Cloneable
,MutableTreeNode
,TreeNode
,GraphCell
,Port
A simple implementation for a port.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Port
Reference to the anchor of this portprotected HashSet
Edges that are connected to the portFields inherited from class org.jgraph.graph.DefaultGraphCell
attributes
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty port.DefaultPort
(Object userObject) Constructs a port that holds a reference to the specified user object.DefaultPort
(Object userObject, Port anchor) Constructs a port that holds a reference to the specified user object and a reference to the specified anchor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Addsedge
to the list of edges.clone()
Create a clone of the cell.edges()
Returns an iterator of the edges connected to the port.Returns the anchor of this port.getEdges()
Returns the collection of edges connected to this port.boolean
removeEdge
(Object edge) Removesedge
from the list of edges.void
Sets the anchor of this port.void
Sets the collection of edges connected to this port.Methods inherited from class org.jgraph.graph.DefaultGraphCell
addPort, addPort, addPort, changeAttributes, 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, 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, setUserObject, toString
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jgraph.graph.GraphCell
changeAttributes, getAttributes, setAttributes
-
Field Details
-
edges
Edges that are connected to the port -
anchor
Reference to the anchor of this port
-
-
Constructor Details
-
DefaultPort
public DefaultPort()Constructs an empty port. -
DefaultPort
Constructs a port that holds a reference to the specified user object.- Parameters:
userObject
- reference to the user object
-
DefaultPort
Constructs a port that holds a reference to the specified user object and a reference to the specified anchor.- Parameters:
userObject
- reference to the user objectanchor
- reference to a graphcell that constitutes the anchor
-
-
Method Details
-
edges
Returns an iterator of the edges connected to the port. -
addEdge
Addsedge
to the list of edges. -
removeEdge
Removesedge
from the list of edges.- Specified by:
removeEdge
in interfacePort
-
getEdges
Returns the collection of edges connected to this port. -
setEdges
Sets the collection of edges connected to this port. -
getAnchor
Returns the anchor of this port. -
setAnchor
Sets the anchor of this port. -
clone
Create a clone of the cell. The cloning of the user object is deferred to the cloneUserObject() method.- Overrides:
clone
in classDefaultGraphCell
- Returns:
- Object a clone of this object.
-