Package com.luciad.network.graph
Interface ILcdEditableGraph<N,E>
- All Superinterfaces:
ILcdGraph<N,
E>
- All Known Implementing Classes:
TLcdGraph
,TLcdPartitionedGraph
An
ILcdEditableGraph
is a graph to which nodes and edges can be added or removed.- Since:
- 5.1
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an edge to this graph, connecting the two given nodes.void
Adds a node to this graph.boolean
canAddEdge
(E aEdge, N aStartNode, N aEndNode) Returnstrue
if the given edge can be added to this graph,false
otherwise.boolean
canAddNode
(N aNode) Returnstrue
if the given node can be added to this graph,false
otherwise.boolean
canRemoveEdge
(E aEdge) Returnstrue
if the given edge can be removed from this graph,false
otherwise.boolean
canRemoveNode
(N aNode) Returnstrue
if the given node can be removed from this graph,false
otherwise.void
clear
(int aFireEventMode) Clears the graph; all edges and nodes are removed.void
edgeChanged
(E aEdge, int aEventMode) This method should be called when the given edge has changed.void
edgesChanged
(Vector<E> aEdges, int aEventMode) This method should be called when the given edges have changed.void
Fires all the collected graph changes, i.e., all graph events that have been generated using the the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedGraphChanges()
.void
nodeChanged
(N aNode, int aEventMode) This method should be called when the given node has changed.void
nodesChanged
(Vector<N> aNodes, int aEventMode) This method should be called when the given nodes have changed.removeEdge
(E aEdge, int aFireEventMode) Removes an edge from this graph.void
removeEdges
(int aFireEventMode) Removes all edges from this graph - nodes will remain in the graph.removeNode
(N aNode, int aFireEventMode) Removes a node from this graph.Methods inherited from interface com.luciad.network.graph.ILcdGraph
addGraphListener, containsEdge, containsNode, getEdges, getEdges, getEndNode, getNodes, getOppositeNode, getStartNode, isConnected, removeGraphListener
-
Method Details
-
canAddNode
Returnstrue
if the given node can be added to this graph,false
otherwise. More specifically, a node can be added to this graph if the following conditions are met:- the node is not
null
- the node is not yet part of this graph
- the node satisfies all additional implementation-specific requirements (see the documentation of the implementing class).
- Parameters:
aNode
- the node to be verified.- Returns:
true
if the node can be added to this graph,false
otherwise.
- the node is not
-
addNode
Adds a node to this graph.- Parameters:
aNode
- the node to be added to this graph.aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.- Preconditions:
canAddNode(aNode)
- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
canAddEdge
Returnstrue
if the given edge can be added to this graph,false
otherwise. More specifically, an edge can be added to this graph if the following conditions are met:- none of the arguments is
null
- the edge is not yet part of this graph
- both nodes are part of this graph
- the edge satisfies all additional implementation-specific requirements (see the documentation of the implementing class).
- Parameters:
aEdge
- the edge to be verified.aStartNode
- the first node that should be connected by the given edge.aEndNode
- the second node that should be connected by the given edge.- Returns:
true
if the edge can be added to this graph,false
otherwise.
- none of the arguments is
-
addEdge
Adds an edge to this graph, connecting the two given nodes.- Parameters:
aEdge
- the edge to be added to this graph.aStartNode
- the first node that should be connected by the given edge.aEndNode
- the second node that should be connected by the given edge.aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.- Preconditions:
canAddEdge(aEdge, aStartNode, aEndNode)
- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
canRemoveNode
Returnstrue
if the given node can be removed from this graph,false
otherwise. More specifically, a node can be remove from this graph if the following conditions are met:- the node is not
null
- the node is part of this graph
- there are no edges in this graph, connected to the node
- Parameters:
aNode
- the node to be verified.- Returns:
true
if the node can be removed from this graph,false
otherwise.
- the node is not
-
removeNode
Removes a node from this graph.- Parameters:
aNode
- the node to be removed from this graph.aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.- Preconditions:
canRemoveNode(aNode)
- Note: this validation is potentially expensive, and should be avoided whenever possible.- Returns:
- the node that was removed from the graph.
-
canRemoveEdge
Returnstrue
if the given edge can be removed from this graph,false
otherwise. More specifically, a edge can be remove from this graph if the following conditions are met:- the edge is not
null
- the edge is part of this graph
- Parameters:
aEdge
- the edge to be verified.- Returns:
true
if the edge can be removed from this graph,false
otherwise.
- the edge is not
-
removeEdge
Removes an edge from this graph.- Parameters:
aEdge
- the edge to be removed from this graph.aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.- Preconditions:
canRemoveEdge(aEdge)
- Note: this validation is potentially expensive, and should be avoided whenever possible.- Returns:
- the edge which was removed from the graph.
-
removeEdges
void removeEdges(int aFireEventMode) Removes all edges from this graph - nodes will remain in the graph.- Parameters:
aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
-
clear
void clear(int aFireEventMode) Clears the graph; all edges and nodes are removed.- Parameters:
aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
-
fireCollectedGraphChanges
void fireCollectedGraphChanges()Fires all the collected graph changes, i.e., all graph events that have been generated using the the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedGraphChanges()
. Note that afireCollectedGraphChanges()
call is made whenever a graph event is generated in theILcdFireEventMode.FIRE_NOW
, to guarantee the correct order of the events. -
nodeChanged
This method should be called when the given node has changed.- Preconditions:
containsPartition(aNode)
- Note: this validation is potentially expensive, and should be avoided whenever possible.- Parameters:
aNode
- the node that has changed.aEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
-
nodesChanged
This method should be called when the given nodes have changed.- Parameters:
aNodes
- a vector containing the nodes that have changed.aEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.- Preconditions:
- for each
node
object in the given vector should hold that:containsPartition(node)
- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
edgeChanged
This method should be called when the given edge has changed.- Parameters:
aEdge
- the edge that has changed.aEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.- Preconditions:
containsBoundaryEdge(aEdge)
- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
edgesChanged
This method should be called when the given edges have changed.- Parameters:
aEdges
- a vector containing the edges that have changed.aEventMode
- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.- Preconditions:
- for each
edge
object in the given vector should hold that:containsBoundaryEdge(edge)
- Note: this validation is potentially expensive, and should be avoided whenever possible.
-