001: package prefuse.controls;
002:
003: import java.awt.event.KeyEvent;
004: import java.awt.event.KeyListener;
005: import java.awt.event.MouseEvent;
006: import java.awt.event.MouseListener;
007: import java.awt.event.MouseMotionListener;
008: import java.awt.event.MouseWheelEvent;
009: import java.awt.event.MouseWheelListener;
010: import java.util.EventListener;
011:
012: import prefuse.visual.VisualItem;
013:
014: /**
015: * Listener interface for processing user interface events on a Display.
016: *
017: * @author alan newberger
018: * @author <a href="http://jheer.org">jeffrey heer</a>
019: */
020: public interface Control extends EventListener, MouseListener,
021: MouseMotionListener, MouseWheelListener, KeyListener {
022: /** Represents the use of the left mouse button */
023: public static final int LEFT_MOUSE_BUTTON = MouseEvent.BUTTON1_MASK;
024: /** Represents the use of the middle mouse button */
025: public static final int MIDDLE_MOUSE_BUTTON = MouseEvent.BUTTON2_MASK;
026: /** Represents the use of the right mouse button */
027: public static final int RIGHT_MOUSE_BUTTON = MouseEvent.BUTTON3_MASK;
028:
029: /**
030: * Indicates if this Control is currently enabled.
031: * @return true if the control is enabled, false if disabled
032: */
033: public boolean isEnabled();
034:
035: /**
036: * Sets the enabled status of this control.
037: * @param enabled true to enable the control, false to disable it
038: */
039: public void setEnabled(boolean enabled);
040:
041: // -- Actions performed on VisualItems ------------------------------------
042:
043: /**
044: * Invoked when a mouse button is pressed on a VisualItem and then dragged.
045: */
046: public void itemDragged(VisualItem item, MouseEvent e);
047:
048: /**
049: * Invoked when the mouse cursor has been moved onto a VisualItem but
050: * no buttons have been pushed.
051: */
052: public void itemMoved(VisualItem item, MouseEvent e);
053:
054: /**
055: * Invoked when the mouse wheel is rotated while the mouse is over a
056: * VisualItem.
057: */
058: public void itemWheelMoved(VisualItem item, MouseWheelEvent e);
059:
060: /**
061: * Invoked when the mouse button has been clicked (pressed and released) on
062: * a VisualItem.
063: */
064: public void itemClicked(VisualItem item, MouseEvent e);
065:
066: /**
067: * Invoked when a mouse button has been pressed on a VisualItem.
068: */
069: public void itemPressed(VisualItem item, MouseEvent e);
070:
071: /**
072: * Invoked when a mouse button has been released on a VisualItem.
073: */
074: public void itemReleased(VisualItem item, MouseEvent e);
075:
076: /**
077: * Invoked when the mouse enters a VisualItem.
078: */
079: public void itemEntered(VisualItem item, MouseEvent e);
080:
081: /**
082: * Invoked when the mouse exits a VisualItem.
083: */
084: public void itemExited(VisualItem item, MouseEvent e);
085:
086: /**
087: * Invoked when a key has been pressed, while the mouse is over
088: * a VisualItem.
089: */
090: public void itemKeyPressed(VisualItem item, KeyEvent e);
091:
092: /**
093: * Invoked when a key has been released, while the mouse is over
094: * a VisualItem.
095: */
096: public void itemKeyReleased(VisualItem item, KeyEvent e);
097:
098: /**
099: * Invoked when a key has been typed, while the mouse is over
100: * a VisualItem.
101: */
102: public void itemKeyTyped(VisualItem item, KeyEvent e);
103:
104: // -- Actions performed on the Display ------------------------------------
105:
106: /**
107: * Invoked when the mouse enters the Display.
108: */
109: public void mouseEntered(MouseEvent e);
110:
111: /**
112: * Invoked when the mouse exits the Display.
113: */
114: public void mouseExited(MouseEvent e);
115:
116: /**
117: * Invoked when a mouse button has been pressed on the Display but NOT
118: * on a VisualItem.
119: */
120: public void mousePressed(MouseEvent e);
121:
122: /**
123: * Invoked when a mouse button has been released on the Display but NOT
124: * on a VisualItem.
125: */
126: public void mouseReleased(MouseEvent e);
127:
128: /**
129: * Invoked when the mouse button has been clicked (pressed and released) on
130: * the Display, but NOT on a VisualItem.
131: */
132: public void mouseClicked(MouseEvent e);
133:
134: /**
135: * Invoked when a mouse button is pressed on the Display (but NOT a
136: * VisualItem) and then dragged.
137: */
138: public void mouseDragged(MouseEvent e);
139:
140: /**
141: * Invoked when the mouse cursor has been moved on the Display (but NOT a
142: * VisualItem) and no buttons have been pushed.
143: */
144: public void mouseMoved(MouseEvent e);
145:
146: /**
147: * Invoked when the mouse wheel is rotated while the mouse is over the
148: * Display (but NOT a VisualItem).
149: */
150: public void mouseWheelMoved(MouseWheelEvent e);
151:
152: /**
153: * Invoked when a key has been pressed, while the mouse is NOT
154: * over a VisualItem.
155: */
156: public void keyPressed(KeyEvent e);
157:
158: /**
159: * Invoked when a key has been released, while the mouse is NOT
160: * over a VisualItem.
161: */
162: public void keyReleased(KeyEvent e);
163:
164: /**
165: * Invoked when a key has been typed, while the mouse is NOT
166: * over a VisualItem.
167: */
168: public void keyTyped(KeyEvent e);
169:
170: } // end of inteface ControlListener
|