org.apache.ojb.tools.mapping.reversedb2.dnd2
Class ReverseDbNodesDragWorker

java.lang.Object
  extended byorg.apache.ojb.tools.mapping.reversedb2.dnd2.ReverseDbNodesDragWorker
All Implemented Interfaces:
DragCopyCutWorkerInterface

public class ReverseDbNodesDragWorker
extends java.lang.Object
implements DragCopyCutWorkerInterface

Version:
$Id: ReverseDbNodesDragWorker.java,v 1.7 2003/12/13 14:34:23 thma Exp $
Author:
Florian Bruckner

Constructor Summary
ReverseDbNodesDragWorker()
          Creates a new instance of ReverseDbNodesDragWorker
 
Method Summary
 void exportDone(java.awt.Component c, int action)
          Is called to notify you that the export this Worker has been notified of has finished.
 void exportStarted(java.awt.Component c, int action)
          Is called to notify you that the export has started.
 int getAcceptableActions(java.awt.Component c)
          Return a bitmask of acceptable actions.
 java.awt.Image getDragImage(java.awt.Component c, java.awt.datatransfer.Transferable t, int action)
          DnD on some platforms supports displaying a drag image in addition to the drag cursor (Windows is known not to support it, so if you are on Windows you might be doing all right, but still see no image)
 java.awt.datatransfer.Transferable getTransferable(java.awt.Component c)
          Return a Transferable with the data you whish to export.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReverseDbNodesDragWorker

public ReverseDbNodesDragWorker()
Creates a new instance of ReverseDbNodesDragWorker

Method Detail

exportDone

public void exportDone(java.awt.Component c,
                       int action)
Description copied from interface: DragCopyCutWorkerInterface
Is called to notify you that the export this Worker has been notified of has finished. action shows you which action has been performed, e.g. if it is DRAG_MOVE you can remove the dragged items from your model.

Specified by:
exportDone in interface DragCopyCutWorkerInterface
Parameters:
c - The component that acts as the drag source
action - The drag action that has been performed

exportStarted

public void exportStarted(java.awt.Component c,
                          int action)
Description copied from interface: DragCopyCutWorkerInterface
Is called to notify you that the export has started. This is always called after getTransferable, so you should know which items are exported. This method is currently not called by the framework, but may be in future.

Specified by:
exportStarted in interface DragCopyCutWorkerInterface
Parameters:
c - The component that acts as the drag source
action - The drag action that is going to be performed

getAcceptableActions

public int getAcceptableActions(java.awt.Component c)
Description copied from interface: DragCopyCutWorkerInterface
Return a bitmask of acceptable actions. In most cases you will only support DRAG_COPY, but sometimes you might support DRAG_LINK or DRAG_MOVE as well.

Specified by:
getAcceptableActions in interface DragCopyCutWorkerInterface
Parameters:
c - The component that acts as the drag source
Returns:
A bitmask of possible drag actions for the given Component

getDragImage

public java.awt.Image getDragImage(java.awt.Component c,
                                   java.awt.datatransfer.Transferable t,
                                   int action)
Description copied from interface: DragCopyCutWorkerInterface
DnD on some platforms supports displaying a drag image in addition to the drag cursor (Windows is known not to support it, so if you are on Windows you might be doing all right, but still see no image)

Specified by:
getDragImage in interface DragCopyCutWorkerInterface
Parameters:
c - The component that acts as the drag source
t - The transferable that is used in this DnD process
action - The currently requested action for the ongoing drag process
Returns:
an Image that shall be displayed with the cursor.

getTransferable

public java.awt.datatransfer.Transferable getTransferable(java.awt.Component c)
Description copied from interface: DragCopyCutWorkerInterface
Return a Transferable with the data you whish to export. You also get the Component the DnD actions has been started for. If the component supports selection you must first check which items are selected and afterwards put those items in the Transferable.

Specified by:
getTransferable in interface DragCopyCutWorkerInterface
Parameters:
c - The component that acts as the drag source
Returns:
a Transferable containing the exported data


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14