Java Doc for DragGestureRecognizer.java in  » 6.0-JDK-Core » AWT » java » awt » dnd » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt.dnd 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.dnd.DragGestureRecognizer

All known Subclasses:   java.awt.dnd.MouseDragGestureRecognizer,
DragGestureRecognizer
abstract public class DragGestureRecognizer implements Serializable(Code)
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 initiating gestures.

The appropriate DragGestureRecognizer subclass instance is obtained from the DragSource asssociated with a particular Component, or from the Toolkit object via its java.awt.Toolkit.createDragGestureRecognizer 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 initiating gesture, it will notify its unicast DragGestureListener by invoking its java.awt.dnd.DragGestureListener.dragGestureRecognized gestureRecognized() method.

When a concrete DragGestureRecognizer instance detects a drag initiating gesture on the Component it is associated with, it fires a DragGestureEvent to the DragGestureListener registered on its unicast event source for DragGestureListener events. This DragGestureListener is responsible for causing the associated DragSource to start the Drag and Drop operation (if appropriate).


author:
   Laurence P. G. Cable
version:
   1.28
See Also:   java.awt.dnd.DragGestureListener
See Also:   java.awt.dnd.DragGestureEvent
See Also:   java.awt.dnd.DragSource



Field Summary
protected  Componentcomponent
     The Component associated with this DragGestureRecognizer.
protected transient  DragGestureListenerdragGestureListener
     The DragGestureListener associated with this DragGestureRecognizer.
protected  DragSourcedragSource
     The DragSource associated with this DragGestureRecognizer.
protected  ArrayList<InputEvent>events
     The list of events (in order) that the DragGestureRecognizer "recognized" as a "gesture" that triggers a drag.
protected  intsourceActions
     An int representing the type(s) of action(s) used in this Drag and Drop operation.

Constructor Summary
protected  DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl)
     Construct a new DragGestureRecognizer given the DragSource to be used in this Drag and Drop operation, the Component this DragGestureRecognizer should "observe" for drag initiating gestures, the action(s) supported for this Drag and Drop operation, and the DragGestureListener to notify once a drag initiating gesture has been detected.
protected  DragGestureRecognizer(DragSource ds, Component c, int sa)
     Construct a new DragGestureRecognizer given the DragSource to be used in this Drag and Drop operation, the Component this DragGestureRecognizer should "observe" for drag initiating gestures, and the action(s) supported for this Drag and Drop operation.
protected  DragGestureRecognizer(DragSource ds, Component c)
     Construct a new DragGestureRecognizer given the DragSource to be used in this Drag and Drop operation, and the Component this DragGestureRecognizer should "observe" for drag initiating gestures.
protected  DragGestureRecognizer(DragSource ds)
     Construct a new DragGestureRecognizer given the DragSource to be used in this Drag and Drop operation.

Method Summary
public synchronized  voidaddDragGestureListener(DragGestureListener dgl)
     Register a new DragGestureListener.
protected synchronized  voidappendEvent(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.

This method is used by a DragGestureRecognizer implementation to add an InputEvent subclass (that it believes is one in a series of events that comprise a Drag and Drop operation) to the array of events that this DragGestureRecognizer maintains internally.


Parameters:
  awtie - the InputEvent to add to this DragGestureRecognizer's internal array of events.

protected synchronized  voidfireDragGestureRecognized(int dragAction, Point p)
     Notify the DragGestureListener that a Drag and Drop initiating gesture has occurred.
public synchronized  ComponentgetComponent()
     This method returns the Component that is to be "observed" by the DragGestureRecognizer for drag initiating gestures.
public  DragSourcegetDragSource()
     This method returns the DragSource this DragGestureRecognizer will use in order to process the Drag and Drop operation.
public synchronized  intgetSourceActions()
     This method returns an int representing the type of action(s) this Drag and Drop operation will support.
public  InputEventgetTriggerEvent()
     This method returns the first event in the series of events that initiated the Drag and Drop operation.
abstract protected  voidregisterListeners()
    
public synchronized  voidremoveDragGestureListener(DragGestureListener dgl)
    
public  voidresetRecognizer()
     Reset the Recognizer, if its currently recognizing a gesture, ignore it.
public synchronized  voidsetComponent(Component c)
     set the Component that the DragGestureRecognizer is associated with registerListeners() and unregisterListeners() are called as a side effect as appropriate.
public synchronized  voidsetSourceActions(int actions)
     This method sets the permitted source drag action(s) for this Drag and Drop operation.
abstract protected  voidunregisterListeners()
    

Field Detail
component
protected Component component(Code)
The Component associated with this DragGestureRecognizer.



dragGestureListener
protected transient DragGestureListener dragGestureListener(Code)
The DragGestureListener associated with this DragGestureRecognizer.



dragSource
protected DragSource dragSource(Code)
The DragSource associated with this DragGestureRecognizer.



events
protected ArrayList<InputEvent> events(Code)
The list of events (in order) that the DragGestureRecognizer "recognized" as a "gesture" that triggers a drag.



sourceActions
protected int sourceActions(Code)
An int representing the type(s) of action(s) used in this Drag and Drop operation.




Constructor Detail
DragGestureRecognizer
protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl)(Code)
Construct a new DragGestureRecognizer given the DragSource to be used in this Drag and Drop operation, the Component this DragGestureRecognizer should "observe" for drag initiating gestures, the action(s) supported for this Drag and Drop operation, and the DragGestureListener to notify once a drag initiating gesture has been detected.


