jpicedt.graphic.toolkit
Class TransferableGraphic
java.lang.Object
jpicedt.graphic.toolkit.TransferableGraphic
- All Implemented Interfaces:
- ClipboardOwner, Transferable
- public class TransferableGraphic
- extends Object
- implements Transferable, ClipboardOwner
Wrapper 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,...
Constructor Summary |
TransferableGraphic(Element[] elements,
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). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JPICEDT_DATA_FLAVOR
public static final DataFlavor JPICEDT_DATA_FLAVOR
- the DataFlavor for Element's
TransferableGraphic
public TransferableGraphic(Element[] elements,
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
getTransferData
public Object getTransferData(DataFlavor flavor)
- Specified by:
getTransferData
in interface 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 DataFlavor[] getTransferDataFlavors()
- Specified by:
getTransferDataFlavors
in interface 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(DataFlavor flavor)
- Specified by:
isDataFlavorSupported
in interface 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(Clipboard c,
Transferable contents)
- Notifies this object that it is no longer the owner of the content of the clipboard
This implementation does nothing.
- Specified by:
lostOwnership
in interface ClipboardOwner
- Since:
- jPicEdt 1.3.2
Submit a bug : syd@jpicedt.org