KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > event > MenuDragMouseEvent


1 /*
2  * @(#)MenuDragMouseEvent.java 1.13 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.swing.event;
8
9 import javax.swing.MenuElement JavaDoc;
10 import javax.swing.MenuSelectionManager JavaDoc;
11 import java.util.EventObject JavaDoc;
12 import java.awt.event.MouseEvent JavaDoc;
13 import java.awt.Component JavaDoc;
14
15
16 /**
17  * MenuDragMouseEvent is used to notify interested parties that
18  * the menu element has received a MouseEvent forwarded to it
19  * under drag conditions.
20  * <p>
21  * <strong>Warning:</strong>
22  * Serialized objects of this class will not be compatible with
23  * future Swing releases. The current serialization support is
24  * appropriate for short term storage or RMI between applications running
25  * the same version of Swing. As of 1.4, support for long term storage
26  * of all JavaBeans<sup><font size="-2">TM</font></sup>
27  * has been added to the <code>java.beans</code> package.
28  * Please see {@link java.beans.XMLEncoder}.
29  *
30  * @version 1.13 12/19/03
31  * @author Georges Saab
32  */

33 public class MenuDragMouseEvent extends MouseEvent JavaDoc {
34     private MenuElement JavaDoc path[];
35     private MenuSelectionManager JavaDoc manager;
36
37     /**
38      * Constructs a MenuDragMouseEvent object.
39      *
40      * @param source the Component that originated the event
41      * (typically <code>this</code>)
42      * @param id an int specifying the type of event, as defined
43      * in {@link java.awt.event.MouseEvent}
44      * @param when a long identifying the time the event occurred
45      * @param modifiers an int specifying any modifier keys held down,
46      * as specified in {@link java.awt.event.InputEvent}
47      * @param x an int specifying the horizontal position at which
48      * the event occurred, in pixels
49      * @param y an int specifying the vertical position at which
50      * the event occurred, in pixels
51      * @param clickCount an int specifying the number of mouse-clicks
52      * @param popupTrigger a boolean -- true if the event {should?/did?}
53      * trigger a popup
54      * @param p an array of MenuElement objects specifying a path
55      * to a menu item affected by the drag
56      * @param m a MenuSelectionManager object that handles selections
57      */

58     public MenuDragMouseEvent(Component JavaDoc source, int id, long when,
59                   int modifiers, int x, int y, int clickCount,
60                   boolean popupTrigger, MenuElement JavaDoc p[],
61                   MenuSelectionManager JavaDoc m) {
62         super(source, id, when, modifiers, x, y, clickCount, popupTrigger);
63     path = p;
64     manager = m;
65     }
66
67     /**
68      * Returns the path to the selected menu item.
69      *
70      * @return an array of MenuElement objects representing the path value
71      */

72     public MenuElement JavaDoc[] getPath() {
73     return path;
74     }
75
76     /**
77      * Returns the current menu selection manager.
78      *
79      * @return a MenuSelectionManager object
80      */

81     public MenuSelectionManager JavaDoc getMenuSelectionManager() {
82     return manager;
83     }
84 }
85
86
Popular Tags