KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > dnd > TypeDragGesture


1 package com.opensymphony.workflow.designer.dnd;
2
3 import java.awt.dnd.DragGestureEvent JavaDoc;
4 import java.awt.dnd.DragGestureListener JavaDoc;
5 import java.awt.dnd.DragSource JavaDoc;
6 import java.awt.dnd.DragSourceDragEvent JavaDoc;
7 import java.awt.dnd.DragSourceDropEvent JavaDoc;
8 import java.awt.dnd.DragSourceEvent JavaDoc;
9 import java.awt.dnd.DragSourceListener JavaDoc;
10
11 /**
12  * @author jackflit
13  * Date: 2003-11-27
14  */

15 public class TypeDragGesture implements DragGestureListener JavaDoc, DragSourceListener JavaDoc
16 {
17
18   private DragSource JavaDoc ds;
19   private DragData type;
20
21   public TypeDragGesture(DragSource JavaDoc ds, DragData type)
22   {
23     this.ds = ds;
24     this.type = type;
25   }
26
27   DragDataTransferable transferable;
28
29   public void dragGestureRecognized(DragGestureEvent JavaDoc dge)
30   {
31
32     transferable = new DragDataTransferable(type);
33
34     ds.startDrag(dge, DragSource.DefaultCopyDrop, transferable, this);
35   }
36
37   public void dragEnter(DragSourceDragEvent JavaDoc dsde)
38   {
39
40   }
41
42   public void dragOver(DragSourceDragEvent JavaDoc dsde)
43   {
44
45   }
46
47   public void dropActionChanged(DragSourceDragEvent JavaDoc dsde)
48   {
49
50   }
51
52   public void dragDropEnd(DragSourceDropEvent JavaDoc dsde)
53   {
54     if(dsde.getDropSuccess())
55     {
56       // System.out.println("Succeeded");
57
}
58     else
59     {
60       // System.out.println("Failed");
61
}
62   }
63
64   public void dragExit(DragSourceEvent JavaDoc dse)
65   {
66   }
67
68 }
69
Popular Tags