Package jpicedt.graphic.toolkit
Class TransferableGraphic
- java.lang.Object
-
- jpicedt.graphic.toolkit.TransferableGraphic
-
- All Implemented Interfaces:
java.awt.datatransfer.ClipboardOwner,java.awt.datatransfer.Transferable
public class TransferableGraphic extends java.lang.Object implements java.awt.datatransfer.Transferable, java.awt.datatransfer.ClipboardOwnerWrapper for Element's that can be transfered to/from a Clipboard. Contrary to a BranchElement implementation : - this object stores a reference to a CLONE of the Element(s) of interest, not to the Element(s) itself (this allow the source Element to be further modified w/o affecting the content of this TransferableGraphic, which is necessary for proper ClipBoard behaviour) - As a result, Element's added to this TransferableGraphic have no parent, no view,...
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.datatransfer.DataFlavorJPICEDT_DATA_FLAVORthe DataFlavor for Element's
-
Constructor Summary
Constructors Constructor Description TransferableGraphic(Element[] elements, java.lang.String formatted)Construct a new TransferableGraphic from a clone of the given elements and the given String containing the formatted representation of the elements (this depends on the ContentType of of the caller).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetTransferData(java.awt.datatransfer.DataFlavor flavor)java.awt.datatransfer.DataFlavor[]getTransferDataFlavors()booleanisDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)voidlostOwnership(java.awt.datatransfer.Clipboard c, java.awt.datatransfer.Transferable contents)Notifies this object that it is no longer the owner of the content of the clipboard This implementation does nothing.
-
-
-
Constructor Detail
-
TransferableGraphic
public TransferableGraphic(Element[] elements, java.lang.String formatted)
Construct a new TransferableGraphic from a clone of the given elements and the given String containing the formatted representation of the elements (this depends on the ContentType of of the caller).- Parameters:
elements- an array of elements to be set as the content of this Transferableformatted- the text representation of the given elements (can be null)- Since:
- jPicEdt 1.3.2
-
-
Method Detail
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
- Specified by:
getTransferDatain interfacejava.awt.datatransfer.Transferable- Parameters:
flavor- the requested flavor for the data- Returns:
- an Object which represents the data to be transferred. Current implementation returns an array of elements if flavor is of type "JPICEDT_DATA_FLAVOR", or a string representation of the elements (as given in the constructor) is flavor is of type "DataFlavor.stringFlavor".
- Since:
- jPicEdt 1.3.2
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
- Specified by:
getTransferDataFlavorsin interfacejava.awt.datatransfer.Transferable- Returns:
- an array of DataFlavor objects indicating the flavors the data can be provided in.
- Since:
- jPicEdt 1.3.2
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
- Specified by:
isDataFlavorSupportedin interfacejava.awt.datatransfer.Transferable- Returns:
- whether or not the specified data flavor is supported for this TransferableGraphic Currently only "stringFlavor" and "javaJVMLocalObjectMimeType" are supported.
- Since:
- jPicEdt 1.3.2
-
lostOwnership
public void lostOwnership(java.awt.datatransfer.Clipboard c, java.awt.datatransfer.Transferable contents)Notifies this object that it is no longer the owner of the content of the clipboard This implementation does nothing.- Specified by:
lostOwnershipin interfacejava.awt.datatransfer.ClipboardOwner- Since:
- jPicEdt 1.3.2
-
-