Class RMEditorClipboard
java.lang.Object
com.inductiveautomation.rm.editor.RMEditorClipboard
- All Implemented Interfaces:
Transferable
Handles editor methods specific to clipboard operations (cut, copy paste).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRMEditorClipboard
(byte[] bytes) Creates new editor clipboard object with the given bytes. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Handles editor copy operation.static void
Handles editor cut operation.static RMShape
getShapeFromClipboard
(RMEditor anEditor) Returns the first Shape read from the system clipboard.static Object
getShapesFromClipboard
(RMEditor anEditor, Transferable contents) Returns the shape or shapes read from the given transferable (uses system clipboard if null).getTransferData
(DataFlavor aFlavor) Transferable method - returns the transfer data for the specified flavor.Transferable method - returns the transfer data flavors supported by this transferable.static RMShape
getTransferPDF
(Transferable contents) Returns an RMImage with the contents if there's a pdf image on the clipboard.static RMShape
getTransferText
(Transferable contents) Returns an RMText object with the contents if there's a plain text string on the clipboard.boolean
isDataFlavorSupported
(DataFlavor aFlavor) Transferable method - returns whether the given flavor is supported.static void
Handles editor paste operation.static void
paste
(RMEditor anEditor, Transferable contents, RMParentShape aParent, Point2D aPoint) Handles editor paste operation for given transferable, parent shape and location.
-
Field Details
-
RMDataFlavor
-
SupportedFlavors
-
-
Constructor Details
-
RMEditorClipboard
public RMEditorClipboard(byte[] bytes) Creates new editor clipboard object with the given bytes.
-
-
Method Details
-
cut
Handles editor cut operation. -
copy
Handles editor copy operation. -
paste
Handles editor paste operation. -
paste
public static void paste(RMEditor anEditor, Transferable contents, RMParentShape aParent, Point2D aPoint) Handles editor paste operation for given transferable, parent shape and location. -
getShapeFromClipboard
Returns the first Shape read from the system clipboard. -
getShapesFromClipboard
Returns the shape or shapes read from the given transferable (uses system clipboard if null). -
getTransferText
Returns an RMText object with the contents if there's a plain text string on the clipboard. -
getTransferPDF
Returns an RMImage with the contents if there's a pdf image on the clipboard. -
getTransferDataFlavors
Transferable method - returns the transfer data flavors supported by this transferable.- Specified by:
getTransferDataFlavors
in interfaceTransferable
-
isDataFlavorSupported
Transferable method - returns whether the given flavor is supported.- Specified by:
isDataFlavorSupported
in interfaceTransferable
-
getTransferData
Transferable method - returns the transfer data for the specified flavor.- Specified by:
getTransferData
in interfaceTransferable
- Throws:
UnsupportedFlavorException
IOException
-