Class ClipboardHandler
- java.lang.Object
-
- com.actelion.research.gui.clipboard.ClipboardHandler
-
- All Implemented Interfaces:
IClipboardHandler
public class ClipboardHandler extends java.lang.Object implements IClipboardHandler
Title: Actelion Library
Description: Actelion Java Library
Copyright: Copyright (c) 2002-2003
Company: Actelion Ltd
- Version:
- 1.0
- Author:
- Thomas Sander, Christian Rufener
-
-
Constructor Summary
Constructors Constructor Description ClipboardHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
copyImage(java.awt.Image img)
Copies an Image to the clipboardstatic boolean
copyMetaFile(byte[] data)
Copy a windows enhance metafile to the Windows clipboardboolean
copyMolecule(StereoMolecule mol)
Copies a molecule to the clipboard in various formats: ENHMETAFILE with an embedded sketch MDLSK Sketch MDLCT MDL molfileboolean
copyMolecule(java.lang.String molfile)
boolean
copyReaction(Reaction r)
Copies a reaction to the clipboard in various formats: MDLSK Sketch MDLCT MDL molfileboolean
copyReaction(java.lang.String ctab)
Copies a reaction to the clipboard in various formats: CTAB with an embedded sketch MDLSK Sketch serializedstatic java.awt.Image
getImage()
Deprecated.Use ImageClipboardHandler.pasteImage for consistency reasonsjava.awt.Image
pasteImage()
StereoMolecule
pasteMolecule()
Get one Molecule from the Clipboard.StereoMolecule
pasteMolecule(boolean prefer2D, int smartsMode)
java.util.ArrayList<StereoMolecule>
pasteMolecules()
Get one or more Molecule(s) from the Clipboard.Reaction
pasteReaction()
Get a Reaction from the ClipboardReaction
pasteReactionWindowsNative()
static void
putImage(java.awt.Image image)
Deprecated.You may use ImageClipboardHandler.copyImage for consistency reasonsstatic boolean
setClipBoardData(java.lang.String format, byte[] buffer)
-
-
-
Method Detail
-
pasteMolecules
public java.util.ArrayList<StereoMolecule> pasteMolecules()
Get one or more Molecule(s) from the Clipboard. On all platforms the first choice is a serialized StereoMolecule. Further supported formats on Windows are: MDLSK,MDLCT,MDL_MOL,CF_ENHMETAFILE with embedded sketch. If no supported format is found and the clipboard contains text, which can be interpreted as molfile, then the corresponding molecule is returned. If the clipboard contains one or multiple SMILES, IUPAC name(s) or idcode(s), then the corresponding molecule(s) is/are returned. These can be multiple if allowMultiple is true. Otherwise, if a StructureNameResolver is present, then it tries to interpret the name(s) and returns the corresponding molecules, which may be limited to a certain number.- Specified by:
pasteMolecules
in interfaceIClipboardHandler
- Returns:
- Molecule found or null if no molecule present on the clipboard
-
pasteMolecule
public StereoMolecule pasteMolecule()
Get one Molecule from the Clipboard. On all platforms the first choice is a serialized StereoMolecule. Further supported formats on Windows are: MDLSK,MDLCT,MDL_MOL,CF_ENHMETAFILE with embedded sketch. If no supported format is found and the clipboard contains text, which can be interpreted as molfile, SMILES (with SMARTS features), IUPAC name or idcode, then the corresponding molecule is returned. Otherwise, if a StructureNameResolver is present, then it tries to interpret the name. If the clipboard molecule has 3D coordinates, then new 2D-coords are invented and used instead.- Specified by:
pasteMolecule
in interfaceIClipboardHandler
- Returns:
- Molecule found or null if no molecule present on the clipboard
-
pasteMolecule
public StereoMolecule pasteMolecule(boolean prefer2D, int smartsMode)
- Specified by:
pasteMolecule
in interfaceIClipboardHandler
-
pasteReaction
public Reaction pasteReaction()
Get a Reaction from the Clipboard- Specified by:
pasteReaction
in interfaceIClipboardHandler
- Returns:
- Reaction or null if no reaction present
-
pasteReactionWindowsNative
public Reaction pasteReactionWindowsNative()
-
copyMolecule
public boolean copyMolecule(java.lang.String molfile)
- Specified by:
copyMolecule
in interfaceIClipboardHandler
-
copyMolecule
public boolean copyMolecule(StereoMolecule mol)
Copies a molecule to the clipboard in various formats: ENHMETAFILE with an embedded sketch MDLSK Sketch MDLCT MDL molfile- Specified by:
copyMolecule
in interfaceIClipboardHandler
-
copyReaction
public boolean copyReaction(Reaction r)
Copies a reaction to the clipboard in various formats: MDLSK Sketch MDLCT MDL molfile- Specified by:
copyReaction
in interfaceIClipboardHandler
-
copyReaction
public boolean copyReaction(java.lang.String ctab)
Copies a reaction to the clipboard in various formats: CTAB with an embedded sketch MDLSK Sketch serialized- Specified by:
copyReaction
in interfaceIClipboardHandler
-
setClipBoardData
public static boolean setClipBoardData(java.lang.String format, byte[] buffer)
-
copyMetaFile
public static boolean copyMetaFile(byte[] data)
Copy a windows enhance metafile to the Windows clipboard- Parameters:
data
- byte[]- Returns:
- boolean
-
copyImage
public boolean copyImage(java.awt.Image img)
Copies an Image to the clipboard- Specified by:
copyImage
in interfaceIClipboardHandler
- Parameters:
img
- Image to be copied- Returns:
- true on success
-
pasteImage
public java.awt.Image pasteImage()
- Specified by:
pasteImage
in interfaceIClipboardHandler
-
getImage
public static java.awt.Image getImage()
Deprecated.Use ImageClipboardHandler.pasteImage for consistency reasons
-
putImage
public static void putImage(java.awt.Image image)
Deprecated.You may use ImageClipboardHandler.copyImage for consistency reasons
-
-