| java.lang.Object org.apache.ojb.tools.mapping.reversedb2.dnd2.DragHelper
DragHelper | public class DragHelper (Code) | | 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);
author: Florian Bruckner version: $Id: DragHelper.java,v 1.1.2.1 2005/12/21 22:32:42 tomdz Exp $ |
DragHelper | public DragHelper(java.awt.dnd.DragGestureListener pDgListener, java.awt.dnd.DragSourceListener pDsListener, java.awt.dnd.DragSource pDragSource, Class pRecognizerAbstractClass, DragCopyCutWorkerInterface pDragWorker)(Code) | | Using this constructor you can completely customize the drag behaviour. You
have to supply your own DragGestureListener and DragSourcecListener in addition
to the DragSource, the drag gesture recognizer and the worker.
The default implementation of DragGestureListener and DragSourceListener are
exposed publicly in this class, so you are able to provide your own
implementation for DragGestureListener or DragSourceListener and use the default
one for the other.
Parameters: pDgListener - Your implementation of DragGestureListener. In case you want touse the default supplied within this class, instantiate a DGListener and supplyit here. Parameters: pDsListener - Your implementation of DragSourceListener. In case you want touse the default supplied within this class, instantiate a DSListener and supplyit here. Parameters: pDragSource - Your DragSource implementation. The default AWT DragSource is exposed by java.awt.dnd.DragSource.getDefaultDragSource() Parameters: pRecognizerAbstractClass - The drag gesture recognizer. To use the AWT-built-in default supply a null here. Parameters: pDragWorker - Your DragWorker implementation |
DragHelper | public DragHelper(java.awt.dnd.DragSource pDragSource, Class pRecognizerAbstractClass, DragCopyCutWorkerInterface pDragWorker)(Code) | | A more complex way of setting up dragging. In addition to your worker you need
to supply the recognizer and the DragSource (usually
java.awt.dnd.DragSource.getDefaultDragSource(), but you can supply your own
here)
Parameters: pDragSource - The drag source Parameters: pRecognizerAbstractClass - The recognizer, may be null if you want to use the Swing default implementation Parameters: pDragWorker - Your DragCopyCutWorkerInterface |
DragHelper | public DragHelper(DragCopyCutWorkerInterface pDragWorker)(Code) | | Easiest way to setup dragging for your GUI. The default implementations for
DragGestureListener, DragSourceListener and the drag gesture recognizer
are used. You just need to supply a DragCopyCutWorkerInterface.
Parameters: pDragWorker - Your implementation of the DragCopyCutWorkerInterface |
registerComponent | public void registerComponent(java.awt.Component c)(Code) | | add a Component to this Worker. After the call dragging is enabled for this
Component.
Parameters: c - the Component to register |
unregisterComponent | public void unregisterComponent(java.awt.Component c)(Code) | | remove drag support from the given Component.
Parameters: c - the Component to remove |
|
|