1 /*
2 * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
37 import java.awt.dnd.DnDConstants;
38 import java.awt.dnd.DragSourceContext;
39 import java.awt.dnd.DragSourceEvent;
40 import java.awt.dnd.DragSourceDropEvent;
41 import java.awt.dnd.DragSourceDragEvent;
42 import java.awt.dnd.DragGestureEvent;
43 import java.awt.dnd.InvalidDnDOperationException;
44
45 import java.awt.dnd.peer.DragSourceContextPeer;
46
47 import java.awt.event.InputEvent;
48 import java.awt.event.MouseEvent;
49
50 import java.util.Map;
51 import java.util.SortedMap;
52
53 import sun.awt.SunToolkit;
54 import sun.awt.datatransfer.DataTransferer;
55 import java.awt.datatransfer.DataFlavor;
56
57 import javax.tools.annotation.GenerateNativeHeader;
58
59 /**
60 * <p>
61 * TBC
62 * </p>
63 *
64 * @since JDK1.3.1
65 *
66 */
67 /* No native methods here, but the constants are needed in the supporting JNI code */
68 @GenerateNativeHeader
69 public abstract class SunDragSourceContextPeer implements DragSourceContextPeer {
70
71 private DragGestureEvent trigger;
72 private Component component;
73 private Cursor cursor;
74 private Image dragImage;
75 private Point dragImageOffset;
76 private long nativeCtxt;
77 private DragSourceContext dragSourceContext;
78 private int sourceActions;
79
80 private static boolean dragDropInProgress = false;
81 private static boolean discardingMouseEvents = false;
82
83 /*
84 * dispatch constants
85 */
86
87 protected final static int DISPATCH_ENTER = 1;
88 protected final static int DISPATCH_MOTION = 2;
|
1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
37 import java.awt.dnd.DnDConstants;
38 import java.awt.dnd.DragSourceContext;
39 import java.awt.dnd.DragSourceEvent;
40 import java.awt.dnd.DragSourceDropEvent;
41 import java.awt.dnd.DragSourceDragEvent;
42 import java.awt.dnd.DragGestureEvent;
43 import java.awt.dnd.InvalidDnDOperationException;
44
45 import java.awt.dnd.peer.DragSourceContextPeer;
46
47 import java.awt.event.InputEvent;
48 import java.awt.event.MouseEvent;
49
50 import java.util.Map;
51 import java.util.SortedMap;
52
53 import sun.awt.SunToolkit;
54 import sun.awt.datatransfer.DataTransferer;
55 import java.awt.datatransfer.DataFlavor;
56
57
58 /**
59 * <p>
60 * TBC
61 * </p>
62 *
63 * @since JDK1.3.1
64 *
65 */
66 public abstract class SunDragSourceContextPeer implements DragSourceContextPeer {
67
68 private DragGestureEvent trigger;
69 private Component component;
70 private Cursor cursor;
71 private Image dragImage;
72 private Point dragImageOffset;
73 private long nativeCtxt;
74 private DragSourceContext dragSourceContext;
75 private int sourceActions;
76
77 private static boolean dragDropInProgress = false;
78 private static boolean discardingMouseEvents = false;
79
80 /*
81 * dispatch constants
82 */
83
84 protected final static int DISPATCH_ENTER = 1;
85 protected final static int DISPATCH_MOTION = 2;
|