|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgraph.graph.ConnectionSet
public class ConnectionSet
An object that represents a set of connections. Connections are equal, if equals returns true. Connections that are added later replace earlier connections.
Nested Class Summary | |
---|---|
static class |
ConnectionSet.Connection
Object that represents the connection between an edge and a port. |
Field Summary | |
---|---|
protected Set |
connections
Contents of the connection set. |
protected Set |
edges
Set of changed edges for the connection set. |
Constructor Summary | |
---|---|
ConnectionSet()
Constructs an empty ConnectionSet. |
|
ConnectionSet(Edge edge,
Port port,
boolean source)
Constructs a ConnectionSet with one Connection. |
|
ConnectionSet(Edge edge,
Port source,
Port target)
Constructs a ConnectionSet with two Connections (to the source and target port of the edge). |
Method Summary | |
---|---|
void |
addConnections(CellView[] views)
Adds the connections in views to the connection set. |
ConnectionSet |
clone(Map map)
Creates a new connection set based on this connection set, where the edges, and ports are mapped using map . |
protected static void |
connect(ConnectionSet cs,
Object edge,
Object port,
boolean source,
boolean disconnect)
Connect or disconnect edge from source
and target in cs based on disconnect . |
void |
connect(Object edge,
Object port,
boolean source)
Connect edge to port . |
void |
connect(Object edge,
Object source,
Object target)
Connect edge to source
and target in the connection set. |
Iterator |
connections()
Returns an Iterator for the connections in this set. |
static ConnectionSet |
create(GraphModel m,
Object[] cells,
boolean disconnect)
Returns a connection set that represents the connection or disconnection of cells in model based
on disconnect . |
void |
disconnect(Object edge)
Disconnect edge from source
and target in the connection set. |
void |
disconnect(Object edge,
boolean source)
Disconnect edge from port . |
Set |
getChangedEdges()
Returns a Set for the edges in this connection set. |
Set |
getConnections()
|
Set |
getEdges()
|
boolean |
isEmpty()
Returns true if the connection set is empty. |
void |
setConnections(Set set)
|
void |
setEdges(Set set)
|
int |
size()
Returns the number of (edge, port)-pairs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Set connections
protected Set edges
Constructor Detail |
---|
public ConnectionSet()
public ConnectionSet(Edge edge, Port port, boolean source)
public ConnectionSet(Edge edge, Port source, Port target)
Method Detail |
---|
public static ConnectionSet create(GraphModel m, Object[] cells, boolean disconnect)
cells
in model
based
on disconnect
.
protected static void connect(ConnectionSet cs, Object edge, Object port, boolean source, boolean disconnect)
edge
from source
and target
in cs
based on disconnect
.
public void addConnections(CellView[] views)
views
to the connection set.
public void connect(Object edge, Object source, Object target)
edge
to source
and target
in the connection set. The
previous connections between edge
and
its source and target are replaced in the set.
public void connect(Object edge, Object port, boolean source)
edge
to port
.
source
indicates if port
is the
source of edge
. The previous connections
between edge
and its source or target
in the set is replaced.
public void disconnect(Object edge)
edge
from source
and target
in the connection set. The
previous connections between edge
and
its source and target are replaced in the set.
public void disconnect(Object edge, boolean source)
edge
from port
.
source
indicates if port
is the
source of edge
. The previous connections
between edge
and its source or target
in the set is replaced.
public boolean isEmpty()
true
if the connection set is empty.
public int size()
public Iterator connections()
Iterator
for the connections in this set.
public Set getChangedEdges()
Set
for the edges in this connection set.
public ConnectionSet clone(Map map)
map
.
If a port is not found, the old port is used. If both, the
edge and the port are not in map
, the entry
is ignored.Note: Consequently, unselected edges are only reconnected at the first "paste" after a "cut", because in this case the ConnectionSet is not cloned.
public Set getConnections()
public Set getEdges()
public void setConnections(Set set)
set
- public void setEdges(Set set)
set
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |