KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
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: bobintetley@users.sourceforge.net
9  
10    $Log: DragSourceEvent.java,v $
11    Revision 1.1 2004/05/05 12:43:19 bobintetley
12    Patches/new files from Laurent Martell
13
14  
15  */

16
17 package swingwt.awt.dnd;
18
19 import swingwt.awt.Point;
20 import java.util.EventObject JavaDoc;
21
22 /** @author Laurent Martell */
23 public class DragSourceEvent extends EventObject JavaDoc {
24     public DragSourceEvent(DragSourceContext dsc) {
25         super(dsc);
26         hasLocation = false;
27     }
28
29     public DragSourceEvent(DragSourceContext dsc, int x, int y) {
30         super(dsc);
31         hasLocation = true;
32         this.x = x;
33         this.y = y;
34     }
35
36     boolean hasLocation;
37     int x;
38     int y;
39
40     public DragSourceContext getDragSourceContext() {
41         return (DragSourceContext)getSource();
42     }
43
44     public Point getLocation() {
45         return hasLocation ? new Point(x, y) : null;
46     }
47
48     public int getX() {
49         return x;
50     }
51
52     public int getY() {
53         return y;
54     }
55
56 }
57
Popular Tags