01: /*
02: * @(#)CellHandle.java 1.0 03-JUL-04
03: *
04: * Copyright (c) 2001-2004 Gaudenz Alder
05: *
06: */
07: package org.jgraph.graph;
08:
09: import java.awt.Graphics;
10: import java.awt.event.MouseEvent;
11:
12: /**
13: * Defines the requirements for objects that may be used as handles.
14: * Handles are used to interactively manipulate a cell's appearance.
15: *
16: * @version 1.0 1/1/02
17: * @author Gaudenz Alder
18: */
19:
20: public interface CellHandle {
21:
22: /**
23: * Paint the handle on the given graphics object once.
24: *
25: * @param g the graphics object to paint the handle on
26: */
27: void paint(Graphics g);
28:
29: /**
30: * Paint the handle on the given graphics object during mouse
31: * operations.
32: *
33: * @param g the graphics object to paint the handle on
34: */
35: void overlay(Graphics g);
36:
37: /**
38: * Messaged when the mouse is moved.
39: *
40: * @param event the mouse event to be processed
41: */
42: void mouseMoved(MouseEvent event);
43:
44: /**
45: * Messaged when a mouse button is pressed.
46: *
47: * @param event the mouse event to be processed
48: */
49: void mousePressed(MouseEvent event);
50:
51: /**
52: * Messaged when the user drags the selection.
53: * The Controller is responsible to determine whether the mouse is
54: * inside the parent graph or not.
55: *
56: * @param event the drag event to be processed
57: */
58: void mouseDragged(MouseEvent event);
59:
60: /**
61: * Messaged when the drag operation has
62: * terminated with a drop.
63: *
64: * @param event the drop event to be processed
65: */
66: void mouseReleased(MouseEvent event);
67:
68: }
|