|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
chemaxon.marvin.applet.AbstractMarvinApplet
chemaxon.marvin.applet.JMSketch
public class JMSketch
Swing version of the MarvinSketch Applet.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JApplet |
|---|
javax.swing.JApplet.AccessibleJApplet |
| Nested classes/interfaces inherited from class java.applet.Applet |
|---|
java.applet.Applet.AccessibleApplet |
| Nested classes/interfaces inherited from class java.awt.Panel |
|---|
java.awt.Panel.AccessibleAWTPanel |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class chemaxon.marvin.applet.AbstractMarvinApplet |
|---|
debug, panel |
| Fields inherited from class javax.swing.JApplet |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JMSketch()
|
|
| Method Summary | |
|---|---|
void |
clean2D()
Invokes the Clean2D command. |
void |
clean3D()
Invokes the Clean3D command. |
protected void |
createGUI()
|
java.lang.String |
evaluateChemicalTerms(java.lang.String expression)
Evaluates a Chemical Terms expression on the molecule in MarvinSketch, and returns the result in string format. |
protected java.lang.String |
evaluateChemicalTerms0(java.lang.String expression,
chemaxon.struc.Molecule mol)
|
java.lang.String |
getAtomAlias(int i)
Gets atom alias. |
int |
getAtomCharge(int atomNum)
Gets the charge of the specified atom, from the molecule currently used. |
int |
getAtomCount()
Returns the number of atoms. |
java.lang.String |
getAtomExtraLabel(int i)
Gets extra atom label. |
int |
getAtomRadicalState(int atomNum)
Gets the radical state of the specified atom, from the molecule currently used. |
java.lang.String |
getAtomSymbol(int atomNum)
Gets the atom symbol of the specified atom, from the molecule currently used. |
int |
getAtomValenceProperty(int atomNum)
Gets the valence property of the specified atom, from the molecule currently used. |
boolean |
getAutoScale()
Returns the autoscale property. |
protected chemaxon.struc.MDocument |
getDocInPanel()
|
java.lang.String |
getImageShowURL()
Gets the show image URL. |
java.lang.String |
getMol(java.lang.String fmt)
Gets the molecule in a text format. |
double |
getMolExactMass()
Gets the exact molecule weight. |
java.lang.String |
getMolFormula()
Gets the molecule formula. |
protected chemaxon.struc.Molecule |
getMolInPanel()
|
double |
getMolMass()
Gets the molecule weight. |
java.lang.String |
getMolProperty(java.lang.String key)
Gets an RDfile/SDfile property. |
int |
getMolPropertyCount()
Gets the number of RDfile/SDfile properties. |
java.lang.String |
getMolPropertyKey(int i)
Gets an RDfile/SDfile property key. |
protected chemaxon.marvin.sketch.swing.SketchPanel |
getPanel()
|
java.lang.String |
getPiece(java.lang.String fmt)
Gets the current molecule piece in the specified format. |
double |
getScale()
Gets the magnification. |
java.lang.String |
getSelectedMol(java.lang.String fmt)
Gets the selected molecule part in a text format. |
boolean |
hasValenceError()
Determines if this molecule has a valence error on any of its atoms. |
boolean |
isAtomSelected(int i)
Returns true if atom is selected. |
boolean |
isEmpty()
Returns true sketcher canvas is empty. |
void |
mouseReleased(java.awt.event.MouseEvent ev)
Handles the viewer button press events. |
void |
postImage(java.lang.String fmt,
java.lang.String where)
Posts image to CGI script. |
void |
redo()
Invokes the Redo command. |
void |
selectAllAtoms(boolean v)
Select or unselect all atoms in the specified molecule. |
void |
selectAtom(int atom,
boolean v)
Select or unselect an atom in the specified molecule. |
void |
setAbsoluteStereoFlag(boolean stereoFlag)
|
void |
setAbsoluteStereoFlag0(java.lang.Boolean stereoFlag)
|
void |
setAtomAlias(int i,
java.lang.String alias)
Sets atom alias. |
void |
setAtomCharge(int atomNum,
int chg)
Sets the charge of the specified atom, from the molecule currently used. |
void |
setAtomExtraLabel(int i,
java.lang.String label)
Sets extra atom label. |
void |
setAtomRadicalState(int atomNum,
int radState)
Sets the radical state of the specified atom, from the molecule currently used. |
void |
setAtomValenceProperty(int atomNum,
int value)
Sets the valence property of the specified atom, from the molecule currently used. |
void |
setAutoScale(boolean as)
Sets the autoscale property. |
void |
setMol(java.lang.String s)
Starts loading a molecule into the sketcher in a separate thread. |
void |
setMol(java.lang.String s,
java.lang.String opts)
Starts loading a molecule into the sketcher in a separate thread. |
void |
setMolProperty(java.lang.String key,
java.lang.String value)
Sets an RDfile/SDfile property. |
void |
setPiece(java.lang.String s)
Sets the current piece. |
void |
setScale(double m)
Sets the magnification. |
void |
start()
Starts the applet. |
void |
undo()
Invokes the Undo command. |
| Methods inherited from class chemaxon.marvin.applet.AbstractMarvinApplet |
|---|
destroy, enqueueForPrivilegedProcessing, getAppletInBrowser, getAppletInfo, getCodeBase, getParameter, init, isChemicalTermsExpressionSyntaxError, mouseClicked, mouseEntered, mouseExited, mousePressed, propertyChange, setPanel, setParentApplet, stop, validateMoleculeStr, validateMoleculeStr |
| Methods inherited from class javax.swing.JApplet |
|---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
| Methods inherited from class java.applet.Applet |
|---|
getAppletContext, getAudioClip, getAudioClip, getDocumentBase, getImage, getImage, getLocale, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface chemaxon.marvin.applet.JMSketchIface |
|---|
mouseClicked, mouseEntered, mouseExited, mousePressed |
| Methods inherited from interface chemaxon.marvin.applet.MAppletIface |
|---|
isChemicalTermsExpressionSyntaxError, setParentApplet, validateMoleculeStr, validateMoleculeStr |
| Constructor Detail |
|---|
public JMSketch()
| Method Detail |
|---|
protected void createGUI()
createGUI in class AbstractMarvinAppletpublic void start()
AbstractMarvinApplet
start in class AbstractMarvinAppletprotected chemaxon.marvin.sketch.swing.SketchPanel getPanel()
getPanel in class AbstractMarvinAppletprotected chemaxon.struc.Molecule getMolInPanel()
protected chemaxon.struc.MDocument getDocInPanel()
public boolean isEmpty()
true sketcher canvas is empty.
isEmpty in interface chemaxon.marvin.applet.JMSketchIfacetrue if sketcher canvas is emptypublic java.lang.String getSelectedMol(java.lang.String fmt)
s1 = msketch.getSelectedMol("mol");
s2 = msketch.getSelectedMol("smiles:a-H"); // aromatize and remove Hydrogens
getSelectedMol in interface chemaxon.marvin.applet.JMSketchIfacefmt - the format descriptor string
public java.lang.String getMol(java.lang.String fmt)
s1 = msketch.getMol("mol");
s2 = msketch.getMol("smiles:a-H"); // aromatize and remove Hydrogens
getMol in interface chemaxon.marvin.applet.JMSketchIfacefmt - the format descriptor string
public java.lang.String getMolProperty(java.lang.String key)
getMolProperty in interface chemaxon.marvin.applet.JMSketchIfacekey - the property key
public void setMolProperty(java.lang.String key,
java.lang.String value)
setMolProperty in interface chemaxon.marvin.applet.JMSketchIfacekey - the property namevalue - the value or nullpublic int getMolPropertyCount()
getMolPropertyCount in interface chemaxon.marvin.applet.JMSketchIfacepublic java.lang.String getMolPropertyKey(int i)
getMolPropertyKey in interface chemaxon.marvin.applet.JMSketchIfacei - the property key index
public int getAtomCount()
getAtomCount in interface chemaxon.marvin.applet.JMSketchIfacepublic boolean isAtomSelected(int i)
true if atom is selected.
Should be called after the molecule has been loaded.
isAtomSelected in interface chemaxon.marvin.applet.JMSketchIfacei - the atom index
true if atom is selectedpublic void selectAllAtoms(boolean v)
selectAllAtoms in interface chemaxon.marvin.applet.JMSketchIfacev - select (true) or unselect (false)
public void selectAtom(int atom,
boolean v)
selectAtom in interface chemaxon.marvin.applet.JMSketchIfaceatom - atom indexv - select (true) or unselect (false)
public void setAtomAlias(int i,
java.lang.String alias)
setAtomAlias in interface chemaxon.marvin.applet.JMSketchIfacei - the atom indexalias - the aliaspublic java.lang.String getAtomAlias(int i)
getAtomAlias in interface chemaxon.marvin.applet.JMSketchIfacei - the atom index
public void setAtomExtraLabel(int i,
java.lang.String label)
setAtomExtraLabel in interface chemaxon.marvin.applet.JMSketchIfacei - the atom indexlabel - the extra atom labelpublic java.lang.String getAtomExtraLabel(int i)
getAtomExtraLabel in interface chemaxon.marvin.applet.JMSketchIfacei - the atom index
public double getMolMass()
getMolMass in interface chemaxon.marvin.applet.JMSketchIfacepublic double getMolExactMass()
getMolExactMass in interface chemaxon.marvin.applet.JMSketchIfacepublic java.lang.String getMolFormula()
getMolFormula in interface chemaxon.marvin.applet.JMSketchIfacepublic java.lang.String evaluateChemicalTerms(java.lang.String expression)
s1 = MSketch.evaluateChemicalTerms("atomCount()");
s2 = MSketch.evaluateChemicalTerms("logP() <= 5");
See the
Chemical Terms Language Reference and the
Chemical Terms Reference Tables for more.
evaluateChemicalTerms in interface chemaxon.marvin.applet.JMSketchIfaceexpression - the Chemical Terms expression
protected java.lang.String evaluateChemicalTerms0(java.lang.String expression,
chemaxon.struc.Molecule mol)
evaluateChemicalTerms0 in class AbstractMarvinAppletpublic void setMol(java.lang.String s)
setMol in interface chemaxon.marvin.applet.JMSketchIfaces - molfile contents, URL or (Unix) filename
public void setMol(java.lang.String s,
java.lang.String opts)
setMol in interface chemaxon.marvin.applet.JMSketchIfaces - molfile contents, URL or (Unix) filenameopts - options or nullpublic java.lang.String getPiece(java.lang.String fmt)
getPiece in interface chemaxon.marvin.applet.JMSketchIfacefmt - the format
JMSketchIface.getMol(java.lang.String)public void setPiece(java.lang.String s)
setPiece in interface chemaxon.marvin.applet.JMSketchIfaces - string containing the molecule in a molecule file format
public void postImage(java.lang.String fmt,
java.lang.String where)
postImage in interface chemaxon.marvin.applet.JMSketchIfacefmt - image file format: "jpeg", "png" or "ppm"public void undo()
undo in interface chemaxon.marvin.applet.JMSketchIfacepublic void redo()
redo in interface chemaxon.marvin.applet.JMSketchIfacepublic void clean2D()
clean2D in interface chemaxon.marvin.applet.JMSketchIfacepublic void clean3D()
clean3D in interface chemaxon.marvin.applet.JMSketchIfacepublic java.lang.String getImageShowURL()
getImageShowURL in interface chemaxon.marvin.applet.JMSketchIfacepublic void setAutoScale(boolean as)
setAutoScale in interface chemaxon.marvin.applet.JMSketchIfaceas - true to switch on, false to switch off autoscalepublic boolean getAutoScale()
getAutoScale in interface chemaxon.marvin.applet.JMSketchIfacepublic double getScale()
getScale in interface chemaxon.marvin.applet.JMSketchIfacepublic void setScale(double m)
setScale in interface chemaxon.marvin.applet.JMSketchIfacem - the scaling factorpublic boolean hasValenceError()
hasValenceError in interface chemaxon.marvin.applet.JMSketchIfacetrue if there is an atom with valence error,
false if there is no valence errorpublic void mouseReleased(java.awt.event.MouseEvent ev)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class AbstractMarvinAppletev - the event objectpublic java.lang.String getAtomSymbol(int atomNum)
getAtomSymbol in interface chemaxon.marvin.applet.JMSketchIfaceatomNum - the specified atom's number in the molecule
public int getAtomValenceProperty(int atomNum)
getAtomValenceProperty in interface chemaxon.marvin.applet.JMSketchIfaceatomNum - the specified atom's number in the molecule
public void setAtomValenceProperty(int atomNum,
int value)
setAtomValenceProperty in interface chemaxon.marvin.applet.JMSketchIfaceatomNum - the specified atom's number in the moleculevalue - valence property valuepublic int getAtomCharge(int atomNum)
getAtomCharge in interface chemaxon.marvin.applet.JMSketchIfaceatomNum - the specified atom's number in the molecule
public void setAtomCharge(int atomNum,
int chg)
setAtomCharge in interface chemaxon.marvin.applet.JMSketchIfaceatomNum - the specified atom's number in the moleculechg - the chargepublic int getAtomRadicalState(int atomNum)
getAtomRadicalState in interface chemaxon.marvin.applet.JMSketchIfaceatomNum - the specified atom's number in the molecule
public void setAtomRadicalState(int atomNum,
int radState)
setAtomRadicalState in interface chemaxon.marvin.applet.JMSketchIfaceatomNum - the specified atom's number in the moleculeradState - radical statepublic void setAbsoluteStereoFlag(boolean stereoFlag)
setAbsoluteStereoFlag in interface chemaxon.marvin.applet.JMSketchIfacepublic void setAbsoluteStereoFlag0(java.lang.Boolean stereoFlag)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||