|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectchemaxon.struc.MDocument
Marvin document. Stores molecules and graphics objects.
| Nested Class Summary | |
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 |
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 should 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 |
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 |
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)
Creates a binary representation of the document. |
java.lang.String |
exportToFormat(java.lang.String fmt)
Creates a string representation of the document. |
java.lang.Object |
exportToObject(java.lang.String fmt)
Creates a String, byte[] array or Image representation of the molecule. |
Molecule[] |
getAllMolecules()
Gets an array containing all molecule objects. |
Molecule[] |
getAllNonEmptyMolecules()
Gets an array containing all non-empty molecule objects. |
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. |
MObject |
getDraggedObject()
Gets the dragged object |
long |
getEndPosition()
Gets the end position of this document in the input file. |
java.awt.Color |
getExtraLabelSetColor(int seq)
|
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. |
chemaxon.struc.MProp |
getMProp()
Gets the document as a property. |
MObject |
getObject(int i)
Gets an object |
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 an object in the document. |
boolean |
isEmpty()
Tests whether the document is empty. |
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)
Parses a document from a string in Marvin Document (MRV) format. |
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 |
removeNodeFromGraphs(CNode 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. |
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 |
setFocus(MObject o)
Focus to the specified object. |
void |
setGUIProperyContainer(MPropertyContainer gpc)
Sets the property container storing MarvinPane settings |
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. |
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 |
public static final int SETCOLOR_DEFAULT
getAtomSetColorMode(int),
getBondSetColorMode(int),
Constant Field Valuespublic static final int SETCOLOR_SPECIFIED
getAtomSetColorMode(int),
getBondSetColorMode(int),
Constant Field Valuespublic static final int SETCOLOR_COLORLESS
getAtomSetColorMode(int),
getBondSetColorMode(int),
Constant Field Valuesprotected transient java.util.ArrayList objects
protected transient MChemicalStruct mainMChemicalStruct
protected transient chemaxon.struc.graphics.MMoleculeMovie mainMMoleculeMovie
protected transient MObject objectContainingSelection
| Constructor Detail |
public MDocument(MoleculeGraph m)
m - the main molecule graphpublic MDocument(Molecule[] mols)
mols - the molecule animationpublic MDocument(MDocument doc)
doc - the source
protected MDocument(MDocument doc,
boolean cloneobjs)
doc - the sourcecloneobjs - whether to clone objects| Method Detail |
public void cloneSets(MDocument doc)
doc - the document to clone from.
public static MDocument parseMRV(java.lang.String sval)
throws chemaxon.formats.MolFormatException
sval - the string
chemaxon.formats.MolFormatExceptionpublic MDocument cloneDocument()
public final Molecule cloneMainMolecule()
java.lang.ClassCastException - if the main molecule graph is
not a Molecule instancepublic final MoleculeGraph cloneMainMoleculeGraph()
public final java.lang.Object clone()
public void removeNodeFromGraphs(CNode node)
node - the node to removepublic void selectAllObjects(boolean s)
public MObject getObjectContainingSelection()
public void setObjectContainingSelection(MObject o)
o - the object or nullpublic boolean isHighlighted(MObject o)
public void highlight(MObject o)
o - the object to highlightpublic void unhighlight(MObject o)
o - the object to unhighlightpublic void unhighlightAll()
public MObject getDraggedObject()
public void setDraggedObject(MObject o)
o - the objectpublic MObject getFocus()
public void setFocus(MObject o)
o - the objectpublic MoleculeGraph getMainMoleculeGraph()
public void setMainMoleculeGraph(MoleculeGraph m)
m - the molecule graphpublic chemaxon.struc.graphics.MMoleculeMovie getMoleculeMovie()
public Molecule getPrimaryMolecule()
public Molecule[] getPrimaryMolecules()
public Molecule[] getAllMolecules()
public Molecule[] getAllNonEmptyMolecules()
public void setMoleculeMovie(chemaxon.struc.graphics.MMoleculeMovie mmm)
mmm - the molecule moviepublic int indexOf(MObject o)
o - the object
public void moveObject(MObject o,
int i)
o - the objecti - the new positionpublic void moveMainMoleculeGraphToFront()
public void moveMoleculeMovieToFront()
public boolean contains(MObject o)
o - the object
public boolean contains(MDocument doc)
doc - the other document
public boolean containsOnlyOne(java.lang.Class cl)
cl - MObject.class or a derived class
public void addObject(MObject o)
o - the objectpublic void removeObject(MObject o)
o - the objectpublic void removeObject(int i)
i - the object indexpublic int getObjectCount()
public MObject getObject(int i)
i - the line number
public void setObject(MObject o,
int i)
o - the objecti - the indexpublic void removeAtom(MolAtom a)
a - the atom to remove
public void removeAtom(MolAtom a,
int cleanupFlags)
a - the atom to removecleanupFlags - cleanup optionspublic void clear()
public void clearSets()
public boolean isEmpty()
public boolean isSimpleMolecule()
public void transform(CTransform3D t)
transform in interface MTransformablet - the transformation matrix
public void transform(CTransform3D t,
int opts)
t - the transformation matrixopts - the transformation optionsMObject.transform(CTransform3D, int, CTransform3D)
public void transform(CTransform3D t,
int opts,
CTransform3D trot)
t - the transformation matrixopts - the transformation optionstrot - the viewing transformationMObject.transform(CTransform3D, int, CTransform3D)public DPoint3 calcCenter()
public DPoint3 calcCenter(CTransform3D t)
t - the viewing transformation or null
public long getStartPosition()
public void setStartPosition(long off)
off - the starting positionpublic long getEndPosition()
public void setEndPosition(long off)
off - the end positionpublic final java.lang.String getInputFormat()
public void setInputFormat(java.lang.String format)
format - the input format
public final java.lang.String exportToFormat(java.lang.String fmt)
throws MolExportException
s1 = doc.exportToFormat("mol");
s2 = doc.exportToFormat("smiles:a-H"); // aromatize and remove Hydrogens
fmt - the format descriptor string
MolExportException - Export error
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of
security reasons (firewall).exportToBinFormat(java.lang.String),
exportToObject(java.lang.String),
Molecule.exportToFormat(java.lang.String)
public final byte[] exportToBinFormat(java.lang.String fmt)
throws MolExportException
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");
fmt - the format descriptor string
MolExportException - Export error.
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of
security reasons (firewall).exportToFormat(java.lang.String),
exportToObject(java.lang.String),
Molecule.exportToBinFormat(java.lang.String)
public java.lang.Object exportToObject(java.lang.String fmt)
throws MolExportException
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");
fmt - the format descriptor string
MolExportException - Export error.
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of
security reasons (firewall).exportToFormat(java.lang.String),
exportToBinFormat(java.lang.String),
Molecule.exportToObject(java.lang.String)public chemaxon.struc.MProp getMProp()
public MPropertyContainer properties()
public MFont getAtomSetFont(int seq)
seq - the atom set sequence number
public void setAtomSetFont(int seq,
MFont font)
seq - atom set sequence number
(0, ..., MolAtom.SETSEQ_MAX)font - public int getAtomSetColorMode(int seq)
seq - the atom set sequence number
SETCOLOR_DEFAULT,
SETCOLOR_SPECIFIED,
SETCOLOR_COLORLESS
public void setAtomSetColorMode(int seq,
int m)
seq - the atom set sequence numberm - the modeSETCOLOR_DEFAULT,
SETCOLOR_SPECIFIED,
SETCOLOR_COLORLESS
public void setExtraLabelSetColorMode(int seq,
int mode)
public int getAtomSetSize()
public int getExtraLabelSetSize()
public int getAtomSetRGB(int seq)
seq - the atom set sequence number
public long getExtraLabelSetRGBs(int seq)
public int getExtraLabelSetColorMode(int seq)
seq - the atom sequence number
SETCOLOR_DEFAULT,
SETCOLOR_SPECIFIED,
SETCOLOR_COLORLESSpublic MFont getExtraLabelSetFont(int seq)
public void setExtraLabelColorsForDocument(Molecule mol)
mol - the graph union in the document
public void setAtomSetRGB(int seq,
int rgb)
SETCOLOR_SPECIFIED.
seq - atom set sequence number
(0, ..., MolAtom.SETSEQ_MAX)rgb - the RGB values
public void setExtraLabelSetRGBs(int seq,
int rgb)
public java.awt.Color getAtomSetColor(int seq)
seq - the atom set sequence number
null if unset or default bond coloring is usedpublic java.awt.Color getExtraLabelSetColor(int seq)
public int getBondSetSize()
public double getBondSetThickness(int seq)
seq - the atom set sequence number
public void setBondSetThickness(int seq,
double thickness)
seq - bond set sequence number
(0, ..., MolAtom.SETSEQ_MAX)thickness - public int getBondSetColorMode(int seq)
seq - the bond set sequence number
SETCOLOR_DEFAULT,
SETCOLOR_SPECIFIED,
SETCOLOR_COLORLESS
public void setBondSetColorMode(int seq,
int m)
seq - the bond set sequence numberm - the modeSETCOLOR_DEFAULT,
SETCOLOR_SPECIFIED,
SETCOLOR_COLORLESSpublic int getBondSetRGB(int seq)
seq - the bond set sequence number
public void setBondSetRGB(int seq,
int rgb)
SETCOLOR_SPECIFIED.
seq - bond set sequence number
(1, ..., MolBond.SETSEQ_MAX)rgb - the RGB valuespublic java.awt.Color getBondSetColor(int seq)
seq - the bond set sequence number
null if unset or default bond coloring is usedpublic java.lang.String toString()
@', 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.
public chemaxon.struc.PageSettings getPageSettings()
public void setPageSettings(chemaxon.struc.PageSettings pageSettings)
pageSettings - the page settingspublic void setGUIProperyContainer(MPropertyContainer gpc)
gpc - public MPropertyContainer getGUIPropertyContainer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||