Interface MTransferable
-
- All Superinterfaces:
Transferable
- All Known Implementing Classes:
MarvinTransferable
@PublicAPI public interface MTransferable extends Transferable
The interface of Marvin transferable implementations.
This interface extends the functionality of the standard Java transferable interface.
Marvin utilizes the transferable objects to put Molecule objects to the clipboard in various formats, and to retrieve Molecule data back from the clipboard. The
Transferable.getTransferData(java.awt.datatransfer.DataFlavor)
function is responsible to place the data to the clipboard in a format specified by itsDataFlavor
s and as a Molecule object when importing from clipboard, if the implementation supports the input from clipboard.Every implementation should have a name which identifies the MTransferable in the registry. While naming the MTransferable the developer should keep in mind that the name will be displayed in the Copy As dialog window, if the
TransferableDescriptor
object of theMTransferable
in the registry is configured so.In the default java clipboard handling there are some native formats which will be registered into the
SystemFlavorMap
. If any of the DataFlavors supported by the implementation requires a native format to be registered to the SystemFlavorMap, then the implementation should define theregisterNativeNames()
function which will be called automatically byClipboardHandler
.
- Since:
- Marvin 5.3 07/27/2009
-
-
Field Summary
Fields Modifier and Type Field Description static int
CLIPBOARD_OPERATION_GET
Flag that indicates an import operationstatic int
CLIPBOARD_OPERATION_PUT
Flag that indicates an export operationstatic int
CLIPBOARD_OPERATION_UNDEFINED
Undefined clipboard operation state identifierstatic String
CLIPBOARD_ORIGIN_IS_FILE
Temporary property name to mark the molecule if it comes from a file via the clipboard
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isInputAvailable()
Checks that the implementation supports input from clipboard.void
registerNativeNames()
Registers the Native names supported by the implementation.void
setMolecule(Molecule mol)
Sets the Molecule which will be represented by the transferable.void
setProperties(Properties props)
Sets display properties of the Molecule.void
setTransfer(Transferable transfer)
Sets the Transferable for importing Molecule from that.-
Methods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
-
-
-
-
Field Detail
-
CLIPBOARD_OPERATION_UNDEFINED
static final int CLIPBOARD_OPERATION_UNDEFINED
Undefined clipboard operation state identifier- See Also:
- Constant Field Values
-
CLIPBOARD_OPERATION_PUT
static final int CLIPBOARD_OPERATION_PUT
Flag that indicates an export operation- See Also:
- Constant Field Values
-
CLIPBOARD_OPERATION_GET
static final int CLIPBOARD_OPERATION_GET
Flag that indicates an import operation- See Also:
- Constant Field Values
-
CLIPBOARD_ORIGIN_IS_FILE
static final String CLIPBOARD_ORIGIN_IS_FILE
Temporary property name to mark the molecule if it comes from a file via the clipboard- See Also:
- Constant Field Values
-
-
Method Detail
-
setMolecule
void setMolecule(Molecule mol)
Sets the Molecule which will be represented by the transferable.- Parameters:
mol
- the Molecule object that will be exported to the clipboard.
-
setProperties
void setProperties(Properties props)
Sets display properties of the Molecule. This parameter is useful when transferring Molecule images to clipboard, and can be one of, or the union of properties stored inUserSettings
, and in the result ofMDocument.getGUIPropertyContainer()
.
By default only those objects will use this that export image to the clipboard.- Parameters:
props
- the properties- See Also:
ImageExportUtil
-
registerNativeNames
void registerNativeNames()
Registers the Native names supported by the implementation. This has to be done for all native formats which are not supported by default in Java.
This function will be called from ClipboardHandler before performing the first clipboard operation.
-
isInputAvailable
boolean isInputAvailable()
Checks that the implementation supports input from clipboard.- Returns:
- true if the representation could read a Molecule from Clipboard false otherwise
-
setTransfer
void setTransfer(Transferable transfer)
Sets the Transferable for importing Molecule from that. This method should not be called if the implementation does not support input from clipboard.- Parameters:
transfer
- theTransferable
object- See Also:
isInputAvailable()
-
-