public class TLcdGraphChangedEvent<N,E> extends EventObject
TLcdGraphChangedEvent
implements change events that occurred in
an ILcdGraph
.
A TLcdGraphChangedEvent
has an integer code property specifying
the global changes. Its value is any logical OR operation of NODES_ADDED,
NODES_REMOVED, NODES_CHANGED, EDGES_ADDED,EDGES_REMOVED,EDGES_CHANGED,
ALL_EDGES_REMOVED and CLEARED.
A TLcdGraphChangedEvent
also has information specifying the
model changes in more detail, i.e. per object in a ILcdGraph. The nodes() and
edges() methods return an Enumeration of respectively all the nodes and edges
that have been added, removed or changed with respect to the ILcdGraph.
The Change value returned by retrieveChange( Object ) specifies the type of change
of any Object in this enumerations. This value is one of: ADDED, REMOVED or
CHANGED.
Note 1: if ALL_EDGES_REMOVED is set in the getCode() method, only the edge changes
after the removal of all edges are detailed. Node changes are detailed as if nothing
has happened.
Note 2: if CLEARED is set in the getCode() method, only the changes after the
removal of all edges and nodes are detailed.ILcdGraphListener
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
TLcdGraphChangedEvent.Change
Type-safe enumeration containing all possible changes for boundary edges and
partitions.
|
Modifier and Type | Field and Description |
---|---|
static int |
ALL_EDGES_REMOVED
Indicates that all edges have been removed from the graph.
|
static int |
CLEARED
Indicates that the graph has been cleared (all edges and nodes removed).
|
static int |
EDGES_ADDED
Indicates that edges have been added to the graph.
|
static int |
EDGES_CHANGED
Indicates that at least some edges in the graph have changed.
|
static int |
EDGES_REMOVED
Indicates that some edges have been removed from the graph.
|
static int |
NODES_ADDED
Indicates that nodes have been added to the graph.
|
static int |
NODES_CHANGED
Indicates that at least some nodes in the graph have changed.
|
static int |
NODES_REMOVED
Indicates that some nodes have been removed from the graph.
|
source
Constructor and Description |
---|
TLcdGraphChangedEvent(ILcdGraph aGraph,
int aCode,
Vector<N> aChangedNodes,
Vector aIndividualNodeChanges,
Vector<E> aChangedEdges,
Vector aIndividualEdgeChanges)
Constructs a new
TLcdGraphChangedEvent with the given
parameters. |
Modifier and Type | Method and Description |
---|---|
boolean |
containsEdge(E aObject)
Returns whether
aObject is an edge associated to this
TLcdGraphChangedEvent. |
boolean |
containsNode(N aObject)
Returns whether
aObject is a node associated to this
TLcdGraphChangedEvent. |
int |
edgeCount()
Returns the number of edge Objects associated to this TLcdGraphChangedEvent.
|
Enumeration<E> |
edges()
Returns an Enumeration of all the edges that have been added, removed or
changed with respect to the ILcdGraph.
|
int |
getCode()
Returns the global graph change of this
TLcdGraphChangedEvent . |
ILcdGraph |
getGraph()
Returns the
ILcdGraph that is the source of this
TLcdGraphChangedEvent . |
int |
nodeCount()
Returns the number of node Objects associated to this TLcdGraphChangedEvent.
|
Enumeration<N> |
nodes()
Returns an Enumeration of all the nodes that have been added, removed or
changed with respect to the ILcdGraph.
|
TLcdGraphChangedEvent.Change |
retrieveEdgeChange(E aObject)
Returns the details concerning aObject in this
TLcdGraphChangedEvent . |
TLcdGraphChangedEvent.Change |
retrieveNodeChange(N aObject)
Returns the details concerning aObject in this
TLcdGraphChangedEvent . |
getSource, toString
public static final int NODES_ADDED
public static final int NODES_REMOVED
public static final int NODES_CHANGED
public static final int EDGES_ADDED
public static final int EDGES_REMOVED
public static final int EDGES_CHANGED
public static final int ALL_EDGES_REMOVED
public static final int CLEARED
public TLcdGraphChangedEvent(ILcdGraph aGraph, int aCode, Vector<N> aChangedNodes, Vector aIndividualNodeChanges, Vector<E> aChangedEdges, Vector aIndividualEdgeChanges)
TLcdGraphChangedEvent
with the given
parameters.aGraph
- the graph that is firing this event.aCode
- the code indicating the global graph
changes.aChangedNodes
- the vector containing all changed
nodesaIndividualNodeChanges
- the vector containing the changes for each
individual node.aChangedEdges
- the vector containing all changed
edgesaIndividualEdgeChanges
- the vector containing the changes for each
individual edge.public ILcdGraph getGraph()
ILcdGraph
that is the source of this
TLcdGraphChangedEvent
.ILcdGraph
that is the source of this
TLcdGraphChangedEvent
.public int getCode()
TLcdGraphChangedEvent
.TLcdGraphChangedEvent
.
This can be NODES_ADDED, NODES_REMOVED, NODES_CHANGED,
EDGES_ADDED,EDGES_REMOVED,EDGES_CHANGED, ALL_EDGES_REMOVED or
CLEARED. or a binary or of these values.public Enumeration<N> nodes()
retrieveNodeChange(N)
public Enumeration<E> edges()
retrieveEdgeChange(E)
public int nodeCount()
public int edgeCount()
public boolean containsNode(N aObject)
aObject
is a node associated to this
TLcdGraphChangedEvent.aObject
- the object to check for.aObject
is a node associated to this
TLcdGraphChangedEventpublic boolean containsEdge(E aObject)
aObject
is an edge associated to this
TLcdGraphChangedEvent.aObject
- the object to check for.aObject
is an edge associated to this
TLcdGraphChangedEventpublic TLcdGraphChangedEvent.Change retrieveNodeChange(N aObject)
TLcdGraphChangedEvent
.
One of ADDED, REMOVED or CHANGED.aObject
- the object to retrieve the type of change for.TLcdGraphChangedEvent
.
One of ADDED, REMOVED, CHANGED.public TLcdGraphChangedEvent.Change retrieveEdgeChange(E aObject)
TLcdGraphChangedEvent
.
One of ADDED, REMOVED or CHANGED.aObject
- the object to retrieve the type of change for.TLcdGraphChangedEvent
.
One of ADDED, REMOVED, CHANGED.