public class BsfSystemClipboard
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
version |
Constructor and Description |
---|
BsfSystemClipboard() |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clears (empties) the system clipboard.
|
static java.awt.datatransfer.DataFlavor[] |
getDataFlavors()
Returns an array of java.awt.datatransfer.DataFlavors (formats)
currently available on the system clipboard.
|
static java.awt.Image |
getImage()
Gets an image from the system clipboard and returns it.
|
static java.lang.String |
getString()
Returns the string currently in the system clipboard.
|
static byte[] |
getString(java.lang.String codepage)
Returns the string currently in the system clipboard as a byte array encoded according to the
supplied codepage.
|
static boolean |
isEmpty()
Tests whether the system clipboard is empty (if no data flavors are present).
|
static void |
setImage(java.awt.Image img)
This copies the received image to the clipboard.
|
static java.awt.Image |
setImageWithoutAlpha(java.awt.Image img)
This allows a java.awt.Image image to be copied as a JPG/JPEG (!) image to the
system clipboard.
|
static void |
setString(java.lang.String str)
Sets the supplied string to the system clipboard.
|
public static final java.lang.String version
public static boolean isEmpty()
public static java.awt.datatransfer.DataFlavor[] getDataFlavors()
static boolean isEmpty()
will return .true.public static void clear()
public static java.awt.Image setImageWithoutAlpha(java.awt.Image img)
img
- the image to be copied (without alpha/translucency on white background) to the clipboard)public static void setImage(Image img)}
public static void setImage(java.awt.Image img)
static void setImageNoAlpha(Image img)
to make
sure that the image does not have alpha (translucency) such that creating a JPG/JPEG
is possible in any case.img
- the image to copy to the clipboardpublic static void setImageWithoutAlpha(Image img)}
public static java.awt.Image getImage()
public static void setString(java.lang.String str)
public static java.lang.String getString()
public static byte[] getString(java.lang.String codepage)