KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > dnd > DropTargetEvent


1 /*
2  * @(#)DropTargetEvent.java 1.18 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt.dnd;
9
10 import java.util.EventObject JavaDoc;
11
12 import java.awt.Component JavaDoc;
13 import java.awt.Point JavaDoc;
14
15 import java.awt.datatransfer.DataFlavor JavaDoc;
16
17 import java.awt.dnd.DropTarget JavaDoc;
18 import java.awt.dnd.DropTargetContext JavaDoc;
19
20 /**
21  * The <code>DropTargetEvent</code> is the base
22  * class for both the <code>DropTargetDragEvent</code>
23  * and the <code>DropTargetDropEvent</code>.
24  * It encapsulates the current state of the Drag and
25  * Drop operations, in particular the current
26  * <code>DropTargetContext</code>.
27  *
28  * @version 1.18, 12/19/03
29  * @since 1.2
30  *
31  */

32
33 public class DropTargetEvent extends java.util.EventObject JavaDoc {
34
35     private static final long serialVersionUID = 2821229066521922993L;
36
37     /**
38      * Construct a <code>DropTargetEvent</code> with
39      * a specified <code>DropTargetContext</code>.
40      * <P>
41      * @param dtc the <code>DropTargetContext</code>
42      */

43
44     public DropTargetEvent(DropTargetContext JavaDoc dtc) {
45     super(dtc.getDropTarget());
46
47     context = dtc;
48     }
49
50     /**
51      * This method returns the <code>DropTargetContext</code>
52      * associated with this <code>DropTargetEvent</code>.
53      * <P>
54      * @return the <code>DropTargetContext</code>
55      */

56
57     public DropTargetContext JavaDoc getDropTargetContext() {
58     return context;
59     }
60
61     /**
62      * The <code>DropTargetContext</code> associated with this
63      * <code>DropTargetEvent</code>.
64      *
65      * @serial
66      */

67     protected DropTargetContext JavaDoc context;
68 }
69
Popular Tags