APIdia Launch Partner
Top Description Methods
com.sun.javafx.tk

public Interface TKClipboard

Known Direct Implementers
com.sun.javafx.tk.quantum.QuantumClipboard, com.sun.javafx.tk.LocalClipboard
Imports
java.util.Set, javafx.scene.image.Image, javafx.scene.input.DataFormat, .TransferMode, javafx.util.Pair

We use this interface to represent the PG peer for the public Clipboard and Dragboard APIs, so that we don't leak the QuantumClipboard to callers (and so forth).

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

The content associated with this type, or null if there is none
getContent
(DataFormat dataFormat)

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

public Set<DataFormat>

Returns:

A non-null immutable set of content types.
getContentTypes
()

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

public Image

Returns:

the image used as a drag view
getDragView
()

Gets the image used as a drag view.

public double

Returns:

x position of the cursor over the image
getDragViewOffsetX
()

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

public double

Returns:

y position of the cursor over the image
getDragViewOffsetY
()

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

public Set<TransferMode>
public boolean

Returns:

true if there is content on this clipboard for this type
hasContent
(DataFormat dataFormat)

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

public boolean

Returns:

True if successful, false if the content fails to be added.
putContent
(Pair<DataFormat, Object>...
The content to put on the clipboard.
content
)

Puts the specified content onto the clipboard.

public void
setDragView(Image
image to use for the drag view
image
)

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
)

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
)

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

Method Detail

getContentback to summary
public 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.

Returns:Object

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

getContentTypesback to summary
public Set<DataFormat> 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.

getDragViewback to summary
public Image getDragView()

Gets the image used as a drag view.

Returns:Image

the image used as a drag view

getDragViewOffsetXback to summary
public double getDragViewOffsetX()

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

Returns:double

x position of the cursor over the image

getDragViewOffsetYback to summary
public double getDragViewOffsetY()

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

Returns:double

y position of the cursor over the image

getTransferModesback to summary
public Set<TransferMode> getTransferModes()
hasContentback to summary
public boolean hasContent(DataFormat dataFormat)

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

putContentback to summary
public boolean putContent(Pair<DataFormat, Object>... content)

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.

setDragViewback to summary
public void setDragView(Image image)

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

Parameters
image:Image

image to use for the drag view

setDragViewOffsetXback to summary
public void setDragViewOffsetX(double offsetX)

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

Parameters
offsetX:double

x position of the cursor over the image

setDragViewOffsetYback to summary
public void setDragViewOffsetY(double offsetY)

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

Parameters
offsetY:double

x position of the cursor over the image