Package snap.swing
Class SwingClipboard
java.lang.Object
snap.view.Clipboard
snap.swing.SwingClipboard
- All Implemented Interfaces:
DragSourceListener
,DragSourceMotionListener
,EventListener
,Loadable
public class SwingClipboard
extends Clipboard
implements DragSourceListener, DragSourceMotionListener
A Clipboard implementation for Swing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface snap.util.Loadable
Loadable.MultiLoadable, Loadable.Support
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDataImpl
(String aMIMEType, ClipboardData aData) Sets the clipboard content.protected void
Creates a window to represent interactive drag (if not DragImageSupported).void
dragDropEnd
(DragSourceDropEvent anEvent) DragSourceListener method.void
dragEnter
(DragSourceDragEvent anEvent) DragSourceListener methods.void
dragExit
(DragSourceEvent anEvent) void
dragMouseMoved
(DragSourceDragEvent anEvent) DragSourceMotionListener method.void
dragOver
(DragSourceDragEvent anEvent) void
dropActionChanged
(DragSourceDragEvent anEvent) static SwingClipboard
get()
Returns the shared SwingClipboard.protected DataFlavor
getDataFlavor
(String aName) Returns a dataflavor for a name.protected ClipboardData
getDataImpl
(String aMIMEType) Returns the clipboard content.static SwingClipboard
Returns the shared SwingClipboard for drag and drop.Returns the drag source view that started drag.getImage()
Override to support DataFlavor.imageFlavor.Override to support DataFlavor.imageFlavor.protected String
getMIMEType
(DataFlavor aFlavor) Returns a dataflavor for a name.protected Transferable
getTrans()
Returns the current transferable.protected boolean
hasDataImpl
(String aMIMEType) Override to map to Swing clipboard.boolean
hasImage()
Override to support DataFlavor.imageFlavor.void
Starts the drag.Methods inherited from class snap.view.Clipboard
addData, addData, addLoadListener, clearData, getCleared, getClipboardDatas, getColor, getData, getDataBytes, getDataString, getDrag, getDragImage, getDragImageOffset, getFiles, getImage, getJavaFiles, getString, hasColor, hasData, hasFiles, hasString, isLoaded, setDragImage, setDragImage, setDragImageOffset, setDragImageOffset
-
Constructor Details
-
SwingClipboard
public SwingClipboard()
-
-
Method Details
-
hasDataImpl
Override to map to Swing clipboard.- Overrides:
hasDataImpl
in classClipboard
-
getDataImpl
Returns the clipboard content.- Overrides:
getDataImpl
in classClipboard
-
hasImage
public boolean hasImage()Override to support DataFlavor.imageFlavor. -
getImage
Override to support DataFlavor.imageFlavor. -
getImageData
Override to support DataFlavor.imageFlavor.- Overrides:
getImageData
in classClipboard
-
addDataImpl
Sets the clipboard content.- Overrides:
addDataImpl
in classClipboard
-
getTrans
Returns the current transferable. -
getDataFlavor
Returns a dataflavor for a name. -
getMIMEType
Returns a dataflavor for a name. -
startDrag
public void startDrag()Starts the drag. -
getDragSourceView
Returns the drag source view that started drag.- Overrides:
getDragSourceView
in classClipboard
-
dragEnter
DragSourceListener methods.- Specified by:
dragEnter
in interfaceDragSourceListener
-
dragOver
- Specified by:
dragOver
in interfaceDragSourceListener
-
dragExit
- Specified by:
dragExit
in interfaceDragSourceListener
-
dropActionChanged
- Specified by:
dropActionChanged
in interfaceDragSourceListener
-
dragMouseMoved
DragSourceMotionListener method.- Specified by:
dragMouseMoved
in interfaceDragSourceMotionListener
-
dragDropEnd
DragSourceListener method.- Specified by:
dragDropEnd
in interfaceDragSourceListener
-
createDragWindow
protected void createDragWindow()Creates a window to represent interactive drag (if not DragImageSupported). -
get
Returns the shared SwingClipboard. -
getDrag
Returns the shared SwingClipboard for drag and drop.
-