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 DefaultGraphCell
attributesFields inherited from class 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 DefaultGraphCell
addPort, addPort, addPort, changeAttributes, getAttributes, getChildren, setAttributesMethods inherited from class 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 Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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
-
-
Method Details
-
edges
-
addEdge
-
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
-
setAnchor
-
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.
-