Package com.luciad.network.graph
Class TLcdGraphChangedEvent<N,E>
java.lang.Object
java.util.EventObject
com.luciad.network.graph.TLcdGraphChangedEvent<N,E>
- All Implemented Interfaces:
Serializable
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.- Since:
- 5.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classType-safe enumeration containing all possible changes for boundary edges and partitions. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicates that all edges have been removed from the graph.static final intIndicates that the graph has been cleared (all edges and nodes removed).static final intIndicates that edges have been added to the graph.static final intIndicates that at least some edges in the graph have changed.static final intIndicates that some edges have been removed from the graph.static final intIndicates that nodes have been added to the graph.static final intIndicates that at least some nodes in the graph have changed.static final intIndicates that some nodes have been removed from the graph.Fields inherited from class java.util.EventObject
source -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsEdge(E aObject) Returns whetheraObjectis an edge associated to this TLcdGraphChangedEvent.booleancontainsNode(N aObject) Returns whetheraObjectis a node associated to this TLcdGraphChangedEvent.intReturns the number of edge Objects associated to this TLcdGraphChangedEvent.edges()Returns an Enumeration of all the edges that have been added, removed or changed with respect to the ILcdGraph.intgetCode()Returns the global graph change of thisTLcdGraphChangedEvent.getGraph()Returns theILcdGraphthat is the source of thisTLcdGraphChangedEvent.intReturns the number of node Objects associated to this TLcdGraphChangedEvent.nodes()Returns an Enumeration of all the nodes that have been added, removed or changed with respect to the ILcdGraph.retrieveEdgeChange(E aObject) Returns the details concerning aObject in thisTLcdGraphChangedEvent.retrieveNodeChange(N aObject) Returns the details concerning aObject in thisTLcdGraphChangedEvent.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
NODES_ADDED
public static final int NODES_ADDEDIndicates that nodes have been added to the graph.- See Also:
-
NODES_REMOVED
public static final int NODES_REMOVEDIndicates that some nodes have been removed from the graph.- See Also:
-
NODES_CHANGED
public static final int NODES_CHANGEDIndicates that at least some nodes in the graph have changed.- See Also:
-
EDGES_ADDED
public static final int EDGES_ADDEDIndicates that edges have been added to the graph.- See Also:
-
EDGES_REMOVED
public static final int EDGES_REMOVEDIndicates that some edges have been removed from the graph.- See Also:
-
EDGES_CHANGED
public static final int EDGES_CHANGEDIndicates that at least some edges in the graph have changed.- See Also:
-
ALL_EDGES_REMOVED
public static final int ALL_EDGES_REMOVEDIndicates that all edges have been removed from the graph.- See Also:
-
CLEARED
public static final int CLEAREDIndicates that the graph has been cleared (all edges and nodes removed).- See Also:
-
-
Constructor Details
-
TLcdGraphChangedEvent
public TLcdGraphChangedEvent(ILcdGraph aGraph, int aCode, Vector<N> aChangedNodes, Vector aIndividualNodeChanges, Vector<E> aChangedEdges, Vector aIndividualEdgeChanges) Constructs a newTLcdGraphChangedEventwith the given parameters.- 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.
-
-
Method Details
-
getGraph
Returns theILcdGraphthat is the source of thisTLcdGraphChangedEvent.- Returns:
- the
ILcdGraphthat is the source of thisTLcdGraphChangedEvent.
-
getCode
public int getCode()Returns the global graph change of thisTLcdGraphChangedEvent.- Returns:
- the global graph change of this
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.
-
nodes
Returns an Enumeration of all the nodes that have been added, removed or changed with respect to the ILcdGraph.- Returns:
- an Enumeration of all the nodes that have been added, removed or changed with respect to the ILcdGraph.
- See Also:
-
edges
Returns an Enumeration of all the edges that have been added, removed or changed with respect to the ILcdGraph.- Returns:
- an Enumeration of all the edges that have been added, removed or changed with respect to the ILcdGraph.
- See Also:
-
nodeCount
public int nodeCount()Returns the number of node Objects associated to this TLcdGraphChangedEvent.- Returns:
- the number of node Objects associated to this TLcdGraphChangedEvent
-
edgeCount
public int edgeCount()Returns the number of edge Objects associated to this TLcdGraphChangedEvent.- Returns:
- the number of edge Objects associated to this TLcdGraphChangedEvent
-
containsNode
Returns whetheraObjectis a node associated to this TLcdGraphChangedEvent.- Parameters:
aObject- the object to check for.- Returns:
- whether
aObjectis a node associated to this TLcdGraphChangedEvent
-
containsEdge
Returns whetheraObjectis an edge associated to this TLcdGraphChangedEvent.- Parameters:
aObject- the object to check for.- Returns:
- whether
aObjectis an edge associated to this TLcdGraphChangedEvent
-
retrieveNodeChange
Returns the details concerning aObject in thisTLcdGraphChangedEvent. One of ADDED, REMOVED or CHANGED.- Parameters:
aObject- the object to retrieve the type of change for.- Returns:
- the details concerning aObject in this
TLcdGraphChangedEvent. One of ADDED, REMOVED, CHANGED.
-
retrieveEdgeChange
Returns the details concerning aObject in thisTLcdGraphChangedEvent. One of ADDED, REMOVED or CHANGED.- Parameters:
aObject- the object to retrieve the type of change for.- Returns:
- the details concerning aObject in this
TLcdGraphChangedEvent. One of ADDED, REMOVED, CHANGED.
-