Package java.awt.datatransfer

Examples of java.awt.datatransfer.UnsupportedFlavorException


    }

    private Object getURL(DataFlavor f)
            throws IOException, UnsupportedFlavorException {
        if (!data.isNativeFormatAvailable(DataProvider.FORMAT_URL)) {
            throw new UnsupportedFlavorException(f);
        }
        String str = data.getURL();
        if (str == null) {
            // awt.4F=Data is not available
            throw new IOException(Messages.getString("awt.4F")); //$NON-NLS-1$
        }
        URL url = new URL(str);
        if (f.getRepresentationClass().isAssignableFrom(URL.class)) {
            return url;
        }
        if (f.isFlavorTextType()) {
            return getTextRepresentation(url.toString(), f);
        }
        throw new UnsupportedFlavorException(f);
    }
View Full Code Here


    private Object getSerializedObject(DataFlavor f)
            throws IOException, UnsupportedFlavorException {
        String nativeFormat = SystemFlavorMap.encodeDataFlavor(f);
        if ((nativeFormat == null) ||
                !data.isNativeFormatAvailable(nativeFormat)) {
            throw new UnsupportedFlavorException(f);
        }
        byte bytes[] = data.getSerializedObject(f.getRepresentationClass());
        if (bytes == null) {
            // awt.4F=Data is not available
            throw new IOException(Messages.getString("awt.4F")); //$NON-NLS-1$
View Full Code Here

        }
        if (f.isRepresentationClassInputStream()) {
            byte[] bytes = text.getBytes(charset);
            return new ByteArrayInputStream(bytes);
        }
        throw new UnsupportedFlavorException(f);
    }
View Full Code Here

    }

    private Image getImage(DataFlavor f)
            throws IOException, UnsupportedFlavorException {
        if (!data.isNativeFormatAvailable(DataProvider.FORMAT_IMAGE)) {
            throw new UnsupportedFlavorException(f);
        }
        RawBitmap bitmap = data.getRawBitmap();
        if (bitmap == null) {
            // awt.4F=Data is not available
            throw new IOException(Messages.getString("awt.4F")); //$NON-NLS-1$
View Full Code Here

      this.dropY = dropY;
    }
    public Object getTransferData(DataFlavor flavor)
    throws UnsupportedFlavorException, IOException {
      if (!isDataFlavorSupported(flavor)) {
        UnsupportedFlavorException errorVar = new UnsupportedFlavorException(flavor);
        ErrorMgr.addError(errorVar);
        throw errorVar;
      }
      return this;
    }
View Full Code Here

    public void setSourceData(List<File> fileList) {
      this.fileList = fileList;
    }
    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
      if (!isDataFlavorSupported(flavor)) {
        UnsupportedFlavorException errorVar = new UnsupportedFlavorException(flavor);
        ErrorMgr.addError(errorVar);
        throw errorVar;
      }
      return getSourceData();
    }
View Full Code Here

        /**
         * Returns Image object housed by this Transferable object
         */
        public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
            if (!DataFlavor.imageFlavor.equals(flavor)) {
                throw new UnsupportedFlavorException(flavor);
            }
            return image;
        }
View Full Code Here

      this.dropY = dropY;
    }
    public Object getTransferData(DataFlavor flavor)
    throws UnsupportedFlavorException, IOException {
      if (!isDataFlavorSupported(flavor)) {
        UnsupportedFlavorException errorVar = new UnsupportedFlavorException(flavor);
        ErrorMgr.addError(errorVar);
        throw errorVar;
      }
      return this;
    }
View Full Code Here

    public void setSourceData(List<File> fileList) {
      this.fileList = fileList;
    }
    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
      if (!isDataFlavorSupported(flavor)) {
        UnsupportedFlavorException errorVar = new UnsupportedFlavorException(flavor);
        ErrorMgr.addError(errorVar);
        throw errorVar;
      }
      return getSourceData();
    }
View Full Code Here

            return _objectList.iterator();
        } else if (flavor.equals(DataFlavor.stringFlavor)) {
            return _getMoML();
        }

        throw new UnsupportedFlavorException(flavor);
    }
View Full Code Here

TOP

Related Classes of java.awt.datatransfer.UnsupportedFlavorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.