@Test public void testGetWithURLFlavorReturnsLocationAsUrl() throws Exception { assertEquals(new URL(identifier.getLocation()), classToBeTested.getTransferData(getURLFlavor())); }
@Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (getStringFlavor().equals(flavor)) { return identifier.getName(); } if (getURLFlavor().equals(flavor)) { return new URL(identifier.getLocation()); } if (getLayerIdentifierFlavor().equals(flavor)) { return identifier; } return null; }
LayerIdentifierTransferable implements Transferable { @Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (getStringFlavor().equals(flavor)) { return identifier.getName(); } if (getURLFlavor().equals(flavor)) { return new URL(identifier.getLocation()); } if (getLayerIdentifierFlavor().equals(flavor)) { return identifier; } return null; } }
LayerIdentifierTransferable implements Transferable { @Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (getStringFlavor().equals(flavor)) { return identifier.getName(); } if (getURLFlavor().equals(flavor)) { return new URL(identifier.getLocation()); } if (getLayerIdentifierFlavor().equals(flavor)) { return identifier; } return null; } LayerIdentifierTransferable(LayerIdentifier identifier); }
LayerIdentifierTransferable implements Transferable { @Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (getStringFlavor().equals(flavor)) { return identifier.getName(); } if (getURLFlavor().equals(flavor)) { return new URL(identifier.getLocation()); } if (getLayerIdentifierFlavor().equals(flavor)) { return identifier; } return null; } LayerIdentifierTransferable(LayerIdentifier identifier); @Override DataFlavor[] getTransferDataFlavors(); @Override boolean isDataFlavorSupported(DataFlavor flavor); @Override Object getTransferData(DataFlavor flavor); }
LayerIdentifierTransferable implements Transferable { @Override public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (getStringFlavor().equals(flavor)) { return identifier.getName(); } if (getURLFlavor().equals(flavor)) { return new URL(identifier.getLocation()); } if (getLayerIdentifierFlavor().equals(flavor)) { return identifier; } return null; } LayerIdentifierTransferable(LayerIdentifier identifier); @Override DataFlavor[] getTransferDataFlavors(); @Override boolean isDataFlavorSupported(DataFlavor flavor); @Override Object getTransferData(DataFlavor flavor);  }