View Javadoc

1   package de.fzi.wim.guibase.graphview.view;
2   
3   import java.awt.Graphics2D;
4   import java.awt.Point;
5   import java.awt.Rectangle;
6   
7   import de.fzi.wim.guibase.graphview.graph.*;
8   
9   /***
10   * The painter for the node.
11   */
12  public interface NodePainter {
13      /***
14       * Paints the supplied node.
15       *
16       * @param graphPane             the graph pane
17       * @param g                     the graphics
18       * @param node                  the node to paint
19       */
20      void paintNode(JGraphPane graphPane,Graphics2D g,Node node);
21      /***
22       * Checks whether given point is inside the node.
23       *
24       * @param graphPane             the graph pane
25       * @param node                  the node
26       * @param point                 the point
27       * @return                      <code>true</code> if the point is in the node
28       */
29      boolean isInNode(JGraphPane graphPane,Node node,Point point);
30      /***
31       * Returns the outer rectangle of the node on screen.
32       *
33       * @param graphPane             the graph pane
34       * @param node                  the node
35       * @param nodeScreenRectangle   the rectangle receiving the node's coordinates
36       */
37      void getNodeScreenBounds(JGraphPane graphPane,Node node,Rectangle nodeScreenRectangle);
38      /***
39       * Retruns the tool-tip for given point.
40       *
41       * @param graphPane             the graph pane
42       * @param node                  the node
43       * @param point                 the point
44       * @return                      the tool-tip at given point (or <code>null</code>)
45       */
46      String getToolTipText(JGraphPane graphPane,Node node,Point point);
47  }