1 16 17 package swingwt.awt.dnd; 18 19 import swingwt.awt.Point; 20 import java.util.EventObject ; 21 22 23 public class DragSourceEvent extends EventObject { 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 |