home *** CD-ROM | disk | FTP | other *** search
- package java.awt.dnd;
-
- import java.awt.Component;
- import java.awt.Cursor;
- import java.awt.Image;
- import java.awt.Point;
- import java.awt.datatransfer.Transferable;
- import java.awt.event.InputEvent;
- import java.util.EventObject;
- import java.util.Iterator;
- import java.util.List;
-
- public class DragGestureEvent extends EventObject {
- private List events;
- private DragSource dragSource;
- private Component component;
- private Point origin;
- private int action;
-
- public DragGestureEvent(DragGestureRecognizer var1, int var2, Point var3, List var4) {
- super(var1);
- if ((this.component = var1.getComponent()) == null) {
- throw new IllegalArgumentException("null component");
- } else if ((this.dragSource = var1.getDragSource()) == null) {
- throw new IllegalArgumentException("null DragSource");
- } else if (var4 != null && !var4.isEmpty()) {
- if (var2 != 1 && var2 != 2 && var2 != 1073741824) {
- throw new IllegalArgumentException("bad action");
- } else if (var3 == null) {
- throw new IllegalArgumentException("null origin");
- } else {
- this.events = var4;
- this.action = var2;
- this.origin = var3;
- }
- } else {
- throw new IllegalArgumentException("null or empty list of events");
- }
- }
-
- public DragGestureRecognizer getSourceAsDragGestureRecognizer() {
- return (DragGestureRecognizer)((EventObject)this).getSource();
- }
-
- public Component getComponent() {
- return this.component;
- }
-
- public DragSource getDragSource() {
- return this.dragSource;
- }
-
- public Point getDragOrigin() {
- return this.origin;
- }
-
- public Iterator iterator() {
- return this.events.iterator();
- }
-
- public Object[] toArray() {
- return this.events.toArray();
- }
-
- public Object[] toArray(Object[] var1) {
- return this.events.toArray(var1);
- }
-
- public int getDragAction() {
- return this.action;
- }
-
- public InputEvent getTriggerEvent() {
- return this.getSourceAsDragGestureRecognizer().getTriggerEvent();
- }
-
- public void startDrag(Cursor var1, Transferable var2, DragSourceListener var3) throws InvalidDnDOperationException {
- this.dragSource.startDrag(this, var1, var2, var3);
- }
-
- public void startDrag(Cursor var1, Image var2, Point var3, Transferable var4, DragSourceListener var5) throws InvalidDnDOperationException {
- this.dragSource.startDrag(this, var1, var2, var3, var4, var5);
- }
- }
-