Exemplo n.º 1
0
 /// <summary>
 /// Constructs a <code>TransferableProxy</code> given
 /// a specified <code>Transferable</code> object representing
 /// data transfer for a particular drag-n-drop operation and
 /// a <code>boolean</code> which indicates whether the
 /// drag-n-drop operation is local (within the same JVM).
 /// <para>
 /// </para>
 /// </summary>
 /// <param name="t"> the <code>Transferable</code> object </param>
 /// <param name="local"> <code>true</code>, if <code>t</code> represents
 ///        the result of local drag-n-drop operation </param>
 internal TransferableProxy(DropTargetContext outerInstance, Transferable t, bool local)
 {
     this.OuterInstance = outerInstance;
     Proxy        = new sun.awt.datatransfer.TransferableProxy(t, local);
     Transferable = t;
     IsLocal      = local;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Construct a <code>DropTargetDragEvent</code> given the
        /// <code>DropTargetContext</code> for this operation,
        /// the location of the "Drag" <code>Cursor</code>'s hotspot
        /// in the <code>Component</code>'s coordinates, the
        /// user drop action, and the source drop actions.
        /// <P> </summary>
        /// <param name="dtc">        The DropTargetContext for this operation </param>
        /// <param name="cursorLocn"> The location of the "Drag" Cursor's
        /// hotspot in Component coordinates </param>
        /// <param name="dropAction"> The user drop action </param>
        /// <param name="srcActions"> The source drop actions
        /// </param>
        /// <exception cref="NullPointerException"> if cursorLocn is null </exception>
        /// <exception cref="IllegalArgumentException"> if dropAction is not one of
        ///         <code>DnDConstants</code>. </exception>
        /// <exception cref="IllegalArgumentException"> if srcActions is not
        ///         a bitwise mask of <code>DnDConstants</code>. </exception>
        /// <exception cref="IllegalArgumentException"> if dtc is <code>null</code>. </exception>

        public DropTargetDragEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) : base(dtc)
        {
            if (cursorLocn == null)
            {
                throw new NullPointerException("cursorLocn");
            }

            if (dropAction != DnDConstants.ACTION_NONE && dropAction != DnDConstants.ACTION_COPY && dropAction != DnDConstants.ACTION_MOVE && dropAction != DnDConstants.ACTION_LINK)
            {
                throw new IllegalArgumentException("dropAction" + dropAction);
            }

            if ((srcActions & ~(DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK)) != 0)
            {
                throw new IllegalArgumentException("srcActions");
            }

            Location_Renamed        = cursorLocn;
            Actions                 = srcActions;
            this.DropAction_Renamed = dropAction;
        }
 /// <summary>
 /// Construct a <code>DropTargetDragEvent</code> given the
 /// <code>DropTargetContext</code> for this operation,
 /// the location of the "Drag" <code>Cursor</code>'s hotspot
 /// in the <code>Component</code>'s coordinates, the
 /// user drop action, and the source drop actions.
 /// </summary>
 public DropTargetDragEvent(DropTargetContext @dtc, Point @cursorLocn, int @dropAction, int @srcActions)
     : base(null)
 {
 }
		/// <summary>
		/// Construct a <code>DropTargetEvent</code> with
		/// a specified <code>DropTargetContext</code>.
		/// </summary>
		public DropTargetEvent(DropTargetContext @dtc)
		{
		}
