home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / awt / dnd / DragGestureEvent.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.3 KB  |  85 lines

  1. package java.awt.dnd;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Cursor;
  5. import java.awt.Image;
  6. import java.awt.Point;
  7. import java.awt.datatransfer.Transferable;
  8. import java.awt.event.InputEvent;
  9. import java.util.EventObject;
  10. import java.util.Iterator;
  11. import java.util.List;
  12.  
  13. public class DragGestureEvent extends EventObject {
  14.    private List events;
  15.    private DragSource dragSource;
  16.    private Component component;
  17.    private Point origin;
  18.    private int action;
  19.  
  20.    public DragGestureEvent(DragGestureRecognizer var1, int var2, Point var3, List var4) {
  21.       super(var1);
  22.       if ((this.component = var1.getComponent()) == null) {
  23.          throw new IllegalArgumentException("null component");
  24.       } else if ((this.dragSource = var1.getDragSource()) == null) {
  25.          throw new IllegalArgumentException("null DragSource");
  26.       } else if (var4 != null && !var4.isEmpty()) {
  27.          if (var2 != 1 && var2 != 2 && var2 != 1073741824) {
  28.             throw new IllegalArgumentException("bad action");
  29.          } else if (var3 == null) {
  30.             throw new IllegalArgumentException("null origin");
  31.          } else {
  32.             this.events = var4;
  33.             this.action = var2;
  34.             this.origin = var3;
  35.          }
  36.       } else {
  37.          throw new IllegalArgumentException("null or empty list of events");
  38.       }
  39.    }
  40.  
  41.    public DragGestureRecognizer getSourceAsDragGestureRecognizer() {
  42.       return (DragGestureRecognizer)((EventObject)this).getSource();
  43.    }
  44.  
  45.    public Component getComponent() {
  46.       return this.component;
  47.    }
  48.  
  49.    public DragSource getDragSource() {
  50.       return this.dragSource;
  51.    }
  52.  
  53.    public Point getDragOrigin() {
  54.       return this.origin;
  55.    }
  56.  
  57.    public Iterator iterator() {
  58.       return this.events.iterator();
  59.    }
  60.  
  61.    public Object[] toArray() {
  62.       return this.events.toArray();
  63.    }
  64.  
  65.    public Object[] toArray(Object[] var1) {
  66.       return this.events.toArray(var1);
  67.    }
  68.  
  69.    public int getDragAction() {
  70.       return this.action;
  71.    }
  72.  
  73.    public InputEvent getTriggerEvent() {
  74.       return this.getSourceAsDragGestureRecognizer().getTriggerEvent();
  75.    }
  76.  
  77.    public void startDrag(Cursor var1, Transferable var2, DragSourceListener var3) throws InvalidDnDOperationException {
  78.       this.dragSource.startDrag(this, var1, var2, var3);
  79.    }
  80.  
  81.    public void startDrag(Cursor var1, Image var2, Point var3, Transferable var4, DragSourceListener var5) throws InvalidDnDOperationException {
  82.       this.dragSource.startDrag(this, var1, var2, var3, var4, var5);
  83.    }
  84. }
  85.