public virtual DataFlavor[] getTransferDataFlavors()
 {
   DataFlavor[] dataFlavorArray = new DataFlavor[1];
   int index = 0;
   DataFlavor dataFlavor = this.imageFlavor;
   dataFlavorArray[index] = dataFlavor;
   return dataFlavorArray;
 }
 public virtual object getTransferData(DataFlavor flavor)
 {
   if (this.imageFlavor.equals(flavor))
   {
     return (object) this.chart.createBufferedImage(this.width, this.height);
   }
   else
   {
     DataFlavor dataFlavor = flavor;
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new UnsupportedFlavorException(dataFlavor);
   }
 }
Esempio n. 3
0
        /// <summary>
        /// Returns whether or not the current contents of this clipboard can be
        /// provided in the specified <code>DataFlavor</code>.
        /// </summary>
        /// <param name="flavor"> the requested <code>DataFlavor</code> for the contents
        /// </param>
        /// <returns> <code>true</code> if the current contents of this clipboard
        ///         can be provided in the specified <code>DataFlavor</code>;
        ///         <code>false</code> otherwise
        /// </returns>
        /// <exception cref="NullPointerException"> if <code>flavor</code> is <code>null</code> </exception>
        /// <exception cref="IllegalStateException"> if this clipboard is currently unavailable
        ///
        /// @since 1.5 </exception>
        public virtual bool IsDataFlavorAvailable(DataFlavor flavor)
        {
            if (flavor == null)
            {
                throw new NullPointerException("flavor");
            }

            Transferable cntnts = GetContents(null);

            if (cntnts == null)
            {
                return(false);
            }
            return(cntnts.IsDataFlavorSupported(flavor));
        }
Esempio n. 4
0
        /// <summary>
        /// Returns an object representing the current contents of this clipboard
        /// in the specified <code>DataFlavor</code>.
        /// The class of the object returned is defined by the representation
        /// class of <code>flavor</code>.
        /// </summary>
        /// <param name="flavor"> the requested <code>DataFlavor</code> for the contents
        /// </param>
        /// <returns> an object representing the current contents of this clipboard
        ///         in the specified <code>DataFlavor</code>
        /// </returns>
        /// <exception cref="NullPointerException"> if <code>flavor</code> is <code>null</code> </exception>
        /// <exception cref="IllegalStateException"> if this clipboard is currently unavailable </exception>
        /// <exception cref="UnsupportedFlavorException"> if the requested <code>DataFlavor</code>
        ///         is not available </exception>
        /// <exception cref="IOException"> if the data in the requested <code>DataFlavor</code>
        ///         can not be retrieved
        /// </exception>
        /// <seealso cref= DataFlavor#getRepresentationClass
        ///
        /// @since 1.5 </seealso>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public Object getData(DataFlavor flavor) throws UnsupportedFlavorException, java.io.IOException
        public virtual Object GetData(DataFlavor flavor)
        {
            if (flavor == null)
            {
                throw new NullPointerException("flavor");
            }

            Transferable cntnts = GetContents(null);

            if (cntnts == null)
            {
                throw new UnsupportedFlavorException(flavor);
            }
            return(cntnts.GetTransferData(flavor));
        }
    public ChartTransferable(JFreeChart chart, int width, int height, bool cloneData)
    {
      base.\u002Ector();
      ChartTransferable chartTransferable = this;
      this.imageFlavor = new DataFlavor("image/x-java-image; class=java.awt.Image", "Image");
      try
      {
        this.chart = (JFreeChart) chart.clone();
        goto label_4;
      }
      catch (CloneNotSupportedException ex)
      {
      }
      this.chart = chart;
label_4:
      this.width = width;
      this.height = height;
    }
Esempio n. 6
0
 /// <summary>
 /// Compares the <code>mimeType</code> of two <code>DataFlavor</code>
 /// objects.
 /// </summary>
 public bool isMimeTypeEqual(DataFlavor @dataFlavor)
 {
     return(default(bool));
 }
		/// <summary>
		/// Indicates whether a component would accept an import of the given
		/// set of data flavors prior to actually attempting to import it.
		/// </summary>
		public bool canImport(JComponent @comp, DataFlavor[] @transferFlavors)
		{
			return default(bool);
		}
 public virtual bool isDataFlavorSupported(DataFlavor flavor)
 {
   return (this.imageFlavor.equals(flavor) ? 1 : 0) != 0;
 }
Esempio n. 9
0
		/// <summary>
		/// Compares the <code>mimeType</code> of two <code>DataFlavor</code>
		/// objects.
		/// </summary>
		public bool isMimeTypeEqual(DataFlavor @dataFlavor)
		{
			return default(bool);
		}
		/// <summary>
		/// This method returns a <code>boolean</code> indicating
		/// if the specified <code>DataFlavor</code> is supported.
		/// </summary>
		public bool isDataFlavorSupported(DataFlavor @df)
		{
			return default(bool);
		}
Esempio n. 11
0
		/// <summary>
		/// Tests a <code>DataFlavor</code> to this <code>DataFlavor</code> for
		/// equality.
		/// </summary>
		public bool equals(DataFlavor @that)
		{
			return default(bool);
		}
Esempio n. 12
0
		/// <summary>
		/// Selects the best text <code>DataFlavor</code> from an array of <code>
		/// DataFlavor</code>s.
		/// </summary>
		public DataFlavor selectBestTextFlavor(DataFlavor[] @availableFlavors)
		{
			return default(DataFlavor);
		}
Esempio n. 13
0
		/// <summary>
		/// Tests a <code>DataFlavor</code> to this <code>DataFlavor</code> for
		/// equality.
		/// </summary>
		public bool match(DataFlavor @that)
		{
			return default(bool);
		}
Esempio n. 14
0
 /// <summary>
 /// Tests a <code>DataFlavor</code> to this <code>DataFlavor</code> for
 /// equality.
 /// </summary>
 public bool match(DataFlavor @that)
 {
     return(default(bool));
 }
		/// <summary>
		/// This method returns a <code>boolean</code>
		/// indicating if the given <code>DataFlavor</code> is
		/// supported by this <code>DropTargetContext</code>.
		/// </summary>
		protected bool isDataFlavorSupported(DataFlavor @df)
		{
			return default(bool);
		}
Esempio n. 16
0
 /// <summary>
 /// Tests a <code>DataFlavor</code> to this <code>DataFlavor</code> for
 /// equality.
 /// </summary>
 public bool equals(DataFlavor @that)
 {
     return(default(bool));
 }
 /// <summary>
 /// Constructs an UnsupportedFlavorException.
 /// </summary>
 /// <param name="flavor"> the flavor object which caused the exception. May
 ///        be <code>null</code>. </param>
 public UnsupportedFlavorException(DataFlavor flavor) : base((flavor != null) ? flavor.HumanPresentableName : null)
 {
 }