예제 #1
0
        /// <summary>
        /// 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>
        /// is not active.
        /// </summary>
        /// <param name="dtde"> the <code>DropTargetDragEvent</code>
        /// </param>
        /// <exception cref="NullPointerException"> if this <code>DropTarget</code>
        ///         is active and <code>dtde</code> is <code>null</code>
        /// </exception>
        /// <seealso cref= #isActive </seealso>
        public virtual void DropActionChanged(DropTargetDragEvent dtde)
        {
            lock (this)
            {
                if (!Active_Renamed)
                {
                    return;
                }

                if (DtListener != null)
                {
                    DtListener.DropActionChanged(dtde);
                }

                UpdateAutoscroll(dtde.Location);
            }
        }
예제 #2
0
        /// <summary>
        /// Removes the current <code>DropTargetListener</code> (UNICAST SOURCE).
        /// <P> </summary>
        /// <param name="dtl"> the DropTargetListener to deregister. </param>

        public virtual void RemoveDropTargetListener(DropTargetListener dtl)
        {
            lock (this)
            {
                if (dtl != null && DtListener != null)
                {
                    if (DtListener.Equals(dtl))
                    {
                        DtListener = null;
                    }
                    else
                    {
                        throw new IllegalArgumentException("listener mismatch");
                    }
                }
            }
        }
예제 #3
0
        /// <summary>
        /// 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.
        /// </summary>
        /// <param name="dtde"> the <code>DropTargetDropEvent</code>
        /// </param>
        /// <exception cref="NullPointerException"> if <code>dtde</code> 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.
        /// </exception>
        /// <seealso cref= #isActive </seealso>
        public virtual void Drop(DropTargetDropEvent dtde)
        {
            lock (this)
            {
                IsDraggingInside = false;

                ClearAutoscroll();

                if (DtListener != null && Active_Renamed)
                {
                    DtListener.Drop(dtde);
                }
                else                 // we should'nt get here ...
                {
                    dtde.RejectDrop();
                }
            }
        }
예제 #4
0
        /// <summary>
        /// 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>
        /// is not active.
        /// <para>
        /// This method itself does not throw any exception
        /// for null parameter but for exceptions thrown by
        /// the respective method of the listener.
        ///
        /// </para>
        /// </summary>
        /// <param name="dte"> the <code>DropTargetEvent</code>
        /// </param>
        /// <seealso cref= #isActive </seealso>
        public virtual void DragExit(DropTargetEvent dte)
        {
            lock (this)
            {
                IsDraggingInside = false;

                if (!Active_Renamed)
                {
                    return;
                }

                if (DtListener != null && Active_Renamed)
                {
                    DtListener.DragExit(dte);
                }

                ClearAutoscroll();
            }
        }
예제 #5
0
        /// <summary>
        /// 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>
        /// is not active.
        /// </summary>
        /// <param name="dtde"> the <code>DropTargetDragEvent</code>
        /// </param>
        /// <exception cref="NullPointerException"> if this <code>DropTarget</code>
        ///         is active and <code>dtde</code> is <code>null</code>
        /// </exception>
        /// <seealso cref= #isActive </seealso>
        public virtual void DragEnter(DropTargetDragEvent dtde)
        {
            lock (this)
            {
                IsDraggingInside = true;

                if (!Active_Renamed)
                {
                    return;
                }

                if (DtListener != null)
                {
                    DtListener.DragEnter(dtde);
                }
                else
                {
                    dtde.DropTargetContext.TargetActions = DnDConstants.ACTION_NONE;
                }

                InitializeAutoscrolling(dtde.Location);
            }
        }