Top Description Fields Constructors Methods
com.sun.javafx.tk.quantum

pack-priv final Class QuantumClipboard

extends Object
implements TKClipboard
Class Inheritance
All Implemented Interfaces
com.sun.javafx.tk.TKClipboard
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .File, .IOException, .InputStream, .ObjectInput, .ObjectInputStream, .ObjectOutput, .ObjectOutputStream, .Serializable, .ObjectStreamClass, java.nio.ByteBuffer, java.util.ArrayList, .Collections, .EnumSet, .HashSet, .List, .Set, java.util.regex.Matcher, .Pattern, javafx.scene.image.Image, .PixelReader, .WritablePixelFormat, javafx.scene.input.DataFormat, .TransferMode, javafx.util.Pair, com.sun.glass.ui.Application, .Clipboard, .ClipboardAssistance, .Pixels, com.sun.javafx.tk.ImageLoader, .TKClipboard, .Toolkit

The implementation of TKClipboard, which is used both for clipboards and dragboards.

Field Summary

Modifier and TypeField and Description
private static ClipboardAssistance
private List<Pair<DataFormat, 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
private static final Pattern
private boolean
isCaching

Distinguishes between clipboard and dragboard.

private ClipboardAssistance
systemAssistant

Handle to the Glass peer.

private Set<TransferMode>
transferModesCache

Cache of the transfer modes used for dragboard between setting them and flushing them to system dragboard.

Constructor Summary

AccessConstructor and Description
private
QuantumClipboard()

Disallow direct creation of QuantumClipboard

Method Summary

Modifier and TypeMethod and Description
private void
private void
public static Set<TransferMode>
public void
private static Image
public void
public static QuantumClipboard
getClipboardInstance(ClipboardAssistance assistant)

Gets an instance of QuantumClipboard for the given assistant.

public Object
getContent(DataFormat dataFormat)

Implements com.sun.javafx.tk.TKClipboard.getContent.

Returns the content stored in this clipboard of the given type, or null if there is no content with this type.

public Set<DataFormat>
getContentTypes()

Implements com.sun.javafx.tk.TKClipboard.getContentTypes.

Gets the set of DataFormat types on this Clipboard instance which have associated data registered on the clipboard.

pack-priv static ClipboardAssistance
public static QuantumClipboard
getDragboardInstance(ClipboardAssistance assistant, boolean isDragSource)

Gets an instance of QuantumClipboard for the given assistant for usage as dragboard during drag and drop.

public Image
getDragView()

Implements com.sun.javafx.tk.TKClipboard.getDragView.

Gets the image used as a drag view.

public double
getDragViewOffsetX()

Implements com.sun.javafx.tk.TKClipboard.getDragViewOffsetX.

Gets the x position of the cursor of the drag view image.

public double
getDragViewOffsetY()

Implements com.sun.javafx.tk.TKClipboard.getDragViewOffsetY.

Gets the y position of the cursor of the drag view image.

public Set<TransferMode>
public boolean
hasContent(DataFormat dataFormat)

Implements com.sun.javafx.tk.TKClipboard.hasContent.

Tests whether there is any content on this clipboard of the given DataFormat type.

private String
private boolean
placeImage(final Image image)

private static ByteBuffer
private static ByteBuffer
prepareOffset(double offsetX, double offsetY)

public boolean
putContent(Pair<DataFormat, Object>...
The content to put on the clipboard.
content
)

Implements com.sun.javafx.tk.TKClipboard.putContent.

Puts the specified content onto the clipboard.

private boolean
private Image
pack-priv static void
public void
setDragView(Image
image to use for the drag view
image
)

Implements com.sun.javafx.tk.TKClipboard.setDragView.

Sets the visual representation of data being transfered in a drag and drop gesture.

public void
setDragViewOffsetX(double
x position of the cursor over the image
offsetX
)

Implements com.sun.javafx.tk.TKClipboard.setDragViewOffsetX.

Sets the x position of the cursor of the drag view image.

public void
setDragViewOffsetY(double
x position of the cursor over the image
offsetY
)

Implements com.sun.javafx.tk.TKClipboard.setDragViewOffsetY.

Sets the y position of the cursor of the drag view image.

public void
public static int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentDragboardback to summary
private static ClipboardAssistance currentDragboard
dataCacheback to summary
private List<Pair<DataFormat, Object>> dataCache

Cache of the data used for dragboard between setting them and flushing them to system dragboard.

dragImageback to summary
private Image dragImage

An image which is displayed during the drag operation. Set by the user.

dragOffsetXback to summary
private double dragOffsetX

An offset of the image which is displayed during the drag operation. Set by the user.

dragOffsetYback to summary
private double dragOffsetY
findTagIMGback to summary
private static final Pattern findTagIMG
isCachingback to summary
private boolean isCaching

Distinguishes between clipboard and dragboard. This is needed because dragboard's flush() starts DnD operation so it mustn't be called too early.

systemAssistantback to summary
private ClipboardAssistance systemAssistant

Handle to the Glass peer.

transferModesCacheback to summary
private Set<TransferMode> transferModesCache

Cache of the transfer modes used for dragboard between setting them and flushing them to system dragboard.

Constructor Detail

QuantumClipboardback to summary
private QuantumClipboard()

Disallow direct creation of QuantumClipboard

Method Detail

clearCacheback to summary
private void clearCache()
clearDragViewback to summary
private void clearDragView()
clipboardActionsToTransferModesback to summary
public static Set<TransferMode> clipboardActionsToTransferModes(final int actions)
closeback to summary
public void close()
convertObjectToImageback to summary
private static Image convertObjectToImage(Object obj)
flushback to summary
public void flush()
getClipboardInstanceback to summary
public static QuantumClipboard getClipboardInstance(ClipboardAssistance assistant)

