Class Overview
MenuDragMouseEvent is used to notify interested parties that
the menu element has received a MouseEvent forwarded to it
under drag conditions.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see XMLEncoder
.
Summary
[Expand]
Inherited Fields |
From class
java.awt.AWTEvent
protected
boolean |
consumed |
Controls whether or not the event is sent back down to the peer once the
source has processed it - false means it's sent to the peer; true means
it's not. |
protected
int |
id |
The event's id.@serial |
|
From class
java.util.EventObject
protected
Object |
source |
The object on which the Event initially occurred. |
|
Public Constructors |
|
MenuDragMouseEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, MenuElement[] p, MenuSelectionManager m)
Constructs a MenuDragMouseEvent object.
|
|
MenuDragMouseEvent(Component source, int id, long when, int modifiers, int x, int y, int xAbs, int yAbs, int clickCount, boolean popupTrigger, MenuElement[] p, MenuSelectionManager m)
Constructs a MenuDragMouseEvent object.
|
[Expand]
Inherited Methods |
From class
java.awt.event.MouseEvent
int
|
getButton()
Returns which, if any, of the mouse buttons has changed state.
|
int
|
getClickCount()
Returns the number of mouse clicks associated with this event.
|
Point
|
getLocationOnScreen()
Returns the absolute x, y position of the event.
|
static
String
|
getMouseModifiersText(int modifiers)
Returns a String describing the modifier keys and
mouse buttons that were down during the event, such as "Shift",
or "Ctrl+Shift".
|
Point
|
getPoint()
Returns the x,y position of the event relative to the source component.
|
int
|
getX()
Returns the horizontal x position of the event relative to the
source component.
|
int
|
getXOnScreen()
Returns the absolute horizontal x position of the event.
|
int
|
getY()
Returns the vertical y position of the event relative to the
source component.
|
int
|
getYOnScreen()
Returns the absolute vertical y position of the event.
|
boolean
|
isPopupTrigger()
Returns whether or not this mouse event is the popup menu
trigger event for the platform.
|
String
|
paramString()
Returns a parameter string identifying this event.
|
synchronized
void
|
translatePoint(int x, int y)
Translates the event's coordinates to a new position
by adding specified x (horizontal) and y
(vertical) offsets.
|
|
From class
java.awt.event.InputEvent
|
From class
java.awt.event.ComponentEvent
|
From class
java.awt.AWTEvent
void
|
consume()
Consumes this event, if this event can be consumed.
|
int
|
getID()
Returns the event type.
|
boolean
|
isConsumed()
Returns whether this event has been consumed.
|
String
|
paramString()
Returns a string representing the state of this Event .
|
void
|
setSource(Object newSource)
Retargets an event to a new source.
|
String
|
toString()
Returns a String representation of this object.
|
|
From class
java.util.EventObject
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Public Constructors
public
MenuDragMouseEvent
(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger, MenuElement[] p, MenuSelectionManager m)
Constructs a MenuDragMouseEvent object.
Absolute coordinates xAbs and yAbs are set to source's location on screen plus
relative coordinates x and y. xAbs and yAbs are set to zero if the source is not showing.
Parameters
source
| the Component that originated the event
(typically this ) |
id
| an int specifying the type of event, as defined
in MouseEvent |
when
| a long identifying the time the event occurred |
modifiers
| an int specifying any modifier keys held down,
as specified in InputEvent |
x
| an int specifying the horizontal position at which
the event occurred, in pixels |
y
| an int specifying the vertical position at which
the event occurred, in pixels |
clickCount
| an int specifying the number of mouse-clicks |
popupTrigger
| a boolean -- true if the event {should?/did?}
trigger a popup |
p
| an array of MenuElement objects specifying a path
to a menu item affected by the drag |
m
| a MenuSelectionManager object that handles selections |
See Also
MouseEvent(java.awt.Component, int, long, int, int, int, int, int, int, boolean, int)
public
MenuDragMouseEvent
(Component source, int id, long when, int modifiers, int x, int y, int xAbs, int yAbs, int clickCount, boolean popupTrigger, MenuElement[] p, MenuSelectionManager m)
Constructs a MenuDragMouseEvent object.
Even if inconsistent values for relative and absolute coordinates are
passed to the constructor, the MenuDragMouseEvent instance is still
created.
Parameters
source
| the Component that originated the event
(typically this ) |
id
| an int specifying the type of event, as defined
in MouseEvent |
when
| a long identifying the time the event occurred |
modifiers
| an int specifying any modifier keys held down,
as specified in InputEvent |
x
| an int specifying the horizontal position at which
the event occurred, in pixels |
y
| an int specifying the vertical position at which
the event occurred, in pixels |
xAbs
| an int specifying the horizontal absolute position at which
the event occurred, in pixels |
yAbs
| an int specifying the vertical absolute position at which
the event occurred, in pixels |
clickCount
| an int specifying the number of mouse-clicks |
popupTrigger
| a boolean -- true if the event {should?/did?}
trigger a popup |
p
| an array of MenuElement objects specifying a path
to a menu item affected by the drag |
m
| a MenuSelectionManager object that handles selections |
See Also
MouseEvent(java.awt.Component, int, long, int, int, int, int, int, int, boolean, int)
Public Methods
Returns the current menu selection manager.
Returns
- a MenuSelectionManager object
Returns the path to the selected menu item.
Returns
- an array of MenuElement objects representing the path value