Package java.awt.datatransfer

Examples of java.awt.datatransfer.UnsupportedFlavorException


    }

    private Object getURL(DataFlavor f)
            throws IOException, UnsupportedFlavorException {
        if (!data.isNativeFormatAtailable(DataProvider.FORMAT_URL)) {
            throw new UnsupportedFlavorException(f);
        }
        String str = data.getURL();
        if (str == null) {
            throw new IOException("Data is not available");
        }
        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.isNativeFormatAtailable(nativeFormat)) {
            throw new UnsupportedFlavorException(f);
        }
        byte bytes[] = data.getSerializedObject(f.getRepresentationClass());
        if (bytes == null) {
            throw new IOException("Data is not available");
        }
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.isNativeFormatAtailable(DataProvider.FORMAT_IMAGE)) {
            throw new UnsupportedFlavorException(f);
        }
        RawBitmap bitmap = data.getRawBitmap();
        if (bitmap == null) {
            throw new IOException("Data is not available");
        }
View Full Code Here

            return messages ;
        }
      
        else
        {
            throw new UnsupportedFlavorException(flavour) ;
        }
    }
View Full Code Here

            return messages ;
        }
      
        else
        {
            throw new UnsupportedFlavorException(flavour) ;
        }
    }
View Full Code Here

        public Object getTransferData(DataFlavor df)
            throws UnsupportedFlavorException, IOException {
            if (isDataFlavorSupported (df))
                return object;
            else
                throw new UnsupportedFlavorException(df);
        }
View Full Code Here

                            throws UnsupportedFlavorException, IOException {
                          if (flavor.getHumanPresentableName().equals(
                              DefaultGraphCell.class.getSimpleName()))
                            return this;
                          else
                            throw new UnsupportedFlavorException(flavor);
                        }

                        public DataFlavor[] getTransferDataFlavors() {
                          return new DataFlavor[] { new DataFlavor(
                              DefaultGraphCell.class, DefaultGraphCell.class
View Full Code Here

                            return false;
                        }
                        public Object getTransferData(DataFlavor flavor)
                            throws UnsupportedFlavorException
                        {
                            throw new UnsupportedFlavorException(flavor);
                        }
                    };
            }
            transferable = emptyTransferable;
        }
View Full Code Here

     
     
     
      public Object getTransferData(java.awt.datatransfer.DataFlavor df) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException {
          if(!df.equals(LINKABLE_FLAVOR)){
              throw new UnsupportedFlavorException(df);
          }
          return this;
      }
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.