Class GenericDrawArea

    • Constructor Detail

      • GenericDrawArea

        public GenericDrawArea​(StereoMolecule mol,
                               int mode,
                               GenericDialogHelper helper,
                               GenericCanvas canvas)
        Parameters:
        mol - an empty or valid stereo molecule
        mode - 0 or a meaningful combination of the mode flags, e.g. MODE_REACTION | MODE_DRAWING_OBJECTS
    • Method Detail

      • setClipboardHandler

        public void setClipboardHandler​(IClipboardHandler h)
        Call this after initialization to get clipboard support
        Parameters:
        h -
      • setReactionMapper

        public static void setReactionMapper​(IReactionMapper mapper)
      • lassoColor

        public static java.awt.Color lassoColor()
      • selectionColor

        public static java.awt.Color selectionColor()
      • mapToolColor

        public static java.awt.Color mapToolColor()
      • chainHiliteColor

        public static java.awt.Color chainHiliteColor()
      • buttonPressed

        protected void buttonPressed​(int button)
      • clearAll

        public void clearAll()
      • toolChanged

        public void toolChanged​(int newTool)
      • addPastedOrDropped

        public boolean addPastedOrDropped​(StereoMolecule mol,
                                          java.awt.Point p)
      • showHelpDialog

        public void showHelpDialog()
      • restoreState

        protected void restoreState()
      • storeState

        public void storeState()
      • moleculeChanged

        public void moleculeChanged()
        Use this to inform the JDrawArea after changing its molecule from outside.
      • moleculeChanged

        public void moleculeChanged​(boolean userChange)
        Ideally don't use this from outside JDrawArea. Use moleculeChanged() instead.
        Parameters:
        userChange - is true if the change was done within the editor
      • setMolecule

        public void setMolecule​(StereoMolecule theMolecule)
      • setFragments

        public void setFragments​(StereoMolecule[] fragment)
      • getReaction

        public Reaction getReaction()
        Returns:
        mapped reaction with absolute coordinates, but without drawing objects
      • getReactionAndDrawings

        public Reaction getReactionAndDrawings()
        Returns:
        mapped reaction with absolute coordinates and drawing objects
      • setReaction

        public void setReaction​(Reaction rxn)
      • setMarkushStructure

        public void setMarkushStructure​(MarkushStructure markush)
      • getDisplayMode

        public int getDisplayMode()
      • setDisplayMode

        public void setDisplayMode​(int dMode)
      • setAllowQueryFeatures

        public void setAllowQueryFeatures​(boolean allow)
        If set to false then any query features will be removed from the molecule and any functionality that allows to define atom- or bond-query features won't be available. This feature is only relevant if the molecule is a fragment.
        Parameters:
        allow - if false, then query feature editing is not allowed, even for molecules being a fragment
      • setAtomText

        public void setAtomText​(java.lang.String[] atomText)
        Defines additional atom text to be displayed in top right position of some/all atom label. If the atom is charged, then the atom text follows the charge information. If using atom text make sure to update it accordingly, if atom indexes change due to molecule changes. Atom text is not supported for MODE_REACTION, MODE_MULTIPLE_FRAGMENTS or MODE_MARKUSH_STRUCTURE.
        Parameters:
        atomText - String[] matching atom indexes (may contain null entries)
      • setDrawingObjects

        public void setDrawingObjects​(DrawingObjectList drawingObjectList)
      • getMode

        public int getMode()
      • getHiliteAtom

        public int getHiliteAtom()
      • getHiliteBond

        public int getHiliteBond()
      • setHiliteBondSet

        public void setHiliteBondSet​(int[] bondSet)
      • setReactionMode

        public void setReactionMode​(boolean rxn)
      • setUpdateMode

        protected void setUpdateMode​(int mode)
      • isAtomColorSupported

        public boolean isAtomColorSupported()
      • setAtomColorSupported

        public void setAtomColorSupported​(boolean acs)