|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Panel java.applet.Applet javax.swing.JApplet JMView
public class JMView
Swing version of the MarvinView 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 | |
---|---|
JMView()
|
Method Summary | |
---|---|
void |
addMol(java.lang.String s)
Starts loading molecules in a separate thread. |
void |
addMol(java.lang.String s,
java.lang.String opts)
Starts loading molecules in a separate thread. |
void |
animate(java.lang.String arg)
Starts or stops animation. |
void |
destroy()
Dispose all the frames. |
java.lang.String |
evaluateChemicalTerms(java.lang.String expression,
int n)
Evaluates a Chemical Terms expression on the molecule in given cell, and returns the result in string format. |
void |
focusGained(java.awt.event.FocusEvent e)
|
void |
focusLost(java.awt.event.FocusEvent e)
|
java.lang.String |
getAppletInfo()
Returns a string containing the version and the author. |
java.lang.String |
getAtomAlias(int n,
int i)
Gets atom alias. |
int |
getAtomCount(int i)
Gets the number of atoms in the specified molecule cell. |
java.lang.String |
getAtomExtraLabel(int n,
int i)
Gets extra atom label. |
double |
getBestTabScale()
Gets the smallest best scale value in the molecule table. |
double |
getBestTabScale(int i)
Gets the best scale value for a molecule cell. |
boolean |
getC(int i)
Gets the state of a checkbox. |
int |
getCellCount()
Gets the number of cells in the table. |
java.lang.String |
getL(int i)
Gets a label. |
java.lang.String |
getM(int n,
java.lang.String fmt)
Gets the nth molecule in a text format. |
double |
getMolExactMass(int n)
Gets the exact molecule weight. |
java.lang.String |
getMolFormula(int n)
Gets the molecule formula. |
double |
getMolMass(int n)
Gets the molecule weight. |
java.lang.String |
getMProperty(int n,
java.lang.String key)
Gets an RDfile/SDfile property. |
int |
getMPropertyCount(int n)
Gets the number of RDfile/SDfile properties. |
java.lang.String |
getMPropertyKey(int n,
int i)
Gets an RDfile/SDfile property key. |
int |
getSelectedIndex()
Gets the index of the molecule that is selected by the user. |
java.lang.String |
getT(int i)
Gets the value of a text field. |
double |
getTabScale(int i)
Gets the magnification for a molecule cell. |
boolean |
hasValenceError(int i)
Determines if the molecule in the specified cell has a valence error on any of its atoms. |
void |
init()
Initializes the applet. |
boolean |
isAtomSetVisible(int id)
Is the specified atom set visible? |
boolean |
isChemicalTermsExpressionSyntaxError()
Returns true , if the last Chemical Terms expression evaluated by the
JMViewIface.evaluateChemicalTerms(String, int) method is a syntactically not correct expression. |
boolean |
isEmpty(int n)
Returns true if molecule cell is empty. |
boolean |
isSelected(int i,
int atom)
Is the specified atom selected? |
boolean |
isSetVisible(int id)
Deprecated. as of Marvin 3.3, replaced by isAtomSetVisible |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
propertyChange(java.beans.PropertyChangeEvent ev)
Invoke propertyChange(prop) JavaScript method on applet's page. |
boolean |
selectAllAtoms(int i,
boolean v)
Select or unselect all atoms in the specified molecule. |
boolean |
selectAtom(int i,
int atom,
boolean v)
Select or unselect an atom in the specified molecule. |
void |
setActionB(int i,
java.lang.String s)
Sets the action string (URL or JavaScript expression) of a button. |
void |
setActionC(int i,
boolean c,
java.lang.String s)
Sets one of the two action strings (JavaScript expressions) of a checkbox. |
void |
setAtomAlias(int n,
int i,
java.lang.String alias)
Sets atom alias. |
void |
setAtomExtraLabel(int n,
int i,
java.lang.String label)
Sets extra atom label. |
void |
setAtomSetColor(int i,
int rgb)
Sets the color of an atom set. |
boolean |
setAtomSetSeq(int i,
int atom,
int id)
Sets the set sequence number of the atom. |
void |
setAtomSetVisible(int id,
boolean v)
Set the visibility of the specified atom set. |
void |
setBondSetColor(int i,
int rgb)
Sets the color of a bond set. |
boolean |
setBondSetSeq(int i,
int j1,
int j2,
int id)
Sets the set sequence number of a bond. |
boolean |
setBondSetSeqAll(int i,
int id)
Sets the set sequence number for each bond. |
void |
setC(int i,
boolean s)
Sets the state of a checkbox. |
void |
setL(int i,
java.lang.String s)
Sets a label. |
void |
setM(int n,
java.lang.String s)
Starts loading a molecule into the nth cell in a separate thread. |
void |
setM(int n,
java.lang.String s,
java.lang.String opts)
Starts loading a molecule into the nth cell in a separate thread. |
void |
setMol(java.lang.String s)
Starts loading molecules in a separate thread. |
void |
setMol(java.lang.String s,
java.lang.String opts)
Starts loading molecules in a separate thread. |
void |
setMProperty(int n,
java.lang.String key,
java.lang.String value)
Sets an RDfile/SDfile property. |
void |
setParentApplet(javax.swing.JApplet parent)
|
void |
setSelectedIndex(int i)
Selects a molecule. |
void |
setSetColor(int i,
int rgb)
Deprecated. as of Marvin 3.3, replaced by setAtomSetColor |
boolean |
setSetSeq(int i,
int atom,
int id)
Deprecated. as of Marvin 3.3, replaced by setAtomSetSeq |
void |
setSetVisible(int id,
boolean v)
Deprecated. as of Marvin 3.3, replaced by setAtomSetVisible |
void |
setT(int i,
java.lang.String s)
Gets the value of a text field. |
void |
start()
Starts the applet. |
void |
stop()
Stops the applet. |
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 JMView()
Method Detail |
---|
public void init()
init
in class java.applet.Applet
public void propertyChange(java.beans.PropertyChangeEvent ev)
propertyChange
in interface java.beans.PropertyChangeListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void start()
start
in class java.applet.Applet
public void stop()
stop
in class java.applet.Applet
public void destroy()
destroy
in class java.applet.Applet
public java.lang.String getAppletInfo()
getAppletInfo
in class java.applet.Applet
public void animate(java.lang.String arg)
MView.animate("all"); // starts animating all molecules MView.animate("off"); // stops animating all molecules MView.animate("3"); // starts animation in cell 3 MView.animate("0,1,2"); // starts animation in cells 0, 1 and 2 MView.animate("-1,-2,-3"); // stops animation in cells 0, 1 and 2
animate
in interface JMViewIface
arg
- "off", "all" or a
comma separated list of integerspublic boolean isEmpty(int n)
true
if molecule cell is empty.
isEmpty
in interface JMViewIface
n
- molecule cell number
true
if molecule cell is emptypublic java.lang.String getM(int n, java.lang.String fmt)
s1 = mview.getM(0, "mol"); s2 = mview.getM(0, "smiles:a-H"); // aromatize and remove Hydrogens
getM
in interface JMViewIface
n
- molecule cell numberfmt
- the format descriptor string
public java.lang.String getMProperty(int n, java.lang.String key)
getMProperty
in interface JMViewIface
n
- molecule cell numberkey
- the property key
public void setMProperty(int n, java.lang.String key, java.lang.String value)
setMProperty
in interface JMViewIface
n
- molecule cell numberkey
- the property namevalue
- the value or nullpublic int getMPropertyCount(int n)
getMPropertyCount
in interface JMViewIface
n
- molecule cell number
public java.lang.String getMPropertyKey(int n, int i)
getMPropertyKey
in interface JMViewIface
n
- molecule cell numberi
- the property key index
public void setAtomAlias(int n, int i, java.lang.String alias)
setAtomAlias
in interface JMViewIface
n
- molecule cell numberi
- the atom indexalias
- the aliaspublic java.lang.String getAtomAlias(int n, int i)
getAtomAlias
in interface JMViewIface
n
- molecule cell numberi
- the atom index
public void setAtomExtraLabel(int n, int i, java.lang.String label)
setAtomExtraLabel
in interface JMViewIface
n
- molecule cell numberi
- the atom indexlabel
- the extra atom labelpublic java.lang.String getAtomExtraLabel(int n, int i)
getAtomExtraLabel
in interface JMViewIface
n
- molecule cell numberi
- the atom index
public double getMolMass(int n)
getMolMass
in interface JMViewIface
n
- molecule cell number
public double getMolExactMass(int n)
getMolExactMass
in interface JMViewIface
n
- molecule cell number
public java.lang.String getMolFormula(int n)
getMolFormula
in interface JMViewIface
n
- molecule cell number
public java.lang.String evaluateChemicalTerms(java.lang.String expression, int n)
s1 = MView.evaluateChemicalTerms("atomCount()", 0); s2 = MView.evaluateChemicalTerms("logP() <= 5", 1);See the Chemical Terms Language Reference and the Chemical Terms Reference Tables for more.
evaluateChemicalTerms
in interface JMViewIface
expression
- the Chemical Terms expressionn
- molecule cell number
public boolean isChemicalTermsExpressionSyntaxError()
true
, if the last Chemical Terms expression evaluated by the
JMViewIface.evaluateChemicalTerms(String, int)
method is a syntactically not correct expression.
Should be called after JMViewIface.evaluateChemicalTerms(String, int)
.
isChemicalTermsExpressionSyntaxError
in interface JMViewIface
true
, if the last evaluated Chemical Terms expression is syntactically not correctpublic void addMol(java.lang.String s)
addMol
in interface JMViewIface
s
- molecule file contents, URL, or (Unix) filenamepublic void addMol(java.lang.String s, java.lang.String opts)
addMol
in interface JMViewIface
s
- molecule file contents, URL, or (Unix) filenameopts
- options or nullpublic void setMol(java.lang.String s)
setMol
in interface JMViewIface
s
- molecule file contents, URL, or (Unix) filenamepublic void setMol(java.lang.String s, java.lang.String opts)
setMol
in interface JMViewIface
s
- molecule file contents, URL, or (Unix) filenameopts
- options or nullpublic void setM(int n, java.lang.String s)
setM
in interface JMViewIface
n
- molecule cell number (0 for simple viewer)s
- molecule file contents, URL, or (Unix) filenamepublic void setM(int n, java.lang.String s, java.lang.String opts)
setM
in interface JMViewIface
n
- molecule cell number (0 for simple viewer)s
- molecule file contents, URL, or (Unix) filenameopts
- options or nullpublic java.lang.String getL(int i)
getL
in interface JMViewIface
i
- the label index
public void setL(int i, java.lang.String s)
setL
in interface JMViewIface
i
- the label indexs
- the labelpublic boolean getC(int i)
getC
in interface JMViewIface
i
- the checkbox index
public void setC(int i, boolean s)
setC
in interface JMViewIface
i
- the checkbox indexs
- true to check, false to uncheckpublic void setActionB(int i, java.lang.String s)
setActionB
in interface JMViewIface
i
- the button numbers
- action stringpublic void setActionC(int i, boolean c, java.lang.String s)
setActionC
in interface JMViewIface
i
- the button numberc
- checked (true) or unchecked (false) states
- action stringpublic java.lang.String getT(int i)
getT
in interface JMViewIface
i
- the text field index
public void setT(int i, java.lang.String s)
setT
in interface JMViewIface
i
- the text field indexs
- the textpublic int getCellCount()
getCellCount
in interface JMViewIface
public int getSelectedIndex()
getSelectedIndex
in interface JMViewIface
public void setSelectedIndex(int i)
setSelectedIndex
in interface JMViewIface
i
- the cell index or -1 to unselectpublic int getAtomCount(int i)
getAtomCount
in interface JMViewIface
i
- molecule cell index
public boolean selectAllAtoms(int i, boolean v)
selectAllAtoms
in interface JMViewIface
i
- molecule cell indexv
- select (true) or unselect (false)
public boolean selectAtom(int i, int atom, boolean v)
selectAtom
in interface JMViewIface
i
- molecule cell indexatom
- atom indexv
- select (true) or unselect (false)
public boolean isSelected(int i, int atom)
isSelected
in interface JMViewIface
i
- molecule cell indexatom
- atom index
public boolean isAtomSetVisible(int id)
isAtomSetVisible
in interface JMViewIface
id
- atom set identifier (0, ..., 63)
public void setAtomSetVisible(int id, boolean v)
setAtomSetVisible
in interface JMViewIface
id
- atom set identifier (0, ..., 63)v
- visibilitypublic void setAtomSetColor(int i, int rgb)
setAtomSetColor
in interface JMViewIface
i
- atom set identifier (0, ..., 63)rgb
- 24-bit RGB color valuepublic boolean setAtomSetSeq(int i, int atom, int id)
setAtomSetSeq
in interface JMViewIface
i
- molecule cell indexatom
- atom indexid
- a number between 0 and 63. 0 is the default set.
It contains all atoms that are not in another set.
public void setBondSetColor(int i, int rgb)
setBondSetColor
in interface JMViewIface
i
- bond set identifier (1, ..., 63)rgb
- 24-bit RGB color valuepublic boolean setBondSetSeq(int i, int j1, int j2, int id)
setBondSetSeq
in interface JMViewIface
i
- molecule cell indexj1
- first atom indexj2
- second atom indexid
- a number between 0 and 31
public boolean setBondSetSeqAll(int i, int id)
setBondSetSeqAll
in interface JMViewIface
i
- molecule cell indexid
- a number between 0 and 31
public boolean isSetVisible(int id)
id
- atom set identifier (0, ..., 63)
public void setSetVisible(int id, boolean v)
id
- atom set identifier (0, ..., 63)v
- visibilitypublic void setSetColor(int i, int rgb)
i
- atom set identifier (1, ..., 63)rgb
- 24-bit RGB color valuepublic boolean setSetSeq(int i, int atom, int id)
i
- molecule cell indexatom
- atom indexid
- a number between 0 and 63
public double getTabScale(int i)
getTabScale
in interface JMViewIface
i
- molecule cell index
public double getBestTabScale(int i)
getBestTabScale
in interface JMViewIface
i
- the cell index
public double getBestTabScale()
getBestTabScale
in interface JMViewIface
public boolean hasValenceError(int i)
hasValenceError
in interface JMViewIface
i
- the cell index
true
if there is an atom with valence error,
false
if there is no valence error or there is no molecule in the cellpublic void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public 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 |