1. /*
  2. * @(#)MenuDragMouseEvent.java 1.9 00/02/02
  3. *
  4. * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.event;
  11. import javax.swing.MenuElement;
  12. import javax.swing.MenuSelectionManager;
  13. import java.util.EventObject;
  14. import java.awt.event.MouseEvent;
  15. import java.awt.Component;
  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 appropriate
  24. * for short term storage or RMI between applications running the same
  25. * version of Swing. A future release of Swing will provide support for
  26. * long term persistence.
  27. *
  28. * @version 1.9 02/02/00
  29. * @author Georges Saab
  30. */
  31. public class MenuDragMouseEvent extends MouseEvent {
  32. private MenuElement path[];
  33. private MenuSelectionManager manager;
  34. /**
  35. * Constructs a MenuDragMouseEvent object.
  36. *
  37. * @param source the Component that originated the event
  38. * (typically <code>this</code>)
  39. * @param id an int specifying the type of event, as defined
  40. * in {@link java.awt.event.MouseEvent}
  41. * @param when a long identifying the time the event occurred
  42. * @param modifiers an int specifying any modifier keys held down,
  43. * as specified in {@link java.awt.event.InputEvent}
  44. * @param x an int specifying the horizontal position at which
  45. * the event occurred, in pixels
  46. * @param y an int specifying the vertical position at which
  47. * the event occurred, in pixels
  48. * @param clickCount an int specifying the number of mouse-clicks
  49. * @param popupTrigger a boolean -- true if the event {should?/did?}
  50. * trigger a popup
  51. * @param p an array of MenuElement objects specifying a path
  52. * to a menu item affected by the drag
  53. * @param m a MenuSelectionManager object that handles selections
  54. */
  55. public MenuDragMouseEvent(Component source, int id, long when,
  56. int modifiers, int x, int y, int clickCount,
  57. boolean popupTrigger, MenuElement p[],
  58. MenuSelectionManager m) {
  59. super(source, id, when, modifiers, x, y, clickCount, popupTrigger);
  60. path = p;
  61. manager = m;
  62. }
  63. /**
  64. * Returns the path to the selected menu item.
  65. *
  66. * @return an array of MenuElement objects representing the path value
  67. */
  68. public MenuElement[] getPath() {
  69. return path;
  70. }
  71. /**
  72. * Returns the current menu selection manager.
  73. *
  74. * @return a MenuSelectionManager object
  75. */
  76. public MenuSelectionManager getMenuSelectionManager() {
  77. return manager;
  78. }
  79. }