home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / Transferable.java < prev    next >
Text File  |  1997-05-20  |  2KB  |  67 lines

  1. /*
  2.  * @(#)Transferable.java    1.3 97/02/12
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.awt.datatransfer;
  24.  
  25. import java.io.IOException;
  26.  
  27. /**
  28.  * Defines the interface for classes that can be used to provide data
  29.  * for a transfer operation.
  30.  *
  31.  * @version     1.3, 02/12/97
  32.  * @author    Amy Fowler  
  33.  */
  34.  
  35. public interface Transferable {
  36.  
  37.     /**
  38.      * Returns an array of DataFlavor objects indicating the flavors the data 
  39.      * can be provided in.  The array should be ordered according to preference
  40.      * for providing the data (from most richly descriptive to least descriptive).
  41.      * @return an array of data flavors in which this data can be transferred
  42.      */
  43.     public DataFlavor[] getTransferDataFlavors();
  44.  
  45.     /**
  46.      * Returns whether or not the specified data flavor is supported for
  47.      * this object.
  48.      * @param flavor the requested flavor for the data
  49.      * @return boolean indicating wjether or not the data flavor is supported
  50.      */
  51.     public boolean isDataFlavorSupported(DataFlavor flavor);
  52.  
  53.     /**
  54.      * Returns an object which represents the data to be transferred.  The class 
  55.      * of the object returned is defined by the representation class of the flavor.
  56.      *
  57.      * @param flavor the requested flavor for the data
  58.      * @see DataFlavor#getRepresentationClass
  59.      * @exception IOException                if the data is no longer available
  60.      *              in the requested flavor.
  61.      * @exception UnsupportedFlavorException if the requested data flavor is
  62.      *              not supported.
  63.      */
  64.     public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException;
  65.  
  66. }
  67.