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 booleancopyImage(java.awt.Image img)Copies an Image to the clipboardstatic booleancopyMetaFile(byte[] data)Copy a windows enhance metafile to the Windows clipboardbooleancopyMolecule(StereoMolecule mol)Copies a molecule to the clipboard in various formats: ENHMETAFILE with an embedded sketch MDLSK Sketch MDLCT MDL molfilebooleancopyMolecule(java.lang.String molfile)booleancopyReaction(Reaction r)Copies a reaction to the clipboard in various formats: MDLSK Sketch MDLCT MDL molfilebooleancopyReaction(java.lang.String ctab)Copies a reaction to the clipboard in various formats: CTAB with an embedded sketch MDLSK Sketch serializedstatic java.awt.ImagegetImage()Deprecated.Use ImageClipboardHandler.pasteImage for consistency reasonsjava.awt.ImagepasteImage()StereoMoleculepasteMolecule()Get one Molecule from the Clipboard.StereoMoleculepasteMolecule(boolean prefer2D)java.util.ArrayList<StereoMolecule>pasteMolecules()Get one or more Molecule(s) from the Clipboard.ReactionpasteReaction()Get a Reaction from the ClipboardReactionpasteReactionWindowsNative()static voidputImage(java.awt.Image image)Deprecated.You may use ImageClipboardHandler.copyImage for consistency reasonsstatic booleansetClipBoardData(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:
pasteMoleculesin 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, 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:
pasteMoleculein interfaceIClipboardHandler- Returns:
- Molecule found or null if no molecule present on the clipboard
-
pasteMolecule
public StereoMolecule pasteMolecule(boolean prefer2D)
-
pasteReaction
public Reaction pasteReaction()
Get a Reaction from the Clipboard- Specified by:
pasteReactionin interfaceIClipboardHandler- Returns:
- Reaction or null if no reaction present
-
pasteReactionWindowsNative
public Reaction pasteReactionWindowsNative()
-
copyMolecule
public boolean copyMolecule(java.lang.String molfile)
- Specified by:
copyMoleculein 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:
copyMoleculein interfaceIClipboardHandler
-
copyReaction
public boolean copyReaction(Reaction r)
Copies a reaction to the clipboard in various formats: MDLSK Sketch MDLCT MDL molfile- Specified by:
copyReactionin 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:
copyReactionin 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:
copyImagein interfaceIClipboardHandler- Parameters:
img- Image to be copied- Returns:
- true on success
-
pasteImage
public java.awt.Image pasteImage()
- Specified by:
pasteImagein 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
-
-