25 package javax.swing.event; 26 27 import javax.swing.MenuElement; 28 import javax.swing.MenuSelectionManager; 29 import java.util.EventObject; 30 import java.awt.event.MouseEvent; 31 import java.awt.Component; 32 33 34 /** 35 * MenuDragMouseEvent is used to notify interested parties that 36 * the menu element has received a MouseEvent forwarded to it 37 * under drag conditions. 38 * <p> 39 * <strong>Warning:</strong> 40 * Serialized objects of this class will not be compatible with 41 * future Swing releases. The current serialization support is 42 * appropriate for short term storage or RMI between applications running 43 * the same version of Swing. As of 1.4, support for long term storage 44 * of all JavaBeans™ 45 * has been added to the <code>java.beans</code> package. 46 * Please see {@link java.beans.XMLEncoder}. 47 * 48 * @author Georges Saab 49 */ 50 @SuppressWarnings("serial") 51 public class MenuDragMouseEvent extends MouseEvent { 52 private MenuElement path[]; 53 private MenuSelectionManager manager; 54 55 /** 56 * Constructs a MenuDragMouseEvent object. 57 * <p>Absolute coordinates xAbs and yAbs are set to source's location on screen plus 58 * relative coordinates x and y. xAbs and yAbs are set to zero if the source is not showing. 59 * 60 * @param source the Component that originated the event 61 * (typically <code>this</code>) 62 * @param id an int specifying the type of event, as defined 63 * in {@link java.awt.event.MouseEvent} 64 * @param when a long identifying the time the event occurred 65 * @param modifiers an int specifying any modifier keys held down, 66 * as specified in {@link java.awt.event.InputEvent} 67 * @param x an int specifying the horizontal position at which 68 * the event occurred, in pixels 69 * @param y an int specifying the vertical position at which 70 * the event occurred, in pixels 71 * @param clickCount an int specifying the number of mouse-clicks 72 * @param popupTrigger a boolean -- true if the event {should?/did?} 73 * trigger a popup 74 * @param p an array of MenuElement objects specifying a path 75 * to a menu item affected by the drag 76 * @param m a MenuSelectionManager object that handles selections 77 * @see MouseEvent#MouseEvent(java.awt.Component, int, long, int, int, int, int, int, int, boolean, int) 78 */ 79 public MenuDragMouseEvent(Component source, int id, long when, 80 int modifiers, int x, int y, int clickCount, 81 boolean popupTrigger, MenuElement p[], 82 MenuSelectionManager m) { 83 super(source, id, when, modifiers, x, y, clickCount, popupTrigger); 84 path = p; 85 manager = m; 86 } 87 88 /** 89 * Constructs a MenuDragMouseEvent object. 90 * <p>Even if inconsistent values for relative and absolute coordinates are 91 * passed to the constructor, the MenuDragMouseEvent instance is still 92 * created. 93 * @param source the Component that originated the event 94 * (typically <code>this</code>) 95 * @param id an int specifying the type of event, as defined 96 * in {@link java.awt.event.MouseEvent} 97 * @param when a long identifying the time the event occurred 98 * @param modifiers an int specifying any modifier keys held down, 99 * as specified in {@link java.awt.event.InputEvent} 100 * @param x an int specifying the horizontal position at which 101 * the event occurred, in pixels 102 * @param y an int specifying the vertical position at which 103 * the event occurred, in pixels 104 * @param xAbs an int specifying the horizontal absolute position at which 105 * the event occurred, in pixels 106 * @param yAbs an int specifying the vertical absolute position at which 107 * the event occurred, in pixels 108 * @param clickCount an int specifying the number of mouse-clicks 109 * @param popupTrigger a boolean -- true if the event {should?/did?} 110 * trigger a popup 111 * @param p an array of MenuElement objects specifying a path 112 * to a menu item affected by the drag 113 * @param m a MenuSelectionManager object that handles selections 114 * @see MouseEvent#MouseEvent(java.awt.Component, int, long, int, int, int, int, int, int, boolean, int) | 25 package javax.swing.event; 26 27 import javax.swing.MenuElement; 28 import javax.swing.MenuSelectionManager; 29 import java.util.EventObject; 30 import java.awt.event.MouseEvent; 31 import java.awt.Component; 32 33 34 /** 35 * MenuDragMouseEvent is used to notify interested parties that 36 * the menu element has received a MouseEvent forwarded to it 37 * under drag conditions. 38 * <p> 39 * <strong>Warning:</strong> 40 * Serialized objects of this class will not be compatible with 41 * future Swing releases. The current serialization support is 42 * appropriate for short term storage or RMI between applications running 43 * the same version of Swing. As of 1.4, support for long term storage 44 * of all JavaBeans™ 45 * has been added to the {@code java.beans} package. 46 * Please see {@link java.beans.XMLEncoder}. 47 * 48 * @author Georges Saab 49 */ 50 @SuppressWarnings("serial") 51 public class MenuDragMouseEvent extends MouseEvent { 52 private MenuElement path[]; 53 private MenuSelectionManager manager; 54 55 /** 56 * Constructs a MenuDragMouseEvent object. 57 * <p>Absolute coordinates xAbs and yAbs are set to source's location on screen plus 58 * relative coordinates x and y. xAbs and yAbs are set to zero if the source is not showing. 59 * 60 * @param source the Component that originated the event 61 * (typically {@code this}) 62 * @param id an int specifying the type of event, as defined 63 * in {@link java.awt.event.MouseEvent} 64 * @param when a long identifying the time the event occurred 65 * @param modifiers an int specifying any modifier keys held down, 66 * as specified in {@link java.awt.event.InputEvent} 67 * @param x an int specifying the horizontal position at which 68 * the event occurred, in pixels 69 * @param y an int specifying the vertical position at which 70 * the event occurred, in pixels 71 * @param clickCount an int specifying the number of mouse-clicks 72 * @param popupTrigger a boolean -- true if the event {should?/did?} 73 * trigger a popup 74 * @param p an array of MenuElement objects specifying a path 75 * to a menu item affected by the drag 76 * @param m a MenuSelectionManager object that handles selections 77 * @see MouseEvent#MouseEvent(java.awt.Component, int, long, int, int, int, int, int, int, boolean, int) 78 */ 79 public MenuDragMouseEvent(Component source, int id, long when, 80 int modifiers, int x, int y, int clickCount, 81 boolean popupTrigger, MenuElement p[], 82 MenuSelectionManager m) { 83 super(source, id, when, modifiers, x, y, clickCount, popupTrigger); 84 path = p; 85 manager = m; 86 } 87 88 /** 89 * Constructs a MenuDragMouseEvent object. 90 * <p>Even if inconsistent values for relative and absolute coordinates are 91 * passed to the constructor, the MenuDragMouseEvent instance is still 92 * created. 93 * @param source the Component that originated the event 94 * (typically {@code this}) 95 * @param id an int specifying the type of event, as defined 96 * in {@link java.awt.event.MouseEvent} 97 * @param when a long identifying the time the event occurred 98 * @param modifiers an int specifying any modifier keys held down, 99 * as specified in {@link java.awt.event.InputEvent} 100 * @param x an int specifying the horizontal position at which 101 * the event occurred, in pixels 102 * @param y an int specifying the vertical position at which 103 * the event occurred, in pixels 104 * @param xAbs an int specifying the horizontal absolute position at which 105 * the event occurred, in pixels 106 * @param yAbs an int specifying the vertical absolute position at which 107 * the event occurred, in pixels 108 * @param clickCount an int specifying the number of mouse-clicks 109 * @param popupTrigger a boolean -- true if the event {should?/did?} 110 * trigger a popup 111 * @param p an array of MenuElement objects specifying a path 112 * to a menu item affected by the drag 113 * @param m a MenuSelectionManager object that handles selections 114 * @see MouseEvent#MouseEvent(java.awt.Component, int, long, int, int, int, int, int, int, boolean, int) |