oracle.ide.controls
Class DragComponentEvent
java.lang.Object
java.util.EventObject
oracle.ide.controls.DragComponentEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class DragComponentEvent
- extends java.util.EventObject
The event sent when a component is dragged.
- See Also:
- Serialized Form
Field Summary |
static int |
DRAGGEDID_CANCEL
Event ID used when the user cancels the drag |
static int |
DRAGGEDID_END
Event ID used when the component is dropped |
static int |
DRAGGEDID_MOVE
Event ID used when the component is being dragged to new place. |
static int |
DRAGGEDID_START
Event ID used when dragging starts. |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
DragComponentEvent()
This event is reusable because we do not want to overload the GC when the mouse is moved around. |
DragComponentEvent(java.awt.Component src, java.awt.Point ptMouse, int nID, int nModifiers)
The canonical form of the constructor. |
Method Summary |
void |
consume()
consume the event |
int |
getModifiers()
|
java.awt.Point |
getPoint()
|
boolean |
isConsumed()
|
void |
set(java.awt.Component src, java.awt.Point ptMouse, int nID, int nModifiers)
Sets new value on the object. |
Methods inherited from class java.util.EventObject |
getSource, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DRAGGEDID_START
public static final int DRAGGEDID_START
- Event ID used when dragging starts.
- See Also:
- Constant Field Values
DRAGGEDID_MOVE
public static final int DRAGGEDID_MOVE
- Event ID used when the component is being dragged to new place.
- See Also:
- Constant Field Values
DRAGGEDID_END
public static final int DRAGGEDID_END
- Event ID used when the component is dropped
- See Also:
- Constant Field Values
DRAGGEDID_CANCEL
public static final int DRAGGEDID_CANCEL
- Event ID used when the user cancels the drag
- See Also:
- Constant Field Values
DragComponentEvent
public DragComponentEvent(java.awt.Component src,
java.awt.Point ptMouse,
int nID,
int nModifiers)
- The canonical form of the constructor. The default constructor and the set method should be used if you want to re-use this event object.
DragComponentEvent
public DragComponentEvent()
- This event is reusable because we do not want to overload the GC when the mouse is moved around. When reusing the same event, use this constructor once and call set to adjust the values.
set
public void set(java.awt.Component src,
java.awt.Point ptMouse,
int nID,
int nModifiers)
- Sets new value on the object.
-
- Parameters:
src
- The component being dragged
ptMouse
- the point where the component was taken in screen coordinates
nID
- The event ID. Takes values from DRAGGEDID_xxx
nModifiers
- See InputEvent.getModifiers()
getPoint
public java.awt.Point getPoint()
-
- Returns:
- the mouse position in screen coordinates
getModifiers
public int getModifiers()
-
- Returns:
- the InputEvents modifiers
isConsumed
public boolean isConsumed()
-
- Returns:
- true if the event has already be consumed by another listener
consume
public void consume()
- consume the event
-
- See Also:
isConsumed
Copyright © 1997, 2004, Oracle. All rights reserved.