net.sf.freecol.client.gui.panel
Class ImageSelection

java.lang.Object
  extended by net.sf.freecol.client.gui.panel.ImageSelection
All Implemented Interfaces:
java.awt.datatransfer.Transferable

public final class ImageSelection
extends java.lang.Object
implements java.awt.datatransfer.Transferable

Represents an image selection that can be selected and dragged/dropped to/from Swing components.


Constructor Summary
ImageSelection(javax.swing.JLabel label)
          The constructor to use.
 
Method Summary
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
          Returns the data that this Transferable represents or 'null' if the data is not of the given flavor.
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          Returns the flavors that are supported by this Transferable.
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
          Checks if the given data flavor is supported by this Transferable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageSelection

public ImageSelection(javax.swing.JLabel label)
The constructor to use.

Parameters:
label - The data that this ImageSelection should hold.
Method Detail

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
Returns the data that this Transferable represents or 'null' if the data is not of the given flavor.

Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Parameters:
flavor - The flavor that the data should have.
Returns:
The data that this Transferable represents or 'null' if the data is not of the given flavor.

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Returns the flavors that are supported by this Transferable.

Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable
Returns:
The flavors that are supported by this Transferable.

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Checks if the given data flavor is supported by this Transferable.

Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable
Parameters:
flavor - The data flavor to check.
Returns:
'true' if the given data flavor is supported by this Transferable, 'false' otherwise.