Package org.jmol.awt
Class AwtClipboard
- java.lang.Object
-
- org.jmol.awt.AwtClipboard
-
- All Implemented Interfaces:
Transferable
public class AwtClipboard extends Object implements Transferable
This class is used to transfer text or an image into the clipboard and to get tet from the clipboard. Simplified by Bob Hanson- Author:
- Nicolas Vervelle
-
-
Constructor Summary
Constructors Modifier Constructor Description private
AwtClipboard(Object image)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getClipboardText()
Get the String residing on the clipboard.Object
getTransferData(DataFlavor flavor)
DataFlavor[]
getTransferDataFlavors()
boolean
isDataFlavorSupported(DataFlavor flavor)
static void
setClipboard(Object textOrImage)
Transfers text or image into the clipboard.
-
-
-
Constructor Detail
-
AwtClipboard
private AwtClipboard(Object image)
-
-
Method Detail
-
setClipboard
public static void setClipboard(Object textOrImage)
Transfers text or image into the clipboard.- Parameters:
textOrImage
- to transfer into the clipboard.
-
getTransferDataFlavors
public DataFlavor[] getTransferDataFlavors()
- Specified by:
getTransferDataFlavors
in interfaceTransferable
-
isDataFlavorSupported
public boolean isDataFlavorSupported(DataFlavor flavor)
- Specified by:
isDataFlavorSupported
in interfaceTransferable
-
getTransferData
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
- Specified by:
getTransferData
in interfaceTransferable
- 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.
-
-