< prev index next >

src/java.desktop/share/classes/java/awt/dnd/DropTarget.java

Print this page

        

@@ -52,42 +52,42 @@
 import sun.awt.AWTAccessor;
 import sun.awt.AWTAccessor.ComponentAccessor;
 
 
 /**
- * The <code>DropTarget</code> is associated
- * with a <code>Component</code> when that <code>Component</code>
+ * The {@code DropTarget} is associated
+ * with a {@code Component} when that {@code Component}
  * wishes
  * to accept drops during Drag and Drop operations.
  * <P>
  *  Each
- * <code>DropTarget</code> is associated with a <code>FlavorMap</code>.
- * The default <code>FlavorMap</code> hereafter designates the
- * <code>FlavorMap</code> returned by <code>SystemFlavorMap.getDefaultFlavorMap()</code>.
+ * {@code DropTarget} is associated with a {@code FlavorMap}.
+ * The default {@code FlavorMap} hereafter designates the
+ * {@code FlavorMap} returned by {@code SystemFlavorMap.getDefaultFlavorMap()}.
  *
  * @since 1.2
  */
 
 public class DropTarget implements DropTargetListener, Serializable {
 
     private static final long serialVersionUID = -6283860791671019047L;
 
     /**
-     * Creates a new DropTarget given the <code>Component</code>
-     * to associate itself with, an <code>int</code> representing
+     * Creates a new DropTarget given the {@code Component}
+     * to associate itself with, an {@code int} representing
      * the default acceptable action(s) to
-     * support, a <code>DropTargetListener</code>
-     * to handle event processing, a <code>boolean</code> indicating
-     * if the <code>DropTarget</code> is currently accepting drops, and
-     * a <code>FlavorMap</code> to use (or null for the default <CODE>FlavorMap</CODE>).
+     * support, a {@code DropTargetListener}
+     * to handle event processing, a {@code boolean} indicating
+     * if the {@code DropTarget} is currently accepting drops, and
+     * a {@code FlavorMap} to use (or null for the default {@code FlavorMap}).
      * <P>
      * The Component will receive drops only if it is enabled.
-     * @param c         The <code>Component</code> with which this <code>DropTarget</code> is associated
-     * @param ops       The default acceptable actions for this <code>DropTarget</code>
-     * @param dtl       The <code>DropTargetListener</code> for this <code>DropTarget</code>
-     * @param act       Is the <code>DropTarget</code> accepting drops.
-     * @param fm        The <code>FlavorMap</code> to use, or null for the default <CODE>FlavorMap</CODE>
+     * @param c         The {@code Component} with which this {@code DropTarget} is associated
+     * @param ops       The default acceptable actions for this {@code DropTarget}
+     * @param dtl       The {@code DropTargetListener} for this {@code DropTarget}
+     * @param act       Is the {@code DropTarget} accepting drops.
+     * @param fm        The {@code FlavorMap} to use, or null for the default {@code FlavorMap}
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      *            returns true
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public DropTarget(Component c, int ops, DropTargetListener dtl,

@@ -119,22 +119,22 @@
             flavorMap = SystemFlavorMap.getDefaultFlavorMap();
         }
     }
 
     /**
-     * Creates a <code>DropTarget</code> given the <code>Component</code>
-     * to associate itself with, an <code>int</code> representing
+     * Creates a {@code DropTarget} given the {@code Component}
+     * to associate itself with, an {@code int} representing
      * the default acceptable action(s)
-     * to support, a <code>DropTargetListener</code>
-     * to handle event processing, and a <code>boolean</code> indicating
-     * if the <code>DropTarget</code> is currently accepting drops.
+     * to support, a {@code DropTargetListener}
+     * to handle event processing, and a {@code boolean} indicating
+     * if the {@code DropTarget} is currently accepting drops.
      * <P>
      * The Component will receive drops only if it is enabled.
-     * @param c         The <code>Component</code> with which this <code>DropTarget</code> is associated
-     * @param ops       The default acceptable actions for this <code>DropTarget</code>
-     * @param dtl       The <code>DropTargetListener</code> for this <code>DropTarget</code>
-     * @param act       Is the <code>DropTarget</code> accepting drops.
+     * @param c         The {@code Component} with which this {@code DropTarget} is associated
+     * @param ops       The default acceptable actions for this {@code DropTarget}
+     * @param dtl       The {@code DropTargetListener} for this {@code DropTarget}
+     * @param act       Is the {@code DropTarget} accepting drops.
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      *            returns true
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public DropTarget(Component c, int ops, DropTargetListener dtl,

@@ -143,27 +143,27 @@
     {
         this(c, ops, dtl, act, null);
     }
 
     /**
-     * Creates a <code>DropTarget</code>.
+     * Creates a {@code DropTarget}.
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      *            returns true
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public DropTarget() throws HeadlessException {
         this(null, DnDConstants.ACTION_COPY_OR_MOVE, null, true, null);
     }
 
     /**
-     * Creates a <code>DropTarget</code> given the <code>Component</code>
-     * to associate itself with, and the <code>DropTargetListener</code>
+     * Creates a {@code DropTarget} given the {@code Component}
+     * to associate itself with, and the {@code DropTargetListener}
      * to handle event processing.
      * <P>
      * The Component will receive drops only if it is enabled.
-     * @param c         The <code>Component</code> with which this <code>DropTarget</code> is associated
-     * @param dtl       The <code>DropTargetListener</code> for this <code>DropTarget</code>
+     * @param c         The {@code Component} with which this {@code DropTarget} is associated
+     * @param dtl       The {@code DropTargetListener} for this {@code DropTarget}
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      *            returns true
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public DropTarget(Component c, DropTargetListener dtl)

@@ -171,19 +171,19 @@
     {
         this(c, DnDConstants.ACTION_COPY_OR_MOVE, dtl, true, null);
     }
 
     /**
-     * Creates a <code>DropTarget</code> given the <code>Component</code>
-     * to associate itself with, an <code>int</code> representing
+     * Creates a {@code DropTarget} given the {@code Component}
+     * to associate itself with, an {@code int} representing
      * the default acceptable action(s) to support, and a
-     * <code>DropTargetListener</code> to handle event processing.
+     * {@code DropTargetListener} to handle event processing.
      * <P>
      * The Component will receive drops only if it is enabled.
-     * @param c         The <code>Component</code> with which this <code>DropTarget</code> is associated
-     * @param ops       The default acceptable actions for this <code>DropTarget</code>
-     * @param dtl       The <code>DropTargetListener</code> for this <code>DropTarget</code>
+     * @param c         The {@code Component} with which this {@code DropTarget} is associated
+     * @param ops       The default acceptable actions for this {@code DropTarget}
+     * @param dtl       The {@code DropTargetListener} for this {@code DropTarget}
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      *            returns true
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public DropTarget(Component c, int ops, DropTargetListener dtl)

@@ -193,15 +193,15 @@
     }
 
     /**
      * Note: this interface is required to permit the safe association
      * of a DropTarget with a Component in one of two ways, either:
-     * <code> component.setDropTarget(droptarget); </code>
-     * or <code> droptarget.setComponent(component); </code>
+     * {@code component.setDropTarget(droptarget);}
+     * or {@code droptarget.setComponent(component);}
      * <P>
      * The Component will receive drops only if it is enabled.
-     * @param c The new <code>Component</code> this <code>DropTarget</code>
+     * @param c The new {@code Component} this {@code DropTarget}
      * is to be associated with.
      */
 
     public synchronized void setComponent(Component c) {
         if (component == c || component != null && component.equals(c))

@@ -227,22 +227,22 @@
             }
         }
     }
 
     /**
-     * Gets the <code>Component</code> associated
-     * with this <code>DropTarget</code>.
+     * Gets the {@code Component} associated
+     * with this {@code DropTarget}.
      *
-     * @return the current <code>Component</code>
+     * @return the current {@code Component}
      */
 
     public synchronized Component getComponent() {
         return component;
     }
 
     /**
-     * Sets the default acceptable actions for this <code>DropTarget</code>
+     * Sets the default acceptable actions for this {@code DropTarget}
      *
      * @param ops the default actions
      * @see java.awt.dnd.DnDConstants
      */
 

