01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package java.awt.dnd;
19:
20: import java.awt.Point;
21: import java.awt.datatransfer.DataFlavor;
22: import java.awt.datatransfer.Transferable;
23: import java.util.List;
24:
25: public class DropTargetDropEvent extends DropTargetEvent {
26:
27: private static final long serialVersionUID = -1721911170440459322L;
28:
29: private final boolean local;
30:
31: public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn,
32: int dropAction, int srcActions) {
33: super (dtc, cursorLocn, dropAction, srcActions);
34:
35: local = false;
36: }
37:
38: public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn,
39: int dropAction, int srcActions, boolean isLocal) {
40: super (dtc, cursorLocn, dropAction, srcActions);
41:
42: local = isLocal;
43: }
44:
45: @Override
46: public Point getLocation() {
47: return super .getLocation();
48: }
49:
50: public int getSourceActions() {
51: return super .getSourceAction();
52: }
53:
54: public int getDropAction() {
55: return super .getUserAction();
56: }
57:
58: public boolean isLocalTransfer() {
59: return local;
60: }
61:
62: public List<DataFlavor> getCurrentDataFlavorsAsList() {
63: return context.getCurrentDataFlavorsAsList();
64: }
65:
66: public Transferable getTransferable() {
67: return context.getTransferable();
68: }
69:
70: public boolean isDataFlavorSupported(DataFlavor df) {
71: return context.isDataFlavorSupported(df);
72: }
73:
74: public DataFlavor[] getCurrentDataFlavors() {
75: return context.getCurrentDataFlavors();
76: }
77:
78: public void dropComplete(boolean success) {
79: context.dropComplete(success);
80: }
81:
82: public void acceptDrop(int dropAction) {
83: context.acceptDrop(dropAction);
84: }
85:
86: public void rejectDrop() {
87: context.rejectDrop();
88: }
89: }
|