Class Dragboard
java.lang.Object
javafx.scene.input.Clipboard
javafx.scene.input.Dragboard
-
Method Summary
Modifier and TypeMethodDescriptionGets the image used as a drag view.doubleGets the x position of the cursor of the drag view image.doubleGets the y position of the cursor of the drag view image.final Set<TransferMode> Gets set of transport modes supported by source of this drag operation.voidsetDragView(Image image) Sets the visual representation of data being transferred in a drag and drop gesture.voidsetDragView(Image image, double offsetX, double offsetY) Sets the visual representation of data being transferred in a drag and drop gesture.voidsetDragViewOffsetX(double offsetX) Sets the x position of the cursor of the drag view image.voidsetDragViewOffsetY(double offsetY) Sets the y position of the cursor of the drag view image.Methods declared in class Clipboard
clear, getContent, getContentTypes, getFiles, getHtml, getImage, getRtf, getString, getSystemClipboard, getUrl, hasContent, hasFiles, hasHtml, hasImage, hasRtf, hasString, hasUrl, setContentModifier and TypeMethodDescriptionfinal voidclear()Clears the clipboard of any and all content.final ObjectgetContent(DataFormat dataFormat) Returns the content stored in this clipboard of the given type, or null if there is no content with this type.final Set<DataFormat> Gets the set of DataFormat types on this Clipboard instance which have associated data registered on the clipboard.getFiles()Gets the List of Files from the clipboard which had previously been registered.final StringgetHtml()Gets the HTML text String from the clipboard which had previously been registered.final ImagegetImage()Gets the Image from the clipboard which had previously been registered.final StringgetRtf()Gets the RTF text String from the clipboard which had previously been registered.final StringGets the plain text String from the clipboard which had previously been registered.static ClipboardGets the current system clipboard, through which data can be stored and retrieved.final StringgetUrl()Gets the URL String from the clipboard which had previously been registered.final booleanhasContent(DataFormat dataFormat) Tests whether there is any content on this clipboard of the given DataFormat type.final booleanhasFiles()Gets whether an List of Files (DataFormat.FILES) has been registered on this Clipboard.final booleanhasHtml()Gets whether an HTML text String (DataFormat.HTML) has been registered on this Clipboard.final booleanhasImage()Gets whether an Image (DataFormat.IMAGE) has been registered on this Clipboard.final booleanhasRtf()Gets whether an RTF String (DataFormat.RTF) has been registered on this Clipboard.final booleanGets whether a plain text String (DataFormat.PLAIN_TEXT) has been registered on this Clipboard.final booleanhasUrl()Gets whether a url String (DataFormat.URL) has been registered on this Clipboard.final booleansetContent(Map<DataFormat, Object> content) Puts content onto the clipboard.
-
Method Details
-
getTransferModes
Gets set of transport modes supported by source of this drag operation.- Returns:
- set of supported transfer modes
-
setDragView
Sets the visual representation of data being transferred in a drag and drop gesture. Uses the given image for the drag view with the offsetX and offsetY specifying cursor position over the image. This method should be called only when starting drag and drop operation in the DRAG_DETECTED handler, calling it at other times doesn't have any effect.- Parameters:
image- image to use for the drag viewoffsetX- x position of the cursor over the imageoffsetY- y position of the cursor over the image- Since:
- JavaFX 8.0
-
setDragView
Sets the visual representation of data being transferred in a drag and drop gesture. This method should be called only when starting drag and drop operation in the DRAG_DETECTED handler, calling it at other times doesn't have any effect.- Parameters:
image- image to use for the drag view- Since:
- JavaFX 8.0
-
setDragViewOffsetX
public void setDragViewOffsetX(double offsetX) Sets the x position of the cursor of the drag view image. This method should be called only when starting drag and drop operation in the DRAG_DETECTED handler, calling it at other times doesn't have any effect.- Parameters:
offsetX- x position of the cursor over the image- Since:
- JavaFX 8.0
-
setDragViewOffsetY
public void setDragViewOffsetY(double offsetY) Sets the y position of the cursor of the drag view image. This method should be called only when starting drag and drop operation in the DRAG_DETECTED handler, calling it at other times doesn't have any effect.- Parameters:
offsetY- y position of the cursor over the image- Since:
- JavaFX 8.0
-
getDragView
Gets the image used as a drag view. This method returns meaningful value only when starting drag and drop operation in the DRAG_DETECTED handler, it returns null at other times.- Returns:
- the image used as a drag view
- Since:
- JavaFX 8.0
-
getDragViewOffsetX
public double getDragViewOffsetX()Gets the x position of the cursor of the drag view image. This method returns meaningful value only when starting drag and drop operation in the DRAG_DETECTED handler, it returns 0 at other times.- Returns:
- x position of the cursor over the image
- Since:
- JavaFX 8.0
-
getDragViewOffsetY
public double getDragViewOffsetY()Gets the y position of the cursor of the drag view image. This method returns meaningful value only when starting drag and drop operation in the DRAG_DETECTED handler, it returns 0 at other times.- Returns:
- y position of the cursor over the image
- Since:
- JavaFX 8.0
-