@@ -257,25 +257,25 @@
     void doSetDefaultActions(int ops) {
         actions = ops;
     }
 
     /**
-     * Gets an <code>int</code> representing the
-     * current action(s) supported by this <code>DropTarget</code>.
+     * Gets an {@code int} representing the
+     * current action(s) supported by this {@code DropTarget}.
      *
      * @return the current default actions
      */
 
     public int getDefaultActions() {
         return actions;
     }
 
     /**
-     * Sets the DropTarget active if <code>true</code>,
-     * inactive if <code>false</code>.
+     * Sets the DropTarget active if {@code true},
+     * inactive if {@code false}.
      *
-     * @param isActive sets the <code>DropTarget</code> (in)active.
+     * @param isActive sets the {@code DropTarget} (in)active.
      */
 
     public synchronized void setActive(boolean isActive) {
         if (isActive != active) {
             active = isActive;

@@ -284,28 +284,28 @@
         if (!active) clearAutoscroll();
     }
 
     /**
      * Reports whether or not
-     * this <code>DropTarget</code>
+     * this {@code DropTarget}
      * is currently active (ready to accept drops).
      *
-     * @return <CODE>true</CODE> if active, <CODE>false</CODE> if not
+     * @return {@code true} if active, {@code false} if not
      */
 
     public boolean isActive() {
         return active;
     }
 
     /**
-     * Adds a new <code>DropTargetListener</code> (UNICAST SOURCE).
+     * Adds a new {@code DropTargetListener} (UNICAST SOURCE).
      *
-     * @param dtl The new <code>DropTargetListener</code>
+     * @param dtl The new {@code DropTargetListener}
      *
      * @throws TooManyListenersException if a
-     * <code>DropTargetListener</code> is already added to this
-     * <code>DropTarget</code>.
+     * {@code DropTargetListener} is already added to this
+     * {@code DropTarget}.
      */
 
     public synchronized void addDropTargetListener(DropTargetListener dtl) throws TooManyListenersException {
         if (dtl == null) return;
 

@@ -316,11 +316,11 @@
         else
             throw new TooManyListenersException();
     }
 
     /**
-     * Removes the current <code>DropTargetListener</code> (UNICAST SOURCE).
+     * Removes the current {@code DropTargetListener} (UNICAST SOURCE).
      *
      * @param dtl the DropTargetListener to deregister.
      */
 
     public synchronized void removeDropTargetListener(DropTargetListener dtl) {

@@ -331,20 +331,20 @@
                 throw new IllegalArgumentException("listener mismatch");
         }
     }
 
     /**
-     * Calls <code>dragEnter</code> on the registered
-     * <code>DropTargetListener</code> and passes it
-     * the specified <code>DropTargetDragEvent</code>.
-     * Has no effect if this <code>DropTarget</code>
+     * Calls {@code dragEnter} on the registered
+     * {@code DropTargetListener} and passes it
+     * the specified {@code DropTargetDragEvent}.
+     * Has no effect if this {@code DropTarget}
      * is not active.
      *
-     * @param dtde the <code>DropTargetDragEvent</code>
+     * @param dtde the {@code DropTargetDragEvent}
      *
-     * @throws NullPointerException if this <code>DropTarget</code>
-     *         is active and <code>dtde</code> is <code>null</code>
+     * @throws NullPointerException if this {@code DropTarget}
+     *         is active and {@code dtde} is {@code null}
      *
      * @see #isActive
      */
     public synchronized void dragEnter(DropTargetDragEvent dtde) {
         isDraggingInside = true;

@@ -358,20 +358,20 @@
 
         initializeAutoscrolling(dtde.getLocation());
     }
 
     /**
-     * Calls <code>dragOver</code> on the registered
-     * <code>DropTargetListener</code> and passes it
-     * the specified <code>DropTargetDragEvent</code>.
-     * Has no effect if this <code>DropTarget</code>
+     * Calls {@code dragOver} on the registered
+     * {@code DropTargetListener} and passes it
+     * the specified {@code DropTargetDragEvent}.
+     * Has no effect if this {@code DropTarget}
      * is not active.
      *
-     * @param dtde the <code>DropTargetDragEvent</code>
+     * @param dtde the {@code DropTargetDragEvent}
      *
-     * @throws NullPointerException if this <code>DropTarget</code>
-     *         is active and <code>dtde</code> is <code>null</code>
+     * @throws NullPointerException if this {@code DropTarget}
+     *         is active and {@code dtde} is {@code null}
      *
      * @see #isActive
      */
     public synchronized void dragOver(DropTargetDragEvent dtde) {
         if (!active) return;

@@ -380,20 +380,20 @@
 
         updateAutoscroll(dtde.getLocation());
     }
 
     /**
-     * Calls <code>dropActionChanged</code> on the registered
-     * <code>DropTargetListener</code> and passes it
-     * the specified <code>DropTargetDragEvent</code>.
-     * Has no effect if this <code>DropTarget</code>
+     * Calls {@code dropActionChanged} on the registered
+     * {@code DropTargetListener} and passes it
+     * the specified {@code DropTargetDragEvent}.
+     * Has no effect if this {@code DropTarget}
      * is not active.
      *
-     * @param dtde the <code>DropTargetDragEvent</code>
+     * @param dtde the {@code DropTargetDragEvent}
      *
-     * @throws NullPointerException if this <code>DropTarget</code>
-     *         is active and <code>dtde</code> is <code>null</code>
+     * @throws NullPointerException if this {@code DropTarget}
+     *         is active and {@code dtde} is {@code null}
      *
      * @see #isActive
      */
     public synchronized void dropActionChanged(DropTargetDragEvent dtde) {
         if (!active) return;

@@ -402,21 +402,21 @@
 
         updateAutoscroll(dtde.getLocation());
     }
 
     /**
-     * Calls <code>dragExit</code> on the registered
-     * <code>DropTargetListener</code> and passes it
-     * the specified <code>DropTargetEvent</code>.
-     * Has no effect if this <code>DropTarget</code>
+     * Calls {@code dragExit} on the registered
+     * {@code DropTargetListener} and passes it
+     * the specified {@code DropTargetEvent}.
+     * Has no effect if this {@code DropTarget}
      * is not active.
      * <p>
      * This method itself does not throw any exception
      * for null parameter but for exceptions thrown by
      * the respective method of the listener.
      *
-     * @param dte the <code>DropTargetEvent</code>
+     * @param dte the {@code DropTargetEvent}
      *
      * @see #isActive
      */
     public synchronized void dragExit(DropTargetEvent dte) {
         isDraggingInside = false;

@@ -427,21 +427,21 @@
 
         clearAutoscroll();
     }
 
     /**
-     * Calls <code>drop</code> on the registered
-     * <code>DropTargetListener</code> and passes it
-     * the specified <code>DropTargetDropEvent</code>
-     * if this <code>DropTarget</code> is active.
+     * Calls {@code drop} on the registered
+     * {@code DropTargetListener} and passes it
+     * the specified {@code DropTargetDropEvent}
+     * if this {@code DropTarget} is active.
      *
-     * @param dtde the <code>DropTargetDropEvent</code>
+     * @param dtde the {@code DropTargetDropEvent}
      *
-     * @throws NullPointerException if <code>dtde</code> is null
+     * @throws NullPointerException if {@code dtde} is null
      *         and at least one of the following is true: this
-     *         <code>DropTarget</code> is not active, or there is
-     *         no a <code>DropTargetListener</code> registered.
+     *         {@code DropTarget} is not active, or there is
+     *         no a {@code DropTargetListener} registered.
      *
      * @see #isActive
      */
     public synchronized void drop(DropTargetDropEvent dtde) {
         isDraggingInside = false;

@@ -454,26 +454,26 @@
             dtde.rejectDrop();
         }
     }
 
     /**
-     * Gets the <code>FlavorMap</code>
-     * associated with this <code>DropTarget</code>.
-     * If no <code>FlavorMap</code> has been set for this
-     * <code>DropTarget</code>, it is associated with the default
-     * <code>FlavorMap</code>.
+     * Gets the {@code FlavorMap}
+     * associated with this {@code DropTarget}.
+     * If no {@code FlavorMap} has been set for this
+     * {@code DropTarget}, it is associated with the default
+     * {@code FlavorMap}.
      *
      * @return the FlavorMap for this DropTarget
      */
 
     public FlavorMap getFlavorMap() { return flavorMap; }
 
     /**
-     * Sets the <code>FlavorMap</code> associated
-     * with this <code>DropTarget</code>.
+     * Sets the {@code FlavorMap} associated
+     * with this {@code DropTarget}.
      *
-     * @param fm the new <code>FlavorMap</code>, or null to
+     * @param fm the new {@code FlavorMap}, or null to
      * associate the default FlavorMap with this DropTarget.
      */
 
     public void setFlavorMap(FlavorMap fm) {
         flavorMap = fm == null ? SystemFlavorMap.getDefaultFlavorMap() : fm;

@@ -542,14 +542,14 @@
             }
         }
     }
 
     /**
-     * Gets the <code>DropTargetContext</code> associated
-     * with this <code>DropTarget</code>.
+     * Gets the {@code DropTargetContext} associated
+     * with this {@code DropTarget}.
      *
-     * @return the <code>DropTargetContext</code> associated with this <code>DropTarget</code>.
+     * @return the {@code DropTargetContext} associated with this {@code DropTarget}.
      */
 
     public DropTargetContext getDropTargetContext() {
         return dropTargetContext;
     }

