public class SuperatomSgroup extends Sgroup implements Expandable, chemaxon.core.structure.AbbreviationForBuilder<Integer>
atomSet, brackets, CHARGE_ON_ATOMS, CHARGE_ON_GROUP, parentSgroup, PR_ATSYMS, RA_IN_EXPAND, RA_REMOVE_EXCEPT_RU, SCN_EITHER_UNKNOWN, SCN_HEAD_TO_HEAD, SCN_HEAD_TO_TAIL, SGROUP_TYPE_COUNT, sgroupGraph, sgroupType, SORT_CHILD_PARENT, SORT_PARENT_CHILD, SST_ALTERNATING, SST_BLOCK, SST_RANDOM, ST_AMINOACID, ST_ANY, ST_COMPONENT, ST_COPOLYMER, ST_CROSSLINK, ST_DATA, ST_FORMULATION, ST_GENERIC, ST_GRAFT, ST_MER, ST_MIXTURE, ST_MODIFICATION, ST_MONOMER, ST_MULTICENTER, ST_MULTIPLE, ST_SRU, ST_SUPERATOM, XSTATE_C, XSTATE_NONE, XSTATE_X, XSTATE_XC
COORDS_UPDATE, DEFAULT_OPTIONS, FAST_COORDS, LEAVE_COORDS_UNCHANGED, MDL_EXPAND, NONRECURSIVE_EXPAND, REVERSIBLE_EXPAND
Modifier | Constructor and Description |
---|---|
|
SuperatomSgroup(Molecule parent)
Constructs a superatom S-group in expanded state.
|
|
SuperatomSgroup(Molecule parent,
boolean expanded)
Constructs a superatom S-group.
|
protected |
SuperatomSgroup(SuperatomSgroup sg,
Molecule m,
Sgroup psg,
int[] atomIndexMap)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(MolAtom atom)
Adds a new atom to the S-group.
|
int |
addAttachmentPoint(MolAtom atom)
Adds a new free attachment point for an atom.
|
int |
addAttachmentPoint(MolAtom atom,
int order)
Adds a new free attachment point of the given attachment atom and order.
|
int |
addAttachmentPoint(MolAtom atom,
int order,
MolBond bond)
Adds a new free attachment point.
|
boolean |
areChildSgroupsVisible()
Checks whether the child S-groups are visible.
|
void |
calculateAttachmentPoints()
Calculates the attachment points for the crossing atoms and crossing
bonds and sets the calculated values.
|
protected void |
calculateCoordinates(Molecule parentMol,
MolBond[] xbonds,
MoleculeGraph g,
int opts,
boolean isContract,
SelectionMolecule otherSgroup,
List<Double> xBondLength)
Calculates the coordinates during expand and contract.
|
protected void |
checkBonds(MolAtom atom)
Add the bonds of the given atom to the sgroup if the given atom and the
other atom of the selected bond is in the sgroup.
|
protected boolean |
checkSgroupGraphConsistency(Sgroup parent)
Checks whether the parameter s-group contain the proper atoms of this
SuperatomSgroup . |
SuperatomSgroup |
clone()
Clones the SuperatomSgroup (and not the
Molecule).
|
protected void |
cloneLeavingGroups(SuperatomSgroup sasg)
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
protected Sgroup |
cloneSgroup(Molecule m,
Sgroup psg,
int[] atomIndexMap)
Gets a new Sgroup instance.
|
boolean |
contract(int opts)
Contracts this S-group.
|
protected SuperatomSgroup |
createGroup() |
Molecule |
createMolecule()
Creates a molecule object that contains only one
SuperatomSgroup
identical to this one. |
boolean |
expand(int opts)
Expands this S-group.
|
boolean |
expandOther(int opts,
Molecule moltoexpand)
Deprecated.
as of Marvin 6.2. use
expand(int) instead on the
s-groups desired to be expanded |
MolAtom |
findAttachAtom()
Gets the attachment atom of attachment point with the smallest order.
|
MolBond[] |
findCrossingBonds()
Finds the crossing bonds.
|
MolAtom[] |
getAllAttachAtoms()
Gets the attachment atoms (atoms having attachment point).
|
MolAtom[] |
getAttachAtoms()
Deprecated.
As of Marvin 6.0, replaced by
getBoundAttachAtoms() . |
chemaxon.struc.sgroup.AttachmentPoint |
getAttachmentPoint(int order)
Gets the attachment point that's order is given as parameter
|
int |
getAttachmentPointCount()
Gets the number of the attachment points.
|
List<Integer> |
getAttachmentPointOrders()
Gets the orders with which attachment point exists
|
List<Integer> |
getAttachmentPointOrders(MolAtom atom)
Gets the attachment orders of the given attachment atom.
|
List<chemaxon.struc.sgroup.AttachmentPoint> |
getAttachmentPoints()
Gets the sorted copy of the attachment point list.
|
MolAtom[] |
getBoundAttachAtoms()
Gets atoms with attachment point having crossing bond and the related
leaving group is not visible.
|
MolAtom[] |
getCrossingAtoms(MolBond[] xbonds)
Gets the atoms from the S-group that have crossing bonds.
|
int |
getExternalConnections(MolAtom a)
Gets the number of bonds of a specified atom where the neighbor atom
doesn't belong to the S-group.
|
MolAtom[] |
getFreeAttachAtoms()
Gets the atoms with free attachment points.
|
int |
getFreeAttachmentPointCount()
Gets the number of free attachment points.
|
List<Integer> |
getFreeAttachmentPointOrders()
Gets the increasingly sorted orders of the free attachment points.
|
List<Integer> |
getFreeAttachmentPointOrders(MolAtom atom)
Gets the sorted free attachment orders of the given attachment atom.
|
MolAtom[] |
getFreeLegalAttachAtoms()
Deprecated.
As of Marvin 6.0, replaced by
getFreeAttachAtoms() . |
MolAtom[] |
getLegalAttachAtoms()
Deprecated.
As of Marvin 6.0, replaced by
getAllAttachAtoms() . |
SelectionMolecule |
getParentSgroupGraph()
Deprecated.
as of Marvin 6.2, intended for internal use, similar
functionality can be reached by
getSgroupGraph() |
SelectionMolecule |
getSgroupGraph()
Gets the molecule graph as a selection.
|
SgroupAtom |
getSuperAtom()
Gets the superatom.
|
boolean |
hasAtom(MolAtom a)
Is the specified atom an element of this group?
|
boolean |
hasBrackets()
Checks if brackets should be painted or not.
|
boolean |
isAttachmentAtom(MolAtom a)
Checks whether the given atom is an attachment atom or not.
|
boolean |
isBracketVisible()
Tests whether the bracket is visible.
|
boolean |
isContracted()
Decides whether this S-group is contracted or not.
|
boolean |
isExpanded()
Is this S-group expanded?
|
boolean |
isFreeAttachAtom(MolAtom a)
Checks whether the specified atom has free attachment point.
|
boolean |
isFreeLegalAttachAtom(MolAtom a)
Deprecated.
As of Marvin 6.0, replaced by
isFreeAttachAtom(MolAtom a) . |
boolean |
isLegalAttachment(MolAtom atom)
Deprecated.
As of Marvin 6.0, replaced by
isAttachmentAtom(MolAtom) . |
boolean |
isTotalSelected(MoleculeGraph sel)
Decides if the whole superatom sgroup is selected or not.
|
void |
removeAllAttachmentPoints()
Removes all of the attachment points of the Superatom s-group.
|
protected void |
removeAtom(MolAtom atom,
int opts)
Removes an atom from the S-group.
|
void |
removeAttachmentPoint(int order)
Removes the attachment point with the given order.
|
void |
removeAttachmentPoints(MolAtom atom)
Removes all attachment points of the given attachment atom.
|
void |
removeBond(MolBond bond)
Removes a the given bond from the S-group.
|
void |
removeLeavingGroup(int order)
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
void |
replaceAtom(MolAtom oldAtom,
MolAtom newAtom,
int opts)
Replace an existing atom by a new one.
|
void |
setAtom(int i,
MolAtom a)
Sets the specified atom in the S-group graph.
|
void |
setAttachmentPointOrder(MolAtom atom,
int oldOrder,
int newOrder)
Sets a new order for the given attachment point.
|
void |
setCrossingBond(int order,
MolBond bond)
Change the crossing bond of an attachment point.
|
void |
setCrossingBondType(int order,
chemaxon.struc.BondType newType)
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
boolean |
setGUIStateRecursively(boolean v)
Sets the expanded/contracted state recursively.
|
void |
setLeavingGroup(int order,
int atNo)
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
void |
setLeavingGroup(int order,
int atNo,
String alternativeName)
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
void |
setLeavingGroup(int order,
int atNo,
String alternativeName,
chemaxon.struc.BondType crossingBondType)
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
void |
setLeavingGroupAlternativeName(int order,
String alternativeName)
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
void |
setSgroupGraph(SelectionMolecule smol)
Sets the molecule graph.
|
void |
sortXBonds()
Deprecated.
As of Marvin 5.12, no replacement.
Crossing bonds of a SuperatomSgroup do not need to be sorted
any more. It is not advised to sort them anyway because then the indexes of
bonds change in the parent molecule. |
String |
toString(int opts)
Returns a string representation of the group.
|
protected void |
transformByParent(CTransform3D t,
boolean incg)
Applies a transformation matrix to the Sgroup coordinates.
|
void |
updateAttachmentPoints()
Deprecated.
as of Marvin 6.2, use
calculateAttachmentPoints()
instead |
addBracket, addChildSgroup, checkBondConsistency, checkConsistencyInEmbeddings, clearObjects, cloneSgroup, cloneStructure, contains, containsAllAtomsOf, countAllAtoms, createMolecule, findSmallestSgroupContaining, findSmallestSgroupOf, getAtom, getAtomArray, getAtomCount, getAtomSymbolListAsString, getAttach, getBondArray, getBracketCount, getBrackets, getChargeLocation, getChildSgroup, getChildSgroupCount, getChildSgroups, getConnectivity, getParentMolecule, getParentSgroup, getSgroupType, getSubscript, getSubType, getSuperscript, getTotalCharge, getType, getXState, indexOf, indexOf, initBrackets, isBracketCrossingBond, isDescendantOf, isEmpty, isOrderedComponentSgroup, isPartSelected, isRemovable, isSelected, isVisible, removeAtom, removeAtom, removeBonds, removeChildSgroup, removeGroupedAtom, removeObject, replaceAtom, selectAllObjects, setChargeLocation, setConnectivity, setGUIStateRecursively, setParentMolecule, setSubscript, setSubType, setXState, setXState, setXState0, sort, toString
public SuperatomSgroup(Molecule parent)
parent
- the parent moleculeSgroup.ST_SUPERATOM
,
MolAtom.SGROUP
,
getSuperAtom()
public SuperatomSgroup(Molecule parent, boolean expanded)
parent
- the parent moleculeexpanded
- whether the S-group is created in expanded state or notSgroup.ST_SUPERATOM
,
MolAtom.SGROUP
,
getSuperAtom()
protected SuperatomSgroup(SuperatomSgroup sg, Molecule m, Sgroup psg, int[] atomIndexMap)
sg
- the S-group to copym
- the new parent moleculepsg
- the new parent S-group or nullatomIndexMap
- indices of cloned atoms in the original molecule or
null
public final SgroupAtom getSuperAtom()
@Deprecated public final MolAtom[] getAttachAtoms()
getBoundAttachAtoms()
.public final MolAtom[] getBoundAttachAtoms()
@Deprecated public final MolAtom[] getFreeLegalAttachAtoms()
getFreeAttachAtoms()
.AttachmentPoint.isFree()
public final MolAtom[] getFreeAttachAtoms()
AttachmentPoint.isFree()
@Deprecated public final boolean isFreeLegalAttachAtom(MolAtom a)
isFreeAttachAtom(MolAtom a)
.a
- the atomtrue
if it has free attachment point,
false
otherwisepublic final boolean isFreeAttachAtom(MolAtom a)
a
- the atomtrue
if it has free attachment point,
false
otherwiseAttachmentPoint.isFree()
,
getFreeAttachAtoms()
@Deprecated public final MolAtom[] getLegalAttachAtoms()
getAllAttachAtoms()
.public final MolAtom[] getAllAttachAtoms()
@Deprecated public final boolean isLegalAttachment(MolAtom atom)
isAttachmentAtom(MolAtom)
.atom
- the atomtrue
if the given atom is an attachment atom
false
otherwisepublic final boolean isAttachmentAtom(MolAtom a)
a
- the atomtrue
if the given atom is an attachment atom
false
otherwisegetAllAttachAtoms()
@Deprecated public void updateAttachmentPoints()
calculateAttachmentPoints()
insteadNoFreeAttachmentPointException
- if there are not enough free attachment pointpublic SelectionMolecule getSgroupGraph()
getSgroupGraph
in class Sgroup
@Deprecated public SelectionMolecule getParentSgroupGraph()
getSgroupGraph()
public void setSgroupGraph(SelectionMolecule smol)
setSgroupGraph
in class Sgroup
smol
- the molecule graphprotected Sgroup cloneSgroup(Molecule m, Sgroup psg, int[] atomIndexMap)
cloneSgroup
in class Sgroup
m
- the new parent moleculepsg
- the new parent S-groupatomIndexMap
- indices of cloned atoms in the original molecule or
null
public final void setAtom(int i, MolAtom a)
protected final void removeAtom(MolAtom atom, int opts)
removeAtom
in class Sgroup
atom
- the atomopts
- unused argumentpublic final void removeBond(MolBond bond)
removeBond
in class Sgroup
bond
- the bondpublic MolBond[] findCrossingBonds()
findCrossingBonds
in class Sgroup
public MolAtom[] getCrossingAtoms(MolBond[] xbonds)
getCrossingAtoms
in class Sgroup
xbonds
- the crossing bondsfindCrossingBonds()
public MolAtom findAttachAtom()
null
if there is not any attachment pointprotected void transformByParent(CTransform3D t, boolean incg)
Molecule.transform(CTransform3D, boolean)
method, thus only those
atom coordinates are transformed here that are not handled in
MoleculeGraph.transform(CTransform3D, boolean)
.transformByParent
in class Sgroup
t
- the transformation matrixincg
- graph invariants are changed (true) or not (false)public boolean hasBrackets()
hasBrackets
in class Sgroup
public boolean hasAtom(MolAtom a)
public final boolean expand(int opts) throws IllegalArgumentException
expand
in interface Expandable
expand
in class Sgroup
opts
- expansion optionsIllegalArgumentException
- if the group is invisible (it has a non-expanded parent)Expandable.DEFAULT_OPTIONS
,
Expandable.COORDS_UPDATE
,
Expandable.LEAVE_COORDS_UNCHANGED
,
Expandable.MDL_EXPAND
,
Expandable.FAST_COORDS
,
Expandable.NONRECURSIVE_EXPAND
@Deprecated public final boolean expandOther(int opts, Molecule moltoexpand) throws IllegalArgumentException
expand(int)
instead on the
s-groups desired to be expandedopts
- expansion optionsmoltoexpand
- molecule containing an Sgroup that has to be expandedIllegalArgumentException
- if the group is invisible (it has a non-expanded parent)public final boolean isExpanded()
isExpanded
in interface Expandable
public final boolean contract(int opts) throws IllegalArgumentException
contract
in interface Expandable
contract
in class Sgroup
opts
- contraction optionsIllegalArgumentException
- if the group is invisible (it has a non-expanded parent)Expandable.NONRECURSIVE_EXPAND
,
Sgroup.RA_REMOVE_EXCEPT_RU
,
Expandable.LEAVE_COORDS_UNCHANGED
protected void calculateCoordinates(Molecule parentMol, MolBond[] xbonds, MoleculeGraph g, int opts, boolean isContract, SelectionMolecule otherSgroup, List<Double> xBondLength)
parentMol
- the parent molecule of the superatomSgroupxbonds
- array of the crossing bondsg
- graph of the sgroupopts
- expand optionisContract
- true if it is called from contract, false if do so from
expandotherSgroup
- graph of the other sgroup in expandOtherpublic final boolean isContracted()
public boolean isBracketVisible()
isBracketVisible
in class Sgroup
false
, superatom S-group brackets are not visiblepublic boolean isTotalSelected(MoleculeGraph sel)
isTotalSelected
in class Sgroup
sel
- molecule graph that contains the selectionpublic boolean areChildSgroupsVisible()
areChildSgroupsVisible
in class Sgroup
@Deprecated public void sortXBonds()
SuperatomSgroup
do not need to be sorted
any more. It is not advised to sort them anyway because then the indexes of
bonds change in the parent molecule.public int getExternalConnections(MolAtom a)
a
- the atom whose connections to be checkedpublic Molecule createMolecule()
SuperatomSgroup
identical to this one.createMolecule
in class Sgroup
SuperatomSgroup
protected SuperatomSgroup createGroup()
public final void replaceAtom(MolAtom oldAtom, MolAtom newAtom, int opts)
replaceAtom
in class Sgroup
oldAtom
- the original atomnewAtom
- the new atomopts
- optionsSgroup.RA_REMOVE_EXCEPT_RU
public String toString(int opts)
toString
in class Sgroup
opts
- options or 0Sgroup.PR_ATSYMS
public final boolean setGUIStateRecursively(boolean v) throws IllegalArgumentException
setGUIStateRecursively
in class Sgroup
v
- true sets Sgroup.XSTATE_C
if previous state was
Sgroup.XSTATE_XC
, false sets Sgroup.XSTATE_XC
if previous
state was Sgroup.XSTATE_C
, no operation in other casesIllegalArgumentException
- if the group is invisible (it has a non-expanded parent)Sgroup.setXState(int)
public void calculateAttachmentPoints()
public void removeAttachmentPoints(MolAtom atom)
atom
- the attachment atomIllegalArgumentException
- if the given atom is not part of the superatom s-grouppublic void setAttachmentPointOrder(MolAtom atom, int oldOrder, int newOrder)
atom
- the attachment atom of the attachment pointoldOrder
- the old attachment order of the attachment pointnewOrder
- the new attachment order of the attachment pointIllegalArgumentException
- if the given atom is not part of the superatom S-group or the
given new order is negativ or zeropublic List<Integer> getAttachmentPointOrders(MolAtom atom)
atom
- the attachment atompublic List<Integer> getFreeAttachmentPointOrders(MolAtom atom)
atom
- the attachment atomAttachmentPoint.isFree()
public void add(MolAtom atom)
public int getAttachmentPointCount()
getAttachmentPointCount
in interface chemaxon.core.structure.AbbreviationForBuilder<Integer>
protected void checkBonds(MolAtom atom)
checkBonds
in class Sgroup
atom
- the atompublic List<chemaxon.struc.sgroup.AttachmentPoint> getAttachmentPoints()
public void setCrossingBond(int order, MolBond bond)
order
- the order of the attachment pointbond
- the crossing bond to be setIllegalArgumentException
- IllegalStateException
NoFreeAttachmentPointException
- if the attachment point for the given order is not freepublic int addAttachmentPoint(MolAtom atom)
atom
- the attachment atom of the new attachment pointIllegalArgumentException
- if the given atom is not part of the superatom S-grouppublic int addAttachmentPoint(MolAtom atom, int order)
atom
- the attachment atom of the new attachment pointorder
- the attachment order of the new attachment pointIllegalArgumentException
- if the order is a non positive numberpublic int addAttachmentPoint(MolAtom atom, int order, MolBond bond)
atom
- the attachment atom of the new attachment pointbond
- the crossing bond of the new attachment pointorder
- the attachment order of the new attachment pointIllegalArgumentException
- if the given atom is not part of the superatom S-group@Deprecated public void setLeavingGroup(int order, int atNo)
order
- the order of the attachment point to which the leaving group
information is addedatNo
- the atomic number of the leaving atomIllegalArgumentException
- if the given order does not exist in the superatom sgroup@Deprecated public void setLeavingGroup(int order, int atNo, String alternativeName)
order
- the order of the attachment point to which the leaving group
information is addedatNo
- the atomic number of the leaving atomalternativeName
- the alternative name of the leaving group. P.e.: in case of
dna it can be 3', 5', etc.IllegalArgumentException
- if the given order does not exist in the superatom sgroup@Deprecated public void setLeavingGroup(int order, int atNo, String alternativeName, chemaxon.struc.BondType crossingBondType)
order
- the order of the attachment point to which the leaving group
information is addedatNo
- the atomic number of the leaving atomalternativeName
- the alternative name of the leaving group. P.e.: in case of
DNA it can be 3', 5', etc.crossingBondType
- the type of the bond connecting the superatom sgroup and the
leaving groupIllegalArgumentException
- BondType
,
AttachmentPoint.isFree()
@Deprecated public void setLeavingGroupAlternativeName(int order, String alternativeName)
order
- the order of the attachment point to which the leaving group
information is addedalternativeName
- the alternative name of the leaving group. P.e.: in case of
DNA it can be 3', 5', etc.IllegalArgumentException
- if attachment point with the given attachment order does not
exist, or the attachment point does not have leaving group@Deprecated public void removeLeavingGroup(int order)
order
- the attachment orderpublic void removeAllAttachmentPoints()
public void removeAttachmentPoint(int order)
order
- the order which's attachment point will be removedpublic List<Integer> getFreeAttachmentPointOrders()
public chemaxon.struc.sgroup.AttachmentPoint getAttachmentPoint(int order)
order
- the required attachment point's order@Deprecated public void setCrossingBondType(int order, chemaxon.struc.BondType newType)
order
- the attachment ordernewType
- new type of the crossing bondIllegalStateException
- public int getFreeAttachmentPointCount()
public SuperatomSgroup clone()
@Deprecated protected void cloneLeavingGroups(SuperatomSgroup sasg)
sasg
- the superatom s-grouppublic List<Integer> getAttachmentPointOrders()
protected boolean checkSgroupGraphConsistency(Sgroup parent)
SuperatomSgroup
. That means the SgroupAtom
of this
s-group if it is contracted state or all of it's atoms if it is in
expanded state.checkSgroupGraphConsistency
in class Sgroup
parent
- parent of Sgroup