Parameters:
  ds - the DragSource this DragGestureRecognizer will use to process the Drag and Drop operation
Parameters:
  c - the Component this DragGestureRecognizer should "observe" the event stream to, in order to detect a drag initiating gesture.If this value is null, the DragGestureRecognizeris not associated with any Component.
Parameters:
  sa - the set (logical OR) of the DnDConstants that this Drag and Drop operation will support
Parameters:
  dgl - the DragGestureRecognizer to notify when a drag gesture is detected

IllegalArgumentException if ds is null.




DragGestureRecognizer
protected DragGestureRecognizer(DragSource ds, Component c, int sa)(Code)
Construct a new DragGestureRecognizer given the DragSource to be used in this Drag and Drop operation, the Component this DragGestureRecognizer should "observe" for drag initiating gestures, and the action(s) supported for this Drag and Drop operation.


Parameters:
  ds - the DragSource this DragGestureRecognizer will use to process the Drag and Drop operation
Parameters:
  c - the Component this DragGestureRecognizer should "observe" the event stream to, in order to detect a drag initiating gesture.If this value is null, the DragGestureRecognizeris not associated with any Component.
Parameters:
  sa - the set (logical OR) of the DnDConstants that this Drag and Drop operation will support

IllegalArgumentException if ds is null.




DragGestureRecognizer
protected DragGestureRecognizer(DragSource ds, Component c)(Code)
Construct a new DragGestureRecognizer given the DragSource to be used in this Drag and Drop operation, and the Component this DragGestureRecognizer should "observe" for drag initiating gestures.


Parameters:
  ds - the DragSource this DragGestureRecognizer will use to process the Drag and Drop operation
Parameters:
  c - the Component this DragGestureRecognizer should "observe" the event stream to, in order to detect a drag initiating gesture.If this value is null, the DragGestureRecognizeris not associated with any Component.

IllegalArgumentException if ds is null.




DragGestureRecognizer
protected DragGestureRecognizer(DragSource ds)(Code)
Construct a new DragGestureRecognizer given the DragSource to be used in this Drag and Drop operation.


Parameters:
  ds - the DragSource this DragGestureRecognizer will use to process the Drag and Drop operation

IllegalArgumentException if ds is null.





Method Detail
addDragGestureListener
public synchronized void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException(Code)
Register a new DragGestureListener.


Parameters:
  dgl - the DragGestureListener to register with this DragGestureRecognizer.


throws:
  java.util.TooManyListenersException - if a DragGestureListener has already been added.




appendEvent
protected synchronized void appendEvent(InputEvent awtie)(Code)
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.

This method is used by a DragGestureRecognizer implementation to add an InputEvent subclass (that it believes is one in a series of events that comprise a Drag and Drop operation) to the array of events that this DragGestureRecognizer maintains internally.


Parameters:
  awtie - the InputEvent to add to this DragGestureRecognizer's internal array of events. Note that nullis not a valid value, and will be ignored.




fireDragGestureRecognized
protected synchronized void fireDragGestureRecognized(int dragAction, Point p)(Code)
Notify the DragGestureListener that a Drag and Drop initiating gesture has occurred. Then reset the state of the Recognizer.


Parameters:
  dragAction - The action initially selected by the users gesture
Parameters:
  p - The point (in Component coords) where the gesture originated




getComponent
public synchronized Component getComponent()(Code)
This method returns the Component that is to be "observed" by the DragGestureRecognizer for drag initiating gestures.

The Component this DragGestureRecognizer is associated with




getDragSource
public DragSource getDragSource()(Code)
This method returns the DragSource this DragGestureRecognizer will use in order to process the Drag and Drop operation.

the DragSource




getSourceActions
public synchronized int getSourceActions()(Code)
This method returns an int representing the type of action(s) this Drag and Drop operation will support.

the currently permitted source action(s)




getTriggerEvent
public InputEvent getTriggerEvent()(Code)
This method returns the first event in the series of events that initiated the Drag and Drop operation.

the initial event that triggered the drag gesture




registerListeners
abstract protected void registerListeners()(Code)
register this DragGestureRecognizer's Listeners with the Component subclasses must override this method



removeDragGestureListener
public synchronized void removeDragGestureListener(DragGestureListener dgl)(Code)
unregister the current DragGestureListener


Parameters:
  dgl - the DragGestureListener to unregister from this DragGestureRecognizer

IllegalArgumentException if dgl is not (equal to) the currently registered DragGestureListener.




resetRecognizer
public void resetRecognizer()(Code)
Reset the Recognizer, if its currently recognizing a gesture, ignore it.



setComponent
public synchronized void setComponent(Component c)(Code)
set the Component that the DragGestureRecognizer is associated with registerListeners() and unregisterListeners() are called as a side effect as appropriate.


Parameters:
  c - The Component or null




setSourceActions
public synchronized void setSourceActions(int actions)(Code)
This method sets the permitted source drag action(s) for this Drag and Drop operation.


Parameters:
  actions - the permitted source drag action(s)




unregisterListeners
abstract protected void unregisterListeners()(Code)
unregister this DragGestureRecognizer's Listeners with the Component subclasses must override this method



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.