@@ -569,35 +569,35 @@
     protected DropTargetContext createDropTargetContext() {
         return new DropTargetContext(this);
     }
 
     /**
-     * Serializes this <code>DropTarget</code>. Performs default serialization,
-     * and then writes out this object's <code>DropTargetListener</code> if and
-     * only if it can be serialized. If not, <code>null</code> is written
+     * Serializes this {@code DropTarget}. Performs default serialization,
+     * and then writes out this object's {@code DropTargetListener} if and
+     * only if it can be serialized. If not, {@code null} is written
      * instead.
      *
      * @serialData The default serializable fields, in alphabetical order,
-     *             followed by either a <code>DropTargetListener</code>
-     *             instance, or <code>null</code>.
+     *             followed by either a {@code DropTargetListener}
+     *             instance, or {@code null}.
      * @since 1.4
      */
     private void writeObject(ObjectOutputStream s) throws IOException {
         s.defaultWriteObject();
 
         s.writeObject(SerializationTester.test(dtListener)
                       ? dtListener : null);
     }
 
     /**
-     * Deserializes this <code>DropTarget</code>. This method first performs
-     * default deserialization for all non-<code>transient</code> fields. An
+     * Deserializes this {@code DropTarget}. This method first performs
+     * default deserialization for all non-{@code transient} fields. An
      * attempt is then made to deserialize this object's
-     * <code>DropTargetListener</code> as well. This is first attempted by
-     * deserializing the field <code>dtListener</code>, because, in releases
-     * prior to 1.4, a non-<code>transient</code> field of this name stored the
-     * <code>DropTargetListener</code>. If this fails, the next object in the
+     * {@code DropTargetListener} as well. This is first attempted by
+     * deserializing the field {@code dtListener}, because, in releases
+     * prior to 1.4, a non-{@code transient} field of this name stored the
+     * {@code DropTargetListener}. If this fails, the next object in the
      * stream is used instead.
      *
      * @since 1.4
      */
     private void readObject(ObjectInputStream s)

