KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > prefuse > controls > Control


1 package prefuse.controls;
2
3 import java.awt.event.KeyEvent JavaDoc;
4 import java.awt.event.KeyListener JavaDoc;
5 import java.awt.event.MouseEvent JavaDoc;
6 import java.awt.event.MouseListener JavaDoc;
7 import java.awt.event.MouseMotionListener JavaDoc;
8 import java.awt.event.MouseWheelEvent JavaDoc;
9 import java.awt.event.MouseWheelListener JavaDoc;
10 import java.util.EventListener JavaDoc;
11
12 import prefuse.visual.VisualItem;
13
14
15 /**
16  * Listener interface for processing user interface events on a Display.
17  *
18  * @author alan newberger
19  * @author <a HREF="http://jheer.org">jeffrey heer</a>
20  */

21 public interface Control extends EventListener JavaDoc,
22     MouseListener JavaDoc, MouseMotionListener JavaDoc, MouseWheelListener JavaDoc, KeyListener JavaDoc
23 {
24     /** Represents the use of the left mouse button */
25     public static final int LEFT_MOUSE_BUTTON = MouseEvent.BUTTON1_MASK;
26     /** Represents the use of the middle mouse button */
27     public static final int MIDDLE_MOUSE_BUTTON = MouseEvent.BUTTON2_MASK;
28     /** Represents the use of the right mouse button */
29     public static final int RIGHT_MOUSE_BUTTON = MouseEvent.BUTTON3_MASK;
30     
31     /**
32      * Indicates if this Control is currently enabled.
33      * @return true if the control is enabled, false if disabled
34      */

35     public boolean isEnabled();
36     
37     /**
38      * Sets the enabled status of this control.
39      * @param enabled true to enable the control, false to disable it
40      */

41     public void setEnabled(boolean enabled);
42     
43     // -- Actions performed on VisualItems ------------------------------------
44

45     /**
46      * Invoked when a mouse button is pressed on a VisualItem and then dragged.
47      */

48     public void itemDragged(VisualItem item, MouseEvent JavaDoc e);
49     
50     /**
51      * Invoked when the mouse cursor has been moved onto a VisualItem but
52      * no buttons have been pushed.
53      */

54     public void itemMoved(VisualItem item, MouseEvent JavaDoc e);
55     
56     /**
57      * Invoked when the mouse wheel is rotated while the mouse is over a
58      * VisualItem.
59      */

60     public void itemWheelMoved(VisualItem item, MouseWheelEvent JavaDoc e);
61     
62     /**
63      * Invoked when the mouse button has been clicked (pressed and released) on
64      * a VisualItem.
65      */

66     public void itemClicked(VisualItem item, MouseEvent JavaDoc e);
67     
68     /**
69      * Invoked when a mouse button has been pressed on a VisualItem.
70      */

71     public void itemPressed(VisualItem item, MouseEvent JavaDoc e);
72     
73     /**
74      * Invoked when a mouse button has been released on a VisualItem.
75      */

76     public void itemReleased(VisualItem item, MouseEvent JavaDoc e);
77     
78     /**
79      * Invoked when the mouse enters a VisualItem.
80      */

81     public void itemEntered(VisualItem item, MouseEvent JavaDoc e);
82     
83     /**
84      * Invoked when the mouse exits a VisualItem.
85      */

86     public void itemExited(VisualItem item, MouseEvent JavaDoc e);
87     
88     /**
89      * Invoked when a key has been pressed, while the mouse is over
90      * a VisualItem.
91      */

92     public void itemKeyPressed(VisualItem item, KeyEvent JavaDoc e);
93     
94     /**
95      * Invoked when a key has been released, while the mouse is over
96      * a VisualItem.
97      */

98     public void itemKeyReleased(VisualItem item, KeyEvent JavaDoc e);
99     
100     /**
101      * Invoked when a key has been typed, while the mouse is over
102      * a VisualItem.
103      */

104     public void itemKeyTyped(VisualItem item, KeyEvent JavaDoc e);
105     
106     
107     // -- Actions performed on the Display ------------------------------------
108

109     /**
110      * Invoked when the mouse enters the Display.
111      */

112     public void mouseEntered(MouseEvent JavaDoc e);
113     
114     /**
115      * Invoked when the mouse exits the Display.
116      */

117     public void mouseExited(MouseEvent JavaDoc e);
118     
119     /**
120      * Invoked when a mouse button has been pressed on the Display but NOT
121      * on a VisualItem.
122      */

123     public void mousePressed(MouseEvent JavaDoc e);
124     
125     /**
126      * Invoked when a mouse button has been released on the Display but NOT
127      * on a VisualItem.
128      */

129     public void mouseReleased(MouseEvent JavaDoc e);
130     
131     /**
132      * Invoked when the mouse button has been clicked (pressed and released) on
133      * the Display, but NOT on a VisualItem.
134      */

135     public void mouseClicked(MouseEvent JavaDoc e);
136     
137     /**
138      * Invoked when a mouse button is pressed on the Display (but NOT a
139      * VisualItem) and then dragged.
140      */

141     public void mouseDragged(MouseEvent JavaDoc e);
142     
143     /**
144      * Invoked when the mouse cursor has been moved on the Display (but NOT a
145      * VisualItem) and no buttons have been pushed.
146      */

147     public void mouseMoved(MouseEvent JavaDoc e);
148     
149     /**
150      * Invoked when the mouse wheel is rotated while the mouse is over the
151      * Display (but NOT a VisualItem).
152      */

153     public void mouseWheelMoved(MouseWheelEvent JavaDoc e);
154     
155     /**
156      * Invoked when a key has been pressed, while the mouse is NOT
157      * over a VisualItem.
158      */

159     public void keyPressed(KeyEvent JavaDoc e);
160     
161     /**
162      * Invoked when a key has been released, while the mouse is NOT
163      * over a VisualItem.
164      */

165     public void keyReleased(KeyEvent JavaDoc e);
166     
167     /**
168      * Invoked when a key has been typed, while the mouse is NOT
169      * over a VisualItem.
170      */

171     public void keyTyped(KeyEvent JavaDoc e);
172
173 } // end of inteface ControlListener
174
Popular Tags