コード例 #1
0
ファイル: DragSource.cs プロジェクト: ranganathsb/JavaSharp
        /// <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;
            }
        }
コード例 #2
0
 public TransferableAnonymousInnerClassHelper(DragSourceContext outerInstance)
 {
     this.OuterInstance = outerInstance;
 }