org.jgraph.graph
Class DefaultPort
- Cloneable, GraphCell, Port
A simple implementation for a port.
protected Port | anchor - Reference to the anchor of this port
|
protected HashSet | edges - Edges that are connected to the port
|
DefaultPort() - Constructs 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.
|
boolean | addEdge(Object edge) - Adds
edge to the list of edges.
|
Object | clone() - Create a clone of the cell.
|
Iterator | edges() - Returns an iterator of the edges connected
to the port.
|
Port | getAnchor() - Returns the anchor of this port.
|
Set | getEdges() - Returns the collection of edges connected to this port.
|
boolean | removeEdge(Object edge) - Removes
edge from the list of edges.
|
void | setAnchor(Port port) - Sets the anchor of this port.
|
void | setEdges(Set edges) - Sets the collection of edges connected to this port.
|
anchor
protected Port anchor
Reference to the anchor of this port
edges
protected HashSet edges
Edges that are connected to the port
DefaultPort
public DefaultPort()
Constructs an empty port.
DefaultPort
public DefaultPort(Object userObject)
Constructs a port that holds a reference to the specified user object.
userObject
- reference to the user object
DefaultPort
public DefaultPort(Object userObject,
Port anchor)
Constructs a port that holds a reference to the specified user object
and a reference to the specified anchor.
userObject
- reference to the user objectanchor
- reference to a graphcell that constitutes the anchor
addEdge
public boolean addEdge(Object edge)
Adds edge
to the list of edges.
- addEdge in interface Port
clone
public Object clone()
Create a clone of the cell. The cloning of the
user object is deferred to the cloneUserObject()
method.
- clone in interface DefaultGraphCell
- Object a clone of this object.
edges
public Iterator edges()
Returns an iterator of the edges connected
to the port.
- edges in interface Port
getAnchor
public Port getAnchor()
Returns the anchor of this port.
- getAnchor in interface Port
getEdges
public Set getEdges()
Returns the collection of edges connected to this port.
removeEdge
public boolean removeEdge(Object edge)
Removes edge
from the list of edges.
- removeEdge in interface Port
setAnchor
public void setAnchor(Port port)
Sets the anchor of this port.
- setAnchor in interface Port
setEdges
public void setEdges(Set edges)
Sets the collection of edges connected to this port.
Copyright (C) 2001-2008 Gaudenz Alder. All rights reserved.