Class RendererModel

    • Constructor Detail

      • RendererModel

        public RendererModel()
        Construct a renderer model with no parameters. To put parameters into the model, use the registerParameters method.
    • Method Detail

      • registerParameters

        public void registerParameters​(IGenerator<? extends IChemObject> generator)
        Registers rendering parameters from IGenerators with this model.
        Parameters:
        generator -
      • getMerge

        public Map<IAtom,​IAtom> getMerge()
        This is the central facility for handling "merges" of atoms. A merge occures if during moving atoms an atom is in Range of another atom. These atoms are then put into the merge map as a key-value pair. During the move, the atoms are then marked by a circle and on releasing the mouse they get actually merged, meaning one atom is removed and bonds pointing to this atom are made to point to the atom it has been marged with.
        Returns:
        Returns the merge.map
      • getHighlightedAtom

        public IAtom getHighlightedAtom()
        Returns the atom currently highlighted.
        Returns:
        the atom currently highlighted
      • setHighlightedAtom

        public void setHighlightedAtom​(IAtom highlightedAtom)
        Sets the atom currently highlighted.
        Parameters:
        highlightedAtom - The atom to be highlighted
      • getHighlightedBond

        public IBond getHighlightedBond()
        Returns the Bond currently highlighted.
        Returns:
        the Bond currently highlighted
      • setHighlightedBond

        public void setHighlightedBond​(IBond highlightedBond)
        Sets the Bond currently highlighted.
        Parameters:
        highlightedBond - The Bond to be currently highlighted
      • getClipboardContent

        public IAtomContainer getClipboardContent()
        Returns the atoms and bonds on the Renderer2D clipboard. If the clipboard is empty it returns null. Primarily used for copy/paste.
        Returns:
        an atomcontainer with the atoms and bonds on the clipboard.
      • setClipboardContent

        public void setClipboardContent​(IAtomContainer content)
        Sets the atoms and bonds on the Renderer2D clipboard. Primarily used for copy/paste.
        Parameters:
        content - the new content of the clipboard.
      • addCDKChangeListener

        public void addCDKChangeListener​(ICDKChangeListener listener)
        Adds a change listener to the list of listeners.
        Parameters:
        listener - The listener added to the list
      • removeCDKChangeListener

        public void removeCDKChangeListener​(ICDKChangeListener listener)
        Removes a change listener from the list of listeners.
        Parameters:
        listener - The listener removed from the list
      • fireChange

        public void fireChange()
        Notifies registered listeners of certain changes that have occurred in this model.
      • getToolTipText

        public String getToolTipText​(IAtom atom)
        Gets the toolTipText for atom certain atom.
        Parameters:
        atom - The atom.
        Returns:
        The toolTipText value.
      • setToolTipTextMap

        public void setToolTipTextMap​(Map<IAtom,​String> map)
        Sets the toolTipTextMap.
        Parameters:
        map - A map containing Atoms of the current molecule as keys and Strings to display as values. A line break will be inserted where a \n is in the string.
      • getToolTipTextMap

        public Map<IAtom,​String> getToolTipTextMap()
        Gets the toolTipTextMap.
        Returns:
        The toolTipTextValue.
      • getExternalSelectedPart

        public IAtomContainer getExternalSelectedPart()
        Get externally selected atoms. These are atoms selected externally in e. g. Bioclipse via the ChemObjectTree, painted in externalSelectedPartColor
        Returns:
        the selected part
      • setExternalSelectedPart

        public void setExternalSelectedPart​(IAtomContainer externalSelectedPart)
        Set externally selected atoms. These are atoms selected externally in e. g. Bioclipse via the ChemObjectTree, painted in externalSelectedPartColor
        Parameters:
        externalSelectedPart - the selected part
      • getNotification

        public boolean getNotification()
        Determines if the model sends around change notifications.
        Returns:
        true, if notifications are sent around upon changes
      • hasParameter

        public <T extends IGeneratorParameter<?>> boolean hasParameter​(Class<T> param)
        Returns true if the passed IGeneratorParameters has been registered.
        Parameters:
        param - parameter for which it is tested if it is registered
        Returns:
        boolean indicating the parameters is registered
      • setNotification

        public void setNotification​(boolean notification)
        Dis- or enables sending around change notifications.
        Parameters:
        notification - true if notifications should be sent, false otherwise.