KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > awt > dnd > DragGestureEvent


1 /*
2    SwingWT
3    Copyright(c)2003-2004, Tomer Barletz
4  
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7  
8    Contact me by electronic mail: tomerb@users.sourceforge.net
9  */

10
11 package swingwt.awt.dnd;
12
13 import java.util.EventObject JavaDoc;
14 import java.util.Iterator JavaDoc;
15 import java.util.List JavaDoc;
16
17 import org.eclipse.swt.dnd.DragSource;
18
19 import swingwt.awt.Component;
20 import swingwt.awt.Cursor;
21 import swingwt.awt.Image;
22 import swingwt.awt.Point;
23 import swingwt.awt.datatransfer.Transferable;
24 import swingwt.awt.event.InputEvent;
25
26 public class DragGestureEvent extends EventObject JavaDoc {
27     
28     private List JavaDoc events;
29     private DragSource dragSource;
30     private Component component;
31     private Point origin;
32     private int action;
33     
34     public DragGestureEvent(DragGestureRecognizer dgr, int act, Point ori, List JavaDoc evs) {
35         super(dgr);
36         events = evs;
37         action = act;
38         origin = ori;
39     }
40     
41     public DragGestureRecognizer getSourceAsDragGestureRecognizer() {
42         return (DragGestureRecognizer) getSource();
43     }
44     
45     public Component getComponent() {
46         return component;
47     }
48     
49     public DragSource getDragSource() {
50         return dragSource;
51     }
52     
53     public Point getDragOrigin() {
54         return origin;
55     }
56     
57     public Iterator JavaDoc iterator() {
58         return events.iterator();
59     }
60     
61     public Object JavaDoc[] toArray() {
62         return events.toArray();
63     }
64     
65     public Object JavaDoc[] toArray(Object JavaDoc[] array) {
66         return events.toArray(array);
67     }
68     
69     public int getDragAction() {
70         return action;
71     }
72     
73     public InputEvent getTriggerEvent() {
74         return getSourceAsDragGestureRecognizer().getTriggerEvent();
75     }
76     
77     public void startDrag(Cursor dragCursor, Transferable transferable) throws
78     InvalidDnDOperationException {
79         /**
80          * @todo implement the "real" DragSource
81          */

82         //dragSource.startDrag(this, dragCursor, transferable, null);
83
}
84     
85     public void startDrag(Cursor dragCursor, Transferable transferable, swingwt.awt.dnd.DragSourceListener dsl)
86         throws InvalidDnDOperationException {
87         /**
88          * @todo implement the "real" DragSource
89          */

90         //dragSource.startDrag(this, dragCursor, transferable, dsl);
91
}
92     
93     public void startDrag(Cursor dragCursor, Image dragImage, Point imageOffset,
94         Transferable transferable, swingwt.awt.dnd.DragSourceListener dsl) throws InvalidDnDOperationException {
95         /**
96          * @todo implement the "real" DragSource
97          */

98         //dragSource.startDrag(this, dragCursor, dragImage, imageOffset, transferable, dsl);
99
}
100     
101     
102 }
103
Popular Tags