예제 #1
0
        /// <summary>
        /// Creates a new DropTarget given the <code>Component</code>
        /// to associate itself with, an <code>int</code> 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>).
        /// <P>
        /// The Component will receive drops only if it is enabled. </summary>
        /// <param name="c">         The <code>Component</code> with which this <code>DropTarget</code> is associated </param>
        /// <param name="ops">       The default acceptable actions for this <code>DropTarget</code> </param>
        /// <param name="dtl">       The <code>DropTargetListener</code> for this <code>DropTarget</code> </param>
        /// <param name="act">       Is the <code>DropTarget</code> accepting drops. </param>
        /// <param name="fm">        The <code>FlavorMap</code> to use, or null for the default <CODE>FlavorMap</CODE> </param>
        /// <exception cref="HeadlessException"> if GraphicsEnvironment.isHeadless()
        ///            returns true </exception>
        /// <seealso cref= java.awt.GraphicsEnvironment#isHeadless </seealso>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public DropTarget(java.awt.Component c, int ops, DropTargetListener dtl, boolean act, java.awt.datatransfer.FlavorMap fm) throws java.awt.HeadlessException
        public DropTarget(Component c, int ops, DropTargetListener dtl, bool act, FlavorMap fm)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
            if (GraphicsEnvironment.Headless)
            {
                throw new HeadlessException();
            }

            Component_Renamed = c;

            DefaultActions = ops;

            if (dtl != null)
            {
                try
                {
                    AddDropTargetListener(dtl);
                }
                catch (TooManyListenersException)
                {
                    // do nothing!
                }
            }

            if (c != null)
            {
                c.DropTarget = this;
                Active       = act;
            }

            if (fm != null)
            {
                FlavorMap_Renamed = fm;
            }
            else
            {
                FlavorMap_Renamed = SystemFlavorMap.DefaultFlavorMap;
            }
        }
예제 #2
0
 /// <summary>
 /// Creates a new DropTarget given the <code>Component</code>
 /// to associate itself with, an <code>int</code> 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>).
 /// </summary>
 public DropTarget(Component @c, int @ops, DropTargetListener @dtl, bool @act, FlavorMap @fm)
 {
 }
예제 #3
0
 /// <summary>
 /// Sets the <code>FlavorMap</code> associated
 /// with this <code>DropTarget</code>.
 /// </summary>
 public void setFlavorMap(FlavorMap @fm)
 {
 }
예제 #4
0
        /// <summary>
        /// Start a drag, given the <code>DragGestureEvent</code>
        /// that initiated the drag, the initial
        /// <code>Cursor</code> to use,
        /// the <code>Transferable</code> subject data
        /// of the drag, the <code>DragSourceListener</code>,
        /// and the <code>FlavorMap</code>.
        /// <P> </summary>
        /// <param name="trigger">        the <code>DragGestureEvent</code> that
        /// initiated the drag </param>
        /// <param name="dragCursor">     the initial {@code Cursor} for this drag operation
        ///                       or {@code null} for the default cursor handling;
        ///                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
        ///                       for more details on the cursor handling mechanism during drag and drop </param>
        /// <param name="transferable">   the subject data of the drag </param>
        /// <param name="dsl">            the <code>DragSourceListener</code> </param>
        /// <param name="flavorMap">      the <code>FlavorMap</code> to use or <code>null</code>
        /// <P> </param>
        /// <exception cref="java.awt.dnd.InvalidDnDOperationException">
        ///    if the Drag and Drop
        ///    system is unable to initiate a drag operation, or if the user
        ///    attempts to start a drag while an existing drag operation
        ///    is still executing </exception>

//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void startDrag(DragGestureEvent trigger, java.awt.Cursor dragCursor, java.awt.datatransfer.Transferable transferable, DragSourceListener dsl, java.awt.datatransfer.FlavorMap flavorMap) throws InvalidDnDOperationException
        public virtual void StartDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable transferable, DragSourceListener dsl, FlavorMap flavorMap)
        {
            StartDrag(trigger, dragCursor, null, null, transferable, dsl, flavorMap);
        }
예제 #5
0
        /// <summary>
        /// Start a drag, given the <code>DragGestureEvent</code>
        /// that initiated the drag, the initial
        /// <code>Cursor</code> to use,
        /// the <code>Image</code> to drag,
        /// the offset of the <code>Image</code> origin
        /// from the hotspot of the <code>Cursor</code> at
        /// the instant of the trigger,
        /// the <code>Transferable</code> subject data
        /// of the drag, the <code>DragSourceListener</code>,
        /// and the <code>FlavorMap</code>.
        /// <P> </summary>
        /// <param name="trigger">        the <code>DragGestureEvent</code> that initiated the drag </param>
        /// <param name="dragCursor">     the initial {@code Cursor} for this drag operation
        ///                       or {@code null} for the default cursor handling;
        ///                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
        ///                       for more details on the cursor handling mechanism during drag and drop </param>
        /// <param name="dragImage">      the image to drag or {@code null} </param>
        /// <param name="imageOffset">    the offset of the <code>Image</code> origin from the hotspot
        ///                       of the <code>Cursor</code> at the instant of the trigger </param>
        /// <param name="transferable">   the subject data of the drag </param>
        /// <param name="dsl">            the <code>DragSourceListener</code> </param>
        /// <param name="flavorMap">      the <code>FlavorMap</code> to use, or <code>null</code>
        /// <P> </param>
        /// <exception cref="java.awt.dnd.InvalidDnDOperationException">
        ///    if the Drag and Drop
        ///    system is unable to initiate a drag operation, or if the user
        ///    attempts to start a drag while an existing drag operation
        ///    is still executing </exception>

//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void startDrag(DragGestureEvent trigger, java.awt.Cursor dragCursor, java.awt.Image dragImage, java.awt.Point imageOffset, java.awt.datatransfer.Transferable transferable, DragSourceListener dsl, java.awt.datatransfer.FlavorMap flavorMap) throws InvalidDnDOperationException
        public virtual void StartDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable transferable, DragSourceListener dsl, FlavorMap flavorMap)
        {
            SunDragSourceContextPeer.DragDropInProgress = true;

            try
            {
                if (flavorMap != null)
                {
                    this.FlavorMap_Renamed = flavorMap;
                }

                DragSourceContextPeer dscp = Toolkit.DefaultToolkit.CreateDragSourceContextPeer(trigger);

                DragSourceContext dsc = CreateDragSourceContext(dscp, trigger, dragCursor, dragImage, imageOffset, transferable, dsl);

                if (dsc == null)
                {
                    throw new InvalidDnDOperationException();
                }

                dscp.StartDrag(dsc, dsc.Cursor, dragImage, imageOffset);                 // may throw
            }
            catch (RuntimeException e)
            {
                SunDragSourceContextPeer.DragDropInProgress = false;
                throw e;
            }
        }
예제 #6
0
		/// <summary>
		/// Creates a new DropTarget given the <code>Component</code>
		/// to associate itself with, an <code>int</code> 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>).
		/// </summary>
		public DropTarget(Component @c, int @ops, DropTargetListener @dtl, bool @act, FlavorMap @fm)
		{
		}
예제 #7
0
		/// <summary>
		/// Sets the <code>FlavorMap</code> associated
		/// with this <code>DropTarget</code>.
		/// </summary>
		public void setFlavorMap(FlavorMap @fm)
		{
		}