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 PortReference to the anchor of this portprotected HashSetEdges that are connected to the portFields inherited from class org.jgraph.graph.DefaultGraphCell
attributesFields 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 TypeMethodDescriptionbooleanAddsedgeto 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.booleanremoveEdge(Object edge) Removesedgefrom the list of edges.voidSets the anchor of this port.voidSets the collection of edges connected to this port.Methods inherited from class org.jgraph.graph.DefaultGraphCell
addPort, addPort, addPort, changeAttributes, getAttributes, getChildren, setAttributesMethods 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, toStringMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
Addsedgeto the list of edges. -
removeEdge
Removesedgefrom the list of edges.- Specified by:
removeEdgein 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:
clonein classDefaultGraphCell- Returns:
- Object a clone of this object.
-