@@ -637,12 +637,12 @@
     protected static class DropTargetAutoScroller implements ActionListener {
 
         /**
          * construct a DropTargetAutoScroller
          *
-         * @param c the <code>Component</code>
-         * @param p the <code>Point</code>
+         * @param c the {@code Component}
+         * @param p the {@code Point}
          */
 
         protected DropTargetAutoScroller(Component c, Point p) {
             super();
 

@@ -707,11 +707,11 @@
         }
 
         /**
          * cause autoscroll to occur
          *
-         * @param newLocn the <code>Point</code>
+         * @param newLocn the {@code Point}
          */
 
         protected synchronized void updateLocation(Point newLocn) {
             prev = locn;
             locn = newLocn;

@@ -731,11 +731,11 @@
         protected void stop() { timer.stop(); }
 
         /**
          * cause autoscroll to occur
          *
-         * @param e the <code>ActionEvent</code>
+         * @param e the {@code ActionEvent}
          */
 
         public synchronized void actionPerformed(ActionEvent e) {
             updateRegion();
 

@@ -764,23 +764,23 @@
     /*********************************************************************/
 
     /**
      * create an embedded autoscroller
      *
-     * @param c the <code>Component</code>
-     * @param p the <code>Point</code>
+     * @param c the {@code Component}
+     * @param p the {@code Point}
      * @return an embedded autoscroller
      */
 
     protected DropTargetAutoScroller createDropTargetAutoScroller(Component c, Point p) {
         return new DropTargetAutoScroller(c, p);
     }
 
     /**
      * initialize autoscrolling
      *
-     * @param p the <code>Point</code>
+     * @param p the {@code Point}
      */
 
     protected void initializeAutoscrolling(Point p) {
         if (component == null || !(component instanceof Autoscroll)) return;
 

@@ -788,11 +788,11 @@
     }
 
     /**
      * update autoscrolling with current cursor location
      *
-     * @param dragCursorLocn the <code>Point</code>
+     * @param dragCursorLocn the {@code Point}
      */
 
     protected void updateAutoscroll(Point dragCursorLocn) {
         if (autoScroller != null) autoScroller.updateLocation(dragCursorLocn);
     }

@@ -841,11 +841,11 @@
      * @serial
      */
     int     actions = DnDConstants.ACTION_COPY_OR_MOVE;
 
     /**
-     * <code>true</code> if the DropTarget is accepting Drag &amp; Drop operations.
+     * {@code true} if the DropTarget is accepting Drag &amp; Drop operations.
      *
      * @serial
      */
     boolean active = true;
 
< prev index next >