|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.tools.mapping.reversedb2.dnd2.DragHelper
This class allows you to implement the drag of DnD in your GUI by simply creating
an instance of this class, supplying your implementation of a DragCopyCutWorkerInterface
and register the Component with the helper using registerCopmponent().
If the default implementation of DnD by this class doesn't satisfy your needs
you can override all of the functionality by supplying your own DragGestureListener
and DragSourceListener. Those interfaces are part of the Java 1.2/1.3 Dnd framework,
so more information about these interfaces can be found in the JDK docs.
This class is closely related to DropTargetHelper, the class responsible for
the drop in DnD.
To implement DnD for any Component, you have to write the following code:
new DragHelper(new YourDragCopyCutWorkerInterfaceImplementation()).registerComponent(aComponent);
Nested Class Summary | |
class |
DragHelper.DGListener
For more information see the javadocs of java.awt.DragGestureListener |
class |
DragHelper.DSListener
an implementation of java.awt.dnd.DragSourceListener. |
Constructor Summary | |
DragHelper(DragCopyCutWorkerInterface pDragWorker)
Easiest way to setup dragging for your GUI. |
|
DragHelper(java.awt.dnd.DragGestureListener pDgListener,
java.awt.dnd.DragSourceListener pDsListener,
java.awt.dnd.DragSource pDragSource,
java.lang.Class pRecognizerAbstractClass,
DragCopyCutWorkerInterface pDragWorker)
Using this constructor you can completely customize the drag behaviour. |
|
DragHelper(java.awt.dnd.DragSource pDragSource,
java.lang.Class pRecognizerAbstractClass,
DragCopyCutWorkerInterface pDragWorker)
A more complex way of setting up dragging. |
Method Summary | |
void |
registerComponent(java.awt.Component c)
add a Component to this Worker. |
void |
unregisterComponent(java.awt.Component c)
remove drag support from the given Component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DragHelper(java.awt.dnd.DragGestureListener pDgListener, java.awt.dnd.DragSourceListener pDsListener, java.awt.dnd.DragSource pDragSource, java.lang.Class pRecognizerAbstractClass, DragCopyCutWorkerInterface pDragWorker)
pDgListener
- Your implementation of DragGestureListener. In case you want to
use the default supplied within this class, instantiate a DGListener and supply
it here.pDsListener
- Your implementation of DragSourceListener. In case you want to
use the default supplied within this class, instantiate a DSListener and supply
it here.pDragSource
- Your DragSource implementation. The default AWT DragSource is exposed by java.awt.dnd.DragSource.getDefaultDragSource()pRecognizerAbstractClass
- The drag gesture recognizer. To use the AWT-built-in default supply a null here.pDragWorker
- Your DragWorker implementationpublic DragHelper(java.awt.dnd.DragSource pDragSource, java.lang.Class pRecognizerAbstractClass, DragCopyCutWorkerInterface pDragWorker)
pDragSource
- The drag sourcepRecognizerAbstractClass
- The recognizer, may be null if you want to use the Swing default implementationpDragWorker
- Your DragCopyCutWorkerInterfacepublic DragHelper(DragCopyCutWorkerInterface pDragWorker)
pDragWorker
- Your implementation of the DragCopyCutWorkerInterfaceMethod Detail |
public void registerComponent(java.awt.Component c)
c
- the Component to registerpublic void unregisterComponent(java.awt.Component c)
c
- the Component to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |