home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 1.9 KB | 101 lines |
- /*
- * @(#)DropTargetDragEvent.java 1.5 98/03/18
- *
- * Copyright 1997, 1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.awt.dnd;
-
- import java.awt.Point;
-
- import java.awt.datatransfer.DataFlavor;
-
- import java.awt.dnd.DropTargetEvent;
-
- /**
- * <p>
- * The DropTargetDragEvent is delivered to a DropTargetListener via its
- * dragEnter(), dragOver(), and dragScroll() methods.
- * </p>
- *
- * @version 1.5
- * @since JDK1.2
- *
- */
-
- public class DropTargetDragEvent extends DropTargetEvent {
-
- /**
- * construct an Event
- */
-
- public DropTargetDragEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) {
- super(dtc);
-
- location = cursorLocn;
- actions = srcActions;
- this.dropAction = dropAction;
- }
-
- /**
- * @return the current cursor location in Component's coords.
- */
-
- public Point getLocation() {
- return location;
- }
-
-
- /**
- * @return current DataFlavors
- */
-
- public DataFlavor[] getCurrentDataFlavors() {
- return context.getCurrentDataFlavors();
- }
-
- /**
- * @return source actions
- */
-
- public int getSourceActions() { return actions; }
-
- /**
- * @return currently selected drop action
- */
-
- public int getDropAction() { return dropAction; }
-
- /**
- * Accept the drag
- */
-
- public void acceptDrag(int dragOperation) {
- context.acceptDrag(dragOperation);
- }
-
- /**
- * Reject the drag
- */
-
- public void rejectDrag() {
- context.rejectDrag();
- }
-
- /*
- * fields
- */
-
- private Point location;
- private int actions;
- private int dropAction;
- }
-