2362N/A * Copyright (c) 1997, 2008, 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 * The <code>DropTarget</code> is associated 0N/A * with a <code>Component</code> when that <code>Component</code> 0N/A * to accept drops during Drag and Drop operations. 0N/A * <code>DropTarget</code> is associated with a <code>FlavorMap</code>. 0N/A * The default <code>FlavorMap</code> hereafter designates the 0N/A * <code>FlavorMap</code> returned by <code>SystemFlavorMap.getDefaultFlavorMap()</code>. 0N/A * Creates a new DropTarget given the <code>Component</code> 0N/A * to associate itself with, an <code>int</code> representing 0N/A * the default acceptable action(s) to 0N/A * support, a <code>DropTargetListener</code> 0N/A * to handle event processing, a <code>boolean</code> indicating 0N/A * if the <code>DropTarget</code> is currently accepting drops, and 0N/A * a <code>FlavorMap</code> to use (or null for the default <CODE>FlavorMap</CODE>). 0N/A * The Component will receive drops only if it is enabled. 0N/A * @param c The <code>Component</code> with which this <code>DropTarget</code> is associated 0N/A * @param ops The default acceptable actions for this <code>DropTarget</code> 0N/A * @param dtl The <code>DropTargetListener</code> for this <code>DropTarget</code> 0N/A * @param act Is the <code>DropTarget</code> accepting drops. 0N/A * @param fm The <code>FlavorMap</code> to use, or null for the default <CODE>FlavorMap</CODE> 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates a <code>DropTarget</code> given the <code>Component</code> 0N/A * to associate itself with, an <code>int</code> representing 0N/A * the default acceptable action(s) 0N/A * to support, a <code>DropTargetListener</code> 0N/A * to handle event processing, and a <code>boolean</code> indicating 0N/A * if the <code>DropTarget</code> is currently accepting drops. 0N/A * The Component will receive drops only if it is enabled. 0N/A * @param c The <code>Component</code> with which this <code>DropTarget</code> is associated 0N/A * @param ops The default acceptable actions for this <code>DropTarget</code> 0N/A * @param dtl The <code>DropTargetListener</code> for this <code>DropTarget</code> 0N/A * @param act Is the <code>DropTarget</code> accepting drops. 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates a <code>DropTarget</code>. 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates a <code>DropTarget</code> given the <code>Component</code> 0N/A * to associate itself with, and the <code>DropTargetListener</code> 0N/A * to handle event processing. 0N/A * The Component will receive drops only if it is enabled. 0N/A * @param c The <code>Component</code> with which this <code>DropTarget</code> is associated 0N/A * @param dtl The <code>DropTargetListener</code> for this <code>DropTarget</code> 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates a <code>DropTarget</code> given the <code>Component</code> 0N/A * to associate itself with, an <code>int</code> representing 0N/A * the default acceptable action(s) to support, and a 0N/A * <code>DropTargetListener</code> to handle event processing. 0N/A * The Component will receive drops only if it is enabled. 0N/A * @param c The <code>Component</code> with which this <code>DropTarget</code> is associated 0N/A * @param ops The default acceptable actions for this <code>DropTarget</code> 0N/A * @param dtl The <code>DropTargetListener</code> for this <code>DropTarget</code> 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Note: this interface is required to permit the safe association 0N/A * of a DropTarget with a Component in one of two ways, either: 0N/A * <code> component.setDropTarget(droptarget); </code> 0N/A * or <code> droptarget.setComponent(component); </code> 0N/A * The Component will receive drops only if it is enabled. 0N/A * @param c The new <code>Component</code> this <code>DropTarget</code> 0N/A * is to be associated with.<P> 0N/A * Gets the <code>Component</code> associated 0N/A * with this <code>DropTarget</code>. 0N/A * @return the current <code>Component</code> 0N/A * Sets the default acceptable actions for this <code>DropTarget</code> 0N/A * @param ops the default actions 0N/A * @see java.awt.dnd.DnDConstants 0N/A * Called by DropTargetContext.setTargetActions() 0N/A * with appropriate synchronization. 0N/A * Gets an <code>int</code> representing the 0N/A * current action(s) supported by this <code>DropTarget</code>. 0N/A * @return the current default actions 0N/A * Sets the DropTarget active if <code>true</code>, 0N/A * inactive if <code>false</code>. 0N/A * @param isActive sets the <code>DropTarget</code> (in)active. 0N/A * Reports whether or not 0N/A * this <code>DropTarget</code> 0N/A * is currently active (ready to accept drops). 0N/A * @return <CODE>true</CODE> if active, <CODE>false</CODE> if not 0N/A * Adds a new <code>DropTargetListener</code> (UNICAST SOURCE). 0N/A * @param dtl The new <code>DropTargetListener</code> 0N/A * @throws <code>TooManyListenersException</code> if a 0N/A * <code>DropTargetListener</code> is already added to this 0N/A * <code>DropTarget</code>. 0N/A * Removes the current <code>DropTargetListener</code> (UNICAST SOURCE). 0N/A * @param dtl the DropTargetListener to deregister. 0N/A * Calls <code>dragEnter</code> on the registered 0N/A * <code>DropTargetListener</code> and passes it 0N/A * the specified <code>DropTargetDragEvent</code>. 0N/A * Has no effect if this <code>DropTarget</code> 0N/A * @param dtde the <code>DropTargetDragEvent</code> 0N/A * @throws NullPointerException if this <code>DropTarget</code> 0N/A * is active and <code>dtde</code> is <code>null</code> 0N/A * Calls <code>dragOver</code> on the registered 0N/A * <code>DropTargetListener</code> and passes it 0N/A * the specified <code>DropTargetDragEvent</code>. 0N/A * Has no effect if this <code>DropTarget</code> 0N/A * @param dtde the <code>DropTargetDragEvent</code> 0N/A * @throws NullPointerException if this <code>DropTarget</code> 0N/A * is active and <code>dtde</code> is <code>null</code> 0N/A * Calls <code>dropActionChanged</code> on the registered 0N/A * <code>DropTargetListener</code> and passes it 0N/A * the specified <code>DropTargetDragEvent</code>. 0N/A * Has no effect if this <code>DropTarget</code> 0N/A * @param dtde the <code>DropTargetDragEvent</code> 0N/A * @throws NullPointerException if this <code>DropTarget</code> 0N/A * is active and <code>dtde</code> is <code>null</code> 0N/A * Calls <code>dragExit</code> on the registered 0N/A * <code>DropTargetListener</code> and passes it 0N/A * the specified <code>DropTargetEvent</code>. 0N/A * Has no effect if this <code>DropTarget</code> 0N/A * This method itself does not throw any exception 0N/A * for null parameter but for exceptions thrown by 0N/A * the respective method of the listener. 0N/A * @param dte the <code>DropTargetEvent</code> 0N/A * Calls <code>drop</code> on the registered 0N/A * <code>DropTargetListener</code> and passes it 0N/A * the specified <code>DropTargetDropEvent</code> 0N/A * if this <code>DropTarget</code> is active. 0N/A * @param dtde the <code>DropTargetDropEvent</code> 0N/A * @throws NullPointerException if <code>dtde</code> is null 0N/A * and at least one of the following is true: this 0N/A * <code>DropTarget</code> is not active, or there is 0N/A * no a <code>DropTargetListener</code> registered. 0N/A else {
// we should'nt get here ... 0N/A * Gets the <code>FlavorMap</code> 0N/A * associated with this <code>DropTarget</code>. 0N/A * If no <code>FlavorMap</code> has been set for this 0N/A * <code>DropTarget</code>, it is associated with the default 0N/A * <code>FlavorMap</code>. 0N/A * @return the FlavorMap for this DropTarget 0N/A * Sets the <code>FlavorMap</code> associated 0N/A * with this <code>DropTarget</code>. 0N/A * @param fm the new <code>FlavorMap</code>, or null to 0N/A * associate the default FlavorMap with this DropTarget. 0N/A * Notify the DropTarget that it has been associated with a Component 0N/A ********************************************************************** 0N/A * This method is usually called from java.awt.Component.addNotify() of 0N/A * the Component associated with this DropTarget to notify the DropTarget 0N/A * that a ComponentPeer has been associated with that Component. 0N/A * Calling this method, other than to notify this DropTarget of the 0N/A * association of the ComponentPeer with the Component may result in 0N/A * a malfunction of the DnD system. 0N/A ********************************************************************** 0N/A * @param peer The Peer of the Component we are associated with! 0N/A * Notify the DropTarget that it has been disassociated from a Component 0N/A ********************************************************************** 0N/A * This method is usually called from java.awt.Component.removeNotify() of 0N/A * the Component associated with this DropTarget to notify the DropTarget 0N/A * that a ComponentPeer has been disassociated with that Component. 0N/A * Calling this method, other than to notify this DropTarget of the 0N/A * disassociation of the ComponentPeer from the Component may result in 0N/A * a malfunction of the DnD system. 0N/A ********************************************************************** 0N/A * @param peer The Peer of the Component we are being disassociated from! 0N/A * Gets the <code>DropTargetContext</code> associated 0N/A * with this <code>DropTarget</code>. 0N/A * @return the <code>DropTargetContext</code> associated with this <code>DropTarget</code>. 0N/A * Creates the DropTargetContext associated with this DropTarget. 0N/A * Subclasses may override this method to instantiate their own 0N/A * DropTargetContext subclass. 0N/A * This call is typically *only* called by the platform's 0N/A * DropTargetContextPeer as a drag operation encounters this 0N/A * DropTarget. Accessing the Context while no Drag is current 0N/A * has undefined results. 0N/A * Serializes this <code>DropTarget</code>. Performs default serialization, 0N/A * and then writes out this object's <code>DropTargetListener</code> if and 0N/A * only if it can be serialized. If not, <code>null</code> is written 0N/A * @serialData The default serializable fields, in alphabetical order, 0N/A * followed by either a <code>DropTargetListener</code> 0N/A * instance, or <code>null</code>. 0N/A * Deserializes this <code>DropTarget</code>. This method first performs 0N/A * default deserialization for all non-<code>transient</code> fields. An 0N/A * attempt is then made to deserialize this object's 0N/A * <code>DropTargetListener</code> as well. This is first attempted by 0N/A * deserializing the field <code>dtListener</code>, because, in releases 0N/A * prior to 1.4, a non-<code>transient</code> field of this name stored the 0N/A * <code>DropTargetListener</code>. If this fails, the next object in the 0N/A * stream is used instead. 0N/A // Pre-1.4 support. 'dropTargetContext' was previoulsy transient 0N/A // Pre-1.4 support. 'dtListener' was previously non-transient 0N/A // 1.4-compatible byte stream. 'dtListener' was written explicitly 0N/A /*********************************************************************/ 0N/A * this protected nested class implements autoscrolling 0N/A * construct a DropTargetAutoScroller 0N/A * @param c the <code>Component</code> 0N/A * @param p the <code>Point</code> 0N/A * update the geometry of the autoscroll region 0N/A * cause autoscroll to occur 0N/A * @param newLocn the <code>Point</code> 0N/A * cause autoscrolling to stop 0N/A * cause autoscroll to occur 0N/A * @param e the <code>ActionEvent</code> 0N/A /*********************************************************************/ 0N/A * create an embedded autoscroller 0N/A * @param c the <code>Component</code> 0N/A * @param p the <code>Point</code> 0N/A * initialize autoscrolling 0N/A * @param p the <code>Point</code> 0N/A * update autoscrolling with current cursor locn 0N/A * @param dragCursorLocn the <code>Point</code> 0N/A * clear autoscrolling 0N/A * The DropTargetContext associated with this DropTarget. 0N/A * The Component associated with this DropTarget. 0N/A * That Component's Peer 0N/A * That Component's "native" Peer 0N/A * Default permissible actions supported by this DropTarget. 0N/A * @see #setDefaultActions 0N/A * @see #getDefaultActions 0N/A * <code>true</code> if the DropTarget is accepting Drag & Drop operations. 0N/A * the auto scrolling object