Package chemaxon.struc.sgroup
Class DataSgroup
java.lang.Object
chemaxon.struc.Sgroup
chemaxon.struc.sgroup.DataSgroup
- All Implemented Interfaces:
Serializable
Data Sgroup.
- Since:
- Marvin 4.0, 1/07/2005
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Field type: formatted.static final int
Field type: numeric.static final int
Field type: text.static final int
Field type: unspecified.static final int
Field type: url.static final int
Specifies that the data sgroup is hidden.Fields inherited from class chemaxon.struc.Sgroup
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
-
Constructor Summary
ConstructorDescriptionDataSgroup
(Molecule parent) Creates a Data S-group with the specified parent.DataSgroup
(DataSgroup sg, Molecule mol, Sgroup psg) Copy constructor.DataSgroup
(DataSgroup sg, Molecule mol, Sgroup psg, int[] atomIndexMap) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDataLine
(String line) Adds a line to the data stored in the field.protected Sgroup
cloneSgroup
(Molecule mol, Sgroup psg, int[] atomIndexMap) Gets a new DataSgroup instance.Gets the X and Y coordinates of the data label in the molecule's coordinate system, considering absolute/relative placement.Gets the context of the data sgroup.int
Gets the id of the context of the data sgroup.getData()
Gets the data value to be set.getDataLine
(int i) Gets a line of data.int
Gets the number of data lines.int
Gets the number of characters to be displayed(1...999 or 0 for all)int
Gets the number of lines to be displayed (0: show all)Gets the data field name.int
Gets the field type.getLineOnScreen
(int i) Returns the i-th row of the data sgroup label, as displayed on the screen (with tag, query operator, units etc.)void
Calculates the middle point of the coordinates of objects this sgroup is associated to.void
Deprecated, for removal: This API element is subject to removal in a future version.int
getPos()
Gets the data display DASP position (0...9).Gets the program code of the query option.Gets the data query operator.Gets the subscript for non-superatom S-groups.char
getTag()
Gets the tag character for footnote display (or space if blank).getUnits()
Gets the unit of this data field.double
getX()
Gets the X coordinate.double
getY()
Gets the Y coordinate.boolean
Brackets are painted if mouse runs over sgroup atoms.boolean
Gets whether the placement of this attached data is absolute or relative to the objects it is attached.boolean
Gets whether the data should be displayed close to the objects or separately (detached).boolean
Gets whether the units string should be displayed.void
setAbsolutePlacement
(boolean isAbsolute) Sets whether the placement of this attached data is absolute or relative to the objects it is attached.void
setAbsoluteXY
(double x, double y) Sets the X and Y coordinates of the data label in the molecule's coordinate system, considering absolute/relative placement.void
Sets the X and Y coordinates of the data label in the molecule's coordinate system, considering absolute/relative placement.void
setContext
(int id) Sets the context of this data sgroup.void
setContext
(String context) Sets the context of this data sgroup.void
Sets the data value to be set.void
setDataDetached
(boolean b) Sets whether the data should be displayed close to the objects or separately (detached).void
setDataLine
(int i, String line) Sets a line of data.void
setDisplayedChars
(int chars) Sets the number of characters to be displayed (1...999 or 0 for no restriction)void
setDisplayedLines
(int lines) Sets the number of lines to be displayed (0: show all)void
setFieldName
(String nameP) Sets the data field name.void
setFieldType
(int typeP) Sets the field type.void
setFieldType
(String ft) Sets the field type from string representation.void
setPos
(int p) Sets the data display DASP position (0...9).void
setQueryCode
(String queryCodeP) Sets the program code for the query option.void
setQueryOp
(String queryOpP) Sets the data query operator.void
setTag
(char c) Sets the tag character for the footnote display.void
setUnitDisplayed
(boolean b) Sets whether the units string should be displayed.void
Sets the unit of this data field.void
setX
(double x) Sets the X coordinate.void
setY
(double y) Sets the Y coordinate.protected void
transformByParent
(CTransform3D t, boolean incg) Applies a transformation matrix to the Data Sgroup coordinates.Methods inherited from class chemaxon.struc.Sgroup
add, addBracket, addChildSgroup, areChildSgroupsVisible, checkBondConsistency, checkBonds, checkConsistencyInEmbeddings, checkSgroupGraphConsistency, clearObjects, cloneSgroup, cloneStructure, contains, containsAllAtomsOf, contract, countAllAtoms, createMolecule, createMolecule, expand, findCrossingBonds, findSmallestSgroupContaining, findSmallestSgroupOf, getAtom, getAtomArray, getAtomCount, getAtomSymbolListAsString, getAttach, getBondArray, getBracketCount, getBrackets, getChargeLocation, getChildSgroup, getChildSgroupCount, getChildSgroups, getConnectivity, getCrossingAtoms, getId, getParentMolecule, getParentSgroup, getSgroupGraph, getSgroupType, getSubType, getSuperscript, getTotalCharge, getType, getXState, hasAtom, indexOf, indexOf, initBrackets, isBracketCrossingBond, isBracketVisible, isDescendantOf, isEmpty, isOrderedComponentSgroup, isPartSelected, isRemovable, isSelected, isTotalSelected, isVisible, removeAtom, removeAtom, removeAtom, removeBond, removeBonds, removeChildSgroup, removeGroupedAtom, removeObject, replaceAtom, replaceAtom, selectAllObjects, setAtom, setChargeLocation, setConnectivity, setGUIStateRecursively, setGUIStateRecursively, setId, setParentMolecule, setSgroupGraph, setSubscript, setSubType, setXState, setXState, setXState0, sort, toString, toString
-
Field Details
-
DT_UNSPEC
public static final int DT_UNSPECField type: unspecified.- See Also:
-
DT_FORMATTED
public static final int DT_FORMATTEDField type: formatted.- See Also:
-
DT_NUMERIC
public static final int DT_NUMERICField type: numeric.- See Also:
-
DT_TEXT
public static final int DT_TEXTField type: text.- See Also:
-
DT_URL
public static final int DT_URLField type: url.- See Also:
-
HIDDEN
public static final int HIDDENSpecifies that the data sgroup is hidden.- Since:
- Marvin 4.1.6 01/12/2007
- See Also:
-
-
Constructor Details
-
DataSgroup
Creates a Data S-group with the specified parent. Please note the S-group is not added automatically to the parent molecule.- Parameters:
parent
- the parent molecule- See Also:
-
DataSgroup
Copy constructor.- Parameters:
sg
- the S-group to copymol
- the new parent moleculepsg
- the new parent S-group or null if no parent S-group existsatomIndexMap
- indices of cloned atoms in the original molecule in the case of partial cloning, ornull
otherwise- Since:
- Marvin 5.3.3 30/03/2010
-
DataSgroup
Copy constructor.- Parameters:
sg
- the S-group to copymol
- the new parent moleculepsg
- the new parent S-group or null- Since:
- Marvin 4.0 1/08/2005
-
-
Method Details
-
cloneSgroup
Gets a new DataSgroup instance.- Overrides:
cloneSgroup
in classSgroup
- Parameters:
mol
- the new parent moleculepsg
- the new parent S-groupatomIndexMap
- indices of cloned atoms in the original molecule ornull
- Returns:
- the new object
-
getContext
Gets the context of the data sgroup. Possible context values: Atom, Bond, Single Bond, Double Bond, Fragment, Group (Selection)- Returns:
- the context of this DataSgroup
-
setContext
Sets the context of this data sgroup. Context play role when displaying the data for this DataSgroup. Possible context values and their meaning: Atom - the data sgroup information should be displayed for any atom in this group separately. Bond - the data sgroup information should be displayed for any bond in this group separately. Single Bond - the data sgroup information should be displayed for any single bond in this group separately. Double Bond - the data sgroup information should be displayed for any double bond in this group separately. Fragment - the data sgroup information should be displayed for any disconnected molecule fragment in this group separately. Group (Selection) - the data sgroup information should be displayed for the whole group once.- Parameters:
context
- - the string representation of the context.
-
getContextId
public int getContextId()Gets the id of the context of the data sgroup. Ids and the corresponding context values: 0 - Atom 1 - Bond 2 - Single Bond 3 - Double Bond 4 - Fragment 5 - Group (Selection)- Returns:
- the id of the context of this DataSgroup
-
setContext
public void setContext(int id) Sets the context of this data sgroup.- Parameters:
id
- - the id of the context.- See Also:
-
getFieldName
Gets the data field name. (V2000: the first 30 chars can only be exported.)- Returns:
- The data field identifier.
-
setFieldName
Sets the data field name. (V2000: the first 30 chars can only be exported.)- Parameters:
nameP
- The data field identifier.
-
getFieldType
public int getFieldType()Gets the field type.- Returns:
- The type of the field.
- See Also:
-
setFieldType
public void setFieldType(int typeP) Sets the field type.- Parameters:
typeP
- The type of the data field.- See Also:
-
setFieldType
Sets the field type from string representation.- Parameters:
ft
- "F", "T" or "N"- See Also:
-
getUnits
Gets the unit of this data field. (V2000: The first 20 characters can only be exported.)- Returns:
- The unit of the data, e.g. "A^2" or "kJ/cm3"
-
setUnits
Sets the unit of this data field. (V2000: The first 20 characters can only be exported.)- Parameters:
unitsP
- The units of the data attached, e.g. "A^2" or "kJ/cm3"
-
getQueryCode
Gets the program code of the query option.- mQ = marvin query
- MQ = MACCS-II query
- IQ = ISIS query
- <P>Q = program name code query
- Returns:
- the string identifying a program for the query option.
-
setQueryCode
Sets the program code for the query option.- Parameters:
queryCodeP
- the string identifying a program for the query option. mQ = marvin query, MQ = MACCS-II query, IQ = ISIS query, <P>Q = program name code query
-
getQueryOp
Gets the data query operator.- Returns:
- One of the following: "<", ">", "<=", ">=", "<>", "between", "like", "contains", "=" or null if not set.
-
setQueryOp
Sets the data query operator.- Parameters:
queryOpP
- One of the following: "<", ">", "<=", ">=", "<>", "between", "like", "contains", "=" or null if not set.
-
getX
public double getX()Gets the X coordinate. This is the label coordinate in case of absolute placement, translation vector coordinate in case of relative placement.- Returns:
- The X coordinate in Angstroms.
-
setX
public void setX(double x) Sets the X coordinate. This is the label coordinate in case of absolute placement, translation vector coordinate in case of relative placement.- Parameters:
x
- The X coordinate in Angstroms.
-
getY
public double getY()Gets the Y coordinate. This is the label coordinate in case of absolute placement, translation vector coordinate in case of relative placement.- Returns:
- The Y coordinate in Angstroms.
-
setY
public void setY(double y) Sets the Y coordinate. This is the label coordinate in case of absolute placement, translation vector coordinate in case of relative placement.- Parameters:
y
- The Y coordinate in Angstroms.
-
setAbsoluteXY
Sets the X and Y coordinates of the data label in the molecule's coordinate system, considering absolute/relative placement.- Parameters:
p
- the absolute coordinates.- See Also:
-
setAbsoluteXY
public void setAbsoluteXY(double x, double y) Sets the X and Y coordinates of the data label in the molecule's coordinate system, considering absolute/relative placement.- Parameters:
x
- X absolute coordinate.y
- Y absolute coordinate.- See Also:
-
getAbsoluteXY
Gets the X and Y coordinates of the data label in the molecule's coordinate system, considering absolute/relative placement.- Returns:
- the absolute coordinates.
- See Also:
-
getPlacementOrigin
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void getPlacementOrigin(DPoint3 p) Deprecated, for removal: This API element is subject to removal in a future version.If isAbsolutePlacement is false it calculates the middle point of the coordinates of atoms this S-group is associated to. The top right reference point of the parent S-group's bracket is used in the case of empty S-groups as placement of origin. Otherwise it returns an all-zero vector.- Parameters:
p
- This point will contain the calculated X and Y coordinates.- See Also:
-
getObjectsMiddle
Calculates the middle point of the coordinates of objects this sgroup is associated to.- Parameters:
p
- This point will contain the calculated X and Y coordinates.
-
isDataDetached
public boolean isDataDetached()Gets whether the data should be displayed close to the objects or separately (detached).- Returns:
- True if the data is detached.
-
setDataDetached
public void setDataDetached(boolean b) Sets whether the data should be displayed close to the objects or separately (detached).- Parameters:
b
- true if the data is detached.
-
isUnitDisplayed
public boolean isUnitDisplayed()Gets whether the units string should be displayed.- Returns:
- True if the units string is displayed.
-
setUnitDisplayed
public void setUnitDisplayed(boolean b) Sets whether the units string should be displayed. (Default is false.)- Parameters:
b
- True if the units string should be displayed.
-
isAbsolutePlacement
public boolean isAbsolutePlacement()Gets whether the placement of this attached data is absolute or relative to the objects it is attached.- Returns:
- true when getX() and getY() coordinates refer to absolute placement.
-
setAbsolutePlacement
public void setAbsolutePlacement(boolean isAbsolute) Sets whether the placement of this attached data is absolute or relative to the objects it is attached. It does not modifies the coordinates, just changes the interpretation.- Parameters:
isAbsolute
- true when getX() and getY() coordinates should refer to absolute placement.
-
getDisplayedChars
public int getDisplayedChars()Gets the number of characters to be displayed(1...999 or 0 for all)- Returns:
- Gets the number of characters to display per line
-
setDisplayedChars
public void setDisplayedChars(int chars) Sets the number of characters to be displayed (1...999 or 0 for no restriction)- Parameters:
chars
- the number of characters to display per line
-
getDisplayedLines
public int getDisplayedLines()Gets the number of lines to be displayed (0: show all)- Returns:
- The number of lines to be displayed.
-
setDisplayedLines
public void setDisplayedLines(int lines) Sets the number of lines to be displayed (0: show all)- Parameters:
lines
- The number of lines to be displayed. 0 means to show all, -1 hides the data, and -2(HIDDEN) hides bracket highlighting as well.- See Also:
-
getTag
public char getTag()Gets the tag character for footnote display (or space if blank).- Returns:
- The caracter to use in the footnote for the attached data.
-
setTag
public void setTag(char c) Sets the tag character for the footnote display.- Parameters:
c
- The character to use in the footnote or space to clear.
-
getPos
public int getPos()Gets the data display DASP position (0...9). (MACCS)- Returns:
- The above position number (1-9 or 0 if not set.)
-
setPos
public void setPos(int p) Sets the data display DASP position (0...9). (MACCS)- Parameters:
p
- The position number to be set (1-9) or 0 if not set.
-
getData
Gets the data value to be set. Can be multiline: '\n' characters separate lines.- Returns:
- The value of the attached data.
-
setData
Sets the data value to be set.- Parameters:
s
- The value of the attached data. Can be multiline: '\n' characters separate lines.
-
getDataLineCount
public int getDataLineCount()Gets the number of data lines. -
getDataLine
Gets a line of data.- Parameters:
i
- line index
-
setDataLine
Sets a line of data.- Parameters:
i
- line index
-
addDataLine
Adds a line to the data stored in the field.- Parameters:
line
- Next line to add.
-
getLineOnScreen
Returns the i-th row of the data sgroup label, as displayed on the screen (with tag, query operator, units etc.)- Parameters:
i
- number of line
-
hasBrackets
public boolean hasBrackets()Brackets are painted if mouse runs over sgroup atoms.- Overrides:
hasBrackets
in classSgroup
- Returns:
- always true in the default implementation
-
getSubscript
Gets the subscript for non-superatom S-groups.- Overrides:
getSubscript
in classSgroup
- Returns:
- the subscript
-
transformByParent
Applies a transformation matrix to the Data Sgroup coordinates. (Only absolute placement.) 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)
.- Overrides:
transformByParent
in classSgroup
- Parameters:
t
- the transformation matrixincg
- graph invariants are changed (true) or not (false)- Since:
- Marvin 4.0.2, 10/26/2005
-