public interface ILcdLimitedEditablePartitionedGraph<N,E> extends ILcdPartitionedGraph<N,E>
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.Modifier and Type | Method and Description |
---|---|
void |
addBoundaryEdge(E aEdge,
N aStartNode,
N aEndNode,
int aPartitionedGraphFireEventMode,
int aGraphFireEventMode)
Adds the given edge to the boundary graph of this partitioned graph.
|
void |
addPartition(ILcdGraph<N,E> aPartition,
int aPartitionedGraphFireEventMode,
int aGraphFireEventMode)
Adds a partition to this graph.
|
void |
boundaryEdgeChanged(E aBoundaryEdge,
int aPartitionedGraphFireEventMode,
int aGraphFireEventMode)
This method should be called when the given boundary edge has changed.
|
void |
boundaryEdgesChanged(Vector<E> aBoundaryEdges,
int aPartitionedGraphFireEventMode,
int aGraphFireEventMode)
This method should be called when the given boundary edges have changed.
|
boolean |
canAddBoundaryEdge(E aEdge,
N aStartNode,
N aEndNode)
Returns
true if the given boundary edge can be added to this
partitioned graph, false otherwise. |
boolean |
canAddPartition(ILcdGraph<N,E> aPartition)
Returns
true if the given partition can be added to this
partitioned graph, false otherwise. |
boolean |
canRemoveBoundaryEdge(E aEdge)
Returns
true if the given boundary edge can be removed from
this graph, false otherwise. |
boolean |
canRemoveBoundaryEdges(ILcdGraph<N,E> aPartition)
Returns
true if the boundary edge connected to the given
partition can be removed from this graph, false otherwise. |
boolean |
canRemovePartition(ILcdGraph<N,E> aPartition)
Returns
true if the given partition can be removed from this
partitioned graph, false otherwise. |
void |
clear(int aPartitionedGraphFireEventMode,
int aGraphFireEventMode)
Clears the graph; all partitions are removed from this graph and the
boundary graph is cleared.
|
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.
|
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 to
fireCollectedGraphChanges() . |
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 to
fireCollectedPartitionedGraphChanges() . |
E |
removeBoundaryEdge(E aEdge,
int aPartitionedGraphFireEventMode,
int aGraphFireEventMode)
Removes the given boundary edge from the boundary graph of this partitioned
graph.
|
Enumeration<E> |
removeBoundaryEdges(ILcdGraph<N,E> aPartition,
int aPartitionedGraphFireEventMode,
int aGraphFireEventMode)
Removes all boundary edges that are connected to the given partition.
|
void |
removePartition(ILcdGraph<N,E> aPartition,
int aPartitionedGraphFireEventMode,
int aGraphFireEventMode)
Removes the given partition from this graph.
|
addPartitionedGraphListener, containsPartition, getBoundaryEdges, getBoundaryGraph, getBoundaryNodes, getPartitionForEdge, getPartitionForNode, getPartitions, removePartitionedGraphListener
addGraphListener, containsEdge, containsNode, getEdges, getEdges, getEndNode, getNodes, getOppositeNode, getStartNode, isConnected, removeGraphListener
boolean canAddBoundaryEdge(E aEdge, N aStartNode, N aEndNode)
true
if the given boundary edge can be added to this
partitioned graph, false
otherwise. More specifically, a
boundary edge can be added to this graph if the following conditions are
met: null
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.true
if the boundary edge can be added to this graph,
false
otherwise.void addBoundaryEdge(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
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 of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.
canAddBoundaryEdge(aEdge,
aStartNode, aEndNode)
- Note:
this validation is potentially
expensive, and should be avoided
whenever possible.NullPointerException
- if one of the arguments is null
.boolean canRemoveBoundaryEdge(E aEdge)
true
if the given boundary edge can be removed from
this graph, false
otherwise. More specifically, a boundary
edge can be remove from this graph if the following conditions are met:
null
aEdge
- the boundary edge to be verified.true
if the boundary edge can be removed from this
graph, false
otherwise.E removeBoundaryEdge(E aEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
aEdge
- the boundary edge that should be
removed.aPartitionedGraphFireEventMode
- the mode for sending out the
TLcdPartitionedGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.
canRemoveBoundaryEdge(aEdge)
- Note: this validation is
potentially expensive, and should be
avoided whenever possible.NullPointerException
- if the given edge is null
.boolean canRemoveBoundaryEdges(ILcdGraph<N,E> aPartition)
true
if the boundary edge connected to the given
partition can be removed from this graph, false
otherwise.
More specifically, the boundary edges connected to the given partition can
be removed from this graph if the following conditions are met: null
aPartition
- the partition to be verified.true
if the boundary edges connected to the given
partition can be removed from this graph, false
otherwise.Enumeration<E> removeBoundaryEdges(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
aPartition
- the partition whose boundary edges
should be removed.aPartitionedGraphFireEventMode
- the mode for sending out the
TLcdPartitionedGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.
canRemoveBoundaryEdges(aPartition)
- Note: this validation is
potentially expensive, and should be
avoided whenever possible.NullPointerException
- if the given partition is null
.void clearBoundaryGraph(int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
aPartitionedGraphFireEventMode
- the mode for sending out the
TLcdPartitionedGraphChangedEvent.
This can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent. This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.boolean canAddPartition(ILcdGraph<N,E> aPartition)
true
if the given partition can be added to this
partitioned graph, false
otherwise. More specifically, a
partition can be added to this graph if the following conditions are met:
null
aPartition
- the partition to be verified.true
if the partition can be added to this graph,
false
otherwise.void addPartition(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
aPartition
- the partition to be added to this
graph.aPartitionedGraphFireEventMode
- the mode for sending out the
TLcdPartitionedGraphChangedEvent.
This can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent. This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.
canAddPartition(aPartition)
- Note: this validation is
potentially expensive, and should be
avoided whenever possible.boolean canRemovePartition(ILcdGraph<N,E> aPartition)
true
if the given partition can be removed from this
partitioned graph, false
otherwise. More specifically, a
partition can be removed from this graph if the following conditions are
met: null
aPartition
- the partition to be verified.true
if the partition can be removed from this graph,
false
otherwise.void removePartition(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
aPartition
- the partition to be removed from this
graph.aPartitionedGraphFireEventMode
- the mode for sending out the
TLcdPartitionedGraphChangedEvent.
This can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent. This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.
canRemovePartition(aPartition)
- Note: this validation is
potentially expensive, and should be
avoided whenever possible.void clear(int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
aPartitionedGraphFireEventMode
- the mode for sending out the
TLcdPartitionedGraphChangedEvent.
This can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent. This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.void fireCollectedPartitionedGraphChanges()
fireCollectedPartitionedGraphChanges()
.
Note that afireCollectedPartitionedGraphChanges()
call is made whenever a
partitioned graph event is generated in the ILcdFireEventMode.FIRE_NOW
,
to guarantee the correct order of the events.void fireCollectedGraphChanges()
fireCollectedGraphChanges()
.
Note that a fireCollectedGraphChanges()
call is made whenever
a graph event is generated in the ILcdFireEventMode.FIRE_NOW
,
to guarantee the correct order of the events.void boundaryEdgeChanged(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
aBoundaryEdge
- the boundary edge that has changed.aPartitionedGraphFireEventMode
- the mode for sending out the
TLcdPartitionedGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.
getBoundaryGraph().containsBoundaryEdge(aBoundaryEdge)
- Note: this validation is
potentially expensive, and should be
avoided whenever possible.void boundaryEdgesChanged(Vector<E> aBoundaryEdges, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
aBoundaryEdges
- a vector containing the boundary
edges that have changed.aPartitionedGraphFireEventMode
- the mode for sending out the
TLcdPartitionedGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.aGraphFireEventMode
- the mode for sending out the
TLcdGraphChangedEvent This can be
one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or
ILcdFireEventMode.NO_EVENT
.
boundaryEdge
in the given vector should hold that:
getBoundaryGraph().containsBoundaryEdge(boundaryEdge)
- Note: this validation is
potentially expensive, and should be
avoided whenever possible.