final class QuantumClipboard extends java.lang.Object implements TKClipboard
| Modifier and Type | Field and Description |
|---|---|
private java.security.AccessControlContext |
accessContext
Security access context for image loading
com.sun.javafx.tk.quantum.QuantumClipboard
javafx.scene.input.Clipboard
...
|
private static ClipboardAssistance |
currentDragboard |
private java.util.List<Pair<DataFormat,java.lang.Object>> |
dataCache
Cache of the data used for dragboard between setting them and flushing
them to system dragboard.
|
private Image |
dragImage
An image which is displayed during the drag operation.
|
private double |
dragOffsetX
An offset of the image which is displayed during the drag operation.
|
private double |
dragOffsetY |
private static java.util.regex.Pattern |
findTagIMG |
private boolean |
isCaching
Distinguishes between clipboard and dragboard.
|
private ClipboardAssistance |
systemAssistant
Handle to the Glass peer.
|
private java.util.Set<TransferMode> |
transferModesCache
Cache of the transfer modes used for dragboard between setting them and
flushing them to system dragboard.
|
| Modifier | Constructor and Description |
|---|---|
private |
QuantumClipboard()
Disallow direct creation of QuantumClipboard
|
| Modifier and Type | Method and Description |
|---|---|
private void |
clearCache() |
private void |
clearDragView() |
static java.util.Set<TransferMode> |
clipboardActionsToTransferModes(int actions) |
void |
close() |
private static Image |
convertObjectToImage(java.lang.Object obj) |
void |
flush() |
private java.security.AccessControlContext |
getAccessControlContext() |
static QuantumClipboard |
getClipboardInstance(ClipboardAssistance assistant)
Gets an instance of QuantumClipboard for the given assistant.
|
java.lang.Object |
getContent(DataFormat dataFormat)
Returns the content stored in this clipboard of the given type, or null
if there is no content with this type.
|
java.util.Set<DataFormat> |
getContentTypes()
Gets the set of DataFormat types on this Clipboard instance which have
associated data registered on the clipboard.
|
(package private) static ClipboardAssistance |
getCurrentDragboard() |
static QuantumClipboard |
getDragboardInstance(ClipboardAssistance assistant,
boolean isDragSource)
Gets an instance of QuantumClipboard for the given assistant for usage
as dragboard during drag and drop.
|
Image |
getDragView()
Gets the image used as a drag view.
|
double |
getDragViewOffsetX()
Gets the x position of the cursor of the drag view image.
|
double |
getDragViewOffsetY()
Gets the y position of the cursor of the drag view image.
|
java.util.Set<TransferMode> |
getTransferModes() |
boolean |
hasContent(DataFormat dataFormat)
Tests whether there is any content on this clipboard of the given DataFormat type.
|
private java.lang.String |
parseIMG(java.lang.Object data) |
private boolean |
placeImage(Image image) |
private static java.nio.ByteBuffer |
prepareImage(Image image) |
private static java.nio.ByteBuffer |
prepareOffset(double offsetX,
double offsetY) |
boolean |
putContent(Pair<DataFormat,java.lang.Object>... content)
Puts the specified content onto the clipboard.
|
private boolean |
putContentToPeer(Pair<DataFormat,java.lang.Object>... content) |
private Image |
readImage() |
(package private) static void |
releaseCurrentDragboard() |
void |
setDragView(Image image)
Sets the visual representation of data being transfered in a drag and drop gesture.
|
void |
setDragViewOffsetX(double offsetX)
Sets the x position of the cursor of the drag view image.
|
void |
setDragViewOffsetY(double offsetY)
Sets the y position of the cursor of the drag view image.
|
void |
setSecurityContext(java.security.AccessControlContext acc)
This method is used to set security context of the Stage.
|
void |
setSupportedTransferMode(java.util.Set<TransferMode> tm) |
static int |
transferModesToClipboardActions(java.util.Set<TransferMode> tms) |
private ClipboardAssistance systemAssistant
private java.security.AccessControlContext accessContext
private boolean isCaching
private java.util.List<Pair<DataFormat,java.lang.Object>> dataCache
private java.util.Set<TransferMode> transferModesCache
private Image dragImage
private double dragOffsetX
private double dragOffsetY
private static ClipboardAssistance currentDragboard
private static final java.util.regex.Pattern findTagIMG
private QuantumClipboard()
public void setSecurityContext(java.security.AccessControlContext acc)
TKClipboardsetSecurityContext in interface TKClipboardprivate java.security.AccessControlContext getAccessControlContext()
public static QuantumClipboard getClipboardInstance(ClipboardAssistance assistant)
assistant - static ClipboardAssistance getCurrentDragboard()
static void releaseCurrentDragboard()
public static QuantumClipboard getDragboardInstance(ClipboardAssistance assistant, boolean isDragSource)
assistant - public static int transferModesToClipboardActions(java.util.Set<TransferMode> tms)
public void setSupportedTransferMode(java.util.Set<TransferMode> tm)
public static java.util.Set<TransferMode> clipboardActionsToTransferModes(int actions)
public java.util.Set<TransferMode> getTransferModes()
getTransferModes in interface TKClipboardpublic void setDragView(Image image)
TKClipboardsetDragView in interface TKClipboardimage - image to use for the drag viewpublic void setDragViewOffsetX(double offsetX)
TKClipboardsetDragViewOffsetX in interface TKClipboardoffsetX - x position of the cursor over the imagepublic void setDragViewOffsetY(double offsetY)
TKClipboardsetDragViewOffsetY in interface TKClipboardoffsetY - x position of the cursor over the imagepublic Image getDragView()
TKClipboardgetDragView in interface TKClipboardpublic double getDragViewOffsetX()
TKClipboardgetDragViewOffsetX in interface TKClipboardpublic double getDragViewOffsetY()
TKClipboardgetDragViewOffsetY in interface TKClipboardpublic void close()
public void flush()
public java.lang.Object getContent(DataFormat dataFormat)
TKClipboardgetContent in interface TKClipboardprivate static Image convertObjectToImage(java.lang.Object obj)
private Image readImage()
private java.lang.String parseIMG(java.lang.Object data)
private boolean placeImage(Image image)
public java.util.Set<DataFormat> getContentTypes()
TKClipboardgetContentTypes in interface TKClipboardpublic boolean hasContent(DataFormat dataFormat)
TKClipboardhasContent in interface TKClipboardprivate static java.nio.ByteBuffer prepareImage(Image image)
private static java.nio.ByteBuffer prepareOffset(double offsetX,
double offsetY)
private boolean putContentToPeer(Pair<DataFormat,java.lang.Object>... content)
public boolean putContent(Pair<DataFormat,java.lang.Object>... content)
TKClipboardNullPointerException is thrown if either the DataFormat
or the Object data in the content Pair is null.putContent in interface TKClipboardcontent - The content to put on the clipboard.private void clearCache()
private void clearDragView()