Class RMEditorClipboard
- java.lang.Object
-
- com.inductiveautomation.rm.editor.RMEditorClipboard
-
- All Implemented Interfaces:
java.awt.datatransfer.Transferable
public class RMEditorClipboard extends java.lang.Object implements java.awt.datatransfer.TransferableHandles editor methods specific to clipboard operations (cut, copy paste).
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.datatransfer.DataFlavorRMDataFlavorstatic java.awt.datatransfer.DataFlavor[]SupportedFlavors
-
Constructor Summary
Constructors Constructor Description RMEditorClipboard(byte[] bytes)Creates new editor clipboard object with the given bytes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcopy(RMEditor anEditor)Handles editor copy operation.static voidcut(RMEditor anEditor)Handles editor cut operation.static RMShapegetShapeFromClipboard(RMEditor anEditor)Returns the first Shape read from the system clipboard.static java.lang.ObjectgetShapesFromClipboard(RMEditor anEditor, java.awt.datatransfer.Transferable contents)Returns the shape or shapes read from the given transferable (uses system clipboard if null).java.lang.ObjectgetTransferData(java.awt.datatransfer.DataFlavor aFlavor)Transferable method - returns the transfer data for the specified flavor.java.awt.datatransfer.DataFlavor[]getTransferDataFlavors()Transferable method - returns the transfer data flavors supported by this transferable.static RMShapegetTransferPDF(java.awt.datatransfer.Transferable contents)Returns an RMImage with the contents if there's a pdf image on the clipboard.static RMShapegetTransferText(java.awt.datatransfer.Transferable contents)Returns an RMText object with the contents if there's a plain text string on the clipboard.booleanisDataFlavorSupported(java.awt.datatransfer.DataFlavor aFlavor)Transferable method - returns whether the given flavor is supported.static voidpaste(RMEditor anEditor)Handles editor paste operation.static voidpaste(RMEditor anEditor, java.awt.datatransfer.Transferable contents, RMParentShape aParent, java.awt.geom.Point2D aPoint)Handles editor paste operation for given transferable, parent shape and location.
-
-
-
Method Detail
-
cut
public static void cut(RMEditor anEditor)
Handles editor cut operation.
-
copy
public static void copy(RMEditor anEditor)
Handles editor copy operation.
-
paste
public static void paste(RMEditor anEditor)
Handles editor paste operation.
-
paste
public static void paste(RMEditor anEditor, java.awt.datatransfer.Transferable contents, RMParentShape aParent, java.awt.geom.Point2D aPoint)
Handles editor paste operation for given transferable, parent shape and location.
-
getShapeFromClipboard
public static RMShape getShapeFromClipboard(RMEditor anEditor)
Returns the first Shape read from the system clipboard.
-
getShapesFromClipboard
public static java.lang.Object getShapesFromClipboard(RMEditor anEditor, java.awt.datatransfer.Transferable contents)
Returns the shape or shapes read from the given transferable (uses system clipboard if null).
-
getTransferText
public static RMShape getTransferText(java.awt.datatransfer.Transferable contents)
Returns an RMText object with the contents if there's a plain text string on the clipboard.
-
getTransferPDF
public static RMShape getTransferPDF(java.awt.datatransfer.Transferable contents)
Returns an RMImage with the contents if there's a pdf image on the clipboard.
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Transferable method - returns the transfer data flavors supported by this transferable.- Specified by:
getTransferDataFlavorsin interfacejava.awt.datatransfer.Transferable
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor aFlavor)
Transferable method - returns whether the given flavor is supported.- Specified by:
isDataFlavorSupportedin interfacejava.awt.datatransfer.Transferable
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor aFlavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOExceptionTransferable method - returns the transfer data for the specified flavor.- Specified by:
getTransferDatain interfacejava.awt.datatransfer.Transferable- Throws:
java.awt.datatransfer.UnsupportedFlavorExceptionjava.io.IOException
-
-