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.Transferable
Handles editor methods specific to clipboard operations (cut, copy paste).
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.datatransfer.DataFlavor
RMDataFlavor
static 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 void
copy(RMEditor anEditor)
Handles editor copy operation.static void
cut(RMEditor anEditor)
Handles editor cut operation.static RMShape
getShapeFromClipboard(RMEditor anEditor)
Returns the first Shape read from the system clipboard.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).java.lang.Object
getTransferData(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 RMShape
getTransferPDF(java.awt.datatransfer.Transferable contents)
Returns an RMImage with the contents if there's a pdf image on the clipboard.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.boolean
isDataFlavorSupported(java.awt.datatransfer.DataFlavor aFlavor)
Transferable method - returns whether the given flavor is supported.static void
paste(RMEditor anEditor)
Handles editor paste operation.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.
-
-
-
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:
getTransferDataFlavors
in interfacejava.awt.datatransfer.Transferable
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor aFlavor)
Transferable method - returns whether the given flavor is supported.- Specified by:
isDataFlavorSupported
in interfacejava.awt.datatransfer.Transferable
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor aFlavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
Transferable method - returns the transfer data for the specified flavor.- Specified by:
getTransferData
in interfacejava.awt.datatransfer.Transferable
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
-
-