Gets an instance of QuantumClipboard for the given assistant. This may be a new instance after each call.

getContentback to summary
public Object getContent(DataFormat dataFormat)

Implements com.sun.javafx.tk.TKClipboard.getContent.

Doc from com.sun.javafx.tk.TKClipboard.getContent.

Returns the content stored in this clipboard of the given type, or null if there is no content with this type.

Returns:Object

The content associated with this type, or null if there is none

Annotations
@Override
getContentTypesback to summary
public Set<DataFormat> getContentTypes()

Implements com.sun.javafx.tk.TKClipboard.getContentTypes.

Doc from com.sun.javafx.tk.TKClipboard.getContentTypes.

Gets the set of DataFormat types on this Clipboard instance which have associated data registered on the clipboard. This set will always be non-null and immutable. If the Clipboard is subsequently modifed, this returned set is not updated.

Returns:Set<DataFormat>

A non-null immutable set of content types.

Annotations
@Override
getCurrentDragboardback to summary
pack-priv static ClipboardAssistance getCurrentDragboard()
getDragboardInstanceback to summary
public static QuantumClipboard getDragboardInstance(ClipboardAssistance assistant, boolean isDragSource)

Gets an instance of QuantumClipboard for the given assistant for usage as dragboard during drag and drop. It doesn't flush the data implicitly and caches them until flush() is called. This may be a new instance after each call.

getDragViewback to summary
public Image getDragView()

Implements com.sun.javafx.tk.TKClipboard.getDragView.

Doc from com.sun.javafx.tk.TKClipboard.getDragView.

Gets the image used as a drag view.

Returns:Image

the image used as a drag view

Annotations
@Override
getDragViewOffsetXback to summary
public double getDragViewOffsetX()

Implements com.sun.javafx.tk.TKClipboard.getDragViewOffsetX.

Doc from com.sun.javafx.tk.TKClipboard.getDragViewOffsetX.

Gets the x position of the cursor of the drag view image.

Returns:double

x position of the cursor over the image

Annotations
@Override
getDragViewOffsetYback to summary
public double getDragViewOffsetY()

Implements com.sun.javafx.tk.TKClipboard.getDragViewOffsetY.

Doc from com.sun.javafx.tk.TKClipboard.getDragViewOffsetY.

Gets the y position of the cursor of the drag view image.

Returns:double

y position of the cursor over the image

Annotations
@Override
getTransferModesback to summary
public Set<TransferMode> getTransferModes()

Implements com.sun.javafx.tk.TKClipboard.getTransferModes.

Annotations
@Override
hasContentback to summary
public boolean hasContent(DataFormat dataFormat)

Implements com.sun.javafx.tk.TKClipboard.hasContent.

Doc from com.sun.javafx.tk.TKClipboard.hasContent.

Tests whether there is any content on this clipboard of the given DataFormat type.

Returns:boolean

true if there is content on this clipboard for this type

Annotations
@Override
parseIMGback to summary
private String parseIMG(Object data)
placeImageback to summary
private boolean placeImage(final Image image)
prepareImageback to summary
private static ByteBuffer prepareImage(Image image)
prepareOffsetback to summary
private static ByteBuffer prepareOffset(double offsetX, double offsetY)
putContentback to summary
public boolean putContent(Pair<DataFormat, Object>... content)

Implements com.sun.javafx.tk.TKClipboard.putContent.

Doc from com.sun.javafx.tk.TKClipboard.putContent.

Puts the specified content onto the clipboard. Note that all existing content is cleared from the clipboard prior to the specified content being added. A NullPointerException is thrown if either the DataFormat or the Object data in the content Pair is null.

Parameters
content:Pair<DataFormat, Object>[]

The content to put on the clipboard.

Returns:boolean

True if successful, false if the content fails to be added.

Annotations
@Override
putContentToPeerback to summary
private boolean putContentToPeer(Pair<DataFormat, Object>... content)
readImageback to summary
private Image readImage()
releaseCurrentDragboardback to summary
pack-priv static void releaseCurrentDragboard()
setDragViewback to summary
public void setDragView(Image image)

Implements com.sun.javafx.tk.TKClipboard.setDragView.

Doc from com.sun.javafx.tk.TKClipboard.setDragView.

Sets the visual representation of data being transfered in a drag and drop gesture.

Parameters
image:Image

image to use for the drag view

Annotations
@Override
setDragViewOffsetXback to summary
public void setDragViewOffsetX(double offsetX)

Implements com.sun.javafx.tk.TKClipboard.setDragViewOffsetX.

Doc from com.sun.javafx.tk.TKClipboard.setDragViewOffsetX.

Sets the x position of the cursor of the drag view image.

Parameters
offsetX:double

x position of the cursor over the image

Annotations
@Override
setDragViewOffsetYback to summary
public void setDragViewOffsetY(double offsetY)

Implements com.sun.javafx.tk.TKClipboard.setDragViewOffsetY.

Doc from com.sun.javafx.tk.TKClipboard.setDragViewOffsetY.

Sets the y position of the cursor of the drag view image.

Parameters
offsetY:double

x position of the cursor over the image

Annotations
@Override
setSupportedTransferModeback to summary
public void setSupportedTransferMode(Set<TransferMode> tm)
transferModesToClipboardActionsback to summary
public static int transferModesToClipboardActions(final Set<TransferMode> tms)