Exemplo n.º 5
0
 /// <summary>
 /// Rejects the drag as a result of examining either the
 /// <code>dropAction</code> or the available <code>DataFlavor</code>
 /// types.
 /// </summary>
 public virtual void RejectDrag()
 {
     DropTargetContext.RejectDrag();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Accepts the drag.
 ///
 /// This method should be called from a
 /// <code>DropTargetListeners</code> <code>dragEnter</code>,
 /// <code>dragOver</code>, and <code>dropActionChanged</code>
 /// methods if the implementation wishes to accept an operation
 /// from the srcActions other than the one selected by
 /// the user as represented by the <code>dropAction</code>.
 /// </summary>
 /// <param name="dragOperation"> the operation accepted by the target </param>
 public virtual void AcceptDrag(int dragOperation)
 {
     DropTargetContext.AcceptDrag(dragOperation);
 }
Exemplo n.º 7
0
        /// <summary>
        /// This method returns a <code>boolean</code> indicating
        /// if the specified <code>DataFlavor</code> is supported.
        /// <P> </summary>
        /// <param name="df"> the <code>DataFlavor</code> to test
        /// <P> </param>
        /// <returns> if a particular DataFlavor is supported </returns>

        public virtual bool IsDataFlavorSupported(DataFlavor df)
        {
            return(DropTargetContext.IsDataFlavorSupported(df));
        }
Exemplo n.º 8
0
        /// <summary>
        /// This method notifies the <code>DragSource</code>
        /// that the drop transfer(s) are completed.
        /// <P> </summary>
        /// <param name="success"> a <code>boolean</code> indicating that the drop transfer(s) are completed. </param>

        public virtual void DropComplete(bool success)
        {
            DropTargetContext.DropComplete(success);
        }
Exemplo n.º 9
0
        /// <summary>
        /// accept the drop, using the specified action.
        /// <P> </summary>
        /// <param name="dropAction"> the specified action </param>

        public virtual void AcceptDrop(int dropAction)
        {
            DropTargetContext.AcceptDrop(dropAction);
        }
Exemplo n.º 10
0
        /// <summary>
        /// Construct a <code>DropTargetEvent</code> given the
        /// <code>DropTargetContext</code> for this operation,
        /// the location of the drag <code>Cursor</code>'s hotspot
        /// in the <code>Component</code>'s
        /// coordinates, the currently selected user drop action,
        /// the current set of actions supported by the source,
        /// and a <code>boolean</code> indicating if the source is in the same JVM
        /// as the target.
        /// <P> </summary>
        /// <param name="dtc">        The DropTargetContext for this operation </param>
        /// <param name="cursorLocn"> The location of the "Drag" Cursor's
        /// hotspot in Component's coordinates </param>
        /// <param name="dropAction"> the user drop action. </param>
        /// <param name="srcActions"> the source drop actions. </param>
        /// <param name="isLocal">  True if the source is in the same JVM as the target
        /// </param>
        /// <exception cref="NullPointerException">
        ///         if cursorLocn is  <code>null</code> </exception>
        /// <exception cref="IllegalArgumentException">
        ///         if dropAction is not one of <code>DnDConstants</code>. </exception>
        /// <exception cref="IllegalArgumentException"> if srcActions is not a bitwise mask of <code>DnDConstants</code>. </exception>
        /// <exception cref="IllegalArgumentException">  if dtc is <code>null</code>. </exception>

        public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions, bool isLocal) : this(dtc, cursorLocn, dropAction, srcActions)
        {
            IsLocalTx = isLocal;
        }
		/// <summary>
		/// Construct a <code>DropTargetDragEvent</code> given the
		/// <code>DropTargetContext</code> for this operation,
		/// the location of the "Drag" <code>Cursor</code>'s hotspot
		/// in the <code>Component</code>'s coordinates, the
		/// user drop action, and the source drop actions.
		/// </summary>
		public DropTargetDragEvent(DropTargetContext @dtc, Point @cursorLocn, int @dropAction, int @srcActions)
			: base(null)
		{
		}
		/// <summary>
		/// Construct a <code>DropTargetEvent</code> given the
		/// <code>DropTargetContext</code> for this operation,
		/// the location of the drag <code>Cursor</code>'s hotspot
		/// in the <code>Component</code>'s
		/// coordinates, the currently selected user drop action,
		/// the current set of actions supported by the source,
		/// and a <code>boolean</code> indicating if the source is in the same JVM
		/// as the target.
		/// </summary>
		public DropTargetDropEvent(DropTargetContext @dtc, Point @cursorLocn, int @dropAction, int @srcActions, bool @isLocal): base(null)
		{
		}
Exemplo n.º 13
0
 /// <summary>
 /// Construct a <code>DropTargetEvent</code> with
 /// a specified <code>DropTargetContext</code>.
 /// </summary>
 public DropTargetEvent(DropTargetContext @dtc)
 {
 }
 /// <summary>
 /// Construct a <code>DropTargetEvent</code> given the
 /// <code>DropTargetContext</code> for this operation,
 /// the location of the drag <code>Cursor</code>'s hotspot
 /// in the <code>Component</code>'s
 /// coordinates, the currently selected user drop action,
 /// the current set of actions supported by the source,
 /// and a <code>boolean</code> indicating if the source is in the same JVM
 /// as the target.
 /// </summary>
 public DropTargetDropEvent(DropTargetContext @dtc, Point @cursorLocn, int @dropAction, int @srcActions, bool @isLocal) : base(null)
 {
 }