01: /*************************************************************************
02: * *
03: * 1) This source code file, in unmodified form, and compiled classes *
04: * derived from it can be used and distributed without restriction, *
05: * including for commercial use. (Attribution is not required *
06: * but is appreciated.) *
07: * *
08: * 2) Modified versions of this file can be made and distributed *
09: * provided: the modified versions are put into a Java package *
10: * different from the original package, edu.hws; modified *
11: * versions are distributed under the same terms as the original; *
12: * and the modifications are documented in comments. (Modification *
13: * here does not include simply making subclasses that belong to *
14: * a package other than edu.hws, which can be done without any *
15: * restriction.) *
16: * *
17: * David J. Eck *
18: * Department of Mathematics and Computer Science *
19: * Hobart and William Smith Colleges *
20: * Geneva, New York 14456, USA *
21: * Email: eck@hws.edu WWW: http://math.hws.edu/eck/ *
22: * *
23: *************************************************************************/package edu.hws.jcm.draw;
24:
25: import java.awt.event.MouseEvent;
26:
27: /**
28: * An interface that can be implemented by an object that can be dragged
29: * with the mouse.
30: */
31: public interface Draggable {
32:
33: /**
34: * Tell the object that a drag operation might be beginning.
35: * The Draggable object can decide whether it really wants
36: * to be dragged, based on the MouseEvent. It should return
37: * true to indicate that a drag should really be started, and
38: * false if it wants to ignore the MouseEvent.
39: */
40: public boolean startDrag(MouseEvent evt);
41:
42: /**
43: * Continue a drag that was started in startDrag(). Presumably
44: * the event is a mouseDragged event.
45: */
46: public void continueDrag(MouseEvent evt);
47:
48: /**
49: * Finish a draw that was started in startDrag(). Presumably
50: * the event is a mouseReleased event.
51: */
52: public void finishDrag(MouseEvent evt);
53:
54: }
|