org.jmol.export.image
Class ImageSelection

java.lang.Object
  extended by org.jmol.export.image.ImageSelection
All Implemented Interfaces:
Transferable

public class ImageSelection
extends Object
implements Transferable

This class is used to transfer an Image into the clipboard.

Author:
Nicolas Vervelle

Field Summary
private  Image image
          The image to transfer into the clipboard.
private  String text
           
 
Constructor Summary
ImageSelection(Image image)
          Constructs a ImageSelection.
ImageSelection(String text)
          Constructs a ImageSelection.
 
Method Summary
static String getClipboardText()
          Get the String residing on the clipboard.
 Object getTransferData(DataFlavor flavor)
           
 DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(DataFlavor flavor)
           
static void setClipboard(Image image)
          Transfers image into the clipboard.
static void setClipboard(String text)
          Transfers text into the clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

image

private Image image
The image to transfer into the clipboard.


text

private String text
Constructor Detail

ImageSelection

public ImageSelection(Image image)
Constructs a ImageSelection.

Parameters:
image - The real Image.

ImageSelection

public ImageSelection(String text)
Constructs a ImageSelection.

Parameters:
text - The text to transfer
Method Detail

setClipboard

public static void setClipboard(Image image)
Transfers image into the clipboard.

Parameters:
image - Image to transfer into the clipboard.

setClipboard

public static void setClipboard(String text)
Transfers text into the clipboard.

Parameters:
text - to transfer into the clipboard.

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Specified by:
isDataFlavorSupported in interface Transferable

getTransferData

public Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException,
                              IOException
Specified by:
getTransferData in interface Transferable
Throws:
UnsupportedFlavorException
IOException

getClipboardText

public static String getClipboardText()
Get the String residing on the clipboard. Or, if it is a file list, get the load command associated with that. from http://www.javapractices.com/Topic82.cjp

Returns:
any text found on the Clipboard; if none found, return an empty String.