KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > tools > mapping > reversedb2 > dnd2 > DragCopyCutWorkerInterface


1 package org.apache.ojb.tools.mapping.reversedb2.dnd2;
2
3 /* Copyright 2002-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 import java.awt.Component JavaDoc;
19 import java.awt.Image JavaDoc;
20 import java.awt.datatransfer.Transferable JavaDoc;
21
22 /** Implementers of this interface are used by DragHelper to query the possible
23  * actions for a drag gesture and to export the data into a Transferable
24  * @author <a HREF="mailto:bfl@florianbruckner.com">Florian Bruckner</a>
25  * @version $Id: DragCopyCutWorkerInterface.java,v 1.1.2.1 2005/12/21 22:32:42 tomdz Exp $
26  */

27 public interface DragCopyCutWorkerInterface
28 {
29     /** Return a Transferable with the data you whish to export. You also get
30      * the Component the DnD actions has been started for. If the component
31      * supports selection you must first check which items are selected and
32      * afterwards put those items in the Transferable.
33      * @param c The component that acts as the drag source
34      * @return a Transferable containing the exported data
35      */

36     public Transferable JavaDoc getTransferable(Component JavaDoc c);
37     
38     /** Return a bitmask of acceptable actions. In most cases you will only support
39      * DRAG_COPY, but sometimes you might support DRAG_LINK or DRAG_MOVE as well.
40      * @param c The component that acts as the drag source
41      * @return A bitmask of possible drag actions for the given Component
42      */

43     public int getAcceptableActions(Component JavaDoc c);
44     
45     /** Is called to notify you that the export has started. This is always
46      * called after getTransferable, so you should know which items are exported.
47      * This method is currently not called by the framework, but may be in future.
48      * @param c The component that acts as the drag source
49      * @param action The drag action that is going to be performed
50      */

51     public void exportStarted(Component JavaDoc c, int action);
52     
53     /** Is called to notify you that the export this Worker has been notified of
54      * has finished. action shows you which action has been performed, e.g. if it
55      * is DRAG_MOVE you can remove the dragged items from your model.
56      * @param c The component that acts as the drag source
57      * @param action The drag action that has been performed
58      */

59     public void exportDone(Component JavaDoc c, int action);
60     
61     
62     /** DnD on some platforms supports displaying a drag image in addition
63      * to the drag cursor (Windows is known not to support it, so if you are
64      * on Windows you might be doing all right, but still see no image)
65      * @return an Image that shall be displayed with the cursor.
66      * @param c The component that acts as the drag source
67      * @param t The transferable that is used in this DnD process
68      * @param action The currently requested action for the ongoing drag process
69      */

70     public Image JavaDoc getDragImage(Component JavaDoc c, Transferable JavaDoc t, int action);
71     
72 }
73
Popular Tags