Package chemaxon.struc
Class Sgroup
java.lang.Object
chemaxon.struc.Sgroup
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DataSgroup,MulticenterSgroup,MultipleSgroup,RepeatingUnitSgroup,SuperatomSgroup
Structural group representation in the molecule.
A structural group is an entity in the molecule. Some of these entities has direct subclasses.
Some example use cases:
A structural group is an entity in the molecule. Some of these entities has direct subclasses.
Some example use cases:
- It can be an abbreviation of a molecule part represented as
SuperatomSgroup. - A repeating unit in the molecule represented as
RepeatingUnitSgroup. - Data assigned to a part of the molecule represented as
DataSgroup. - A bond which has connection to multiple atom in the molecule is represented as multicenter S-group type.
- Components in the molecule can be represented as component S-groups.
See also the possible return values of getType() method which
describes the possible S-group types.
Some relevant functions in the molecule to handle these structural elements:
Molecule.addSgroup(Sgroup, boolean)Molecule.expandSgroups()Molecule.findAllSgroupsContaining(MolAtom)Molecule.findSmallestSgroupsContaining(MolAtom)Molecule.findContainingMulticenterSgroup(MolAtom)Molecule.getRootSgroups()Molecule.getSgroup(int)Molecule.getSgroupArray()Molecule.getSgroupCount()Molecule.getSortedSgroups()Molecule.removeSgroupFromList(Sgroup)Molecule.removeSgroupsOf(Molecule)Molecule.setSgroupParent(MolAtom, Sgroup, boolean)Molecule.ungroupSgroup(Sgroup)
- Since:
- Marvin 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionSet for storing the atoms of the S-group's graph.static final intCharge is located on atoms and displayed on atoms.static final intCharge is located on atoms but displayed on the whole group (bracket).protected Sgroupstatic final intPrint atom symbols.protected static final intAtom removal in expand.protected static final intReplace without duplicating.static final intEither unknown S-group connectivity.static final intHead-to-head S-group connectivity.static final intHead-to-tail S-group connectivity.static final intNumber of S-group types.protected SelectionMoleculeThe S-group's internal structure.protected intThe S-group type.static final intParent-child sort order.static final intParent-child sort order.static final intAlternating polymer S-group subtype.static final intBlock polymer S-group subtype.static final intRandom polymer S-group subtype.static final intAmino acid S-group type.static final intAny polymer S-group type.static final intComponent S-group type.static final intCopolymer S-group type.static final intCrosslink S-group type.static final intData S-group type.static final intFormulation S-group type.static final intGeneric S-group type.static final intGraft S-group type.static final intMer S-group type.static final intMixture S-group type.static final intModification S-group type.static final intMonomer S-group type.static final intMulticenter S-group type.static final intMultiple group S-group type.static final intSRU (Structural Repeating Unit: polymers and repeating units with repetition ranges) S-group type.static final intSuperatom S-group type.static final intS-group is contracted.static final intS-group is in an undetermined state.static final intS-group is expanded.static final intS-group is expanded, but its atoms have the same coordinates as in contracted state. -
Constructor Summary
ConstructorsModifierConstructorDescriptionDeprecated.Deprecated.As of Marvin 5.12, replaced bySgroupFactory.createSgroup(Molecule, SgroupType)andsetXState(int).protectedSgroup(Molecule parent, SgroupType type) protectedSgroup(Molecule parent, SgroupType type, int xstate) protectedCopy constructor.protectedCopy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new atom to the S-group.voidaddBracket(MBracket bracket) Adds a bracket to this S-group.final voidaddChildSgroup(Sgroup sg) Adds a child S-group.booleanChecks whether the child S-groups are visible.protected voidcheckBonds(MolAtom atom) Add the bonds of the given atom to the S-group if the given atom and the other atom of the selected bond are both in the S-group.voidFor internal use only.booleanDeprecated, for removal: This API element is subject to removal in a future version.replaced bycheckConsistency()protected booleancheckSgroupGraphConsistency(Sgroup parentSgroup) Checks whether the parameter S-group contains the atoms of this S-group.voidClears all MObject-s that belong to this S-groups.final SgroupcloneSgroup(Molecule m, Sgroup psg) Gets a new Sgroup instance.protected SgroupcloneSgroup(Molecule m, Sgroup psg, int[] atomIndexMap) Gets a new Sgroup instance.final SelectionMoleculeGets the clone of the structure stored.booleanIs this atom contained by the S-group?booleanChecks if the S-group contains the atoms of another S-group.protected booleancontract(int opts) Sets the state toXSTATE_C.final intCounts the total number of atoms recursively.Creates a molecule object that contains only this group.Creates a cloned S-group instance and a molecule object that contains only this S-group.protected booleanexpand(int f) MolBond[]Finds the crossing bonds.final SgroupFinds the smallest S-group containing the specified atom.final SgroupFinds the smallest S-group that has the specified node.final MolAtomgetAtom(int i) Gets an atom in the S-group.final MolAtom[]Gets the array of atoms in the S-group.final intGets the number of atoms in the S-group.protected static StringgetAtomSymbolListAsString(MolAtom[] atoms) protected static intGets the attachment point information from the ExtraAtomPropertiesMolBond[]Gets all bonds connecting two atoms that are both in the SgroupintGets the number of brackets in this S-group.Gets all graphic brackets from this SgroupintReturns the charge location attribute of the S-group.final SgroupgetChildSgroup(int i) Gets a child S-group.final intGets the number of child S-groups.protected Sgroup[]Gets the children of this S-group.intGets S-group connectivity.MolAtom[]getCrossingAtoms(MolBond[] xbonds) Gets the atoms that have crossing bonds.getId()final MoleculeGets the parent molecule.final SgroupGets the parent S-group.Gets a COPY of the molecule graph.Gets the S-group type.Gets the subscript for non-superatom S-groups.intGets polymer S-group subtype.Gets the superscript for non-superatom S-groups.intCalculates the sum of the charge values on the atoms in this S-group.intgetType()Gets S-group type.final intGets the expanded/contracted state.booleanIs the specified atom an element of this group?booleanChecks if brackets should be painted or not.intGets the atom index in the S-group graph.intGets the bond index in the S-group graph.voidInitializes the list of brackets in this S-group.booleanisBracketCrossingBond(MolBond bond) booleanTests whether the bracket is visible.booleanisDescendantOf(Sgroup psg) Decides whether this is a descendant of another S-group.final booleanisEmpty()Is it an empty S-group?booleanReturns if the Sgroup is ordered component Sgroup.booleanDecides if part of the S-group is selected or not.booleanDecides whether an S-group should be ungrouped if its structure changes.booleanisSelected(MoleculeGraph sel) Is the S-group or part of the S-group selected?booleanDecides if the whole S-group is selected or not.final booleanChecks whether this group is 'visible' (all parents are expanded in case of superatom S-groups) or not.final voidRemoves an atom and its bonds from the S-group.protected voidremoveAtom(MolAtom a, int opts) Removes an atom and its bonds from the S-group.protected static voidremoveAtom(Sgroup sg, MolAtom a, int opts) Wrapper method that callsremoveAtom(MolAtom, int)of sg.protected voidRemoves a bond from the S-group.voidRemoves the edge references.final voidRemoves an S-group from the children list.protected static voidremoveGroupedAtom(MoleculeGraph m, MolAtom a, MolBond[] v, int opts) Removes an atom from the molecule and removes its specified bonds.voidremoveObject(MObject mo) Removes the specified MObject from this Sgroup.final voidreplaceAtom(MolAtom olda, MolAtom newa) Replace an existing atom by a new one in this S-group and its parent(recursively).voidreplaceAtom(MolAtom olda, MolAtom newa, int opts) Replace an existing atom by a new one in this S-group and its parent (recursively).voidselectAllObjects(boolean s) Sets the selection state of the MObject-s that belong to this Sgroup.voidSets the specified atom in the S-group graph.voidsetChargeLocation(int location) Sets the charge location attribute of the S-group.voidsetConnectivity(int c) Sets S-group connectivity.booleansetGUIStateRecursively(boolean v) Deprecated.as of Marvin 6.2, useMolecule.setGUIContracted(boolean)for such functionalitybooleansetGUIStateRecursively(boolean contract, int opts) Deprecated.as of Marvin 6.2, useMolecule.setGUIContracted(boolean)for such functionalityvoidprotected final voidSets the parent molecule.voidSets the molecule graph.voidSets the subscript for non-superatom S-groups.voidsetSubType(int t) Sets polymer S-group subtype.final voidsetXState(int state) Sets the expanded/contracted state.final voidsetXState(int state, int opts) Deprecated.as of Marvin 6.2, usesetXState(int)insteadprotected voidsetXState0(int state) static voidSorts S-groups in parent-child or child-parent order.final StringtoString()Overrides Object.toString() to ease debugging.toString(int opts) Gets a string representation of the S-group.protected voidtransformByParent(CTransform3D t, boolean incg) Applies a transformation matrix to the coordinates.
-
Field Details
-
SGROUP_TYPE_COUNT
public static final int SGROUP_TYPE_COUNTNumber of S-group types. @see #getType()- See Also:
-
ST_SUPERATOM
public static final int ST_SUPERATOMSuperatom S-group type. @see #getType()- See Also:
-
ST_MULTIPLE
public static final int ST_MULTIPLEMultiple group S-group type. @see #getType()- See Also:
-
ST_SRU
public static final int ST_SRUSRU (Structural Repeating Unit: polymers and repeating units with repetition ranges) S-group type.- See Also:
-
ST_MONOMER
public static final int ST_MONOMERMonomer S-group type. @see #getType()- See Also:
-
ST_MER
public static final int ST_MERMer S-group type. @see #getType()- See Also:
-
ST_COPOLYMER
public static final int ST_COPOLYMERCopolymer S-group type. @see #getType()- See Also:
-
ST_CROSSLINK
public static final int ST_CROSSLINKCrosslink S-group type. @see #getType()- See Also:
-
ST_MODIFICATION
public static final int ST_MODIFICATIONModification S-group type. @see #getType()- See Also:
-
ST_MIXTURE
public static final int ST_MIXTUREMixture S-group type. Mixture S-groups are composed from unordered component S-groups.- See Also:
-
ST_FORMULATION
public static final int ST_FORMULATIONFormulation S-group type. Formulation S-groups are composed from ordered component S-groups.- See Also:
-
ST_DATA
public static final int ST_DATAData S-group type. @see #getType()- See Also:
-
ST_ANY
public static final int ST_ANYAny polymer S-group type. @see #getType()- See Also:
-
ST_GENERIC
public static final int ST_GENERICGeneric S-group type. @see #getType()- See Also:
-
ST_COMPONENT
public static final int ST_COMPONENTComponent S-group type. A component here is a set of atoms contained by a component bracket. There are two kind of component S-group: ordered and unordered. The subscript of an unordered S-group contains a simple "c". The subscript of an ordered component S-group contains an additional integer e.g.: "c1" where "1" is the order of the ordered component S-group. Ordered component S-groups can be embedded into formulation S-groups. Unordered component S-groups can be embedded into mixture S-groups.- See Also:
-
ST_MULTICENTER
public static final int ST_MULTICENTERMulticenter S-group type. @see #getSubType()- See Also:
-
ST_GRAFT
public static final int ST_GRAFTGraft S-group type. @see #getType()- See Also:
-
ST_AMINOACID
public static final int ST_AMINOACIDAmino acid S-group type. @see #getType()- See Also:
-
SST_ALTERNATING
public static final int SST_ALTERNATINGAlternating polymer S-group subtype. @see #getSubType()- See Also:
-
SST_RANDOM
public static final int SST_RANDOMRandom polymer S-group subtype. @see #getSubType()- See Also:
-
SST_BLOCK
public static final int SST_BLOCKBlock polymer S-group subtype. @see #getSubType()- See Also:
-
SCN_EITHER_UNKNOWN
public static final int SCN_EITHER_UNKNOWNEither unknown S-group connectivity. @see #getConnectivity()- See Also:
-
SCN_HEAD_TO_HEAD
public static final int SCN_HEAD_TO_HEADHead-to-head S-group connectivity. @see #getConnectivity()- See Also:
-
SCN_HEAD_TO_TAIL
public static final int SCN_HEAD_TO_TAILHead-to-tail S-group connectivity. @see #getConnectivity()- See Also:
-
XSTATE_NONE
public static final int XSTATE_NONES-group is in an undetermined state.- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
XSTATE_X
public static final int XSTATE_XS-group is expanded.- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
XSTATE_C
public static final int XSTATE_CS-group is contracted.- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
XSTATE_XC
public static final int XSTATE_XCS-group is expanded, but its atoms have the same coordinates as in contracted state.- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
SORT_PARENT_CHILD
public static final int SORT_PARENT_CHILDParent-child sort order.- Since:
- Marvin 3.4
- See Also:
-
SORT_CHILD_PARENT
public static final int SORT_CHILD_PARENTParent-child sort order.- Since:
- Marvin 3.4
- See Also:
-
PR_ATSYMS
public static final int PR_ATSYMSPrint atom symbols.- Since:
- Marvin 4.1, 07/26/2006
- See Also:
-
RA_IN_EXPAND
protected static final int RA_IN_EXPANDAtom removal in expand.- Since:
- Marvin 4.1, 07/27/2006
- See Also:
-
RA_REMOVE_EXCEPT_RU
protected static final int RA_REMOVE_EXCEPT_RUReplace without duplicating.- Since:
- Marvin 4.1, 07/27/2006
- See Also:
-
CHARGE_ON_ATOMS
public static final int CHARGE_ON_ATOMSCharge is located on atoms and displayed on atoms.- Since:
- Marvin 5.2, 01/22/2009
- See Also:
-
CHARGE_ON_GROUP
public static final int CHARGE_ON_GROUPCharge is located on atoms but displayed on the whole group (bracket).- Since:
- Marvin 5.2, 01/22/2009
- See Also:
-
parentSgroup
-
sgroupType
protected transient int sgroupTypeThe S-group type. -
sgroupGraph
The S-group's internal structure. -
brackets
-
atomSet
Set for storing the atoms of the S-group's graph.
-
-
Constructor Details
-
Sgroup
Deprecated.As of Marvin 5.12, replaced bySgroupFactory.createSgroup(Molecule, SgroupType).Creates an S-group with the specified parent and type.- Parameters:
parent- the parent moleculet- S-group type
-
Sgroup
Deprecated.As of Marvin 5.12, replaced bySgroupFactory.createSgroup(Molecule, SgroupType)andsetXState(int).Creates an S-group with the specified parent and type.- Parameters:
parent- the parent moleculet- S-group typexstate- the expanded state- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
Sgroup
-
Sgroup
-
Sgroup
Copy constructor.- Parameters:
sg- the S-group to copym- the new parent moleculepsg- the new parent S-group or null- Since:
- Marvin 3.4
-
Sgroup
Copy constructor.- Parameters:
sg- the S-group to copym- the new parent moleculepsg- the new parent S-group or nulliatoms- indices of cloned atoms in the original molecule ornull* @since Marvin 3.4
-
-
Method Details
-
getId
-
setId
-
setSgroupGraph
Sets the molecule graph.- Parameters:
smol- the molecule graph- Since:
- Marvin 3.3, 11/03/2003
-
getSgroupGraph
Gets a COPY of the molecule graph. WARNING! If the returned selection molecule is changed then the graph of the S-group remains unchanged!- Returns:
- the molecule graph
- Since:
- Marvin 3.3, 11/03/2003
-
setParentMolecule
Sets the parent molecule.- Parameters:
p- the parent molecule
-
getParentMolecule
Gets the parent molecule.- Returns:
- the parent molecule
-
getChildSgroupCount
public final int getChildSgroupCount()Gets the number of child S-groups.- Returns:
- the number of children
- Since:
- Marvin 3.4
-
getChildSgroup
Gets a child S-group.- Parameters:
i- the child index- Returns:
- the child
- Since:
- Marvin 3.4
-
addChildSgroup
Adds a child S-group.- Parameters:
sg- the child- Since:
- Marvin 3.4
-
removeChildSgroup
Removes an S-group from the children list.- Parameters:
sg- the child to remove- Since:
- Marvin 4.0.4, 01/04/2006
-
findSmallestSgroupContaining
Finds the smallest S-group containing the specified atom. If this S-group contains the atom, then it searches its children recursively.- Parameters:
a- the atom- Returns:
- the S-group or null if not found
- Since:
- Marvin 3.4, 05/05/2004
-
contains
Is this atom contained by the S-group?- Parameters:
atom- the atom that's may be part of this S-group- Returns:
- true it the referenced atom is contained by this S-group, false otherwise
-
findSmallestSgroupOf
Finds the smallest S-group that has the specified node. If this parent has the node, then it searches the children recursively.- Parameters:
a- the node- Returns:
- the S-group or null if not found
- Since:
- Marvin 3.4, 05/05/2004
-
getParentSgroup
Gets the parent S-group.- Returns:
- the parent S-group
- Since:
- Marvin 3.4
-
getXState
public final int getXState()Gets the expanded/contracted state.- Returns:
- the expanded/contracted state
- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
setXState
public final void setXState(int state) Sets the expanded/contracted state.- Parameters:
state- the expanded/contracted state- Throws:
IllegalArgumentException- if the group is invisible (it has a non-expanded parent)- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
setXState
Deprecated.as of Marvin 6.2, usesetXState(int)insteadSets the expanded/contracted state.- Parameters:
state- the expanded/contracted stateopts- option for updating coordinates- Throws:
IllegalArgumentException- if the group is invisible (it has a non-expanded parent)- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
setXState0
protected void setXState0(int state) -
setGUIStateRecursively
Deprecated.as of Marvin 6.2, useMolecule.setGUIContracted(boolean)for such functionalitySets the expanded/contracted state recursively.- Parameters:
v- true setsXSTATE_Cif previous state wasXSTATE_XC, false setsXSTATE_XCif previous state wasXSTATE_C, no operation in other cases- Returns:
- true if at least one S-group's state was changed, false otherwise
- Throws:
IllegalArgumentException- if the group is invisible (it has a non-expanded parent)- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
setGUIStateRecursively
@Deprecated public boolean setGUIStateRecursively(boolean contract, int opts) throws IllegalArgumentException Deprecated.as of Marvin 6.2, useMolecule.setGUIContracted(boolean)for such functionalitySets the expanded/contracted state recursively.- Parameters:
contract- true setsXSTATE_Cif previous state wasXSTATE_XC, false setsXSTATE_XCif previous state wasXSTATE_C, no operation in other casesopts- the expansion/contraction options- Returns:
- true if at least one S-group's state was changed, false otherwise
- Throws:
IllegalArgumentException- if the group is invisible (it has a non-expanded parent)- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
expand
- Parameters:
f- options, only theExpandable.LEAVE_COORDS_UNCHANGEDand theExpandable.MDL_EXPANDflags are taken into account- Returns:
- true
- Throws:
IllegalArgumentException- if the group is invisible (it has a non-expanded parent)- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
contract
Sets the state toXSTATE_C.- Parameters:
opts- neglected- Returns:
- true
- Throws:
IllegalArgumentException- if the group is invisible (it has a non-expanded parent)- Since:
- Marvin 3.4, 05/04/2004
- See Also:
-
getSuperscript
Gets the superscript for non-superatom S-groups.- Returns:
- the superscript
-
isOrderedComponentSgroup
public boolean isOrderedComponentSgroup()Returns if the Sgroup is ordered component Sgroup.- Since:
- Marvin 4.1.1, 08/30/2006
-
getSubscript
Gets the subscript for non-superatom S-groups.- Returns:
- the subscript
-
setSubscript
Sets the subscript for non-superatom S-groups.- Parameters:
s- the subscript
-
getType
public int getType()Gets S-group type.Warning: as of Marvin 6.3,
getSgroupType()is suggested to be used instead, but the two methods have important differences. In the case ofAminoAcidSgroups, this method returnsST_SUPERATOM, butgetSgroupType()returnsSgroupType.AMINOACID. Furthermore, when this method returnsST_COPOLYMER,getSgroupType()returns eitherSgroupType.COPOLYMERor one ofSgroupType.COPOLYMER_ALT,SgroupType.COPOLYMER_RAN,SgroupType.COPOLYMER_BLK.- Returns:
- the type
- See Also:
-
getSgroupType
Gets the S-group type.- Returns:
- the type of the S-group
- See Also:
-
getSubType
public int getSubType()Gets polymer S-group subtype.- Returns:
- the type
- See Also:
-
setSubType
public void setSubType(int t) Sets polymer S-group subtype.- Parameters:
t- the type- See Also:
-
getConnectivity
public int getConnectivity()Gets S-group connectivity.- Returns:
- the connectivity
- See Also:
-
setConnectivity
public void setConnectivity(int c) Sets S-group connectivity.- Parameters:
c- the connectivity- See Also:
-
hasBrackets
public boolean hasBrackets()Checks if brackets should be painted or not.- Returns:
- always true in the default implementation
- Since:
- Marvin 3.3
-
cloneStructure
Gets the clone of the structure stored.- Returns:
- the clone
-
createMolecule
Creates a molecule object that contains only this group.- Returns:
- the molecule
-
createMolecule
Creates a cloned S-group instance and a molecule object that contains only this S-group.- Parameters:
m- the molecule object- Returns:
- the cloned S-group
- Since:
- Marvin 5.0, 09/01/2008
-
getAtomArray
Gets the array of atoms in the S-group.- Returns:
- the atom array
-
getAtom
Gets an atom in the S-group.- Parameters:
i- the atom index- Returns:
- the atom
-
countAllAtoms
public final int countAllAtoms()Counts the total number of atoms recursively.- Returns:
- the number of atoms
-
isEmpty
public final boolean isEmpty()Is it an empty S-group?- Returns:
- true if the S-group does not contain any atoms, false otherwise
-
cloneSgroup
Gets a new Sgroup instance.- Parameters:
m- the new parent moleculepsg- the new parent S-group- Returns:
- the new object
- Since:
- Marvin 3.4
-
cloneSgroup
Gets a new Sgroup instance.- Parameters:
m- the new parent moleculepsg- the new parent S-groupatomIndexMap- indices of cloned atoms in the original molecule ornull- Returns:
- the new object
- Since:
- Marvin 5.0.2, 03/07/2008
-
getAtomCount
public final int getAtomCount()Gets the number of atoms in the S-group.- Returns:
- the number of atoms
-
indexOf
Gets the atom index in the S-group graph.- Parameters:
a- the atom- Returns:
- the index or -1 if not found
-
indexOf
Gets the bond index in the S-group graph.- Parameters:
b- the bond- Returns:
- the index or -1 if not found
- Since:
- Marvin 5.3.2
-
hasAtom
Is the specified atom an element of this group?- Parameters:
a- the atom- Returns:
- true if it contains the atom, false otherwise
- Since:
- Marvin 3.4
-
containsAllAtomsOf
Checks if the S-group contains the atoms of another S-group.- Returns:
- true if this S-group contains the specified one
- Since:
- Marvin 3.4
-
add
Adds a new atom to the S-group.- Parameters:
a- the atom
-
setAtom
Sets the specified atom in the S-group graph. For internal use only.- Parameters:
i- the indexa- the atom
-
removeBonds
public void removeBonds()Removes the edge references. -
removeAtom
Removes an atom and its bonds from the S-group.- Parameters:
a- the atom
-
removeAtom
Removes an atom and its bonds from the S-group.- Parameters:
a- the atomopts- 0 orRA_IN_EXPAND- Since:
- Marvin 4.1, 07/27/2006
-
removeAtom
Wrapper method that callsremoveAtom(MolAtom, int)of sg. Needed by subclasses because they cannot call the protectedremoveAtom(MolAtom, int)method of another Sgroup.- Parameters:
sg- the other S-groupa- the atomopts- 0 orRA_IN_EXPAND- Since:
- Marvin 4.1, 07/27/2006
-
removeBond
Removes a bond from the S-group.- Parameters:
b- the bond
-
replaceAtom
Replace an existing atom by a new one in this S-group and its parent(recursively). For internal use only.- Parameters:
olda- the original atomnewa- the new atom- Since:
- 3.5.2, 12/15/2004
-
replaceAtom
Replace an existing atom by a new one in this S-group and its parent (recursively). For internal use only.- Parameters:
olda- the original atomnewa- the new atomopts- options- Since:
- 4.1, 07/25/2006
- See Also:
-
findCrossingBonds
Finds the crossing bonds. Use only when the S-group is expanded.- Returns:
- the attachment bonds
- Since:
- Marvin 3.3
-
isBracketCrossingBond
-
getCrossingAtoms
Gets the atoms that have crossing bonds.- Parameters:
xbonds- the crossing bonds- Returns:
- the attachment atoms
- Throws:
IllegalArgumentException- if a bond in the specified array is not a crossing bond- Since:
- Marvin 3.3
-
removeGroupedAtom
Removes an atom from the molecule and removes its specified bonds.- Parameters:
m- the molecule grapha- the atomv- bonds to remove from the atom, remove all bonds if nullopts- the removal options- See Also:
-
areChildSgroupsVisible
public boolean areChildSgroupsVisible()Checks whether the child S-groups are visible.- Returns:
- true if children are visible, false otherwise
- Since:
- Marvin 3.4
-
isVisible
public final boolean isVisible()Checks whether this group is 'visible' (all parents are expanded in case of superatom S-groups) or not.- Returns:
- true if the group is visible, false otherwise
- Since:
- Marvin 3.4
-
isBracketVisible
public boolean isBracketVisible()Tests whether the bracket is visible.- Returns:
trueif visible,falseotherwise- Since:
- Marvin 3.5.1, 11/12/2004
-
transformByParent
Applies a transformation matrix to the coordinates. This method is called by the parent molecule'sMolecule.transform(CTransform3D, boolean)method, thus only those atom coordinates are transformed here that are not handled inMoleculeGraph.transform(CTransform3D, boolean).- Parameters:
t- the transformation matrixincg- graph invariants are changed (true) or not (false)- Since:
- Marvin 4.0.2, 10/26/2005
-
sort
Sorts S-groups in parent-child or child-parent order.- Parameters:
sgroups- the array to sortorderType- the sort order- Since:
- Marvin 3.4
- See Also:
-
toString
Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. -
toString
Gets a string representation of the S-group. Returns a string consisting of the classname (without the package name!), the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object.- Parameters:
opts- options or 0- Returns:
- a string representation of the object
- Since:
- Marvin 4.1, 07/26/2006
- See Also:
-
getAtomSymbolListAsString
-
isDescendantOf
Decides whether this is a descendant of another S-group.- Parameters:
psg- the other S-group- Returns:
- true if this is a descendant of the other S-group, false otherwise.
- Since:
- Marvin 5.0
-
isRemovable
public boolean isRemovable()Decides whether an S-group should be ungrouped if its structure changes.- Returns:
- is true if the S-group is removable, false otherwise.
- See Also:
-
isSelected
Is the S-group or part of the S-group selected?- Parameters:
sel- the molecule that contains the selected atoms- Returns:
- true if the S-group contains at least one selected atom false otherwise.
- Since:
- Marvin 5.0, 04/02/2007
-
isTotalSelected
Decides if the whole S-group is selected or not.- Parameters:
sel- molecule graph that contains the selection- Returns:
- true if the whole S-group is selected
- Since:
- Marvin 5.3.2, 10/01/2010
-
isPartSelected
Decides if part of the S-group is selected or not.- Parameters:
sel- molecule graph that contains the selection- Returns:
- true if at least one of the S-group atoms is selected, but the whole group is not
- Since:
- Marvin 5.3.2, 10/01/2010
-
clearObjects
public void clearObjects()Clears all MObject-s that belong to this S-groups.- Since:
- Marvin 5.3, 11/30/2009
-
removeObject
Removes the specified MObject from this Sgroup.- Parameters:
mo- the MObject to remove.- Since:
- Marvin 5.3, 11/30/2009
-
selectAllObjects
public void selectAllObjects(boolean s) Sets the selection state of the MObject-s that belong to this Sgroup.- Parameters:
s- the state value to set- Since:
- Marvin 5.3, 11/30/2009
-
addBracket
Adds a bracket to this S-group.- Parameters:
bracket- the bracket to add- Since:
- Marvin 5.3, 11/30/2009
- See Also:
-
initBrackets
public void initBrackets()Initializes the list of brackets in this S-group. Creates an empty list of brackets if no brackets were added previously to the S-group, otherwise deletes the brackets from the existing list.- Since:
- Marvin 5.3, 11/30/2009
- See Also:
-
getBracketCount
public int getBracketCount()Gets the number of brackets in this S-group.- Returns:
- the number of brackets in this S-group.
- Since:
- Marvin 5.3, 11/30/2009
- See Also:
-
getBrackets
Gets all graphic brackets from this Sgroup- Returns:
- the list of brackets
- Since:
- Marvin 5.3, 11/30/2009
- See Also:
-
getChargeLocation
public int getChargeLocation()Returns the charge location attribute of the S-group.- Returns:
- charge location type:
CHARGE_ON_ATOMSorCHARGE_ON_GROUP. - Since:
- Marvin 5.2, 01/22/2009
- See Also:
-
setChargeLocation
public void setChargeLocation(int location) Sets the charge location attribute of the S-group. Possible charge location types:CHARGE_ON_ATOMSorCHARGE_ON_GROUP.- Parameters:
location- the charge location type to set- Since:
- Marvin 5.2, 01/22/2009
- See Also:
-
getTotalCharge
public int getTotalCharge()Calculates the sum of the charge values on the atoms in this S-group.- Returns:
- the sum charge
- Since:
- Marvin 5.2, 01/22/2009
- See Also:
-
checkBonds
Add the bonds of the given atom to the S-group if the given atom and the other atom of the selected bond are both in the S-group.- Parameters:
atom- the given atom
-
getAttach
Gets the attachment point information from the ExtraAtomProperties- Parameters:
atom- that attachment point is question.- Returns:
- the attachment point information from ExtraAtomProperties
- Since:
- Marvin 6.0, Dec 12, 2012
-
getBondArray
Gets all bonds connecting two atoms that are both in the Sgroup- Returns:
- S-group's MolBond object array
- Since:
- Marvin 6.1, 04/29/2013
-
checkConsistencyInEmbeddings
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public boolean checkConsistencyInEmbeddings()Deprecated, for removal: This API element is subject to removal in a future version.replaced bycheckConsistency()For internal use only. Checks if the S-group contains all child S-group's atoms and checks consistency between atom and bond references.- Returns:
- true if the S-group is consistent
-
checkConsistency
public void checkConsistency()For internal use only. Checks if the S-group contains all atoms of its children atoms and checks consistency between atom and bond references.- Throws:
IllegalStateException- if inconsistency found
-
checkSgroupGraphConsistency
Checks whether the parameter S-group contains the atoms of this S-group. It checks also that the parent molecule (if exists) contains these atoms as well.- Parameters:
parentSgroup- parent of Sgroup- Returns:
- true if the S-group is consistent
-
getChildSgroups
Gets the children of this S-group.- Returns:
- Child S-groups as an array.
-
SgroupFactory.createSgroup(Molecule, SgroupType).