/// <summary>
        /// Calls <code>dragDropEnd</code> on the
        /// <code>DragSourceListener</code>s registered with this
        /// <code>DragSourceContext</code> and with the associated
        /// <code>DragSource</code>, and passes them the specified
        /// <code>DragSourceDropEvent</code>.
        /// </summary>
        /// <param name="dsde"> the <code>DragSourceDropEvent</code> </param>
        public virtual void DragDropEnd(DragSourceDropEvent dsde)
        {
            DragSourceListener dsl = Listener;

            if (dsl != null)
            {
                dsl.DragDropEnd(dsde);
            }
            DragSource.ProcessDragDropEnd(dsde);
        }
        /// <summary>
        /// Calls <code>dropActionChanged</code> on the
        /// <code>DragSourceListener</code>s registered with this
        /// <code>DragSourceContext</code> and with the associated
        /// <code>DragSource</code>, and passes them the specified
        /// <code>DragSourceDragEvent</code>.
        /// </summary>
        /// <param name="dsde"> the <code>DragSourceDragEvent</code> </param>
        public virtual void DropActionChanged(DragSourceDragEvent dsde)
        {
            DragSourceListener dsl = Listener;

            if (dsl != null)
            {
                dsl.DropActionChanged(dsde);
            }
            DragSource.ProcessDropActionChanged(dsde);

            UpdateCurrentCursor(SourceActions, dsde.TargetActions, CHANGED);
        }
        /// <summary>
        /// Calls <code>dragExit</code> on the
        /// <code>DragSourceListener</code>s registered with this
        /// <code>DragSourceContext</code> and with the associated
        /// <code>DragSource</code>, and passes them the specified
        /// <code>DragSourceEvent</code>.
        /// </summary>
        /// <param name="dse"> the <code>DragSourceEvent</code> </param>
        public virtual void DragExit(DragSourceEvent dse)
        {
            DragSourceListener dsl = Listener;

            if (dsl != null)
            {
                dsl.DragExit(dse);
            }
            DragSource.ProcessDragExit(dse);

            UpdateCurrentCursor(DnDConstants.ACTION_NONE, DnDConstants.ACTION_NONE, DEFAULT);
        }
        /// <summary>
        /// Calls <code>dragOver</code> on the
        /// <code>DragSourceListener</code>s registered with this
        /// <code>DragSourceContext</code> and with the associated
        /// <code>DragSource</code>, and passes them the specified
        /// <code>DragSourceDragEvent</code>.
        /// </summary>
        /// <param name="dsde"> the <code>DragSourceDragEvent</code> </param>
        public virtual void DragOver(DragSourceDragEvent dsde)
        {
            DragSourceListener dsl = Listener;

            if (dsl != null)
            {
                dsl.DragOver(dsde);
            }
            DragSource.ProcessDragOver(dsde);

            UpdateCurrentCursor(SourceActions, dsde.TargetActions, OVER);
        }
Example #5
0
        /// <summary>
        /// Deserializes this <code>DragGestureRecognizer</code>. This method first
        /// performs default deserialization for all non-<code>transient</code>
        /// fields. This object's <code>DragGestureListener</code> is then
        /// deserialized as well by using the next object in the stream.
        ///
        /// @since 1.4
        /// </summary>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") private void readObject(java.io.ObjectInputStream s) throws ClassNotFoundException, java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        private void ReadObject(ObjectInputStream s)
        {
            ObjectInputStream.GetField f = s.ReadFields();

            DragSource newDragSource = (DragSource)f.Get("dragSource", null);

            if (newDragSource == null)
            {
                throw new InvalidObjectException("null DragSource");
            }
            DragSource_Renamed = newDragSource;

            Component_Renamed     = (Component)f.Get("component", null);
            SourceActions_Renamed = f.Get("sourceActions", 0) & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);
            Events = (List <InputEvent>)f.Get("events", new List <>(1));

            DragGestureListener = (DragGestureListener)s.ReadObject();
        }
