JHotDraw 6.0b1

org.jhotdraw.contrib.dnd
Class DNDHelper

java.lang.Object
  extended by org.jhotdraw.contrib.dnd.DNDHelper

public abstract class DNDHelper
extends java.lang.Object

Changes made in hopes of eventually cleaning up the functionality and distributing it sensibly. 1/10/02


Field Summary
static java.awt.datatransfer.DataFlavor ASCIIFlavor
           
 
Constructor Summary
DNDHelper(boolean newIsDragSource, boolean newIsDropTarget)
           
 
Method Summary
protected  java.awt.dnd.DragGestureRecognizer createDragGestureRecognizer(java.awt.dnd.DragGestureListener dgl)
          Used to create the gesture recognizer which in effect turns on draggability.
protected  java.awt.dnd.DragSourceListener createDragSourceListener()
           
protected  java.awt.dnd.DropTarget createDropTarget()
           
protected  java.awt.dnd.DropTargetListener createDropTargetListener()
           
 void deinitialize()
           
protected  void destroyDragGestreRecognizer()
          Used to destroy the gesture listener which ineffect turns off dragability.
protected abstract  DrawingEditor editor()
           
protected  java.awt.dnd.DragGestureListener getDragGestureListener()
           
protected  java.awt.dnd.DragGestureRecognizer getDragGestureRecognizer()
           
protected  int getDragSourceActions()
          This must reflect the capabilities of the dragSsource, not your desired actions.
 java.awt.dnd.DragSourceListener getDragSourceListener()
           
protected  int getDropTargetActions()
           
protected  java.awt.dnd.DropTargetListener getDropTargetListener()
           
 void initialize(java.awt.dnd.DragGestureListener dgl)
          Do not call this from the constructor.
protected static java.lang.Object processReceivedData(java.awt.datatransfer.DataFlavor flavor, java.awt.datatransfer.Transferable transferable)
           
protected  void setDragGestureListener(java.awt.dnd.DragGestureListener dragGestureListener)
           
protected  void setDragGestureRecognizer(java.awt.dnd.DragGestureRecognizer dragGestureRecognizer)
           
protected  void setDragSourceListener(java.awt.dnd.DragSourceListener dragSourceListener)
           
protected  void setDropTarget(java.awt.dnd.DropTarget newDropTarget)
           
protected  void setDropTargetListener(java.awt.dnd.DropTargetListener dropTargetListener)
           
protected abstract  DrawingView view()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASCIIFlavor

public static java.awt.datatransfer.DataFlavor ASCIIFlavor
Constructor Detail

DNDHelper

public DNDHelper(boolean newIsDragSource,
                 boolean newIsDropTarget)
Method Detail

initialize

public void initialize(java.awt.dnd.DragGestureListener dgl)
Do not call this from the constructor. its methods are overridable.


deinitialize

public void deinitialize()

view

protected abstract DrawingView view()

editor

protected abstract DrawingEditor editor()

processReceivedData

protected static java.lang.Object processReceivedData(java.awt.datatransfer.DataFlavor flavor,
                                                      java.awt.datatransfer.Transferable transferable)

getDragSourceActions

protected int getDragSourceActions()
This must reflect the capabilities of the dragSsource, not your desired actions. If you desire limited drag actions, then I suppose you need to make a new drag gesture recognizer? I do know that if you put for instance ACTION_COPY but your device supports ACTION_COPY_OR_MOVE, then the receiving target may show the rejected icon, but will still be forced improperly to accept your MOVE since the system is not properly calling your MOVE a MOVE because you claimed incorrectly that you were incapable of MOVE.


getDropTargetActions

protected int getDropTargetActions()

setDragGestureListener

protected void setDragGestureListener(java.awt.dnd.DragGestureListener dragGestureListener)

getDragGestureListener

protected java.awt.dnd.DragGestureListener getDragGestureListener()

setDragGestureRecognizer

protected void setDragGestureRecognizer(java.awt.dnd.DragGestureRecognizer dragGestureRecognizer)

getDragGestureRecognizer

protected java.awt.dnd.DragGestureRecognizer getDragGestureRecognizer()

setDropTarget

protected void setDropTarget(java.awt.dnd.DropTarget newDropTarget)

createDropTarget

protected java.awt.dnd.DropTarget createDropTarget()

createDragGestureRecognizer

protected java.awt.dnd.DragGestureRecognizer createDragGestureRecognizer(java.awt.dnd.DragGestureListener dgl)
Used to create the gesture recognizer which in effect turns on draggability.


destroyDragGestreRecognizer

protected void destroyDragGestreRecognizer()
Used to destroy the gesture listener which ineffect turns off dragability.


setDropTargetListener

protected void setDropTargetListener(java.awt.dnd.DropTargetListener dropTargetListener)

getDropTargetListener

protected java.awt.dnd.DropTargetListener getDropTargetListener()

createDropTargetListener

protected java.awt.dnd.DropTargetListener createDropTargetListener()

getDragSourceListener

public java.awt.dnd.DragSourceListener getDragSourceListener()

setDragSourceListener

protected void setDragSourceListener(java.awt.dnd.DragSourceListener dragSourceListener)

createDragSourceListener

protected java.awt.dnd.DragSourceListener createDragSourceListener()

JHotDraw 6.0b1