org.apache.ojb.tools.mapping.reversedb2.dnd2
Interface DragCopyCutWorkerInterface

All Known Implementing Classes:
OjbMetaTreeNodesDragWorker, ReverseDbNodesDragWorker

public interface DragCopyCutWorkerInterface

Implementers of this interface are used by DragHelper to query the possible actions for a drag gesture and to export the data into a Transferable

Version:
$Id: DragCopyCutWorkerInterface.java,v 1.4 2002/09/01 15:45:48 florianbruckner Exp $
Author:
Florian Bruckner

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.
 

Method Detail

getTransferable

public java.awt.datatransfer.Transferable getTransferable(java.awt.Component c)
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.

Parameters:
c - The component that acts as the drag source
Returns:
a Transferable containing the exported data

getAcceptableActions

public int getAcceptableActions(java.awt.Component c)
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.

Parameters:
c - The component that acts as the drag source
Returns:
A bitmask of possible drag actions for the given Component

exportStarted

public void exportStarted(java.awt.Component c,
                          int action)
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.

Parameters:
c - The component that acts as the drag source
action - The drag action that is going to be performed

exportDone

public void exportDone(java.awt.Component c,
                       int action)
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.

Parameters:
c - The component that acts as the drag source
action - The drag action that has been performed

getDragImage

public 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)

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.


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