chemaxon.struc
Class MDocument

java.lang.Object
  extended by chemaxon.struc.MDocument
All Implemented Interfaces:
MTransformable, java.io.Serializable
Direct Known Subclasses:
MSelectionDocument

public class MDocument
extends java.lang.Object
implements MTransformable, java.io.Serializable

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:

Extra objects are stored in the related chemical structure, but they are available from this class.

Since:
Marvin 3.1.4
Version:
5.3, 09/25/2009
Author:
Peter Csizmadia, Eva Hollo, Erika Biro
See Also:
Serialized Form

Nested Class Summary
static class MDocument.CheckerMark
          Provides informations for Structure Checker higlight
 class MDocument.Prop
          Property that stores an MDocument.
 
Field Summary
protected  MChemicalStruct mainMChemicalStruct
           
protected  chemaxon.struc.graphics.MMoleculeMovie mainMMoleculeMovie
           
protected  MObject objectContainingSelection
           
protected  java.util.ArrayList<MObject> objects
           
static int SETCOLOR_COLORLESS
          The atom/bond set is colorless, normal (CPK, Monochrome etc.) colors are used.
static int SETCOLOR_DEFAULT
          Default set colors are used for coloring the atom/bond set.
static int SETCOLOR_SPECIFIED
          The user specified set colors are used for coloring the atom/bond set.
 
Constructor Summary
  MDocument(MDocument doc)
          Copy constructor.
protected MDocument(MDocument doc, boolean cloneobjs)
          Copy constructor.
  MDocument(Molecule[] mols)
          Creates a document for the specified molecule animation.
  MDocument(MoleculeGraph m)
          Creates a document for the specified molecule graph.
 
