Interface ILcdLimitedEditablePartitionedGraph<N,E>
- All Superinterfaces:
ILcdGraph<N,,E> ILcdPartitionedGraph<N,E>
- All Known Implementing Classes:
TLcdLimitedEditablePartitionedGraph,TLcdPartitionedGraph
An
ILcdLimitedEditablePartitionedGraph is a partitioned graph
with editable internal boundaries, and to which partitions can be added (or
removed). The partitions themselves must not be editable.
All methods for editing the internal boundaries or partitions will modify
the partitioned graph structure as well as the 'normal' graph structure (e.g.
addPartition will result in a partition being added, but also in
the addition of all the nodes and edges in that partition to this graph) and will
thus generate two events: a TLcdPartitionedGraphChangedEvent and
a TLcdGraphChangedEvent. Therefore, all editing method have two
fire event modes: one for the partitioned graph event, and one for the
normal graph event that is generated.- Since:
- 5.1
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBoundaryEdge(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Adds the given edge to the boundary graph of this partitioned graph.voidaddPartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Adds a partition to this graph.voidboundaryEdgeChanged(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) This method should be called when the given boundary edge has changed.voidboundaryEdgesChanged(Vector<E> aBoundaryEdges, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) This method should be called when the given boundary edges have changed.booleancanAddBoundaryEdge(E aEdge, N aStartNode, N aEndNode) Returnstrueif the given boundary edge can be added to this partitioned graph,falseotherwise.booleancanAddPartition(ILcdGraph<N, E> aPartition) Returnstrueif the given partition can be added to this partitioned graph,falseotherwise.booleancanRemoveBoundaryEdge(E aEdge) Returnstrueif the given boundary edge can be removed from this graph,falseotherwise.booleancanRemoveBoundaryEdges(ILcdGraph<N, E> aPartition) Returnstrueif the boundary edge connected to the given partition can be removed from this graph,falseotherwise.booleancanRemovePartition(ILcdGraph<N, E> aPartition) Returnstrueif the given partition can be removed from this partitioned graph,falseotherwise.voidclear(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Clears the graph; all partitions are removed from this graph and the boundary graph is cleared.voidclearBoundaryGraph(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Clears the boundary graph of this partitioned graph, i.e. all its boundary edges and boundary nodes are removed from its boundary graph.voidFires all the collected graph changes, i.e., all graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedGraphChanges().voidFires all the collected partitioned graph changes, i.e., all partitioned graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedPartitionedGraphChanges().removeBoundaryEdge(E aEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes the given boundary edge from the boundary graph of this partitioned graph.removeBoundaryEdges(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes all boundary edges that are connected to the given partition.voidremovePartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes the given partition from this graph.Methods inherited from interface com.luciad.network.graph.ILcdGraph
addGraphListener, containsEdge, containsNode, getEdges, getEdges, getEndNode, getNodes, getOppositeNode, getStartNode, isConnected, removeGraphListenerMethods inherited from interface com.luciad.network.graph.partition.ILcdPartitionedGraph
addPartitionedGraphListener, containsPartition, getBoundaryEdges, getBoundaryGraph, getBoundaryNodes, getPartitionForEdge, getPartitionForNode, getPartitions, removePartitionedGraphListener
-
Method Details
-
canAddBoundaryEdge
Returnstrueif the given boundary edge can be added to this partitioned graph,falseotherwise. More specifically, a boundary edge can be added to this graph if the following conditions are met:- the boundary edge is not
null - the boundary edge is not yet part of this graph
- the given nodes are both part of this graph
- the given nodes are part of different partitions
- the boundary 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:
trueif the boundary edge can be added to this graph,falseotherwise.
- the boundary edge is not
-
addBoundaryEdge
void addBoundaryEdge(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Adds the given edge to the boundary graph of this partitioned graph.- Parameters:
aEdge- the edge that should be added.aStartNode- the start node of the edge.aEndNode- the end node of the edge.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canAddBoundaryEdge(aEdge, aStartNode, aEndNode)- Note: this validation is potentially expensive, and should be avoided whenever possible.- Throws:
NullPointerException- if one of the arguments isnull.
-
canRemoveBoundaryEdge
Returnstrueif the given boundary edge can be removed from this graph,falseotherwise. More specifically, a boundary edge can be remove from this graph if the following conditions are met:- the boundary edge is not
null - the boundary edge is part of the boundary graph of this partitioned graph
- Parameters:
aEdge- the boundary edge to be verified.- Returns:
trueif the boundary edge can be removed from this graph,falseotherwise.
- the boundary edge is not
-
removeBoundaryEdge
Removes the given boundary edge from the boundary graph of this partitioned graph.- Parameters:
aEdge- the boundary edge that should be removed.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canRemoveBoundaryEdge(aEdge)- Note: this validation is potentially expensive, and should be avoided whenever possible.- Returns:
- the boundary edge that was removed.
- Throws:
NullPointerException- if the given edge isnull.
-
canRemoveBoundaryEdges
Returnstrueif the boundary edge connected to the given partition can be removed from this graph,falseotherwise. More specifically, the boundary edges connected to the given partition can be removed from this graph if the following conditions are met:- the partition is not
null - the partition is part of this partitioned graph
- Parameters:
aPartition- the partition to be verified.- Returns:
trueif the boundary edges connected to the given partition can be removed from this graph,falseotherwise.
- the partition is not
-
removeBoundaryEdges
Enumeration<E> removeBoundaryEdges(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes all boundary edges that are connected to the given partition.- Parameters:
aPartition- the partition whose boundary edges should be removed.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canRemoveBoundaryEdges(aPartition)- Note: this validation is potentially expensive, and should be avoided whenever possible.- Returns:
- an enumeration with all edges that have been removed.
- Throws:
NullPointerException- if the given partition isnull.
-
clearBoundaryGraph
void clearBoundaryGraph(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Clears the boundary graph of this partitioned graph, i.e. all its boundary edges and boundary nodes are removed from its boundary graph.- Parameters:
aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
-
canAddPartition
Returnstrueif the given partition can be added to this partitioned graph,falseotherwise. More specifically, a partition can be added to this graph if the following conditions are met:- the partition is not
null - the partition is not yet part of this graph
- the partition contains no nodes or edges that are already part of this graph
- the partition satisfies all additional implementation-specific requirements (see the documentation of the implementing class).
- Parameters:
aPartition- the partition to be verified.- Returns:
trueif the partition can be added to this graph,falseotherwise.
- the partition is not
-
addPartition
void addPartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Adds a partition to this graph. From the moment a partition is added to the partitioned graph, the client becomes partly responsible himself for maintaining the invariants of the partitioned graph in which it is contained. More specifically, the user should always check himself whether adding a node or an edge to a partition, will not violate the invariants that each node and edge should be unique within a graph (the partitioned graph it is part of, in this case). The most easy way to edit partitions without violating the invariants, is to use the edit methods of the partitioned graph, instead of using the methods of the partition directly. These methods will guarantee that no invariant shall be violated.- Parameters:
aPartition- the partition to be added to this graph.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canAddPartition(aPartition)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
canRemovePartition
Returnstrueif the given partition can be removed from this partitioned graph,falseotherwise. More specifically, a partition can be removed from this graph if the following conditions are met:- the partition is not
null - the partition is part of this graph
- there are no boundary edges in this graph, connected to the given partition
- Parameters:
aPartition- the partition to be verified.- Returns:
trueif the partition can be removed from this graph,falseotherwise.
- the partition is not
-
removePartition
void removePartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes the given partition from this graph. A partition can only be removed if there are no connections any more between that partition and the other partitions. By removing a partition, modifications to the partition have no influence any more on this graph, and can no longer violate its invariants.- Parameters:
aPartition- the partition to be removed from this graph.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canRemovePartition(aPartition)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
clear
void clear(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Clears the graph; all partitions are removed from this graph and the boundary graph is cleared. Note that no recursive clearing is done, i.e. all partitions remain unmodified and can still be used on their own. By clearing the graph, modifications to any of these partitions have no influence any more on this graph, and can no longer violate the invariants of this graph.- Parameters:
aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
-
fireCollectedPartitionedGraphChanges
void fireCollectedPartitionedGraphChanges()Fires all the collected partitioned graph changes, i.e., all partitioned graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedPartitionedGraphChanges(). Note that afireCollectedPartitionedGraphChanges()call is made whenever a partitioned graph event is generated in theILcdFireEventMode.FIRE_NOW, to guarantee the correct order of the events. -
fireCollectedGraphChanges
void fireCollectedGraphChanges()Fires all the collected graph changes, i.e., all graph events that have been generated using 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. -
boundaryEdgeChanged
void boundaryEdgeChanged(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) This method should be called when the given boundary edge has changed.- Parameters:
aBoundaryEdge- the boundary edge that has changed.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
getBoundaryGraph().containsBoundaryEdge(aBoundaryEdge)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
boundaryEdgesChanged
void boundaryEdgesChanged(Vector<E> aBoundaryEdges, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) This method should be called when the given boundary edges have changed.- Parameters:
aBoundaryEdges- a vector containing the boundary edges that have changed.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
- for each
boundaryEdgein the given vector should hold that:getBoundaryGraph().containsBoundaryEdge(boundaryEdge)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-