Methods Summary |
---|
public java.awt.Component | getComponent()Returns the Component associated
with this DragGestureEvent .
return component;
|
public int | getDragAction()Returns an int representing the
action selected by the user.
return action;
|
public java.awt.Point | getDragOrigin()Returns a Point in the coordinates
of the Component over which the drag originated.
return origin;
|
public java.awt.dnd.DragSource | getDragSource()Returns the DragSource .
return dragSource;
|
public java.awt.dnd.DragGestureRecognizer | getSourceAsDragGestureRecognizer()Returns the source as a DragGestureRecognizer .
return (DragGestureRecognizer)getSource();
|
public java.awt.event.InputEvent | getTriggerEvent()Returns the initial event that triggered the gesture.
return getSourceAsDragGestureRecognizer().getTriggerEvent();
|
public java.util.Iterator | iterator()Returns an Iterator for the events
comprising the gesture.
return events.iterator();
|
private void | readObject(java.io.ObjectInputStream s)Deserializes this DragGestureEvent . This method first
performs default deserialization for all non-transient
fields. An attempt is then made to deserialize this object's
List of gesture events as well. This is first attempted
by deserializing the field events , because, in releases
prior to 1.4, a non-transient field of this name stored the
List of gesture events. If this fails, the next object in
the stream is used instead. If the resulting List is
null , this object's List of gesture events
is set to an empty List .
ObjectInputStream.GetField f = s.readFields();
dragSource = (DragSource)f.get("dragSource", null);
component = (Component)f.get("component", null);
origin = (Point)f.get("origin", null);
action = f.get("action", 0);
// Pre-1.4 support. 'events' was previously non-transient
try {
events = (List)f.get("events", null);
} catch (IllegalArgumentException e) {
// 1.4-compatible byte stream. 'events' was written explicitly
events = (List)s.readObject();
}
// Implementation assumes 'events' is never null.
if (events == null) {
events = Collections.EMPTY_LIST;
}
|
public void | startDrag(java.awt.Cursor dragCursor, java.awt.datatransfer.Transferable transferable)Starts the drag operation given the Cursor for this drag
operation and the Transferable representing the source data
for this drag operation.
If a null Cursor is specified no exception will
be thrown and default drag cursors will be used instead.
If a null Transferable is specified
NullPointerException will be thrown.
dragSource.startDrag(this, dragCursor, transferable, null);
|
public void | startDrag(java.awt.Cursor dragCursor, java.awt.datatransfer.Transferable transferable, java.awt.dnd.DragSourceListener dsl)Starts the drag given the initial Cursor to display,
the Transferable object,
and the DragSourceListener to use.
dragSource.startDrag(this, dragCursor, transferable, dsl);
|
public void | startDrag(java.awt.Cursor dragCursor, java.awt.Image dragImage, java.awt.Point imageOffset, java.awt.datatransfer.Transferable transferable, java.awt.dnd.DragSourceListener dsl)Start the drag given the initial Cursor to display,
a drag Image , the offset of
the Image ,
the Transferable object, and
the DragSourceListener to use.
dragSource.startDrag(this, dragCursor, dragImage, imageOffset, transferable, dsl);
|
public java.lang.Object[] | toArray()Returns an Object array of the
events comprising the drag gesture.
return events.toArray();
|
public java.lang.Object[] | toArray(java.lang.Object[] array)Returns an array of the events comprising the drag gesture.
return events.toArray(array);
|
private void | writeObject(java.io.ObjectOutputStream s)Serializes this DragGestureEvent . Performs default
serialization and then writes out this object's List of
gesture events if and only if the List can be serialized.
If not, null is written instead. In this case, a
DragGestureEvent created from the resulting deserialized
stream will contain an empty List of gesture events.
s.defaultWriteObject();
s.writeObject(SerializationTester.test(events) ? events : null);
|