public class DataSgroup extends Sgroup
Modifier and Type | Field and Description |
---|---|
static int |
DT_FORMATTED
Field type: formatted.
|
static int |
DT_NUMERIC
Field type: numeric.
|
static int |
DT_TEXT
Field type: text.
|
static int |
DT_UNSPEC
Field type: unspecified.
|
static int |
DT_URL
Field type: url.
|
static int |
HIDDEN
Specifies that the data sgroup is hidden.
|
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 and Description |
---|
DataSgroup(DataSgroup sg,
Molecule mol,
Sgroup psg)
Copy constructor.
|
DataSgroup(DataSgroup sg,
Molecule mol,
Sgroup psg,
int[] atomIndexMap)
Copy constructor.
|
DataSgroup(Molecule parent)
Creates a Data S-group with the specified parent.
|
Modifier and Type | Method and Description |
---|---|
void |
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.
|
DPoint3 |
getAbsoluteXY()
Gets the X and Y coordinates of the data label in the molecule's
coordinate system, considering absolute/relative placement.
|
String |
getContext()
Gets the context of the data sgroup.
|
int |
getContextId()
Gets the id of the context of the data sgroup.
|
String |
getData()
Gets the data value to be set.
|
String |
getDataLine(int i)
Gets a line of data.
|
int |
getDataLineCount()
Gets the number of data lines.
|
int |
getDisplayedChars()
Gets the number of characters to be displayed(1...999 or 0 for all)
|
int |
getDisplayedLines()
Gets the number of lines to be displayed (0: show all)
|
String |
getFieldName()
Gets the data field name.
|
int |
getFieldType()
Gets the field type.
|
String |
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 |
getObjectsMiddle(DPoint3 p)
Calculates the middle point of the coordinates of objects this sgroup is
associated to.
|
void |
getPlacementOrigin(DPoint3 p)
If isAbsolutePlacement is false it calculates the middle point of the
coordinates of atoms this S-group is associated to.
|
int |
getPos()
Gets the data display DASP position (0...9).
|
String |
getQueryCode()
Gets the program code of the query option.
|
String |
getQueryOp()
Gets the data query operator.
|
String |
getSubscript()
Gets the subscript for non-superatom S-groups.
|
char |
getTag()
Gets the tag character for footnote display (or space if blank).
|
String |
getUnits()
Gets the unit of this data field.
|
double |
getX()
Gets the X coordinate.
|
double |
getY()
Gets the Y coordinate.
|
boolean |
hasBrackets()
Brackets are painted if mouse runs over sgroup atoms.
|
boolean |
isAbsolutePlacement()
Gets whether the placement of this attached data is absolute or relative
to the objects it is attached.
|
boolean |
isDataDetached()
Gets whether the data should be displayed close to the objects or
separately (detached).
|
boolean |
isUnitDisplayed()
Gets whether the units string should be displayed.
|
void |
setAbsolutePlacement(boolean b)
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 |
setAbsoluteXY(DPoint3 p)
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 |
setData(String s)
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 |
setUnits(String unitsP)
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.
|
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, 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, setParentMolecule, setSgroupGraph, setSubscript, setSubType, setXState, setXState, setXState0, sort, toString, toString
public static final int DT_UNSPEC
public static final int DT_FORMATTED
public static final int DT_NUMERIC
public static final int DT_TEXT
public static final int DT_URL
public static final int HIDDEN
setDisplayedLines(int)
,
Constant Field Valuespublic DataSgroup(Molecule parent)
parent
- the parent moleculepublic DataSgroup(DataSgroup sg, Molecule mol, Sgroup psg, int[] atomIndexMap)
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, or null
otherwisepublic DataSgroup(DataSgroup sg, Molecule mol, Sgroup psg)
sg
- the S-group to copymol
- the new parent moleculepsg
- the new parent S-group or nullprotected Sgroup cloneSgroup(Molecule mol, Sgroup psg, int[] atomIndexMap)
cloneSgroup
in class Sgroup
mol
- the new parent moleculepsg
- the new parent S-groupatomIndexMap
- indices of cloned atoms in the original molecule
or null
public String getContext()
public void setContext(String context)
context
- - the string representation of the context.public int getContextId()
public void setContext(int id)
id
- - the id of the context.setContext(String)
,
getContextId()
public String getFieldName()
public void setFieldName(String nameP)
nameP
- The data field identifier.public int getFieldType()
DT_UNSPEC
,
DT_FORMATTED
,
DT_NUMERIC
,
DT_TEXT
,
DT_URL
public void setFieldType(int typeP)
typeP
- The type of the data field.DT_UNSPEC
,
DT_FORMATTED
,
DT_NUMERIC
,
DT_TEXT
,
DT_URL
public void setFieldType(String ft)
ft
- "F", "T" or "N"DT_UNSPEC
,
DT_FORMATTED
,
DT_NUMERIC
,
DT_TEXT
,
DT_URL
public String getUnits()
public void setUnits(String unitsP)
unitsP
- The units of the data attached, e.g. "A^2" or "kJ/cm3"public String getQueryCode()
public void setQueryCode(String queryCodeP)
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 querypublic String getQueryOp()
public void setQueryOp(String queryOpP)
queryOpP
- One of the following: "<", ">", "<=", ">=", "<>",
"between", "like", "contains", "=" or null if not set.public double getX()
public void setX(double x)
x
- The X coordinate in Angstroms.public double getY()
public void setY(double y)
y
- The Y coordinate in Angstroms.public void setAbsoluteXY(DPoint3 p)
p
- the absolute coordinates.getX()
,
getY()
,
isAbsolutePlacement()
public void setAbsoluteXY(double x, double y)
x
- X absolute coordinate.y
- Y absolute coordinate.getX()
,
getY()
,
isAbsolutePlacement()
public DPoint3 getAbsoluteXY()
getX()
,
getY()
,
isAbsolutePlacement()
public void getPlacementOrigin(DPoint3 p)
p
- This point will contain the calculated X and Y coordinates.getObjectsMiddle(chemaxon.struc.DPoint3)
public void getObjectsMiddle(DPoint3 p)
p
- This point will contain the calculated X and Y coordinates.public boolean isDataDetached()
public void setDataDetached(boolean b)
b
- true if the data is detached.public boolean isUnitDisplayed()
public void setUnitDisplayed(boolean b)
b
- True if the units string should be displayed.public boolean isAbsolutePlacement()
public void setAbsolutePlacement(boolean b)
b
- true when getX() and getY() coordinates should refer to
absolute placement.public int getDisplayedChars()
public void setDisplayedChars(int chars)
chars
- the number of characters to display per linepublic int getDisplayedLines()
public void setDisplayedLines(int lines)
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.HIDDEN
public char getTag()
public void setTag(char c)
c
- The character to use in the footnote or space to clear.public int getPos()
public void setPos(int p)
p
- The position number to be set (1-9) or 0 if not set.public String getData()
public void setData(String s)
s
- The value of the attached data. Can be multiline: '\n'
characters separate lines.public int getDataLineCount()
public String getDataLine(int i)
i
- line indexpublic void setDataLine(int i, String line)
i
- line indexpublic void addDataLine(String line)
line
- Next line to add.public String getLineOnScreen(int i)
i
- number of linepublic boolean hasBrackets()
hasBrackets
in class Sgroup
public String getSubscript()
getSubscript
in class Sgroup
protected 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)