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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classProvides informations for Structure Checker higlightclassProperty that stores an MDocument.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected MChemicalStructprotected MMoleculeMovieprotected MObjectstatic final intThe atom/bond set is colorless, normal (CPK, Monochrome etc.) colors are used.static final intDefault set colors are used for coloring the atom/bond set.static final intThe user specified set colors are used for coloring the atom/bond set.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionCopy constructor.protectedCopy constructor.Creates a document for the specified molecule animation.Creates a document for the specified molecule graph.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a checker mark to the document.voidAdds an object to the document.Calculates the geometrical center.Calculates the geometrical center.voidclear()Clears the document.voidClears the checker marksvoidClears the atomSets and the bondSets.final Objectclone()Creates a clone.Creates a clone.final MoleculeCreates a clone.final MoleculeGraphCreates a clone.voidClones the atom/bond sets from doc.protected voidbooleanTests whether the document contains all objects of another document.booleanSearches an object in the document.booleancontainsOnlyOne(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 StringexportToFormat(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 voidfixElectronContainers(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.intgetAtomSetColorMode(int seq) Gets the atom set coloring mode.getAtomSetFont(int seq) Gets an atom set font.intgetAtomSetRGB(int seq) Gets an atom set color.intGets the size of the atom set.getBondSetColor(int seq) Gets a bond set color.intgetBondSetColorMode(int seq) Gets the bond set coloring mode.intgetBondSetRGB(int seq) Gets a bond set color.intGets the bond set size.doublegetBondSetThickness(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.intGets the number of objects in this document and in the chemical structure of this document.Gets the dragged objectintReturns the number of electrons.longGets the end position of this document in the input file.intReturns the number of Lone Pair electrons set by the user.intgetExtraLabelSetColorMode(int seq) Gets the coloring mode of extra label set sequences.getExtraLabelSetFont(int seq) longgetExtraLabelSetRGBs(int seq) intgetFocus()Gets the focused objectintReturns the first unused atomset index.intReturns the first unused bondset index.final StringGets the input file format.intReturns 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.intGets 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.intReturns the number of Radical electrons.longGets the starting position of this document in the input file.booleanReturns whether MDocument contains any electrons.booleanReturns true if the MDocument has any electrons drawn by the user.booleanReturns true if the MDocument has any Radical Electrons.voidHighlight an object.intSearches for an object in the document or in the chemical structure that belongs to the document.booleanDecides whether the atomset coloring mode is set.booleanisEmpty()Tests whether the document is empty: the main molecule object in the document is empty no graphic object is included (neither simple nor extra)booleanDecides whether a graphic object belongs to the main chemical structure of the document.booleanIs the specified object currently highlighted?booleanTests whether the document is equivalent to a simple molecule.voidMove the main molecule graph to the top of stack.voidMove the molecule movie (if exists) to the top of stack.voidmoveObject(MObject o, int i) Move an object to another place in the stack.static MDocumentDeprecated, 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.voidRemoves an atom from all the chemical graphs and removes all graphics objects that contain its reference.voidremoveAtom(MolAtom a, int cleanupFlags) Removes an atom from all the chemical graphs and removes all graphics objects that contain its reference.voidremoveAtomFromGraphs(MolAtom node) Removes the specified node from all molecule graphs.voidRemoves coloring from all molecular objects in the document.voidremoveElectronsOf(MolAtom targetAtom) Removes the Electron containers belongs to targetAtom,voidremoveObject(int i) Removes an object from the document.voidRemoves an object from the document or from the chemical structure of the document.voidselectAllConnectedObjects(boolean s) Selects or unselects all objects in this document and objects that belong to the chemical structure of this document.voidselectAllObjects(boolean s) Selects or unselects all objects.voidsetAtomSetColorMode(int seq, int m) Sets the atom set coloring mode.voidsetAtomSetFont(int seq, MFont font) Sets the font of an atom set.voidsetAtomSetRGB(int seq, int rgb) Sets the color of an atom set.voidsetBondSetColorMode(int seq, int m) Sets the bond set coloring mode.voidsetBondSetRGB(int seq, int rgb) Sets the color of a bond set.voidsetBondSetThickness(int seq, double thickness) Sets the thickness of a bond set.voidSets the dragged object.voidsetEndPosition(long off) Sets the end position of this document in the input file.voidSets the coloring mode sets and colors of extra labelsvoidsetExtraLabelSetColorMode(int seq, int mode) voidsetExtraLabelSetRGBs(int seq, int rgb) voidsetExtraLabelSetRGBs(int seq, int rgb1, int rgb2) voidFocus to the specified object.voidSets the property container storing MarvinPane settingsvoidDeprecated, for removal: This API element is subject to removal in a future version.As of Marvin 6.1, replaced bysetGUIPropertyContainer(MPropertyContainer).voidsetInputFormat(String format) Sets the input file format.voidSets the main molecule graph.voidSets the molecule movie.voidSets an objectvoidSets the object that contains the selection.voidsetPageSettings(PageSettings pageSettings) Sets the page settings of multipage molecular document.voidsetStartPosition(long off) Sets the starting position of this document in the input file.voidSimplifies the main molecule object if possible.toString()Overrides Object.toString() to ease debugging.voidTransforms all object's coordinates.voidtransform(CTransform3D t, int opts) Transforms all object's coordinates.voidtransform(CTransform3D t, int opts, CTransform3D trot) Transforms all object's coordinates.voidtransform(CTransform3D t, CTransform3D textBoxT, int opts, CTransform3D trot) Transforms all object's coordinates.voidUnhighlights an object.voidUnhighlights all objects.
- 
Field Details- 
SETCOLOR_DEFAULTpublic 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_SPECIFIEDpublic 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_COLORLESSpublic 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- 
MDocumentCreates 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)
 
- 
MDocumentCreates a document for the specified molecule animation.- Parameters:
- mols- the molecule animation
- Since:
- Marvin 4.0, 06/30/2005
 
- 
MDocumentCopy constructor.- Parameters:
- doc- the source
 
- 
MDocumentCopy constructor.- Parameters:
- doc- the source
- cloneobjs- whether to clone objects
- Since:
- Marvin 3.5, 11/06/2004
 
 
- 
- 
Method Details- 
getMChemicalStruct
- 
cloneTemporraryObjects
- 
cloneSetsClones 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
 
- 
cloneDocumentCreates a clone.- Returns:
- the clone
- Since:
- Marvin 3.5.1, 11/20/2004
 
- 
cloneMainMoleculeCreates 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
 
- 
cloneMainMoleculeGraphCreates a clone.- Returns:
- the main molecule graph of the clone
- Since:
- Marvin 3.5.1, 11/20/2004
 
- 
cloneCreates a clone.
- 
removeAtomFromGraphsRemoves the specified node from all molecule graphs.- Parameters:
- node- the node to remove
 
- 
selectAllObjectspublic void selectAllObjects(boolean s) Selects or unselects all objects.
- 
selectAllConnectedObjectspublic void selectAllConnectedObjects(boolean s) Selects or unselects all objects in this document and objects that belong to the chemical structure of this document.
- 
getObjectContainingSelectionGets the object that contains the selection.- Returns:
- the object or null
 
- 
setObjectContainingSelectionSets the object that contains the selection. All other objects's contents are unselected.- Parameters:
- o- the object or null
 
- 
isHighlightedIs the specified object currently highlighted?- Returns:
- true if it is highlighted, false otherwise
 
- 
highlightHighlight an object.- Parameters:
- o- the object to highlight
 
- 
unhighlightUnhighlights an object.- Parameters:
- o- the object to unhighlight
 
- 
unhighlightAllpublic void unhighlightAll()Unhighlights all objects.
- 
getDraggedObjectGets the dragged object- Returns:
- the dragged object or null
 
- 
setDraggedObjectSets the dragged object.- Parameters:
- o- the object
 
- 
getFocusGets the focused object- Returns:
- the focused object or null
 
- 
setFocusFocus to the specified object.- Parameters:
- o- the object
 
- 
getMainMoleculeGraphGets the main molecule graph.- Returns:
- the molecule graph
 
- 
setMainMoleculeGraphSets the main molecule graph.- Parameters:
- m- the molecule graph
 
- 
getMoleculeMovieGets the molecule movie.- Returns:
- the molecule movie or null
- Since:
- Marvin 4.0, 06/30/2005
 
- 
getPrimaryMoleculeGets 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
 
- 
getPrimaryMoleculesGets 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
 
- 
getAllMoleculesGets 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
 
- 
getAllNonEmptyMoleculesGets 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
 
- 
setMoleculeMovieSets the molecule movie.- Parameters:
- mmm- the molecule movie
- Since:
- Marvin 4.0, 06/30/2005
 
- 
indexOfSearches 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
 
- 
moveObjectMove an object to another place in the stack.- Parameters:
- o- the object
- i- the new position
 
- 
moveMainMoleculeGraphToFrontpublic void moveMainMoleculeGraphToFront()Move the main molecule graph to the top of stack.
- 
moveMoleculeMovieToFrontpublic void moveMoleculeMovieToFront()Move the molecule movie (if exists) to the top of stack.- Since:
- Marvin 4.0, 06/30/2005
 
- 
containsSearches an object in the document.- Parameters:
- o- the object
- Returns:
- true if the document contains the object, false otherwise
 
- 
containsTests 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
 
- 
addObjectAdds an object to the document.- Parameters:
- o- the object
 
- 
isExtraObjectDecides 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.
 
- 
removeObjectRemoves an object from the document or from the chemical structure of the document.- Parameters:
- o- the object
 
- 
removeObjectpublic void removeObject(int i) Removes an object from the document.- Parameters:
- i- the object index
 
- 
getObjectCountpublic int getObjectCount()Gets the number of objects in this document.- Returns:
- the number of objects
 
- 
getConnectedObjectCountpublic int getConnectedObjectCount()Gets the number of objects in this document and in the chemical structure of this document.- Returns:
- the number of objects
 
- 
getObjectGets an object from the document.- Parameters:
- i- the index of the object
- Returns:
- the object at the specified index.
 
- 
getConnectedObjectGets 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.
 
- 
getAllObjectsGets all objects stored in this document and from the chemical structure of the document.- Returns:
- the list of objects
 
- 
setObjectSets an object- Parameters:
- o- the object
- i- the index
 
- 
removeAtomRemoves 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
 
- 
removeAtomRemoves an atom from all the chemical graphs and removes all graphics objects that contain its reference.- Parameters:
- a- the atom to remove
- cleanupFlags- cleanup options
- Since:
- Marvin 4.1, 03/07/2006
 
- 
clearpublic void clear()Clears the document. Removes all objects except the main molecule graph, from which all atoms, bonds and other objects are removed.
- 
clearSetspublic void clearSets()Clears the atomSets and the bondSets.
- 
isEmptypublic 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
 
- 
isSimpleMoleculepublic 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
 
- 
simplifyMoleculepublic 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:
 
- 
transformTransforms all object's coordinates.- Specified by:
- transformin interface- MTransformable
- Parameters:
- t- the transformation matrix
 
- 
transformTransforms all object's coordinates.- Parameters:
- t- the transformation matrix
- opts- the transformation options
- See Also:
 
- 
transformTransforms all object's coordinates.- Parameters:
- t- the transformation matrix
- opts- the transformation options
- trot- the viewing transformation
- Since:
- Marvin 4.1, 04/28/2006
- See Also:
 
- 
transformTransforms all object's coordinates.- Parameters:
- t- the transformation matrix
- textBoxT- the object transformation matrix
- opts- the transformation options
- trot- the viewing transformation
- Since:
- Marvin 4.1, 04/28/2006
- See Also:
 
- 
calcCenterCalculates the geometrical center.- Returns:
- the center in `absolute' coordinates
 
- 
calcCenterCalculates the geometrical center.- Parameters:
- t- the viewing transformation or null
- Returns:
- the center in transformed coordinates
- Since:
- Marvin 4.1, 04/28/2006
 
- 
getStartPositionpublic long getStartPosition()Gets the starting position of this document in the input file.- Returns:
- the starting position
 
- 
setStartPositionpublic void setStartPosition(long off) Sets the starting position of this document in the input file.- Parameters:
- off- the starting position
 
- 
getEndPositionpublic long getEndPosition()Gets the end position of this document in the input file.- Returns:
- the end position
 
- 
setEndPositionpublic void setEndPosition(long off) Sets the end position of this document in the input file.- Parameters:
- off- the end position
 
- 
getInputFormatGets the input file format. Set by the import module if the molecule is from a file.- Returns:
- the input file format for the document
 
- 
setInputFormatSets 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
- 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 theexportToFormatmethod, 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
- 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
- Since:
- Marvin 4.0, 07/01/2005
 
- 
getMPropGets the document as a property.- Since:
- Marvin 4.1, 08/01/2006
 
- 
propertiesGets the property container.- Since:
- Marvin 4.0, 06/18/2005
 
- 
getAtomSetFontGets an atom set font.- Parameters:
- seq- the atom set sequence number
- Returns:
- the font
- Since:
- Marvin 4.0.3, 06/10/2005
 
- 
setAtomSetFontSets the font of an atom set.- Parameters:
- seq- atom set sequence number (0, ...,- MolAtom.SETSEQ_MAX)
- Since:
- Marvin 4.0.3, 06/10/2005
 
- 
getAtomSetColorModepublic 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:
 
- 
setAtomSetColorModepublic void setAtomSetColorMode(int seq, int m) Sets the atom set coloring mode.- Parameters:
- seq- the atom set sequence number
- m- the mode
- Since:
- Marvin 4.1, 05/31/2006
- See Also:
 
- 
isAtomSetColorModeSetpublic 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.
 
- 
setExtraLabelSetColorModepublic void setExtraLabelSetColorMode(int seq, int mode) 
- 
getAtomSetSizepublic int getAtomSetSize()Gets the size of the atom set.- Returns:
- the atom set size
 
- 
getExtraLabelSetSizepublic int getExtraLabelSetSize()
- 
getAtomSetRGBpublic 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
 
- 
getExtraLabelSetRGBspublic long getExtraLabelSetRGBs(int seq) 
- 
getExtraLabelSetColorModepublic 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
- 
setExtraLabelColorsForDocumentSets the coloring mode sets and colors of extra labels- Parameters:
- mol- the graph union in the document
 
- 
setAtomSetRGBpublic 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
 
- 
setExtraLabelSetRGBspublic void setExtraLabelSetRGBs(int seq, int rgb) 
- 
setExtraLabelSetRGBspublic void setExtraLabelSetRGBs(int seq, int rgb1, int rgb2) 
- 
getAtomSetColorGets an atom set color.- Parameters:
- seq- the atom set sequence number
- Returns:
- the color or
         nullif unset or default bond coloring is used
- Since:
- Marvin 4.0, 03/02/2005
 
- 
getBondSetSizepublic int getBondSetSize()Gets the bond set size.- Returns:
- the bond set size
 
- 
getBondSetThicknesspublic 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
 
- 
setBondSetThicknesspublic 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
 
- 
getBondSetColorModepublic 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:
 
- 
setBondSetColorModepublic void setBondSetColorMode(int seq, int m) Sets the bond set coloring mode.- Parameters:
- seq- the bond set sequence number
- m- the mode
- Since:
- Marvin 4.1, 05/31/2006
- See Also:
 
- 
getBondSetRGBpublic 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
 
- 
setBondSetRGBpublic 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
 
- 
getBondSetColorGets a bond set color.- Parameters:
- seq- the bond set sequence number
- Returns:
- the color or
         nullif unset or default bond coloring is used
- Since:
- Marvin 4.0, 03/02/2005
 
- 
addCheckerMarkAdds 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
 
- 
clearCheckerMarkspublic void clearCheckerMarks()Clears the checker marks- Since:
- Marvin 5.3
- See Also:
 
- 
getCheckerMarksReturns 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:
 
- 
toStringOverrides 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.
- 
getPageSettingsGets the page settings of multipage molecular document.- Returns:
- the page settings
- Since:
- Marvin 4.1, 01/09/2006
 
- 
setPageSettingsSets the page settings of multipage molecular document.- Parameters:
- pageSettings- the page settings
- Since:
- Marvin 4.1, 01/09/2006
 
- 
setGUIPropertyContainerSets 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
 
- 
getFreeAtomSetIndexpublic int getFreeAtomSetIndex()Returns the first unused atomset index.- Returns:
- the atomset index
 
- 
getFreeBondSetIndexpublic int getFreeBondSetIndex()Returns the first unused bondset index.- Returns:
- the bondset index
 
- 
removeColorsFromMoleculespublic 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.
- 
removeElectronsOfRemoves the Electron containers belongs to targetAtom,
- 
fixElectronContainerspublic 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.
- 
hasExplicitLonePairspublic 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
 
- 
getExplicitLonePairCountpublic 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
 
- 
getLonePairCountpublic int getLonePairCount()Returns the number of Lone Pair electrons.- Returns:
- number of user lone pairs.
- Since:
- Marvin 15.9.21
 
- 
hasRadicalspublic boolean hasRadicals()Returns true if the MDocument has any Radical Electrons.- Returns:
- true if MDocument has any radical electrons.
- Since:
- Marvin 15.9.21
 
- 
getRadicalCountpublic int getRadicalCount()Returns the number of Radical electrons.- Returns:
- number of Radical electrons.
- Since:
- Marvin 15.9.21
 
- 
hasElectronspublic boolean hasElectrons()Returns whether MDocument contains any electrons.- Returns:
- true if the MDocument contains any electrons.
- Since:
- Marvin 15.9.21
 
- 
getElectronCountpublic int getElectronCount()Returns the number of electrons.- Returns:
- number of electrons.
- Since:
- Marvin 15.9.21
 
 
- 
MolExporter.exportToBinFormat(MDocument, String).