Example #6
0
        /// <summary>
        /// Construct a new <code>DragGestureRecognizer</code>
        /// given the <code>DragSource</code> to be used
        /// in this Drag and Drop operation, the <code>Component</code>
        /// this <code>DragGestureRecognizer</code> should "observe"
        /// for drag initiating gestures, the action(s) supported
        /// for this Drag and Drop operation, and the
        /// <code>DragGestureListener</code> to notify
        /// once a drag initiating gesture has been detected.
        /// <P> </summary>
        /// <param name="ds">  the <code>DragSource</code> this
        /// <code>DragGestureRecognizer</code>
        /// will use to process the Drag and Drop operation
        /// </param>
        /// <param name="c"> the <code>Component</code>
        /// this <code>DragGestureRecognizer</code>
        /// should "observe" the event stream to,
        /// in order to detect a drag initiating gesture.
        /// If this value is <code>null</code>, the
        /// <code>DragGestureRecognizer</code>
        /// is not associated with any <code>Component</code>.
        /// </param>
        /// <param name="sa">  the set (logical OR) of the
        /// <code>DnDConstants</code>
        /// that this Drag and Drop operation will support
        /// </param>
        /// <param name="dgl"> the <code>DragGestureRecognizer</code>
        /// to notify when a drag gesture is detected
        /// <P> </param>
        /// <exception cref="IllegalArgumentException">
        /// if ds is <code>null</code>. </exception>

        protected internal DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl) : base()
        {
            if (ds == null)
            {
                throw new IllegalArgumentException("null DragSource");
            }

            DragSource_Renamed    = ds;
            Component_Renamed     = c;
            SourceActions_Renamed = sa & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);

            try
            {
                if (dgl != null)
                {
                    AddDragGestureListener(dgl);
                }
            }
            catch (TooManyListenersException)
            {
                // cant happen ...
            }
        }
Example #7
0
        /// <summary>
        /// Construct a new <code>DragGestureRecognizer</code>
        /// given the <code>DragSource</code> to be used in this
        /// Drag and Drop operation.
        /// <P> </summary>
        /// <param name="ds"> the <code>DragSource</code> this
        /// <code>DragGestureRecognizer</code> will
        /// use to process the Drag and Drop operation
        /// <P> </param>
        /// <exception cref="IllegalArgumentException">
        /// if ds is <code>null</code>. </exception>

        protected internal DragGestureRecognizer(DragSource ds) : this(ds, null)
        {
        }
Example #8
0
        /// <summary>
        /// Construct a new <code>DragGestureRecognizer</code>
        /// given the <code>DragSource</code> to be used
        /// in this Drag and Drop operation, and
        /// the <code>Component</code> this
        /// <code>DragGestureRecognizer</code>
        /// should "observe" for drag initiating gestures.
        /// <P> </summary>
        /// <param name="ds"> the <code>DragSource</code> this
        /// <code>DragGestureRecognizer</code>
        /// will use to process the Drag and Drop operation
        /// </param>
        /// <param name="c"> the <code>Component</code>
        /// this <code>DragGestureRecognizer</code>
        /// should "observe" the event stream to,
        /// in order to detect a drag initiating gesture.
        /// If this value is <code>null</code>,
        /// the <code>DragGestureRecognizer</code>
        /// is not associated with any <code>Component</code>.
        /// <P> </param>
        /// <exception cref="IllegalArgumentException">
        /// if ds is <code>null</code>. </exception>

        protected internal DragGestureRecognizer(DragSource ds, Component c) : this(ds, c, DnDConstants.ACTION_NONE)
        {
        }
Example #9
0
        /// <summary>
        /// Construct a new <code>DragGestureRecognizer</code>
        /// given the <code>DragSource</code> to be used in this
        /// Drag and Drop
        /// operation, the <code>Component</code> this
        /// <code>DragGestureRecognizer</code> should "observe"
        /// for drag initiating gestures, and the action(s)
        /// supported for this Drag and Drop operation.
        /// <P> </summary>
        /// <param name="ds">  the <code>DragSource</code> this
        /// <code>DragGestureRecognizer</code> will use to
        /// process the Drag and Drop operation
        /// </param>
        /// <param name="c">   the <code>Component</code> this
        /// <code>DragGestureRecognizer</code> should "observe" the event
        /// stream to, in order to detect a drag initiating gesture.
        /// If this value is <code>null</code>, the
        /// <code>DragGestureRecognizer</code>
        /// is not associated with any <code>Component</code>.
        /// </param>
        /// <param name="sa"> the set (logical OR) of the <code>DnDConstants</code>
        /// that this Drag and Drop operation will support
        /// <P> </param>
        /// <exception cref="IllegalArgumentException">
        /// if ds is <code>null</code>. </exception>

        protected internal DragGestureRecognizer(DragSource ds, Component c, int sa) : this(ds, c, sa, null)
        {
        }
 /// <summary>
 /// Calls <code>dragMouseMoved</code> on the
 /// <code>DragSourceMotionListener</code>s registered with the
 /// <code>DragSource</code> associated with this
 /// <code>DragSourceContext</code>, and them passes the specified
 /// <code>DragSourceDragEvent</code>.
 /// </summary>
 /// <param name="dsde"> the <code>DragSourceDragEvent</code>
 /// @since 1.4 </param>
 public virtual void DragMouseMoved(DragSourceDragEvent dsde)
 {
     DragSource.ProcessDragMouseMoved(dsde);
 }