Class 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 Detail

      • ClipboardHandler

        public ClipboardHandler()
    • 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 interface IClipboardHandler
        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 interface IClipboardHandler
        Returns:
        Molecule found or null if no molecule present on the clipboard
      • pasteReaction

        public Reaction pasteReaction()
        Get a Reaction from the Clipboard
        Specified by:
        pasteReaction in interface IClipboardHandler
        Returns:
        Reaction or null if no reaction present
      • pasteReactionWindowsNative

        public Reaction pasteReactionWindowsNative()
      • 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 interface IClipboardHandler
      • copyReaction

        public boolean copyReaction​(Reaction r)
        Copies a reaction to the clipboard in various formats: MDLSK Sketch MDLCT MDL molfile
        Specified by:
        copyReaction in interface IClipboardHandler
      • 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 interface IClipboardHandler
      • 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 interface IClipboardHandler
        Parameters:
        img - Image to be copied
        Returns:
        true on success
      • 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