|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.dnd.DragGestureRecognizer
The DragGestureRecognizer is an abstract base class for the specification of a platform-dependent listener that can be associated with a particular Component in order to identify platform-dependent drag and drop action initiating gestures.
The appropriate DragGestureRecognizer subclass is obtained from the DragSource asssociated with a particular Component, or from the Toolkit object via its createDragGestureRecognizer() method.
Once the DragGestureRecognizer is associated with a particular Component it will register the appropriate Listener interfaces on that Component in order to track the input Events delivered to the Component.
Once the DragGestureRecognizer identifies a sequence of Events on the Component as a Drag and Drop action initiating gesture it will notify its unicast DragGestureListener by invoking its gestureRecognized() method.
DragGestureListener
,
DragGestureEvent
,
DragSource
Field Summary | |
protected Component |
component
|
protected DragGestureListener |
dragGestureListener
|
protected DragSource |
dragSource
|
protected ArrayList |
events
|
protected int |
sourceActions
|
Constructor Summary | |
protected |
DragGestureRecognizer(DragSource ds)
construct a new DragGestureRecognizer |
protected |
DragGestureRecognizer(DragSource ds,
Component c)
construct a new DragGestureRecognizer |
protected |
DragGestureRecognizer(DragSource ds,
Component c,
int sa)
construct a new DragGestureRecognizer |
protected |
DragGestureRecognizer(DragSource ds,
Component c,
int sa,
DragGestureListener dgl)
construct a new DragGestureRecognizer |
Method Summary | |
void |
addDragGestureListener(DragGestureListener dgl)
register a new DragGestureListener |
protected void |
appendEvent(InputEvent awtie)
Listeners registered on the Component by this Recognizer shall record all Events that are recognized as part of the series of Events that go to comprise a Drag and Drop initiating gesture via this API. |
protected void |
fireDragGestureRecognized(int dragAction,
Point p)
notify the DragGestureListener that a Drag and Drop initiating gesture has occurred. |
Component |
getComponent()
|
DragSource |
getDragSource()
|
int |
getSourceActions()
|
InputEvent |
getTriggerEvent()
|
protected abstract void |
registerListeners()
register this DragGestureRecognizer's Listeners with the Component subclasses must override this method |
void |
removeDragGestureListener(DragGestureListener dgl)
unregister the current DragGestureListener |
void |
resetRecognizer()
reset the Recognizer, if its currently recognizing a gesture, ignore it. |
void |
setComponent(Component c)
set the Component that the DragGestureRecognizer is associated with registerListeners() and unregisterListeners() are called as a side effect as appropriate. |
void |
setSourceActions(int actions)
set the permitted source drag actions |
protected abstract void |
unregisterListeners()
unregister this DragGestureRecognizer's Listeners with the Component subclasses must override this method |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected DragSource dragSource
protected Component component
protected DragGestureListener dragGestureListener
protected int sourceActions
protected ArrayList events
Constructor Detail |
protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl)
ds
- The DragSource for the Component cc
- The Component to observesa
- The source drag actionsdgl
- The DragGestureRecognizer to notify when a gesture is detectedprotected DragGestureRecognizer(DragSource ds, Component c, int sa)
ds
- The DragSource for the Component csa
- The source drag actionsc
- The Component to observeprotected DragGestureRecognizer(DragSource ds, Component c)
ds
- The DragSource for the Component cc
- The Component to observeprotected DragGestureRecognizer(DragSource ds)
ds
- The DragSource for the Component cMethod Detail |
protected abstract void registerListeners()
protected abstract void unregisterListeners()
public DragSource getDragSource()
public Component getComponent()
public void setComponent(Component c)
c
- The Component or nullpublic int getSourceActions()
public void setSourceActions(int actions)
public InputEvent getTriggerEvent()
public void resetRecognizer()
public void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException
public void removeDragGestureListener(DragGestureListener dgl)
protected void fireDragGestureRecognized(int dragAction, Point p)
dragAction
- The action initially selected by the users gesturep
- The point (in Component coords) where the gesture originatedprotected void appendEvent(InputEvent awtie)
|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |