|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.modules.datatransfer.ClipboardHandler
public final class ClipboardHandler
Facade of the Clipboard handling in Marvin.
Utility class that can be used to transfer Molecule or other data from Marvin to the system clipboard using cut/copy/paste operations.
| Field Summary | |
|---|---|
static java.lang.String |
BMP_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
CDX_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
CXSMILES_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
DEFAULT_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
EMF_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
GIF_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
IUPAC_INCHI_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
IUPAC_INCHIKEY_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
IUPAC_NAME_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
JPG_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
MDL_MOL_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
MDL_RXN_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
MRV_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
OLE_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
PDF_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
PNG_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
PS_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
SKC_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
SMILES_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
STRING_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
static java.lang.String |
TIFF_TRANSFERABLE_NAME
Deprecated. will be deleted in 5.4 |
| Method Summary | |
|---|---|
static void |
addTransferable(java.lang.String name,
java.lang.String className,
java.lang.Integer priority,
java.lang.Integer inputPriority,
boolean isdefault,
boolean copyAsTransferable)
Deprecated. use addTransferable(String, String, Integer, Integer, boolean, boolean, boolean) instead. |
static void |
addTransferable(java.lang.String name,
java.lang.String className,
java.lang.Integer priority,
java.lang.Integer inputPriority,
boolean isdefault,
boolean copyAsTransferable,
boolean dndTransferable)
Add a TransferableDescriptor to the registry, and constructing it
by the given parameters. |
static void |
addTransferable(TransferableDescriptor d)
Add a TransferableDescriptor to the MTransferable
Registry. |
static void |
clearClipboard()
Clears the clipboard by creating an empty Transferable and placing it on the clipboard. |
static java.awt.datatransfer.Clipboard |
getClipboard()
Returns the default Toolkit's system clipboard if available, otherwise returns a new singleton clipboard instance. |
static java.lang.Runnable |
getClipboardClearerTask()
Deprecated. see setWorkOnBackground(boolean) |
static java.util.List<java.lang.String> |
getCopyAsTransferableNames()
Returns the format's names that are available in the current environment as transfer types for the Copy As dialog. |
static java.util.List<java.lang.String> |
getCopyAsTransferFormatIds()
Deprecated. changed the method name to getCopyAsTransferableNames() |
static java.lang.Object |
getDataFromClipboardOLE()
Deprecated. this method will not be available after 5.4 |
static java.lang.String |
getDefaultTransferFormatId()
Deprecated. since 5.3.3 |
static java.lang.Runnable |
getImageToClipboardTask(java.awt.Image img)
Deprecated. see setWorkOnBackground(boolean) |
static java.util.logging.Logger |
getLog()
Returns the Logger of the Clipboard handler subsystem. |
static java.lang.Runnable |
getMoleculeToClipboardTask(Molecule mol,
java.util.Properties props,
java.lang.String formatId)
Deprecated. see setWorkOnBackground(boolean) |
static java.lang.Object |
getObjectFromClipboard()
Returns the current content of the clipboard if the data can be imported in any of data formats supported by MolImporter. |
static java.lang.Object |
getObjectFromTransferable(java.awt.datatransfer.Transferable transfer)
Returns the content of Transferable if the data can be imported in any of data formats supported by MolImporter. |
static java.lang.Runnable |
getOLEToClipboardTask(Molecule mol,
java.util.Properties props)
Deprecated. see setWorkOnBackground(boolean) |
static java.lang.String |
getStringFromClipboard()
Returns the String data from the clipboard contents, if the clipboard contains a Transferable that provides support to DataFlavor.stringFlavor |
static java.lang.Runnable |
getStringToClipboardTask(java.lang.String str)
Deprecated. see setWorkOnBackground(boolean) |
static java.awt.datatransfer.Transferable |
getTransferableFor(Molecule mol,
java.util.Properties props)
Creates a MTransferable object to the given Molecule with
the given properties. |
static java.awt.datatransfer.Transferable |
getTransferableFor(Molecule mol,
java.util.Properties props,
java.lang.String fmt)
Creates a MTransferable to the given Molecule with the
given properties in the given format. |
static boolean |
getWorkOnBackGround()
Returns whether the subsystem works on the current thread or on a background thread. |
static boolean |
isClearClipboardBeforeExport()
Returns whether the subsystem clears the clipboard before a copy operation. |
static boolean |
isSupportedTransferFormat(java.lang.String fmtId)
Checks whether the given format is available in the current environment or not. |
static void |
putImageToClipboard(java.awt.Image img)
Places the given Image to the clipboard. |
static void |
putMoleculeToClipboard(Molecule mol,
java.util.Properties props)
Places a Molecule object to the clipboard which is represented as a Transferable being configured to support all the default Transfer types of Marvin. |
static void |
putMoleculeToClipboard(Molecule mol,
java.util.Properties props,
java.lang.String fmt)
Places a Molecule object to the clipboard which is represented as a Transferable configured to support the transfer types of the specified format identifier. |
static void |
putOLEToClipboard(Molecule mol,
java.util.Properties props)
Deprecated. use simply putMoleculeToClipboard(Molecule, Properties) |
static void |
putStringToClipboard(java.lang.String str)
Places the given String to the clipboard as a StringSelection. |
static void |
releasePermanentResources()
Releases all clipboard related native libraries and resources. |
static void |
removeOLESupport()
Removing the support of OLE transfer format. |
static TransferableDescriptor |
removeTransferable(java.lang.String name)
Removes a TransferableDescriptor to the MTransferable
Registry by name. |
static TransferableDescriptor |
removeTransferable(TransferableDescriptor d)
Removes a TransferableDescriptor to the MTransferable
Registry. |
static void |
setClearClipboardBeforeExport(boolean b)
Sets whether the subsystem should clear the clipboard before a copy operation. |
static void |
setWorkOnBackground(boolean b)
Starts or stops the background worker thread and ensures the required state for the type of work. |
static void |
startPermanentResources()
Starts all the permanent native resources that have to be started to do fast and reliable copy in Marvin. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Deprecated public static final java.lang.String DEFAULT_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String OLE_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String EMF_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String JPG_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String PNG_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String MRV_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String IUPAC_NAME_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String IUPAC_INCHI_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String IUPAC_INCHIKEY_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String CDX_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String SKC_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String MDL_MOL_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String MDL_RXN_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String SMILES_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String CXSMILES_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String STRING_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String BMP_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String PDF_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String PS_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String TIFF_TRANSFERABLE_NAME
@Deprecated public static final java.lang.String GIF_TRANSFERABLE_NAME
| Method Detail |
|---|
public static java.util.logging.Logger getLog()
public static void setWorkOnBackground(boolean b)
b - true means working in the background, false means working on
the current thread.public static boolean getWorkOnBackGround()
public static void setClearClipboardBeforeExport(boolean b)
b - true or falsepublic static boolean isClearClipboardBeforeExport()
public static void putStringToClipboard(java.lang.String str)
StringSelection.
When processing on a background thread, this method will continuously try
to put the String to the clipboard until the operation has succeeded.
str - the String to be placed to the clipboard
java.lang.IllegalStateException - if the clipboard is currently unavailable, and running on the
current thread.public static void putImageToClipboard(java.awt.Image img)
img - the Image to be placed to the clipboard
java.lang.IllegalStateException - if the clipboard is currently unavailable, and running on the
current thread.
public static void putMoleculeToClipboard(Molecule mol,
java.util.Properties props)
mol - the Molecule to be placed to the clipboardprops - display properties of the Molecule, this parameter will be
used when transferring Molecule images to clipboard, and can
be one of, or the union of properties stored in
UserSettings, and in the result
of MDocument.getGUIPropertyContainer()
java.lang.IllegalStateException - if the clipboard is currently unavailable, and running on the
current thread.ImageExportUtil
public static void putMoleculeToClipboard(Molecule mol,
java.util.Properties props,
java.lang.String fmt)
mol - the Molecule to be placed to the clipboardprops - 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 in
UserSettings, and in the result
of MDocument.getGUIPropertyContainer()fmt - format identifier in which the data will be represented on the
clipboard. It can be null in which case the Molecule will be
transferred in the default formats.
java.lang.IllegalStateException - if the clipboard is currently unavailable, and running on the
current thread.ImageExportUtilpublic static void removeOLESupport()
public static java.lang.String getStringFromClipboard()
DataFlavor.stringFlavor
public static java.lang.Object getObjectFromClipboard()
public static java.lang.Object getObjectFromTransferable(java.awt.datatransfer.Transferable transfer)
transfer - the Transferable which represents the data
public static java.awt.datatransfer.Transferable getTransferableFor(Molecule mol,
java.util.Properties props)
MTransferable object to the given Molecule with
the given properties.
mol - the Molecule which has to be represented by the Transferableprops - display properties of the Molecule, this parameter will be
used when transferring Molecule images to clipboard, and can
be one of, or the union of properties stored in
UserSettings, and in the result
of MDocument.getGUIPropertyContainer()
ImageExportUtil
public static java.awt.datatransfer.Transferable getTransferableFor(Molecule mol,
java.util.Properties props,
java.lang.String fmt)
MTransferable to the given Molecule with the
given properties in the given format.
mol - the Molecule which has to be represented by the Transferableprops - display properties of the Molecule, this parameter will be
used when transferring Molecule images to clipboard, and can
be one of, or the union of properties stored in
UserSettings, and in the result
of MDocument.getGUIPropertyContainer()fmt - format identifier in which the data will be represented on the
clipboard. It can be null in which case the Molecule will be
transferred in the default formats. If null is given, the
default will be used.
ImageExportUtilpublic static boolean isSupportedTransferFormat(java.lang.String fmtId)
fmtId - the format identifier
public static java.util.List<java.lang.String> getCopyAsTransferableNames()
public static void clearClipboard()
public static java.awt.datatransfer.Clipboard getClipboard()
Toolkit.getSystemClipboard()public static TransferableDescriptor removeTransferable(TransferableDescriptor d)
TransferableDescriptor to the MTransferable
Registry.
d - the descriptor.
public static TransferableDescriptor removeTransferable(java.lang.String name)
TransferableDescriptor to the MTransferable
Registry by name.
name - the name of the MTransferable
public static void addTransferable(TransferableDescriptor d)
TransferableDescriptor to the MTransferable
Registry.
d - the descriptor.
@Deprecated
public static void addTransferable(java.lang.String name,
java.lang.String className,
java.lang.Integer priority,
java.lang.Integer inputPriority,
boolean isdefault,
boolean copyAsTransferable)
addTransferable(String, String, Integer, Integer, boolean, boolean, boolean) instead.
TransferableDescriptor to the registry, and constructing it
by the given parameters.
public static void addTransferable(java.lang.String name,
java.lang.String className,
java.lang.Integer priority,
java.lang.Integer inputPriority,
boolean isdefault,
boolean copyAsTransferable,
boolean dndTransferable)
TransferableDescriptor to the registry, and constructing it
by the given parameters.
name - of the MTransferable represented by the descriptor.className - The representing class name of the MTransferable represented
by the descriptor.priority - priority on the Copy as dialog of the MTransferable
represented by the descriptor.inputPriority - priority used when importing with the help of the
MTransferable represented by the descriptor.isdefault - decides whether the MTransferable should be used in default
copy.copyAsTransferable - decides whether the MTrasnferable should be displayed in the
copy as dialog.dndTransferable - flag to indicate whether the transferable is used when importing
data from a dropped objectpublic static void releasePermanentResources()
public static void startPermanentResources()
@Deprecated public static java.util.List<java.lang.String> getCopyAsTransferFormatIds()
@Deprecated public static java.lang.String getDefaultTransferFormatId()
@Deprecated
public static java.lang.Runnable getMoleculeToClipboardTask(Molecule mol,
java.util.Properties props,
java.lang.String formatId)
setWorkOnBackground(boolean)
mol - props - formatId -
@Deprecated
public static java.lang.Runnable getOLEToClipboardTask(Molecule mol,
java.util.Properties props)
setWorkOnBackground(boolean)
mol - props -
@Deprecated public static java.lang.Runnable getStringToClipboardTask(java.lang.String str)
setWorkOnBackground(boolean)
str -
java.lang.IllegalStateException@Deprecated public static java.lang.Runnable getImageToClipboardTask(java.awt.Image img)
setWorkOnBackground(boolean)
img -
@Deprecated public static java.lang.Runnable getClipboardClearerTask()
setWorkOnBackground(boolean)
@Deprecated
public static void putOLEToClipboard(Molecule mol,
java.util.Properties props)
putMoleculeToClipboard(Molecule, Properties)
mol - props - @Deprecated public static java.lang.Object getDataFromClipboardOLE()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||