Example #1
0
        /// <summary>
        /// Creates a <code>DropTarget</code> given the <code>Component</code>
        /// to associate itself with, and the <code>DropTargetListener</code>
        /// to handle event processing.
        /// <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="dtl">       The <code>DropTargetListener</code> for this <code>DropTarget</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, DropTargetListener dtl) throws java.awt.HeadlessException
        public DropTarget(Component c, DropTargetListener dtl) : this(c, DnDConstants.ACTION_COPY_OR_MOVE, dtl, true, null)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
        }
Example #2
0
        /// <summary>
        /// Creates a <code>DropTarget</code> given the <code>Component</code>
        /// to associate itself with, an <code>int</code> representing
        /// the default acceptable action(s) to support, and a
        /// <code>DropTargetListener</code> to handle event processing.
        /// <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>
        /// <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) throws java.awt.HeadlessException
        public DropTarget(Component c, int ops, DropTargetListener dtl) : this(c, ops, dtl, true)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
        }
Example #3
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");
                    }
                }
            }
        }
Example #4
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;
            }
        }
Example #5
0
        /// <summary>
        /// Adds a new <code>DropTargetListener</code> (UNICAST SOURCE).
        /// <P> </summary>
        /// <param name="dtl"> The new <code>DropTargetListener</code>
        /// <P> </param>
        /// <exception cref="TooManyListenersException"> if a
        /// <code>DropTargetListener</code> is already added to this
        /// <code>DropTarget</code>. </exception>

//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public synchronized void addDropTargetListener(DropTargetListener dtl) throws java.util.TooManyListenersException
        public virtual void AddDropTargetListener(DropTargetListener dtl)
        {
            lock (this)
            {
                if (dtl == null)
                {
                    return;
                }

                if (Equals(dtl))
                {
                    throw new IllegalArgumentException("DropTarget may not be its own Listener");
                }

                if (DtListener == null)
                {
                    DtListener = dtl;
                }
                else
                {
                    throw new TooManyListenersException();
                }
            }
        }
 /// <summary>
 /// Adds a new <code>DropTargetListener</code> (UNICAST SOURCE).
 /// </summary>
 public void addDropTargetListener(DropTargetListener @dtl)
 {
 }
 /// <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)
 {
 }
 /// <summary>
 /// Creates a <code>DropTarget</code> 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, and a <code>boolean</code> indicating
 /// if the <code>DropTarget</code> is currently accepting drops.
 /// </summary>
 public DropTarget(Component @c, int @ops, DropTargetListener @dtl, bool @act)
 {
 }
 /// <summary>
 /// Creates a <code>DropTarget</code> given the <code>Component</code>
 /// to associate itself with, an <code>int</code> representing
 /// the default acceptable action(s) to support, and a
 /// <code>DropTargetListener</code> to handle event processing.
 /// </summary>
 public DropTarget(Component @c, int @ops, DropTargetListener @dtl)
 {
 }
 /// <summary>
 /// Removes the current <code>DropTargetListener</code> (UNICAST SOURCE).
 /// </summary>
 public void removeDropTargetListener(DropTargetListener @dtl)
 {
 }
		/// <summary>
		/// Adds a new <code>DropTargetListener</code> (UNICAST SOURCE).
		/// </summary>
		public void addDropTargetListener(DropTargetListener @dtl)
		{
		}
		/// <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)
		{
		}
		/// <summary>
		/// Creates a <code>DropTarget</code> 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, and a <code>boolean</code> indicating
		/// if the <code>DropTarget</code> is currently accepting drops.
		/// </summary>
		public DropTarget(Component @c, int @ops, DropTargetListener @dtl, bool @act)
		{
		}
		/// <summary>
		/// Creates a <code>DropTarget</code> given the <code>Component</code>
		/// to associate itself with, an <code>int</code> representing
		/// the default acceptable action(s) to support, and a
		/// <code>DropTargetListener</code> to handle event processing.
		/// </summary>
		public DropTarget(Component @c, int @ops, DropTargetListener @dtl)
		{
		}
		/// <summary>
		/// Removes the current <code>DropTargetListener</code> (UNICAST SOURCE).
		/// </summary>
		public void removeDropTargetListener(DropTargetListener @dtl)
		{
		}