View Javadoc

1   package de.fzi.wim.guibase.graphview.graph;
2   
3   import java.util.List;
4   
5   /***
6    * Models a graph.
7    */
8   public interface Graph {
9       /***
10       * Adds a listener to the graph.
11       *
12       * @param listener              the listener added to the graph
13       */
14      void addGraphListener(GraphListener listener);
15      /***
16       * Removes a listener from the graph.
17       *
18       * @param listener              the listener removed from the graph
19       */
20      void removeGraphListener(GraphListener listener);
21      /***
22       * Notifies the graph that its layout has been updated.
23       */
24      void notifyLayoutUpdated();
25      /***
26       * Notifies the graph that its nodes have been updated, but that no node has changed position.
27       */
28      void notifyUpdated();
29      /***
30       * Returns a list the nodes in the graph. The order of the list reflects the Z-order of nodes in the graph.
31       * Elements with lower indices are lower in the Z-order.
32       *
33       * @return                      the list of the nodes in the graph
34       */
35      List getNodes();
36      /***
37       * Returns a collection of the edges in the graph. The order of the list reflects the Z-order of nodes in the graph.
38       *
39       * @return                      the list of the edges in the graph
40       */
41      List getEdges();
42  }