View Javadoc

1   package de.fzi.wim.guibase.graphview.selection;
2   
3   import java.util.Collection;
4   
5   import de.fzi.wim.guibase.graphview.graph.*;
6   
7   /***
8    * Represents a selection of nodes.
9    */
10  public interface NodeSelectionModel {
11      /***
12       * Adds a node to the selection.
13       *
14       * @param node                          the node to add to the selection
15       */
16      void addNode(Node node);
17      /***
18       * Adds a collection of nodes to the selection.
19       *
20       * @param nodes                         the collection of nodes to add to the selection
21       */
22      void addNodes(Collection nodes);
23      /***
24       * Removes a node from the selection.
25       *
26       * @param node                          the node to remove from the selection
27       */
28      void removeNode(Node node);
29      /***
30       * Removes a collection of nodes from the selection.
31       *
32       * @param nodes                         the collection of nodes to remove from the selection
33       */
34      void removeNodes(Collection nodes);
35      /***
36       * Clears the selection.
37       */
38      void clear();
39      /***
40       * Returns the selection.
41       *
42       * @return                              the selection
43       */
44      Collection getSelectedNodes();
45      /***
46       * Checks whteher the node has been selected.
47       *
48       * @param node                          the node that is checked
49       * @return                              <code>true</code> if the node has been selected
50       */
51      boolean isNodeSelected(Node node);
52      /***
53       * Adds a listener to the selection.
54       *
55       * @param listener                      the listener to add to the selection
56       */
57      void addNodeSelectionListener(NodeSelectionListener listener);
58      /***
59       * Removes a listener from the selection.
60       *
61       * @param listener                      the listener to add to the selection
62       */
63      void removeNodeSelectionListener(NodeSelectionListener listener);
64  }