2362N/A * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A <code>DropTargetContext</code> is created 0N/A * whenever the logical cursor associated 0N/A * with a Drag and Drop operation coincides with the visible geometry of 0N/A * a <code>Component</code> associated with a <code>DropTarget</code>. 0N/A * The <code>DropTargetContext</code> provides 0N/A * the mechanism for a potential receiver 0N/A * of a drop operation to both provide the end user with the appropriate 0N/A * drag under feedback, but also to effect the subsequent data transfer 0N/A * Construct a <code>DropTargetContext</code> 0N/A * given a specified <code>DropTarget</code>. 0N/A * @param dt the DropTarget to associate with 0N/A * This method returns the <code>DropTarget</code> associated with this 0N/A * <code>DropTargetContext</code>. 0N/A * @return the <code>DropTarget</code> associated with this <code>DropTargetContext</code> 0N/A * This method returns the <code>Component</code> associated with 0N/A * this <code>DropTargetContext</code>. 0N/A * @return the Component associated with this Context 0N/A * Called when associated with the <code>DropTargetContextPeer</code>. 0N/A * @param dtcp the <code>DropTargetContextPeer</code> 0N/A * Called when disassociated with the <code>DropTargetContextPeer</code>. 0N/A * This method sets the current actions acceptable to 0N/A * this <code>DropTarget</code>. 0N/A * @param actions an <code>int</code> representing the supported action(s) 0N/A * This method returns an <code>int</code> representing the 0N/A * current actions this <code>DropTarget</code> will accept. 0N/A * @return the current actions acceptable to this <code>DropTarget</code> 0N/A * This method signals that the drop is completed and 0N/A * if it was successful or not. 0N/A * @param success true for success, false if not 0N/A * @param dragOperation the supported action(s) 0N/A * called to signal that the drop is acceptable 0N/A * using the specified operation. 0N/A * must be called during DropTargetListener.drop method invocation. 0N/A * @param dropOperation the supported action(s) 0N/A * called to signal that the drop is unacceptable. 0N/A * must be called during DropTargetListener.drop method invocation. 0N/A * get the available DataFlavors of the 0N/A * <code>Transferable</code> operand of this operation. 0N/A * @return a <code>DataFlavor[]</code> containing the 0N/A * supported <code>DataFlavor</code>s of the 0N/A * <code>Transferable</code> operand. 0N/A * This method returns a the currently available DataFlavors 0N/A * of the <code>Transferable</code> operand 0N/A * as a <code>java.util.List</code>. 0N/A * @return the currently available 0N/A * DataFlavors as a <code>java.util.List</code> 0N/A * This method returns a <code>boolean</code> 0N/A * indicating if the given <code>DataFlavor</code> is 0N/A * supported by this <code>DropTargetContext</code>. 0N/A * @param df the <code>DataFlavor</code> 0N/A * @return if the <code>DataFlavor</code> specified is supported 0N/A * get the Transferable (proxy) operand of this operation 0N/A * @return the <code>Transferable</code> 0N/A synchronized (
this) {
0N/A * Get the <code>DropTargetContextPeer</code> 0N/A * @return the platform peer 0N/A * Creates a TransferableProxy to proxy for the specified 0N/A * @param t the <tt>Transferable</tt> to be proxied 0N/A * @param local <tt>true</tt> if <tt>t</tt> represents 0N/A * the result of a local drag-n-drop operation. 0N/A * @return the new <tt>TransferableProxy</tt> instance. 0N/A/****************************************************************************/ 0N/A * <code>TransferableProxy</code> is a helper inner class that implements 0N/A * <code>Transferable</code> interface and serves as a proxy for another 0N/A * <code>Transferable</code> object which represents data transfer for 0N/A * a particular drag-n-drop operation. 0N/A * The proxy forwards all requests to the encapsulated transferable 0N/A * and automatically performs additional conversion on the data 0N/A * returned by the encapsulated transferable in case of local transfer. 0N/A * Constructs a <code>TransferableProxy</code> given 0N/A * a specified <code>Transferable</code> object representing 0N/A * data transfer for a particular drag-n-drop operation and 0N/A * a <code>boolean</code> which indicates whether the 0N/A * drag-n-drop operation is local (within the same JVM). 0N/A * @param t the <code>Transferable</code> object 0N/A * @param local <code>true</code>, if <code>t</code> represents 0N/A * the result of local drag-n-drop operation 0N/A * Returns an array of DataFlavor objects indicating the flavors 0N/A * the data can be provided in by the encapsulated transferable. 0N/A * @return an array of data flavors in which the data can be 0N/A * provided by the encapsulated transferable 0N/A * Returns whether or not the specified data flavor is supported by 0N/A * the encapsulated transferable. 0N/A * @param flavor the requested flavor for the data 0N/A * @return <code>true</code> if the data flavor is supported, 0N/A * <code>false</code> otherwise 0N/A * Returns an object which represents the data provided by 0N/A * the encapsulated transferable for the requested data flavor. 0N/A * In case of local transfer a serialized copy of the object 0N/A * returned by the encapsulated transferable is provided when 0N/A * @param df the requested flavor for the data 0N/A * @throws IOException if the data is no longer available 0N/A * in the requested flavor. 0N/A * @throws UnsupportedFlavorException if the requested data flavor is 0N/A // We don't need to worry about client code changing the values of 0N/A // these variables. Since TransferableProxy is a protected class, only 0N/A // subclasses of DropTargetContext can access it. And DropTargetContext 0N/A // cannot be subclassed by client code because it does not have a 0N/A // public constructor. 0N/A * The encapsulated <code>Transferable</code> object. 0N/A * A <code>boolean</code> indicating if the encapsulated 0N/A * <code>Transferable</code> object represents the result 0N/A * of local drag-n-drop operation (within the same JVM). 0N/A/****************************************************************************/ 0N/A * The DropTarget associated with this DropTargetContext.