|
||||||||
| 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
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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 |
destroy()
Disposes all the frames and removes references to the sketcher. |
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. |
java.lang.String |
getAppletInfo()
Returns a string containing the version and the author. |
java.lang.String |
getAtomAlias(int i)
Gets atom alias. |
int |
getAtomCount()
Returns the number of atoms. |
java.lang.String |
getAtomExtraLabel(int i)
Gets extra atom label. |
boolean |
getAutoScale()
Returns the autoscale property. |
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. |
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. |
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. |
void |
init()
Initializes the applet. |
boolean |
isAtomSelected(int i)
Returns true if atom is selected. |
boolean |
isChemicalTermsExpressionSyntaxError()
Returns true, if the last Chemical Terms expression evaluated by the
JMSketchIface.evaluateChemicalTerms(String) method is a syntactically not correct expression. |
boolean |
isEmpty()
Returns true sketcher canvas is empty. |
void |
mouseClicked(java.awt.event.MouseEvent ev)
Does nothing. |
void |
mouseEntered(java.awt.event.MouseEvent ev)
Does nothing. |
void |
mouseExited(java.awt.event.MouseEvent ev)
Does nothing. |
void |
mousePressed(java.awt.event.MouseEvent ev)
Does nothing. |
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 |
propertyChange(java.beans.PropertyChangeEvent ev)
Invoke propertyChange(prop) JavaScript method on applet's page. |
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 |
setAtomAlias(int i,
java.lang.String alias)
Sets atom alias. |
void |
setAtomExtraLabel(int i,
java.lang.String label)
Sets extra atom label. |
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 |
setParentApplet(javax.swing.JApplet parent)
|
void |
setPiece(java.lang.String s)
Sets the current piece. |
void |
setScale(double m)
Sets the magnification. |
void |
start()
Starts the applet. |
void |
stop()
Hide the frames when stopped. |
void |
undo()
Invokes the Undo command. |
| Methods inherited from class javax.swing.JApplet |
|---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.applet.Applet |
|---|
getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, 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, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, 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 |
| Constructor Detail |
|---|
public JMSketch()
| Method Detail |
|---|
public void init()
init in class java.applet.Appletpublic void start()
start in class java.applet.Appletpublic void propertyChange(java.beans.PropertyChangeEvent ev)
propertyChange in interface java.beans.PropertyChangeListenerpublic void stop()
stop in class java.applet.Appletpublic void destroy()
destroy in class java.applet.Appletpublic java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic boolean isEmpty()
true sketcher canvas is empty.
isEmpty in interface 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 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 JMSketchIfacefmt - the format descriptor string
public java.lang.String getMolProperty(java.lang.String key)
getMolProperty in interface JMSketchIfacekey - the property key
public void setMolProperty(java.lang.String key,
java.lang.String value)
setMolProperty in interface JMSketchIfacekey - the property namevalue - the value or nullpublic int getMolPropertyCount()
getMolPropertyCount in interface JMSketchIfacepublic java.lang.String getMolPropertyKey(int i)
getMolPropertyKey in interface JMSketchIfacei - the property key index
public int getAtomCount()
getAtomCount in interface JMSketchIfacepublic boolean isAtomSelected(int i)
true if atom is selected.
Should be called after the molecule has been loaded.
isAtomSelected in interface JMSketchIfacei - the atom index
true if atom is selectedpublic void selectAllAtoms(boolean v)
selectAllAtoms in interface JMSketchIfacev - select (true) or unselect (false)
public void selectAtom(int atom,
boolean v)
selectAtom in interface JMSketchIfaceatom - atom indexv - select (true) or unselect (false)
public void setAtomAlias(int i,
java.lang.String alias)
setAtomAlias in interface JMSketchIfacei - the atom indexalias - the aliaspublic java.lang.String getAtomAlias(int i)
getAtomAlias in interface JMSketchIfacei - the atom index
public void setAtomExtraLabel(int i,
java.lang.String label)
setAtomExtraLabel in interface JMSketchIfacei - the atom indexlabel - the extra atom labelpublic java.lang.String getAtomExtraLabel(int i)
getAtomExtraLabel in interface JMSketchIfacei - the atom index
public double getMolMass()
getMolMass in interface JMSketchIfacepublic double getMolExactMass()
getMolExactMass in interface JMSketchIfacepublic java.lang.String getMolFormula()
getMolFormula in interface 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 JMSketchIfaceexpression - the Chemical Terms expression
public boolean isChemicalTermsExpressionSyntaxError()
true, if the last Chemical Terms expression evaluated by the
JMSketchIface.evaluateChemicalTerms(String) method is a syntactically not correct expression.
Should be called after JMSketchIface.evaluateChemicalTerms(String).
isChemicalTermsExpressionSyntaxError in interface JMSketchIfacetrue, if the last evaluated Chemical Terms expression is syntactically not correctpublic void setMol(java.lang.String s)
setMol in interface JMSketchIfaces - molfile contents, URL or (Unix) filename
public void setMol(java.lang.String s,
java.lang.String opts)
setMol in interface JMSketchIfaces - molfile contents, URL or (Unix) filenameopts - options or nullpublic java.lang.String getPiece(java.lang.String fmt)
getPiece in interface JMSketchIfacefmt - the format
JMSketchIface.getMol(java.lang.String)public void setPiece(java.lang.String s)
setPiece in interface JMSketchIfaces - string containing the molecule in a molecule file format
public void postImage(java.lang.String fmt,
java.lang.String where)
postImage in interface JMSketchIfacefmt - image file format: "jpeg", "png" or "ppm"public void undo()
undo in interface JMSketchIfacepublic void redo()
redo in interface JMSketchIfacepublic java.lang.String getImageShowURL()
getImageShowURL in interface JMSketchIfacepublic void setAutoScale(boolean as)
setAutoScale in interface JMSketchIfaceas - true to switch on, false to switch off autoscalepublic boolean getAutoScale()
getAutoScale in interface JMSketchIfacepublic double getScale()
getScale in interface JMSketchIfacepublic void setScale(double m)
setScale in interface JMSketchIfacem - the scaling factorpublic boolean hasValenceError()
hasValenceError in interface JMSketchIfacetrue if there is an atom with valence error,
false if there is no valence errorpublic void mouseEntered(java.awt.event.MouseEvent ev)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent ev)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent ev)
mouseClicked in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent ev)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent ev)
mouseReleased in interface java.awt.event.MouseListenerev - the event objectpublic void setParentApplet(javax.swing.JApplet parent)
setParentApplet in interface MAppletIface
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||