Class TLcdPartitionedGraphChangedEvent<N,E>

java.lang.Object
java.util.EventObject
com.luciad.network.graph.partition.TLcdPartitionedGraphChangedEvent<N,E>
All Implemented Interfaces:
Serializable

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.

Since:
5.1
See Also:
  • Field Details

    • PARTITIONS_ADDED

      public static final int PARTITIONS_ADDED
      Indicates that partitions have been added to the graph.
      See Also:
    • PARTITIONS_REMOVED

      public static final int PARTITIONS_REMOVED
      Indicates that some partitions have been removed from the graph.
      See Also:
    • BOUNDARY_EDGES_ADDED

      public static final int BOUNDARY_EDGES_ADDED
      Indicates that boundary boundaryEdges have been added to the graph.
      See Also:
    • BOUNDARY_EDGES_REMOVED

      public static final int BOUNDARY_EDGES_REMOVED
      Indicates that some boundary boundaryEdges have been removed from the graph.
      See Also:
    • BOUNDARY_EDGES_CHANGED

      public static final int BOUNDARY_EDGES_CHANGED
      Indicates that at least some boundary boundaryEdges in the graph have changed.
      See Also:
    • BOUNDARY_GRAPH_CLEARED

      public static final int BOUNDARY_GRAPH_CLEARED
      Indicates that the boundary graph of this partitioned graph has been cleared.
      See Also:
    • CLEARED

      public static final int CLEARED
      Indicates that the graph has been cleared (all partitions are removed and the boundary graph is cleared).
      See Also:
  • Constructor Details

    • TLcdPartitionedGraphChangedEvent

      public 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.
      Parameters:
      aGraph - the graph that is firing this event.
      aCode - the code indicating the global graph changes.
      aChangedPartitions - the vector containing all changed partitions
      aIndividualPartitionChanges - the vector containing the changes for each individual partition, in the same order as the aChangedPartitions vector.
      aChangedBoundaryEdges - the vector containing all changed boundary edges
      aIndividualBoundaryEdgeChanges - the vector containing the changes for each individual boundary edge, in the same order as the aChangedBoundaryEdges vector.
  • Method Details

    • getGraph

      public ILcdPartitionedGraph<N,E> getGraph()
      Returns the ILcdPartitionedGraph that is the source of this TLcdPartitionedGraphChangedEvent.
      Returns:
      the ILcdPartitionedGraph that is the source of this TLcdPartitionedGraphChangedEvent.
    • getCode

      public int getCode()
      Returns the global graph change of this TLcdPartitionedGraphChangedEvent.
      Returns:
      the global graph change of this 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.
    • partitions

      public Enumeration<ILcdGraph<N,E>> partitions()
      Returns an Enumeration of all the partitions that have been added, removed or changed with respect to the ILcdPartitionedGraph.
      Returns:
      an Enumeration of all the partitions that have been added, removed or changed with respect to the ILcdPartitionedGraph.
      See Also:
    • boundaryEdges

      public Enumeration<E> boundaryEdges()
      Returns an Enumeration of all the boundary edges that have been added, removed or changed with respect to the ILcdPartitionedGraph.
      Returns:
      an Enumeration of all the boundary edges that have been added, removed or changed with respect to the ILcdPartitionedGraph.
      See Also:
    • partitionCount

      public int partitionCount()
      Returns the number of partition Objects associated to this TLcdGraphChangedEvent.
      Returns:
      the number of partition Objects associated to this TLcdPartitionedGraphChangedEvent
    • boundaryEdgeCount

      public int boundaryEdgeCount()
      Returns the number of boundary edge Objects associated to this TLcdGraphChangedEvent.
      Returns:
      the number of boundary edge Objects associated to this TLcdPartitionedGraphChangedEvent
    • containsPartition

      public boolean containsPartition(ILcdGraph<N,E> aObject)
      Returns whether aObject is a partition associated to this TLcdPartitionedGraphChangedEvent.
      Parameters:
      aObject - the object to check for.
      Returns:
      whether aObject is a partition associated to this TLcdPartitionedGraphChangedEvent
    • containsBoundaryEdge

      public boolean containsBoundaryEdge(E aObject)
      Returns whether aObject is an boundary edge associated to this TLcdPartitionedGraphChangedEvent.
      Parameters:
      aObject - the object to check for.
      Returns:
      whether aObject is an boundary edge associated to this TLcdPartitionedGraphChangedEvent
    • retrievePartitionChange

      public TLcdPartitionedGraphChangedEvent.Change retrievePartitionChange(ILcdGraph<N,E> aPartition)
      Returns the details concerning aObject in this TLcdPartitionedGraphChangedEvent. One of ADDED or REMOVED.
      Parameters:
      aPartition - the object to retrieve the type of change for.
      Returns:
      the details concerning aObject in this TLcdPartitionedGraphChangedEvent. One of ADDED or REMOVED.
    • retrieveBoundaryEdgeChange

      public TLcdPartitionedGraphChangedEvent.Change retrieveBoundaryEdgeChange(E aBoundaryEdge)
      Returns the details concerning aObject in this TLcdGraphChangedEvent. One of ADDED, REMOVED or CHANGED.
      Parameters:
      aBoundaryEdge - the object to retrieve the type of change for.
      Returns:
      the details concerning aObject in this TLcdGraphChangedEvent. One of ADDED, REMOVED, CHANGED.