Class SgroupAtom

    • Constructor Detail

      • SgroupAtom

        public SgroupAtom​(SuperatomSgroup sg)
        Constructs a superatom for a superatom type S-group.
        Parameters:
        sg - the S-group
    • Method Detail

      • getSgroup

        public SuperatomSgroup getSgroup()
        Gets the S-group corresponding to this superatom.
        Returns:
        the S-group
      • set

        public void set​(MolAtom atom)
        Set properties of this S-group superatom.
        Overrides:
        set in class MolAtom
        Parameters:
        atom - the target atom
        Since:
        Marvin 4.1, 01/01/2006
      • cloneFromSgroupCopy

        public SgroupAtom cloneFromSgroupCopy()
        Clones the S-group superatom partially. This method is needed to prevent infinite recursion when cloning from SuperatomSgroup.copy. Use it only for this purpose.
        Returns:
        the clone
      • transform

        public void transform​(CTransform3D t,
                              boolean incg)
        Apply a transformation matrix to the coordinates.
        Overrides:
        transform in class MolAtom
        Parameters:
        t - the transformation matrix
        incg - graph invariants are changed (true) or not (false)
        Since:
        Marvin 4.0.2, 10/26/2005
      • getSymbol

        public String getSymbol()
        Gets the abbreviated group symbol.
        Overrides:
        getSymbol in class MolAtom
        Returns:
        the symbol
      • getLeftName

        public String getLeftName()
        Gets the string that will be shown at the left side of the molecule.
        Returns:
        the left name string
        Since:
        Marvin 4.1
      • setLeftName

        public void setLeftName​(String s)
        Set the string that will be shown at the left side of the molecule.
        Parameters:
        s -
        Since:
        Marvin 4.1
      • getRightName

        public String getRightName()
        Set the string that will be shown at the right side of the molecule.
        Since:
        Marvin 4.1
      • setRightName

        public void setRightName​(String s)
        Set the string that will be shown at the right side of the molecule.
        Parameters:
        s -
        Since:
        Marvin 4.1
      • hasAlternativeName

        public boolean hasAlternativeName()
        Checks whether there is an alternative name at all.
        Returns:
        true if an alternative name is available for the (s)group
        Since:
        Marvin 4.1
      • hasValenceError

        public boolean hasValenceError()
        Checks if any atom of the Sgroup has a valence error.
        Overrides:
        hasValenceError in class MolAtom
        Returns:
        true if at least one atom of this Sgroup has a valence error
        See Also:
        MolAtom.valenceCheck()
      • getLabelCenter

        public int getLabelCenter()
        Gets the index of the character in the label the bonds should point to.
        Returns:
        character index + 1, or LABEL_DEFAULT for default behavior (geometrical center unless alternative name is specified), or LABEL_AUTO for automatic calculation
        Since:
        Marvin 4.1
      • setLabelCenter

        public void setLabelCenter​(int k)
        Sets the index of the character in the label the bonds should point to.
        Parameters:
        k - character index + 1, or LABEL_DEFAULT for default behavior (geometrical center unless alternative name is specified), or LABEL_AUTO for automatic calculation
        Since:
        Marvin 4.1
      • setFromSgroupCopy

        protected void setFromSgroupCopy​(SgroupAtom sa)
        Make a copy of this S-group superatom. Clones the S-group superatom partially. This method is needed to prevent infinite recursion when cloning from SuperatomSgroup.copy.
        Parameters:
        sa - the target atom
        Since:
        Marvin 4.1, 01/01/2006
      • add

        protected boolean add​(MolBond edge)
        Add an edge if it had not been already added. Overridden to enable access from other classes of this package.
        Overrides:
        add in class MolAtom
        Parameters:
        edge - the edge to add
        Returns:
        true if valence check needed
        Throws:
        chemaxon.struc.sgroup.NoFreeAttachmentPointException - if there is no free attachment point for the given edge.
      • add

        protected boolean add​(MolBond edge,
                              MolAtom atom)
        Add an edge to the given atom of the sgroup, if it had not been already added.
        Parameters:
        edge - the edge to add
        Throws:
        chemaxon.struc.sgroup.NoFreeAttachmentPointException - if there is no free attachment point for the given edge.
      • removeBond

        protected void removeBond​(int i,
                                  boolean clearFromAttachmentPoints)
        Removes a bond.
        Overrides:
        removeBond in class MolAtom
        Parameters:
        i - bond index
      • removeBond

        protected void removeBond​(MolBond bond,
                                  boolean clearFromAttachmentPoints)
        Removes a bond by reference.
        Overrides:
        removeBond in class MolAtom
        Parameters:
        bond - bond reference to remove
      • insertBond

        protected void insertBond​(int index,
                                  MolBond bond)
        Description copied from class: MolAtom
        Inserts a bond at a specified index.
        Overrides:
        insertBond in class MolAtom
        Parameters:
        index - the index where to insert the bond
        bond - the bond reference to insert
      • setAtom1

        protected static void setAtom1​(MolBond edge,
                                       MolAtom newnode)
        Sets the first node of an edge. Overridden to enable access from other classes of this package.
        Parameters:
        edge - the edge
        newnode - the new node value
      • setAtom2

        protected static void setAtom2​(MolBond edge,
                                       MolAtom newnode)
        Sets the second node of an edge. Overridden to enable access from other classes of this package.
        Parameters:
        edge - the edge
        newnode - the new node value
      • removeAllBonds

        protected void removeAllBonds()
        Remove all edges.
        Overrides:
        removeAllBonds in class MolAtom
      • removeAllBonds

        protected void removeAllBonds​(boolean clearFromAttachmentPoints)
        Removes all edges. If the parameter clearFromAttachmentPoints is true, then the bonds are cleared from the SgroupAtoms's s-group's attachment points
        Overrides:
        removeAllBonds in class MolAtom
        Parameters:
        clearFromAttachmentPoints -
      • countAllAtoms

        protected int countAllAtoms()
        Counts all atoms represented by this atom.
        Overrides:
        countAllAtoms in class MolAtom
        Returns:
        the number of atoms in the S-group
      • getCharge

        public int getCharge()
        Returns the sum of the charges in the corresponding superatom s-group.
        Overrides:
        getCharge in class MolAtom
        Returns:
        the charge
        Since:
        Marvin 6.1, 2013.05.21.
      • indexOf

        public int indexOf​(MolBond bond)
        Returns the index of the specified bond in this atom. This method uses == for the bond comparison.
        Overrides:
        indexOf in class MolAtom
        Parameters:
        bond - bond reference
        Returns:
        the bond index, or -1 if it not found
        Since:
        Marvin 6.1, 2013.06.23.
        See Also:
        Object.equals(Object)