Method Summary
 void addCheckerMark(MDocument.CheckerMark mark)
          Adds a checker mark to the document.
 void addObject(MObject o)
          Adds an object to the document.
 DPoint3 calcCenter()
          Calculates the geometrical center.
 DPoint3 calcCenter(CTransform3D t)
          Calculates the geometrical center.
 void clear()
          Clears the document.
 void clearCheckerMarks()
          Clears the checker marks
 void clearSets()
          Clears the atomSets and the bondSets.
 java.lang.Object clone()
          Creates a clone.
 MDocument cloneDocument()
          Creates a clone.
 Molecule cloneMainMolecule()
          Creates a clone.
 MoleculeGraph cloneMainMoleculeGraph()
          Creates a clone.
 void cloneSets(MDocument doc)
          Clones the atom/bond sets from doc.
 boolean contains(MDocument doc)
          Tests whether the document contains all objects of another document.
 boolean contains(MObject o)
          Searches an object in the document.
 boolean containsOnlyOne(java.lang.Class cl)
          Tests whether the document contains only one object of the specified class.
 byte[] exportToBinFormat(java.lang.String fmt)
          Deprecated. As of release 5.7, replaced by MolExporter.exportToBinFormat(MDocument, String)
 java.lang.String exportToFormat(java.lang.String fmt)
          Deprecated. As of release 5.7, replaced by MolExporter.exportToFormat(MDocument, String)
 java.lang.Object exportToObject(java.lang.String fmt)
          Deprecated. As of release 5.7, replaced by MolExporter.exportToObject(MDocument, String)
 Molecule[] getAllMolecules()
          Gets an array containing all molecule objects.
 Molecule[] getAllNonEmptyMolecules()
          Gets an array containing all non-empty molecule objects.
 java.util.List<MObject> getAllObjects()
          Gets all objects stored in this document and from the chemical structure of the document.
 java.awt.Color getAtomSetColor(int seq)
          Gets an atom set color.
 int getAtomSetColorMode(int seq)
          Gets the atom set coloring mode.
 MFont getAtomSetFont(int seq)
          Gets an atom set font.
 int getAtomSetRGB(int seq)
          Gets an atom set color.
 int getAtomSetSize()
          Gets the size of the atom set.
 java.awt.Color 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 getBondSetSize()
          Gets the bond set size.
 double getBondSetThickness(int seq)
          Gets a bond set thickness.
 MDocument.CheckerMark[] getCheckerMarks()
          Returns the array of checker marks NOTE: checker marks will be reset on any molecule change
 MObject getConnectedObject(int i)
          Gets an object from the document or from the chemical structure of the document.
 int getConnectedObjectCount()
          Gets the number of objects in this document and in the chemical structure of this document.
 MObject getDraggedObject()
          Gets the dragged object
 long getEndPosition()
          Gets the end position of this document in the input file.
 int getExtraLabelSetColorMode(int seq)
          Gets the coloring mode of extra label set sequences.
 MFont getExtraLabelSetFont(int seq)
           
 long getExtraLabelSetRGBs(int seq)
           
 int getExtraLabelSetSize()
           
 MObject getFocus()
          Gets the focused object
 MPropertyContainer getGUIPropertyContainer()
           
 java.lang.String getInputFormat()
          Gets the input file format.
 MoleculeGraph getMainMoleculeGraph()
          Gets the main molecule graph.
 chemaxon.struc.graphics.MMoleculeMovie getMoleculeMovie()
          Gets the molecule movie.
 MProp getMProp()
          Gets the document as a property.
 MObject getObject(int i)
          Gets an object from the document.
 MObject getObjectContainingSelection()
          Gets the object that contains the selection.
 int getObjectCount()
          Gets the number of objects in this document.
 chemaxon.struc.PageSettings getPageSettings()
          Gets the page settings of multipage molecular document.
 Molecule getPrimaryMolecule()
          Gets the primary molecule object.
 Molecule[] getPrimaryMolecules()
          Gets an array containing the primary molecule objects.
 long getStartPosition()
          Gets the starting position of this document in the input file.
 void highlight(MObject o)
          Highlight an object.
 int indexOf(MObject o)
          Searches for an object in the document or in the chemical structure that belongs to the document.
 boolean isAtomSetColorModeSet()
          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 isExtraObject(MObject o)
          Decides whether a graphic object belongs to the main chemical structure of the document.
 boolean isHighlighted(MObject o)
          Is the specified object currently highlighted?
 boolean isSimpleMolecule()
          Tests whether the document is equivalent to a simple molecule.
 void moveMainMoleculeGraphToFront()
          Move the main molecule graph to the top of stack.
 void moveMoleculeMovieToFront()
          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 parseMRV(java.lang.String sval)
          Deprecated. As of release 5.7, replaced by MolImporter.parseMRV(String)
 MPropertyContainer properties()
          Gets the property container.
 void removeAtom(MolAtom a)
          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 removeObject(int i)
          Removes an object from the document.
 void removeObject(MObject o)
          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 setDraggedObject(MObject o)
          Sets the dragged object.
 void setEndPosition(long off)
          Sets the end position of this document in the input file.
 void setExtraLabelColorsForDocument(Molecule mol)
          Sets the coloring mode sets and colors of extra labels
 void setExtraLabelSetColorMode(int seq, int mode)
           
 void setExtraLabelSetRGBs(int seq, int rgb)
           
 void setExtraLabelSetRGBs(int seq, int rgb1, int rgb2)
           
 void setFocus(MObject o)
          Focus to the specified object.
 void setGUIPropertyContainer(MPropertyContainer gpc)
          Sets the property container storing MarvinPane settings
 void setGUIProperyContainer(MPropertyContainer gpc)
          Deprecated. in 5.2.2 typo error fixed.
 void setInputFormat(java.lang.String format)
          Sets the input file format.
 void setMainMoleculeGraph(MoleculeGraph m)
          Sets the main molecule graph.
 void setMoleculeMovie(chemaxon.struc.graphics.MMoleculeMovie mmm)
          Sets the molecule movie.
 void setObject(MObject o, int i)
          Sets an object
 void setObjectContainingSelection(MObject o)
          Sets the object that contains the selection.
 void setPageSettings(chemaxon.struc.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 simplifyMolecule()
          Simplifies the main molecule object if possible.
 java.lang.String toString()
          Overrides Object.toString() to ease debugging.
 void transform(CTransform3D t)
          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 unhighlight(MObject o)
          Unhighlights an object.
 void unhighlightAll()
          Unhighlights all objects.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SETCOLOR_DEFAULT

public static final int SETCOLOR_DEFAULT
Default set colors are used for coloring the atom/bond set.

Since:
Marvin 4.1, 05/31/2006
See Also:
getAtomSetColorMode(int), getBondSetColorMode(int), Constant Field Values

SETCOLOR_SPECIFIED

public static final int SETCOLOR_SPECIFIED
The user specified set colors are used for coloring the atom/bond set.

Since:
Marvin 4.1, 05/31/2006
See Also:
getAtomSetColorMode(int), getBondSetColorMode(int), Constant Field Values

SETCOLOR_COLORLESS

public static final int SETCOLOR_COLORLESS
The atom/bond set is colorless, normal (CPK, Monochrome etc.) colors are used.

Since:
Marvin 4.1, 05/31/2006
See Also:
getAtomSetColorMode(int), getBondSetColorMode(int), Constant Field Values

objects

protected transient java.util.ArrayList<MObject> objects

mainMChemicalStruct

protected transient MChemicalStruct mainMChemicalStruct

mainMMoleculeMovie

protected transient chemaxon.struc.graphics.MMoleculeMovie mainMMoleculeMovie

objectContainingSelection

protected transient MObject objectContainingSelection
Constructor Detail

MDocument

public MDocument(MoleculeGraph m)
Creates a document for the specified molecule graph.

Parameters:
m - the main molecule graph

MDocument

public MDocument(Molecule[] mols)
Creates a document for the specified molecule animation.

Parameters:
mols - the molecule animation
Since:
Marvin 4.0, 06/30/2005

MDocument

public MDocument(MDocument doc)
Copy constructor.

Parameters:
doc - the source

MDocument

protected MDocument(MDocument doc,
                    boolean cloneobjs)
Copy constructor.

Parameters:
doc - the source
cloneobjs - whether to clone objects
Since:
Marvin 3.5, 11/06/2004
Method Detail

cloneSets

public void cloneSets(MDocument doc)
Clones the atom/bond sets from doc.

Parameters:
doc - the document to clone from.

parseMRV

@Deprecated
public static MDocument parseMRV(java.lang.String sval)
                          throws MolFormatException
Deprecated. As of release 5.7, replaced by MolImporter.parseMRV(String)

Parses a document from a string in Marvin Document (MRV) format.

Parameters:
sval - the string
Throws:
MolFormatException
Since:
Marvin 4.1, 11/20/2005

cloneDocument

public MDocument cloneDocument()
Creates a clone.

Returns:
the clone
Since:
Marvin 3.5.1, 11/20/2004

cloneMainMolecule

public final Molecule cloneMainMolecule()
Creates a clone.

Returns:
the main molecule of the clone
Throws:
java.lang.ClassCastException - if the main molecule graph is not a Molecule instance
Since:
Marvin 3.5.1, 11/20/2004

cloneMainMoleculeGraph

public final MoleculeGraph cloneMainMoleculeGraph()
Creates a clone.

Returns:
the main molecule graph of the clone
Since:
Marvin 3.5.1, 11/20/2004

clone

public final java.lang.Object clone()
Creates a clone.

Overrides:
clone in class java.lang.Object
Returns:
the clone

removeAtomFromGraphs

public void removeAtomFromGraphs(MolAtom node)
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

public MObject getObjectContainingSelection()
Gets the object that contains the selection.

Returns:
the object or null

setObjectContainingSelection

public void setObjectContainingSelection(MObject o)
Sets the object that contains the selection. All other objects's contents are unselected.

Parameters:
o - the object or null

isHighlighted

public boolean isHighlighted(MObject o)
Is the specified object currently highlighted?

Returns:
true if it is highlighted, false otherwise

highlight

public void highlight(MObject o)
Highlight an object.

Parameters:
o - the object to highlight

unhighlight

public void unhighlight(MObject o)
Unhighlights an object.

Parameters:
o - the object to unhighlight

unhighlightAll

public void unhighlightAll()
Unhighlights all objects.


getDraggedObject

public MObject getDraggedObject()
Gets the dragged object

Returns:
the dragged object or null

setDraggedObject

public void setDraggedObject(MObject o)
Sets the dragged object.

Parameters:
o - the object

getFocus

public MObject getFocus()
Gets the focused object

Returns:
the focused object or null

setFocus

public void setFocus(MObject o)
Focus to the specified object.

Parameters:
o - the object

getMainMoleculeGraph

public MoleculeGraph getMainMoleculeGraph()
Gets the main molecule graph.

Returns:
the molecule graph

setMainMoleculeGraph

public void setMainMoleculeGraph(MoleculeGraph m)
Sets the main molecule graph.

Parameters:
m - the molecule graph

getMoleculeMovie

public chemaxon.struc.graphics.MMoleculeMovie getMoleculeMovie()
Gets the molecule movie.

Returns:
the molecule movie or null
Since:
Marvin 4.0, 06/30/2005

getPrimaryMolecule

public Molecule 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

public Molecule[] 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

public Molecule[] 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

public Molecule[] 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

public void setMoleculeMovie(chemaxon.struc.graphics.MMoleculeMovie mmm)
Sets the molecule movie.

Parameters:
mmm - the molecule movie
Since:
Marvin 4.0, 06/30/2005

indexOf

public int indexOf(MObject o)
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

public void moveObject(MObject o,
                       int i)
Move an object to another place in the stack.

Parameters:
o - the object
i - 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

public boolean contains(MObject o)
Searches an object in the document.

Parameters:
o - the object
Returns:
true if the document contains the object, false otherwise

contains

public boolean contains(MDocument doc)
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

public boolean containsOnlyOne(java.lang.Class cl)
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

public void addObject(MObject o)
Adds an object to the document.

Parameters:
o - the object

isExtraObject

public boolean isExtraObject(MObject o)
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

public void removeObject(MObject o)
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

public MObject getObject(int i)
Gets an object from the document.

Parameters:
i - the index of the object
Returns:
the object at the specified index.

getConnectedObject

public MObject getConnectedObject(int i)
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

public java.util.List<MObject> getAllObjects()
Gets all objects stored in this document and from the chemical structure of the document.

Returns:
the list of objects

setObject

public void setObject(MObject o,
                      int i)
Sets an object

Parameters:
o - the object
i - the index

removeAtom

public void removeAtom(MolAtom a)
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

public void removeAtom(MolAtom a,
                       int cleanupFlags)
Removes 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

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:

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:
Molecule.getSimplifiedMolecule()

transform

public void transform(CTransform3D t)
Transforms all object's coordinates.

Specified by:
transform in interface MTransformable
Parameters:
t - the transformation matrix

transform

public void transform(CTransform3D t,
                      int opts)
Transforms all object's coordinates.

Parameters:
t - the transformation matrix
opts - the transformation options
See Also:
MObject.transform(CTransform3D, int, CTransform3D)

transform

public void transform(CTransform3D t,
                      int opts,
                      CTransform3D trot)
Transforms 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:
MObject.transform(CTransform3D, int, CTransform3D)

calcCenter

public DPoint3 calcCenter()
Calculates the geometrical center.

Returns:
the center in `absolute' coordinates

calcCenter

public DPoint3 calcCenter(CTransform3D t)
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

public final java.lang.String 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

public void setInputFormat(java.lang.String format)
Sets the input file format.

Parameters:
format - the input format

exportToFormat

@Deprecated
public final java.lang.String exportToFormat(java.lang.String fmt)
                                      throws MolExportException
Deprecated. As of release 5.7, replaced by MolExporter.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 error
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of security reasons (firewall).
Since:
Marvin 4.0, 07/01/2005
See Also:
exportToBinFormat(java.lang.String), exportToObject(java.lang.String), Molecule.exportToFormat(java.lang.String)

exportToBinFormat

@Deprecated
public final byte[] exportToBinFormat(java.lang.String fmt)
                               throws MolExportException
Deprecated. As of release 5.7, replaced by MolExporter.exportToBinFormat(MDocument, String)

Creates a binary representation of the document. Works with all the text formats that are supported by the exportToFormat method, and also with the binary image formats (jpeg, msbmp, png, ppm). 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("ppm:w300,h300,#ffff00");
 byte[] d4 = doc.exportToBinFormat("png:w300,h300,b32,#00ffff00");
 byte[] d5 = 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.
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of security reasons (firewall).
Since:
Marvin 4.0, 07/01/2005
See Also:
exportToFormat(java.lang.String), exportToObject(java.lang.String), Molecule.exportToBinFormat(java.lang.String)

exportToObject

@Deprecated
public java.lang.Object exportToObject(java.lang.String fmt)
                                throws MolExportException
Deprecated. As of release 5.7, replaced by MolExporter.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("ppm:w300,h300,#ffff00");
 byte[] d4 = (byte[])doc.exportToObject("png:w300,h300,b32,#00ffff00");
 byte[] d5 = (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.
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of security reasons (firewall).
Since:
Marvin 4.0, 07/01/2005
See Also:
exportToFormat(java.lang.String), exportToBinFormat(java.lang.String), Molecule.exportToObject(java.lang.String)

getMProp

public MProp getMProp()
Gets the document as a property.

Since:
Marvin 4.1, 08/01/2006

properties

public MPropertyContainer properties()
Gets the property container.

Since:
Marvin 4.0, 06/18/2005

getAtomSetFont

public MFont getAtomSetFont(int seq)
Gets an atom set font.

Parameters:
seq - the atom set sequence number
Returns:
the font
Since:
Marvin 4.0.3, 06/10/2005

setAtomSetFont

public void setAtomSetFont(int seq,
                           MFont font)
Sets the font of an atom set.

Parameters:
seq - atom set sequence number (0, ..., MolAtom.SETSEQ_MAX)
font -
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:
SETCOLOR_DEFAULT, SETCOLOR_SPECIFIED, SETCOLOR_COLORLESS

setAtomSetColorMode

public 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:
SETCOLOR_DEFAULT, SETCOLOR_SPECIFIED, SETCOLOR_COLORLESS

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:
SETCOLOR_DEFAULT, SETCOLOR_SPECIFIED, SETCOLOR_COLORLESS

getExtraLabelSetFont

public MFont getExtraLabelSetFont(int seq)

setExtraLabelColorsForDocument

public void setExtraLabelColorsForDocument(Molecule mol)
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 to SETCOLOR_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

public java.awt.Color getAtomSetColor(int seq)
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)
thickness -
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:
SETCOLOR_DEFAULT, SETCOLOR_SPECIFIED, SETCOLOR_COLORLESS

setBondSetColorMode

public 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:
SETCOLOR_DEFAULT, SETCOLOR_SPECIFIED, SETCOLOR_COLORLESS

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 to SETCOLOR_SPECIFIED.

Parameters:
seq - bond set sequence number (1, ..., MolBond.SETSEQ_MAX)
rgb - the RGB values
Since:
Marvin 4.0, 03/02/2005

getBondSetColor

public java.awt.Color getBondSetColor(int seq)
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

public void addCheckerMark(MDocument.CheckerMark mark)
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:
addCheckerMark(CheckerMark)

getCheckerMarks

public MDocument.CheckerMark[] 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:
addCheckerMark(CheckerMark)

toString

public java.lang.String 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.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object
Since:
Marvin 4.1, 04/18/2006

getPageSettings

public chemaxon.struc.PageSettings getPageSettings()
Gets the page settings of multipage molecular document.

Returns:
the page settings
Since:
Marvin 4.1, 01/09/2006

setPageSettings

public void setPageSettings(chemaxon.struc.PageSettings pageSettings)
Sets the page settings of multipage molecular document.

Parameters:
pageSettings - the page settings
Since:
Marvin 4.1, 01/09/2006

setGUIPropertyContainer

public void setGUIPropertyContainer(MPropertyContainer gpc)
Sets the property container storing MarvinPane settings

Parameters:
gpc -
Since:
5.2.2 11/05/2009

setGUIProperyContainer

public void setGUIProperyContainer(MPropertyContainer gpc)
Deprecated. in 5.2.2 typo error fixed.

Sets the property container storing MarvinPane settings

Parameters:
gpc -
Since:
4.1 11/04/2006

getGUIPropertyContainer

public MPropertyContainer getGUIPropertyContainer()
Returns:
the property container storing GUI settings or null
Since:
4.1 11/04/2006