Package snap.view
Class Clipboard
java.lang.Object
snap.view.Clipboard
- All Implemented Interfaces:
Loadable
A class to handle system copy/paste and to initiate drag and drop.
-
Nested Class Summary
Nested classes/interfaces inherited from interface snap.util.Loadable
Loadable.MultiLoadable, Loadable.Support
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the clipboard content.void
Adds clipboard content.protected void
addDataImpl
(String aMimeType, ClipboardData theData) Adds clipboard content.void
addLoadListener
(Runnable aRun) Adds a callback to be triggered when resources loaded.void
Clears the data in the clipboard.static Clipboard
get()
Returns the system clipboard.static Clipboard
Returns the system clipboard with cleared data.Returns the ClipboardDatas managed by this default implementation.getColor()
Returns the clipboard content.Returns the clipboard content.byte[]
getDataBytes
(String aMimeType) Returns the data for given MIME type as byte array.protected ClipboardData
getDataImpl
(String aMimeType) Returns the clipboard content.getDataString
(String aMimeType) Returns the data for given MIME type as string.static Clipboard
getDrag()
Returns the clipboard for drag and drop.Returns the drag image.Returns the drag image offset.Returns the view that started thegetFiles()
Returns the clipboard content.getImage()
Returns the clipboard data as image.Returns the clipboard data as image.Returns the clipboard image data.Returns the clipboard content.Returns the clipboard content.boolean
hasColor()
Returns the clipboard content.boolean
Returns the clipboard content.protected boolean
hasDataImpl
(String aMimeType) Returns the clipboard content.boolean
hasFiles()
Returns the clipboard content.boolean
hasImage()
Returns the clipboard content.boolean
Returns the clipboard content.boolean
isLoaded()
Returns whether clipboard is loaded.void
setDragImage
(Image anImage) Sets the drag image.void
setDragImage
(Image anImage, double aX, double aY) Sets the drag image offset.void
setDragImageOffset
(double aX, double aY) Sets the drag image offset.void
setDragImageOffset
(Point aPnt) Sets the drag image offset.abstract void
Starts the drag.
-
Field Details
-
STRING
-
FILE_LIST
-
IMAGE
-
COLOR
-
-
Constructor Details
-
Clipboard
public Clipboard()
-
-
Method Details
-
hasData
Returns the clipboard content. -
hasDataImpl
Returns the clipboard content. -
getData
Returns the clipboard content. -
getDataImpl
Returns the clipboard content. -
addData
Sets the clipboard content. -
addData
Adds clipboard content. -
addDataImpl
Adds clipboard content. -
clearData
public void clearData()Clears the data in the clipboard. -
getClipboardDatas
Returns the ClipboardDatas managed by this default implementation. -
getDataString
Returns the data for given MIME type as string. -
getDataBytes
Returns the data for given MIME type as byte array. -
hasString
public boolean hasString()Returns the clipboard content. -
getString
Returns the clipboard content. -
hasFiles
public boolean hasFiles()Returns the clipboard content. -
getFiles
Returns the clipboard content. -
getJavaFiles
Returns the clipboard content. -
hasImage
public boolean hasImage()Returns the clipboard content. -
getImage
Returns the clipboard data as image. -
getImage
Returns the clipboard data as image. -
getImageData
Returns the clipboard image data. -
hasColor
public boolean hasColor()Returns the clipboard content. -
getColor
Returns the clipboard content. -
getDragImage
Returns the drag image. -
setDragImage
Sets the drag image. -
getDragImageOffset
Returns the drag image offset. -
setDragImageOffset
Sets the drag image offset. -
setDragImageOffset
public void setDragImageOffset(double aX, double aY) Sets the drag image offset. -
setDragImage
Sets the drag image offset. -
startDrag
public abstract void startDrag()Starts the drag. -
getDragSourceView
Returns the view that started the -
isLoaded
public boolean isLoaded()Returns whether clipboard is loaded. -
addLoadListener
Adds a callback to be triggered when resources loaded.- Specified by:
addLoadListener
in interfaceLoadable
-
get
Returns the system clipboard. -
getCleared
Returns the system clipboard with cleared data. -
getDrag
Returns the clipboard for drag and drop.
-