Package chemaxon.struc
Class MDocument
java.lang.Object
chemaxon.struc.MDocument
- All Implemented Interfaces:
chemaxon.core.structure.DocumentForBuilder
,MTransformable
,Serializable
- Direct Known Subclasses:
MSelectionDocument
@PublicApi
public class MDocument
extends Object
implements MTransformable, Serializable, chemaxon.core.structure.DocumentForBuilder
Marvin document. Stores molecules and graphics objects.
There are two main groups of graphic objects. One of them contains simple objects without chemical
meaning, these are stored directly in this document.
The other group, called extra objects, has chemical meaning and belongs to a chemical structure. Extra object are:
- reaction arrow
- S-group bracket
- Since:
- Marvin 3.1.4
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Provides informations for Structure Checker higlightclass
Property that stores an MDocument. -
Field Summary
Modifier and TypeFieldDescriptionprotected MChemicalStruct
protected MMoleculeMovie
protected MObject
static final int
The atom/bond set is colorless, normal (CPK, Monochrome etc.) colors are used.static final int
Default set colors are used for coloring the atom/bond set.static final int
The user specified set colors are used for coloring the atom/bond set. -
Constructor Summary
ModifierConstructorDescriptionCopy constructor.protected
Copy constructor.Creates a document for the specified molecule animation.Creates a document for the specified molecule graph. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a checker mark to the document.void
Adds an object to the document.Calculates the geometrical center.Calculates the geometrical center.void
clear()
Clears the document.void
Clears the checker marksvoid
Clears the atomSets and the bondSets.final Object
clone()
Creates a clone.Creates a clone.final Molecule
Creates a clone.final MoleculeGraph
Creates a clone.void
Clones the atom/bond sets from doc.protected void
boolean
Tests whether the document contains all objects of another document.boolean
Searches an object in the document.boolean
containsOnlyOne
(Class<?> cl) Deprecated, for removal: This API element is subject to removal in a future version.final byte[]
exportToBinFormat
(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.final String
exportToFormat
(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.As of release 5.7, replaced byMolExporter.exportToFormat(MDocument, String)
exportToObject
(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.As of release 5.7, replaced byMolExporter.exportToObject(MDocument, String)
static void
fixElectronContainers
(MDocument doc, boolean lonePairsAutoCalc, boolean lonePairsVisible) Removes unnecesarry MElectronContainers from the give MDocument corresponding to lone pair display options, if an electron of a MEFlow arrow has been removed the arrow is removed as well.Molecule[]
Gets an array containing all molecule objects.Molecule[]
Gets an array containing all non-empty molecule objects.Gets all objects stored in this document and from the chemical structure of the document.getAtomSetColor
(int seq) Gets an atom set color.int
getAtomSetColorMode
(int seq) Gets the atom set coloring mode.getAtomSetFont
(int seq) Gets an atom set font.int
getAtomSetRGB
(int seq) Gets an atom set color.int
Gets the size of the atom set.getBondSetColor
(int seq) Gets a bond set color.int
getBondSetColorMode
(int seq) Gets the bond set coloring mode.int
getBondSetRGB
(int seq) Gets a bond set color.int
Gets the bond set size.double
getBondSetThickness
(int seq) Gets a bond set thickness.Returns the array of checker marks NOTE: checker marks will be reset on any molecule changegetConnectedObject
(int i) Gets an object from the document or from the chemical structure of the document.int
Gets the number of objects in this document and in the chemical structure of this document.Gets the dragged objectint
Returns the number of electrons.long
Gets the end position of this document in the input file.int
Returns the number of Lone Pair electrons set by the user.int
getExtraLabelSetColorMode
(int seq) Gets the coloring mode of extra label set sequences.getExtraLabelSetFont
(int seq) long
getExtraLabelSetRGBs
(int seq) int
getFocus()
Gets the focused objectint
Returns the first unused atomset index.int
Returns the first unused bondset index.final String
Gets the input file format.int
Returns the number of Lone Pair electrons.Gets the main molecule graph.Gets the molecule movie.getMProp()
Gets the document as a property.getObject
(int i) Gets an object from the document.Gets the object that contains the selection.int
Gets the number of objects in this document.Gets the page settings of multipage molecular document.Gets the primary molecule object.Molecule[]
Gets an array containing the primary molecule objects.int
Returns the number of Radical electrons.long
Gets the starting position of this document in the input file.boolean
Returns whether MDocument contains any electrons.boolean
Returns true if the MDocument has any electrons drawn by the user.boolean
Returns true if the MDocument has any Radical Electrons.void
Highlight an object.int
Searches for an object in the document or in the chemical structure that belongs to the document.boolean
Decides whether the atomset coloring mode is set.boolean
isEmpty()
Tests whether the document is empty: the main molecule object in the document is empty no graphic object is included (neither simple nor extra)boolean
Decides whether a graphic object belongs to the main chemical structure of the document.boolean
Is the specified object currently highlighted?boolean
Tests whether the document is equivalent to a simple molecule.void
Move the main molecule graph to the top of stack.void
Move the molecule movie (if exists) to the top of stack.void
moveObject
(MObject o, int i) Move an object to another place in the stack.static MDocument
Deprecated, for removal: This API element is subject to removal in a future version.As of release 5.7, replaced byMolImporter.parseMRV(String)
Gets the property container.void
Removes an atom from all the chemical graphs and removes all graphics objects that contain its reference.void
removeAtom
(MolAtom a, int cleanupFlags) Removes an atom from all the chemical graphs and removes all graphics objects that contain its reference.void
removeAtomFromGraphs
(MolAtom node) Removes the specified node from all molecule graphs.void
Removes coloring from all molecular objects in the document.void
removeElectronsOf
(MolAtom targetAtom) Removes the Electron containers belongs to targetAtom,void
removeObject
(int i) Removes an object from the document.void
Removes an object from the document or from the chemical structure of the document.void
selectAllConnectedObjects
(boolean s) Selects or unselects all objects in this document and objects that belong to the chemical structure of this document.void
selectAllObjects
(boolean s) Selects or unselects all objects.void
setAtomSetColorMode
(int seq, int m) Sets the atom set coloring mode.void
setAtomSetFont
(int seq, MFont font) Sets the font of an atom set.void
setAtomSetRGB
(int seq, int rgb) Sets the color of an atom set.void
setBondSetColorMode
(int seq, int m) Sets the bond set coloring mode.void
setBondSetRGB
(int seq, int rgb) Sets the color of a bond set.void
setBondSetThickness
(int seq, double thickness) Sets the thickness of a bond set.void
Sets the dragged object.void
setEndPosition
(long off) Sets the end position of this document in the input file.void
Sets the coloring mode sets and colors of extra labelsvoid
setExtraLabelSetColorMode
(int seq, int mode) void
setExtraLabelSetRGBs
(int seq, int rgb) void
setExtraLabelSetRGBs
(int seq, int rgb1, int rgb2) void
Focus to the specified object.void
Sets the property container storing MarvinPane settingsvoid
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 6.1, replaced bysetGUIPropertyContainer(MPropertyContainer)
.void
setInputFormat
(String format) Sets the input file format.void
Sets the main molecule graph.void
Sets the molecule movie.void
Sets an objectvoid
Sets the object that contains the selection.void
setPageSettings
(PageSettings pageSettings) Sets the page settings of multipage molecular document.void
setStartPosition
(long off) Sets the starting position of this document in the input file.void
Simplifies the main molecule object if possible.toString()
Overrides Object.toString() to ease debugging.void
Transforms all object's coordinates.void
transform
(CTransform3D t, int opts) Transforms all object's coordinates.void
transform
(CTransform3D t, int opts, CTransform3D trot) Transforms all object's coordinates.void
transform
(CTransform3D t, CTransform3D textBoxT, int opts, CTransform3D trot) Transforms all object's coordinates.void
Unhighlights an object.void
Unhighlights all objects.
-
Field Details
-
SETCOLOR_DEFAULT
public static final int SETCOLOR_DEFAULTDefault set colors are used for coloring the atom/bond set.- Since:
- Marvin 4.1, 05/31/2006
- See Also:
-
SETCOLOR_SPECIFIED
public static final int SETCOLOR_SPECIFIEDThe user specified set colors are used for coloring the atom/bond set.- Since:
- Marvin 4.1, 05/31/2006
- See Also:
-
SETCOLOR_COLORLESS
public static final int SETCOLOR_COLORLESSThe atom/bond set is colorless, normal (CPK, Monochrome etc.) colors are used.- Since:
- Marvin 4.1, 05/31/2006
- See Also:
-
objects
-
mainMChemicalStruct
-
mainMMoleculeMovie
-
objectContainingSelection
-
temporaryObjects
-
-
Constructor Details
-
MDocument
Creates a document for the specified molecule graph.- Parameters:
m
- the main molecule graph- Throws:
IllegalArgumentException
- if the given molecule has a parent (root, rgroup, component)
-
MDocument
Creates a document for the specified molecule animation.- Parameters:
mols
- the molecule animation- Since:
- Marvin 4.0, 06/30/2005
-
MDocument
Copy constructor.- Parameters:
doc
- the source
-
MDocument
Copy constructor.- Parameters:
doc
- the sourcecloneobjs
- whether to clone objects- Since:
- Marvin 3.5, 11/06/2004
-
-
Method Details
-
getMChemicalStruct
-
cloneTemporraryObjects
-
cloneSets
Clones the atom/bond sets from doc.- Parameters:
doc
- the document to clone from.
-
parseMRV
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static MDocument parseMRV(String sval) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.As of release 5.7, replaced byMolImporter.parseMRV(String)
Parses a document from a string in Marvin Document (MRV) format.- Parameters:
sval
- the string- Returns:
- The document
- Throws:
IOException
- if an exception occurs during parsing- Since:
- Marvin 4.1, 11/20/2005
-
cloneDocument
Creates a clone.- Returns:
- the clone
- Since:
- Marvin 3.5.1, 11/20/2004
-
cloneMainMolecule
Creates a clone.- Returns:
- the main molecule of the clone
- Throws:
ClassCastException
- if the main molecule graph is not a Molecule instance- Since:
- Marvin 3.5.1, 11/20/2004
-
cloneMainMoleculeGraph
Creates a clone.- Returns:
- the main molecule graph of the clone
- Since:
- Marvin 3.5.1, 11/20/2004
-
clone
Creates a clone. -
removeAtomFromGraphs
Removes the specified node from all molecule graphs.- Parameters:
node
- the node to remove
-
selectAllObjects
public void selectAllObjects(boolean s) Selects or unselects all objects. -
selectAllConnectedObjects
public void selectAllConnectedObjects(boolean s) Selects or unselects all objects in this document and objects that belong to the chemical structure of this document. -
getObjectContainingSelection
Gets the object that contains the selection.- Returns:
- the object or null
-
setObjectContainingSelection
Sets the object that contains the selection. All other objects's contents are unselected.- Parameters:
o
- the object or null
-
isHighlighted
Is the specified object currently highlighted?- Returns:
- true if it is highlighted, false otherwise
-
highlight
Highlight an object.- Parameters:
o
- the object to highlight
-
unhighlight
Unhighlights an object.- Parameters:
o
- the object to unhighlight
-
unhighlightAll
public void unhighlightAll()Unhighlights all objects. -
getDraggedObject
Gets the dragged object- Returns:
- the dragged object or null
-
setDraggedObject
Sets the dragged object.- Parameters:
o
- the object
-
getFocus
Gets the focused object- Returns:
- the focused object or null
-
setFocus
Focus to the specified object.- Parameters:
o
- the object
-
getMainMoleculeGraph
Gets the main molecule graph.- Returns:
- the molecule graph
-
setMainMoleculeGraph
Sets the main molecule graph.- Parameters:
m
- the molecule graph
-
getMoleculeMovie
Gets the molecule movie.- Returns:
- the molecule movie or null
- Since:
- Marvin 4.0, 06/30/2005
-
getPrimaryMolecule
Gets the primary molecule object. The main molecule graph is returned if it is a molecule, unless it is empty and a molecule movie is also present. In that case, the current molecule of the movie is returned. WARNING! Do not change the returned molecule object! The document may become corrupted.- Returns:
- the array of molecules
- Since:
- Marvin 4.0, 06/30/2005
-
getPrimaryMolecules
Gets an array containing the primary molecule objects. The main molecule graph is returned if it is a molecule, unless it is empty and a molecule movie is also present. In that case, the molecules of the movie are returned. WARNING! Do not change the returned molecule objects! The document may become corrupted.- Returns:
- the array of molecules
- Since:
- Marvin 4.0, 06/30/2005
-
getAllMolecules
Gets an array containing all molecule objects. WARNING! Do not change the returned molecule objects! The document may become corrupted.- Returns:
- the array of molecules
- Since:
- Marvin 4.0, 06/30/2005
-
getAllNonEmptyMolecules
Gets an array containing all non-empty molecule objects. WARNING! Do not change the returned molecule objects! The document may become corrupted.- Returns:
- the array of molecules
- Since:
- Marvin 4.0, 06/30/2005
-
setMoleculeMovie
Sets the molecule movie.- Parameters:
mmm
- the molecule movie- Since:
- Marvin 4.0, 06/30/2005
-
indexOf
Searches for an object in the document or in the chemical structure that belongs to the document.- Parameters:
o
- the object- Returns:
- the object's index if found, -1 otherwise
-
moveObject
Move an object to another place in the stack.- Parameters:
o
- the objecti
- the new position
-
moveMainMoleculeGraphToFront
public void moveMainMoleculeGraphToFront()Move the main molecule graph to the top of stack. -
moveMoleculeMovieToFront
public void moveMoleculeMovieToFront()Move the molecule movie (if exists) to the top of stack.- Since:
- Marvin 4.0, 06/30/2005
-
contains
Searches an object in the document.- Parameters:
o
- the object- Returns:
- true if the document contains the object, false otherwise
-
contains
Tests whether the document contains all objects of another document.- Parameters:
doc
- the other document- Returns:
- true if the document contains the objects of the other document, false otherwise
- Since:
- Marvin 3.4
-
containsOnlyOne
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean containsOnlyOne(Class<?> cl) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the document contains only one object of the specified class.- Parameters:
cl
- MObject.class or a derived class- Returns:
- true if no more and not less than one non-empty object is instance of the specified class
- Since:
- Marvin 3.5, 07/12/2004
-
addObject
Adds an object to the document.- Parameters:
o
- the object
-
isExtraObject
Decides whether a graphic object belongs to the main chemical structure of the document.- Parameters:
o
- the graphic object- Returns:
- true if the graphic object belongs to the main chemical structure, false otherwise.
-
removeObject
Removes an object from the document or from the chemical structure of the document.- Parameters:
o
- the object
-
removeObject
public void removeObject(int i) Removes an object from the document.- Parameters:
i
- the object index
-
getObjectCount
public int getObjectCount()Gets the number of objects in this document.- Returns:
- the number of objects
-
getConnectedObjectCount
public int getConnectedObjectCount()Gets the number of objects in this document and in the chemical structure of this document.- Returns:
- the number of objects
-
getObject
Gets an object from the document.- Parameters:
i
- the index of the object- Returns:
- the object at the specified index.
-
getConnectedObject
Gets an object from the document or from the chemical structure of the document.- Parameters:
i
- the index of the object- Returns:
- the object at the specified index.
-
getAllObjects
Gets all objects stored in this document and from the chemical structure of the document.- Returns:
- the list of objects
-
setObject
Sets an object- Parameters:
o
- the objecti
- the index
-
removeAtom
Removes an atom from all the chemical graphs and removes all graphics objects that contain its reference.- Parameters:
a
- the atom to remove- Since:
- Marvin 3.5, 07/05/2004
-
removeAtom
Removes an atom from all the chemical graphs and removes all graphics objects that contain its reference.- Parameters:
a
- the atom to removecleanupFlags
- cleanup options- Since:
- Marvin 4.1, 03/07/2006
-
clear
public void clear()Clears the document. Removes all objects except the main molecule graph, from which all atoms, bonds and other objects are removed. -
clearSets
public void clearSets()Clears the atomSets and the bondSets. -
isEmpty
public boolean isEmpty()Tests whether the document is empty:- the main molecule object in the document is empty
- no graphic object is included (neither simple nor extra)
- Returns:
- true if the document is empty, false otherwise
-
isSimpleMolecule
public boolean isSimpleMolecule()Tests whether the document is equivalent to a simple molecule.- Returns:
- true if the document does not have extra properties, false otherwise
- Since:
- Marvin 4.1, 11/19/2005
-
simplifyMolecule
public void simplifyMolecule()Simplifies the main molecule object if possible. Note that it makes the original molecule object invalid.- Since:
- Marvin 4.1.13, 09/20/2007
- See Also:
-
transform
Transforms all object's coordinates.- Specified by:
transform
in interfaceMTransformable
- Parameters:
t
- the transformation matrix
-
transform
Transforms all object's coordinates.- Parameters:
t
- the transformation matrixopts
- the transformation options- See Also:
-
transform
Transforms all object's coordinates.- Parameters:
t
- the transformation matrixopts
- the transformation optionstrot
- the viewing transformation- Since:
- Marvin 4.1, 04/28/2006
- See Also:
-
transform
Transforms all object's coordinates.- Parameters:
t
- the transformation matrixtextBoxT
- the object transformation matrixopts
- the transformation optionstrot
- the viewing transformation- Since:
- Marvin 4.1, 04/28/2006
- See Also:
-
calcCenter
Calculates the geometrical center.- Returns:
- the center in `absolute' coordinates
-
calcCenter
Calculates the geometrical center.- Parameters:
t
- the viewing transformation or null- Returns:
- the center in transformed coordinates
- Since:
- Marvin 4.1, 04/28/2006
-
getStartPosition
public long getStartPosition()Gets the starting position of this document in the input file.- Returns:
- the starting position
-
setStartPosition
public void setStartPosition(long off) Sets the starting position of this document in the input file.- Parameters:
off
- the starting position
-
getEndPosition
public long getEndPosition()Gets the end position of this document in the input file.- Returns:
- the end position
-
setEndPosition
public void setEndPosition(long off) Sets the end position of this document in the input file.- Parameters:
off
- the end position
-
getInputFormat
Gets the input file format. Set by the import module if the molecule is from a file.- Returns:
- the input file format for the document
-
setInputFormat
Sets the input file format.- Parameters:
format
- the input format
-
exportToFormat
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final String exportToFormat(String fmt) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.As of release 5.7, replaced byMolExporter.exportToFormat(MDocument, String)
Creates a string representation of the document. The format descriptor string can also contain export options. Format and options are separated by a colon, multiple options can be separated by commas. See the text formats and their options on the File Formats in Marvin page. Examples:s1 = doc.exportToFormat("mol"); s2 = doc.exportToFormat("smiles:a-H"); // aromatize and remove Hydrogens
- Parameters:
fmt
- the format descriptor string- Returns:
- string representation of the document in the specified format
- Throws:
MolExportException
- Export errorIllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).IOException
- Since:
- Marvin 4.0, 07/01/2005
-
exportToBinFormat
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public final byte[] exportToBinFormat(String fmt) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.As of release 5.7, replaced byMolExporter.exportToBinFormat(MDocument, String)
.Creates a binary representation of the document. Works with all the text formats that are supported by theexportToFormat
method, and also with the binary image formats (jpeg, msbmp, png). When creating an image, display options can also be specified in the format descriptor string. Format and options are separated by a colon, multiple options can be separated by commas. See the possible formats and their options on the File Formats in Marvin page. Examples:byte[] d1 = doc.exportToBinFormat("mrv"); byte[] d2 = doc.exportToBinFormat("smiles:a-H"); // aromatize and remove H byte[] d3 = doc.exportToBinFormat("png:w300,h300,b32,#00ffff00"); byte[] d4 = doc.exportToBinFormat("jpeg:w300,h300,Q95,#ffff00,spacefill");
- Parameters:
fmt
- the format descriptor string- Returns:
- a binary representation of the document in the specified format
- Throws:
MolExportException
- Export error.IllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).IOException
- Since:
- Marvin 4.0, 07/01/2005
-
exportToObject
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public Object exportToObject(String fmt) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.As of release 5.7, replaced byMolExporter.exportToObject(MDocument, String)
Creates a String, byte[] array or Image representation of the molecule. When creating an image, display options can also be specified in the format descriptor string. Format and options are separated by a colon, multiple options can be separated by commas. See the possible formats and their options on the File Formats in Marvin page. Examples:import java.awt.Image; ... String s1 = (String)doc.exportToObject("mol"); String s2 = (String)doc.exportToObject("smiles:a-H"); // aromatize, remove H Image img = (Image)doc.exportToObject("image:w300,h300,#ffff00"); byte[] d3 = (byte[])doc.exportToObject("png:w300,h300,b32,#00ffff00"); byte[] d4 = (byte[])doc.exportToObject("jpeg:w300,h300,Q95,#ffff00,spacefill");
- Parameters:
fmt
- the format descriptor string- Returns:
- a String, a byte[] array or an Image
- Throws:
MolExportException
- Export error.IllegalArgumentException
- Invalid format string.SecurityException
- Export module cannot be loaded because of security reasons (firewall).IOException
- Since:
- Marvin 4.0, 07/01/2005
-
getMProp
Gets the document as a property.- Since:
- Marvin 4.1, 08/01/2006
-
properties
Gets the property container.- Since:
- Marvin 4.0, 06/18/2005
-
getAtomSetFont
Gets an atom set font.- Parameters:
seq
- the atom set sequence number- Returns:
- the font
- Since:
- Marvin 4.0.3, 06/10/2005
-
setAtomSetFont
Sets the font of an atom set.- Parameters:
seq
- atom set sequence number (0, ...,MolAtom.SETSEQ_MAX
)- Since:
- Marvin 4.0.3, 06/10/2005
-
getAtomSetColorMode
public int getAtomSetColorMode(int seq) Gets the atom set coloring mode.- Parameters:
seq
- the atom set sequence number- Returns:
- the mode
- Since:
- Marvin 4.1, 05/31/2006
- See Also:
-
setAtomSetColorMode
public void setAtomSetColorMode(int seq, int m) Sets the atom set coloring mode.- Parameters:
seq
- the atom set sequence numberm
- the mode- Since:
- Marvin 4.1, 05/31/2006
- See Also:
-
isAtomSetColorModeSet
public boolean isAtomSetColorModeSet()Decides whether the atomset coloring mode is set.- Returns:
- true if the coloring mode is set for at lease one atomset false otherwise.
-
setExtraLabelSetColorMode
public void setExtraLabelSetColorMode(int seq, int mode) -
getAtomSetSize
public int getAtomSetSize()Gets the size of the atom set.- Returns:
- the atom set size
-
getExtraLabelSetSize
public int getExtraLabelSetSize() -
getAtomSetRGB
public int getAtomSetRGB(int seq) Gets an atom set color.- Parameters:
seq
- the atom set sequence number- Returns:
- the RGB values or -1 if unset or default atom coloring is used
- Since:
- Marvin 4.0, 03/02/2005
-
getExtraLabelSetRGBs
public long getExtraLabelSetRGBs(int seq) -
getExtraLabelSetColorMode
public int getExtraLabelSetColorMode(int seq) Gets the coloring mode of extra label set sequences.- Parameters:
seq
- the atom sequence number- Returns:
- the coloring mode
- Since:
- Marvin 4.1, 07/06/2006
- See Also:
-
getExtraLabelSetFont
-
setExtraLabelColorsForDocument
Sets the coloring mode sets and colors of extra labels- Parameters:
mol
- the graph union in the document
-
setAtomSetRGB
public void setAtomSetRGB(int seq, int rgb) Sets the color of an atom set. It also sets the color mode of the set toSETCOLOR_SPECIFIED
.- Parameters:
seq
- atom set sequence number (0, ...,MolAtom.SETSEQ_MAX
)rgb
- the RGB values- Since:
- Marvin 4.0, 03/02/2005
-
setExtraLabelSetRGBs
public void setExtraLabelSetRGBs(int seq, int rgb) -
setExtraLabelSetRGBs
public void setExtraLabelSetRGBs(int seq, int rgb1, int rgb2) -
getAtomSetColor
Gets an atom set color.- Parameters:
seq
- the atom set sequence number- Returns:
- the color or
null
if unset or default bond coloring is used - Since:
- Marvin 4.0, 03/02/2005
-
getBondSetSize
public int getBondSetSize()Gets the bond set size.- Returns:
- the bond set size
-
getBondSetThickness
public double getBondSetThickness(int seq) Gets a bond set thickness.- Parameters:
seq
- the atom set sequence number- Returns:
- the thickness
- Since:
- Marvin 4.0.3, 10/14/2005
-
setBondSetThickness
public void setBondSetThickness(int seq, double thickness) Sets the thickness of a bond set.- Parameters:
seq
- bond set sequence number (0, ...,MolAtom.SETSEQ_MAX
)- Since:
- Marvin 4.0.3, 10/14/2005
-
getBondSetColorMode
public int getBondSetColorMode(int seq) Gets the bond set coloring mode.- Parameters:
seq
- the bond set sequence number- Returns:
- the mode
- Since:
- Marvin 4.1, 05/31/2006
- See Also:
-
setBondSetColorMode
public void setBondSetColorMode(int seq, int m) Sets the bond set coloring mode.- Parameters:
seq
- the bond set sequence numberm
- the mode- Since:
- Marvin 4.1, 05/31/2006
- See Also:
-
getBondSetRGB
public int getBondSetRGB(int seq) Gets a bond set color.- Parameters:
seq
- the bond set sequence number- Returns:
- the RGB values or -1 if unset or default coloring is used
- Since:
- Marvin 4.0, 03/02/2005
-
setBondSetRGB
public void setBondSetRGB(int seq, int rgb) Sets the color of a bond set. It also sets the color mode of the set toSETCOLOR_SPECIFIED
.- Parameters:
seq
- bond set sequence number (1, ...,MolBond.SETSEQ_MAX
)rgb
- the RGB values- Since:
- Marvin 4.0, 03/02/2005
-
getBondSetColor
Gets a bond set color.- Parameters:
seq
- the bond set sequence number- Returns:
- the color or
null
if unset or default bond coloring is used - Since:
- Marvin 4.0, 03/02/2005
-
addCheckerMark
Adds a checker mark to the document. The checker mark containts atom indexes, bond indexes, and a color NOTE: checker marks will be reset on any molecule change- Parameters:
mark
- is the checker mark information- Since:
- Marvin 5.3
-
clearCheckerMarks
public void clearCheckerMarks()Clears the checker marks- Since:
- Marvin 5.3
- See Also:
-
getCheckerMarks
Returns the array of checker marks NOTE: checker marks will be reset on any molecule change- Returns:
- atom indexes or
null
- Since:
- Marvin 5.3
- 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. If the main molecule graph is not empty, then the string also contains the number of nodes and edges in "[Na,Mb]" form. -
getPageSettings
Gets the page settings of multipage molecular document.- Returns:
- the page settings
- Since:
- Marvin 4.1, 01/09/2006
-
setPageSettings
Sets the page settings of multipage molecular document.- Parameters:
pageSettings
- the page settings- Since:
- Marvin 4.1, 01/09/2006
-
setGUIPropertyContainer
Sets the property container storing MarvinPane settings- Since:
- 5.2.2 11/05/2009
-
setGUIProperyContainer
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setGUIProperyContainer(MPropertyContainer gpc) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 6.1, replaced bysetGUIPropertyContainer(MPropertyContainer)
.Sets the property container storing MarvinPane settings- Since:
- 4.1 11/04/2006
-
getGUIPropertyContainer
- Returns:
- the property container storing GUI settings or null
- Since:
- 4.1 11/04/2006
-
getFreeAtomSetIndex
public int getFreeAtomSetIndex()Returns the first unused atomset index.- Returns:
- the atomset index
-
getFreeBondSetIndex
public int getFreeBondSetIndex()Returns the first unused bondset index.- Returns:
- the bondset index
-
removeColorsFromMolecules
public void removeColorsFromMolecules()Removes coloring from all molecular objects in the document. Removes coloring of atoms, bonds and extra labels. Removes all color sets from the document. -
removeElectronsOf
Removes the Electron containers belongs to targetAtom, -
fixElectronContainers
public static void fixElectronContainers(MDocument doc, boolean lonePairsAutoCalc, boolean lonePairsVisible) Removes unnecesarry MElectronContainers from the give MDocument corresponding to lone pair display options, if an electron of a MEFlow arrow has been removed the arrow is removed as well. -
hasExplicitLonePairs
public boolean hasExplicitLonePairs()Returns true if the MDocument has any electrons drawn by the user.- Returns:
- true if any electrons if set by the user.
- Since:
- Marvin 15.9.21
-
getExplicitLonePairCount
public int getExplicitLonePairCount()Returns the number of Lone Pair electrons set by the user.- Returns:
- number of user drawn lone pairs.
- Since:
- Marvin 15.9.21
-
getLonePairCount
public int getLonePairCount()Returns the number of Lone Pair electrons.- Returns:
- number of user lone pairs.
- Since:
- Marvin 15.9.21
-
hasRadicals
public boolean hasRadicals()Returns true if the MDocument has any Radical Electrons.- Returns:
- true if MDocument has any radical electrons.
- Since:
- Marvin 15.9.21
-
getRadicalCount
public int getRadicalCount()Returns the number of Radical electrons.- Returns:
- number of Radical electrons.
- Since:
- Marvin 15.9.21
-
hasElectrons
public boolean hasElectrons()Returns whether MDocument contains any electrons.- Returns:
- true if the MDocument contains any electrons.
- Since:
- Marvin 15.9.21
-
getElectronCount
public int getElectronCount()Returns the number of electrons.- Returns:
- number of electrons.
- Since:
- Marvin 15.9.21
-
MolExporter.exportToBinFormat(MDocument, String)
.