public class TLcdPartitionedGraphChangedEvent<N,E> extends EventObject
TLcdPartitionedGraphChangedEvent
implements change events that
occurred in an ILcdPartitionedGraph
. It does only describe events
on the partitioning level, like partitions that have been added or removed.
Basic graph events (e.g., nodes added) are implemented in TLcdGraphChangedEvent
and are handled by a separate handler.
A TLcdPartitionedGraphChangedEvent
has an integer code property specifying
the global changes. Its value is a any logical OR operation of PARTITIONS_ADDED,
PARTITONS_REMOVED, BOUNDARY_EDGES_ADDED, BOUNDARY_EDGES_REMOVED, BOUNDARY_EDGES_CHANGED,
BOUNDARY_GRAPH_CLEARED and CLEARED.
A TLcdPartitionedGraphChangedEvent
also has information specifying the
partition changes in more detail, i.e. per object in a ILcdGraph. The partitions() and
boundaryEdges() methods return an Enumeration of respectively all the partitions and boundary 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 BOUNDARY_GRAPH_CLEARED is set in the getCode() method, only the changes
in the boundary graph, after the clearance of the boundary graph are detailed.
Partition changes are detailed as if nothing has happened.
Note 2: if CLEARED is set in the getCode() method, only the changes (partitions
as well as boundary edges) after the clearance are detailed.ILcdPartitionedGraph
,
ILcdLimitedEditablePartitionedGraph
,
ILcdPartitionedGraphListener
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
TLcdPartitionedGraphChangedEvent.Change
Type-safe enumeration containing all possible changes for boundary edges and
partitions.
|
Modifier and Type | Field and Description |
---|---|
static int |
BOUNDARY_EDGES_ADDED
Indicates that boundary boundaryEdges have been added to the graph.
|
static int |
BOUNDARY_EDGES_CHANGED
Indicates that at least some boundary boundaryEdges in the graph have
changed.
|
static int |
BOUNDARY_EDGES_REMOVED
Indicates that some boundary boundaryEdges have been removed from the
graph.
|
static int |
BOUNDARY_GRAPH_CLEARED
Indicates that the boundary graph of this partitioned graph has been
cleared.
|
static int |
CLEARED
Indicates that the graph has been cleared (all partitions are removed and
the boundary graph is cleared).
|
static int |
PARTITIONS_ADDED
Indicates that partitions have been added to the graph.
|
static int |
PARTITIONS_REMOVED
Indicates that some partitions have been removed from the graph.
|
source
Constructor and Description |
---|
TLcdPartitionedGraphChangedEvent(ILcdPartitionedGraph aGraph,
int aCode,
Vector<ILcdGraph<N,E>> aChangedPartitions,
Vector aIndividualPartitionChanges,
Vector<E> aChangedBoundaryEdges,
Vector aIndividualBoundaryEdgeChanges)
Constructs a new
TLcdPartitionedGraphChangedEvent with the given
parameters. |
Modifier and Type | Method and Description |
---|---|
int |
boundaryEdgeCount()
Returns the number of boundary edge Objects associated to this
TLcdGraphChangedEvent.
|
Enumeration<E> |
boundaryEdges()
Returns an Enumeration of all the boundary edges that have been added,
removed or changed with respect to the ILcdPartitionedGraph.
|
boolean |
containsBoundaryEdge(E aObject)
Returns whether
aObject is an boundary edge associated to this
TLcdPartitionedGraphChangedEvent. |
boolean |
containsPartition(ILcdGraph<N,E> aObject)
Returns whether
aObject is a partition associated to this
TLcdPartitionedGraphChangedEvent. |
int |
getCode()
Returns the global graph change of this
TLcdPartitionedGraphChangedEvent . |
ILcdPartitionedGraph<N,E> |
getGraph()
Returns the
ILcdPartitionedGraph that is the source of this
TLcdPartitionedGraphChangedEvent . |
int |
partitionCount()
Returns the number of partition Objects associated to this
TLcdGraphChangedEvent.
|
Enumeration<ILcdGraph<N,E>> |
partitions()
Returns an Enumeration of all the partitions that have been added, removed or
changed with respect to the ILcdPartitionedGraph.
|
TLcdPartitionedGraphChangedEvent.Change |
retrieveBoundaryEdgeChange(E aBoundaryEdge)
Returns the details concerning aObject in this
TLcdGraphChangedEvent . |
TLcdPartitionedGraphChangedEvent.Change |
retrievePartitionChange(ILcdGraph<N,E> aPartition)
Returns the details concerning aObject in this
TLcdPartitionedGraphChangedEvent . |
getSource, toString
public static final int PARTITIONS_ADDED
public static final int PARTITIONS_REMOVED
public static final int BOUNDARY_EDGES_ADDED
public static final int BOUNDARY_EDGES_REMOVED
public static final int BOUNDARY_EDGES_CHANGED
public static final int BOUNDARY_GRAPH_CLEARED
public static final int CLEARED
public TLcdPartitionedGraphChangedEvent(ILcdPartitionedGraph aGraph, int aCode, Vector<ILcdGraph<N,E>> aChangedPartitions, Vector aIndividualPartitionChanges, Vector<E> aChangedBoundaryEdges, Vector aIndividualBoundaryEdgeChanges)
TLcdPartitionedGraphChangedEvent
with the given
parameters.aGraph
- the graph that is firing this event.aCode
- the code indicating the global graph
changes.aChangedPartitions
- the vector containing all changed
partitionsaIndividualPartitionChanges
- the vector containing the changes for
each individual partition, in the
same order as the aChangedPartitions
vector.aChangedBoundaryEdges
- the vector containing all changed
boundary edgesaIndividualBoundaryEdgeChanges
- the vector containing the changes for
each individual boundary edge, in the
same order as the aChangedBoundaryEdges
vector.public ILcdPartitionedGraph<N,E> getGraph()
ILcdPartitionedGraph
that is the source of this
TLcdPartitionedGraphChangedEvent
.ILcdPartitionedGraph
that is the source of this
TLcdPartitionedGraphChangedEvent
.public int getCode()
TLcdPartitionedGraphChangedEvent
.TLcdPartitionedGraphChangedEvent
.
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<ILcdGraph<N,E>> partitions()
retrievePartitionChange(com.luciad.network.graph.ILcdGraph<N, E>)
public Enumeration<E> boundaryEdges()
retrieveBoundaryEdgeChange(E)
public int partitionCount()
public int boundaryEdgeCount()
public boolean containsPartition(ILcdGraph<N,E> aObject)
aObject
is a partition associated to this
TLcdPartitionedGraphChangedEvent.aObject
- the object to check for.aObject
is a partition associated to this
TLcdPartitionedGraphChangedEventpublic boolean containsBoundaryEdge(E aObject)
aObject
is an boundary edge associated to this
TLcdPartitionedGraphChangedEvent.aObject
- the object to check for.aObject
is an boundary edge associated to this
TLcdPartitionedGraphChangedEventpublic TLcdPartitionedGraphChangedEvent.Change retrievePartitionChange(ILcdGraph<N,E> aPartition)
TLcdPartitionedGraphChangedEvent
.
One of ADDED or REMOVED.aPartition
- the object to retrieve the type of change for.TLcdPartitionedGraphChangedEvent
.
One of ADDED or REMOVED.public TLcdPartitionedGraphChangedEvent.Change retrieveBoundaryEdgeChange(E aBoundaryEdge)
TLcdGraphChangedEvent
.
One of ADDED, REMOVED or CHANGED.aBoundaryEdge
- the object to retrieve the type of change for.TLcdGraphChangedEvent
.
One of ADDED, REMOVED, CHANGED.