Package diva.graph

Interface MutableGraphModel

  • All Superinterfaces:
    GraphModel
    All Known Implementing Classes:
    BasicGraphModel, BasicModularGraphModel, MutableModularGraphModel

    public interface MutableGraphModel
    extends GraphModel
    A mutable graph model is a read-write subclass of the read-only graph model, allowing users to actually create new nodes and edges, and to modify the topology of the graph.
    Version:
    $Id$
    Author:
    Michael Shilman, John Reekie
    Pt.AcceptedRating:
    Yellow
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean acceptHead​(java.lang.Object edge, java.lang.Object node)
      Return true if the head of the given edge can be attached to the given node.
      boolean acceptTail​(java.lang.Object edge, java.lang.Object node)
      Return true if the tail of the given edge can be attached to the given node.
      void addNode​(java.lang.Object eventSource, java.lang.Object node, java.lang.Object parent)
      Add a node to the given graph and notify listeners with a NODE_ADDED event whose source is the given source object.
      void connectEdge​(java.lang.Object eventSource, java.lang.Object edge, java.lang.Object tailNode, java.lang.Object headNode)
      Connect the given edge to the given tail and head nodes, and notify listeners with events whose source is the given eventSource object
      void disconnectEdge​(java.lang.Object eventSource, java.lang.Object edge)
      Disconnect an edge from its two endpoints and notify graph listeners with an EDGE_HEAD_CHANGED and an EDGE_TAIL_CHANGED event whose source is the given source.
      void removeNode​(java.lang.Object eventSource, java.lang.Object node)
      Delete a node from its parent graph and notify graph listeners with a NODE_REMOVED event.
      void setEdgeHead​(java.lang.Object eventSource, java.lang.Object edge, java.lang.Object newHead)
      Connect an edge to the given head node and notify listeners with an EDGE_HEAD_CHANGED event whose source is the given eventSource object.
      void setEdgeTail​(java.lang.Object eventSource, java.lang.Object edge, java.lang.Object newTail)
      Connect an edge to the given tail node and notify listeners with an EDGE_TAIL_CHANGED event whose source is the given eventSource object.
    • Method Detail

      • acceptHead

        boolean acceptHead​(java.lang.Object edge,
                           java.lang.Object node)
        Return true if the head of the given edge can be attached to the given node.
      • acceptTail

        boolean acceptTail​(java.lang.Object edge,
                           java.lang.Object node)
        Return true if the tail of the given edge can be attached to the given node.
      • addNode

        void addNode​(java.lang.Object eventSource,
                     java.lang.Object node,
                     java.lang.Object parent)
              throws GraphException
        Add a node to the given graph and notify listeners with a NODE_ADDED event whose source is the given source object.

        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        Throws:
        GraphException - if the operation fails.
      • connectEdge

        void connectEdge​(java.lang.Object eventSource,
                         java.lang.Object edge,
                         java.lang.Object tailNode,
                         java.lang.Object headNode)
                  throws GraphException
        Connect the given edge to the given tail and head nodes, and notify listeners with events whose source is the given eventSource object
        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        Throws:
        GraphException - if the operation fails.
      • disconnectEdge

        void disconnectEdge​(java.lang.Object eventSource,
                            java.lang.Object edge)
                     throws GraphException
        Disconnect an edge from its two endpoints and notify graph listeners with an EDGE_HEAD_CHANGED and an EDGE_TAIL_CHANGED event whose source is the given source.
        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        Throws:
        GraphException - if the operation fails.
      • removeNode

        void removeNode​(java.lang.Object eventSource,
                        java.lang.Object node)
                 throws GraphException
        Delete a node from its parent graph and notify graph listeners with a NODE_REMOVED event.
        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        Throws:
        GraphException - if the operation fails.
      • setEdgeHead

        void setEdgeHead​(java.lang.Object eventSource,
                         java.lang.Object edge,
                         java.lang.Object newHead)
                  throws GraphException
        Connect an edge to the given head node and notify listeners with an EDGE_HEAD_CHANGED event whose source is the given eventSource object.
        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        Throws:
        GraphException - if the operation fails.
      • setEdgeTail

        void setEdgeTail​(java.lang.Object eventSource,
                         java.lang.Object edge,
                         java.lang.Object newTail)
                  throws GraphException
        Connect an edge to the given tail node and notify listeners with an EDGE_TAIL_CHANGED event whose source is the given eventSource object.
        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        Throws:
        GraphException - if the operation fails.