Class TLcdGraphChangedEvent<N,E>

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

public class TLcdGraphChangedEvent<N,E> extends EventObject
TLcdGraphChangedEvent implements change events that occurred in an ILcdGraph.

A TLcdGraphChangedEvent has an integer code property specifying the global changes. Its value is any logical OR operation of NODES_ADDED, NODES_REMOVED, NODES_CHANGED, EDGES_ADDED,EDGES_REMOVED,EDGES_CHANGED, ALL_EDGES_REMOVED and CLEARED.

A TLcdGraphChangedEvent also has information specifying the model changes in more detail, i.e. per object in a ILcdGraph. The nodes() and edges() methods return an Enumeration of respectively all the nodes and 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 ALL_EDGES_REMOVED is set in the getCode() method, only the edge changes after the removal of all edges are detailed. Node changes are detailed as if nothing has happened.

Note 2: if CLEARED is set in the getCode() method, only the changes after the removal of all edges and nodes are detailed.

Since:
5.1
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Type-safe enumeration containing all possible changes for boundary edges and partitions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Indicates that all edges have been removed from the graph.
    static final int
    Indicates that the graph has been cleared (all edges and nodes removed).
    static final int
    Indicates that edges have been added to the graph.
    static final int
    Indicates that at least some edges in the graph have changed.
    static final int
    Indicates that some edges have been removed from the graph.
    static final int
    Indicates that nodes have been added to the graph.
    static final int
    Indicates that at least some nodes in the graph have changed.
    static final int
    Indicates that some nodes have been removed from the graph.

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    TLcdGraphChangedEvent(ILcdGraph aGraph, int aCode, Vector<N> aChangedNodes, Vector aIndividualNodeChanges, Vector<E> aChangedEdges, Vector aIndividualEdgeChanges)
    Constructs a new TLcdGraphChangedEvent with the given parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    containsEdge(E aObject)
    Returns whether aObject is an edge associated to this TLcdGraphChangedEvent.
    boolean
    containsNode(N aObject)
    Returns whether aObject is a node associated to this TLcdGraphChangedEvent.
    int
    Returns the number of edge Objects associated to this TLcdGraphChangedEvent.
    Returns an Enumeration of all the edges that have been added, removed or changed with respect to the ILcdGraph.
    int
    Returns the global graph change of this TLcdGraphChangedEvent.
    Returns the ILcdGraph that is the source of this TLcdGraphChangedEvent.
    int
    Returns the number of node Objects associated to this TLcdGraphChangedEvent.
    Returns an Enumeration of all the nodes that have been added, removed or changed with respect to the ILcdGraph.
    Returns the details concerning aObject in this TLcdGraphChangedEvent.
    Returns the details concerning aObject in this TLcdGraphChangedEvent.

    Methods inherited from class java.util.EventObject

    getSource, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • NODES_ADDED

      public static final int NODES_ADDED
      Indicates that nodes have been added to the graph.
      See Also:
    • NODES_REMOVED

      public static final int NODES_REMOVED
      Indicates that some nodes have been removed from the graph.
      See Also:
    • NODES_CHANGED

      public static final int NODES_CHANGED
      Indicates that at least some nodes in the graph have changed.
      See Also:
    • EDGES_ADDED

      public static final int EDGES_ADDED
      Indicates that edges have been added to the graph.
      See Also:
    • EDGES_REMOVED

      public static final int EDGES_REMOVED
      Indicates that some edges have been removed from the graph.
      See Also:
    • EDGES_CHANGED

      public static final int EDGES_CHANGED
      Indicates that at least some edges in the graph have changed.
      See Also:
    • ALL_EDGES_REMOVED

      public static final int ALL_EDGES_REMOVED
      Indicates that all edges have been removed from the graph.
      See Also:
    • CLEARED

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

    • TLcdGraphChangedEvent

      public TLcdGraphChangedEvent(ILcdGraph aGraph, int aCode, Vector<N> aChangedNodes, Vector aIndividualNodeChanges, Vector<E> aChangedEdges, Vector aIndividualEdgeChanges)
      Constructs a new TLcdGraphChangedEvent with the given parameters.
      Parameters:
      aGraph - the graph that is firing this event.
      aCode - the code indicating the global graph changes.
      aChangedNodes - the vector containing all changed nodes
      aIndividualNodeChanges - the vector containing the changes for each individual node.
      aChangedEdges - the vector containing all changed edges
      aIndividualEdgeChanges - the vector containing the changes for each individual edge.
  • Method Details

    • getGraph

      public ILcdGraph getGraph()
      Returns the ILcdGraph that is the source of this TLcdGraphChangedEvent.
      Returns:
      the ILcdGraph that is the source of this TLcdGraphChangedEvent.
    • getCode

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

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

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

      public int nodeCount()
      Returns the number of node Objects associated to this TLcdGraphChangedEvent.
      Returns:
      the number of node Objects associated to this TLcdGraphChangedEvent
    • edgeCount

      public int edgeCount()
      Returns the number of edge Objects associated to this TLcdGraphChangedEvent.
      Returns:
      the number of edge Objects associated to this TLcdGraphChangedEvent
    • containsNode

      public boolean containsNode(N aObject)
      Returns whether aObject is a node associated to this TLcdGraphChangedEvent.
      Parameters:
      aObject - the object to check for.
      Returns:
      whether aObject is a node associated to this TLcdGraphChangedEvent
    • containsEdge

      public boolean containsEdge(E aObject)
      Returns whether aObject is an edge associated to this TLcdGraphChangedEvent.
      Parameters:
      aObject - the object to check for.
      Returns:
      whether aObject is an edge associated to this TLcdGraphChangedEvent
    • retrieveNodeChange

      public TLcdGraphChangedEvent.Change retrieveNodeChange(N aObject)
      Returns the details concerning aObject in this TLcdGraphChangedEvent. One of ADDED, REMOVED or CHANGED.
      Parameters:
      aObject - the object to retrieve the type of change for.
      Returns:
      the details concerning aObject in this TLcdGraphChangedEvent. One of ADDED, REMOVED, CHANGED.
    • retrieveEdgeChange

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