Class JMView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by JMView
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, JMViewIface, MAppletIface

public class JMView
extends javax.swing.JApplet
implements java.awt.event.FocusListener, java.beans.PropertyChangeListener, java.awt.event.MouseListener, JMViewIface

Swing version of the MarvinView Applet.

Since:
Marvin 2.0
Version:
5.2.3, 06/20/2009
Author:
Peter Csizmadia, Tamas Vertse, Nora Mate, Zsolt Mohacsi, Istvan Fajth
See Also:
Serialized Form

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

JMView

public JMView()
Method Detail

init

public void init()
Initializes the applet.

Overrides:
init in class java.applet.Applet

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent ev)
Invoke propertyChange(prop) JavaScript method on applet's page. Only for internal usage.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Since:
Marvin 5.0 08/29/2007

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)

Specified by:
mouseReleased in interface java.awt.event.MouseListener

start

public void start()
Starts the applet.

Overrides:
start in class java.applet.Applet

stop

public void stop()
Stops the applet.

Overrides:
stop in class java.applet.Applet

destroy

public void destroy()
Dispose all the frames.

Overrides:
destroy in class java.applet.Applet

getAppletInfo

public java.lang.String getAppletInfo()
Returns a string containing the version and the author.

Overrides:
getAppletInfo in class java.applet.Applet
Returns:
the information

animate

public void animate(java.lang.String arg)
Starts or stops animation. Animation can be an XYZ movie for multframe XYZ files, or simple 3D rotation in other cases. The argument of this method is in the same format as the "animate" applet parameter. Use "all" to start, "off" to stop animating all molecules. To animate only some of the molecules in in a table, use a comma separated list of indices (0...n-1). To stop animating them, use a comma separated list of negative integers (minus cell index minus one = -1...-n). Examples:
 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
 

Specified by:
animate in interface JMViewIface
Parameters:
arg - "off", "all" or a comma separated list of integers
Since:
Marvin 3.0, 12/26/2002

isEmpty

public boolean isEmpty(int n)
Returns true if molecule cell is empty.

Specified by:
isEmpty in interface JMViewIface
Parameters:
n - molecule cell number
Returns:
true if molecule cell is empty
Since:
Marvin 3.5.1

getM

public java.lang.String getM(int n,
                             java.lang.String fmt)
Gets the nth molecule in a text format. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table. 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 = mview.getM(0, "mol");
 s2 = mview.getM(0, "smiles:a-H"); // aromatize and remove Hydrogens
 

Specified by:
getM in interface JMViewIface
Parameters:
n - molecule cell number
fmt - the format descriptor string
Returns:
string containing the molecule in a molecule file format

getMProperty

public java.lang.String getMProperty(int n,
                                     java.lang.String key)
Gets an RDfile/SDfile property. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table.

Specified by:
getMProperty in interface JMViewIface
Parameters:
n - molecule cell number
key - the property key
Returns:
the value of the property, or null if the key is not found
Since:
Marvin 3.4.1

setMProperty

public void setMProperty(int n,
                         java.lang.String key,
                         java.lang.String value)
Sets an RDfile/SDfile property. Setting null value removes the property. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table.

Specified by:
setMProperty in interface JMViewIface
Parameters:
n - molecule cell number
key - the property name
value - the value or null
Since:
Marvin 3.4.1

getMPropertyCount

public int getMPropertyCount(int n)
Gets the number of RDfile/SDfile properties. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table.

Specified by:
getMPropertyCount in interface JMViewIface
Parameters:
n - molecule cell number
Returns:
the number of RDfile/SDfile properties
Since:
Marvin 3.5

getMPropertyKey

public java.lang.String getMPropertyKey(int n,
                                        int i)
Gets an RDfile/SDfile property key. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table.

Specified by:
getMPropertyKey in interface JMViewIface
Parameters:
n - molecule cell number
i - the property key index
Returns:
the the property key
Since:
Marvin 3.5

setAtomAlias

public void setAtomAlias(int n,
                         int i,
                         java.lang.String alias)
Sets atom alias. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table.

Specified by:
setAtomAlias in interface JMViewIface
Parameters:
n - molecule cell number
i - the atom index
alias - the alias
Since:
Marvin 3.5

getAtomAlias

public java.lang.String getAtomAlias(int n,
                                     int i)
Gets atom alias. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table.

Specified by:
getAtomAlias in interface JMViewIface
Parameters:
n - molecule cell number
i - the atom index
Returns:
the atom alias
Since:
Marvin 3.5

setAtomExtraLabel

public void setAtomExtraLabel(int n,
                              int i,
                              java.lang.String label)
Sets extra atom label. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table.

Specified by:
setAtomExtraLabel in interface JMViewIface
Parameters:
n - molecule cell number
i - the atom index
label - the extra atom label
Since:
Marvin 3.5

getAtomExtraLabel

public java.lang.String getAtomExtraLabel(int n,
                                          int i)
Gets extra atom label. Should be called after the nth molecule has been loaded. For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table.

Specified by:
getAtomExtraLabel in interface JMViewIface
Parameters:
n - molecule cell number
i - the atom index
Returns:
the extra atom label
Since:
Marvin 3.5

getMolMass

public double getMolMass(int n)
Gets the molecule weight. Should be called after the nth molecule has been loaded.

Specified by:
getMolMass in interface JMViewIface
Parameters:
n - molecule cell number
Returns:
the molecule weight
Since:
Marvin 4.0.2

getMolExactMass

public double getMolExactMass(int n)
Gets the exact molecule weight. Should be called after the nth molecule has been loaded.

Specified by:
getMolExactMass in interface JMViewIface
Parameters:
n - molecule cell number
Returns:
the exact molecule weight
Since:
Marvin 4.0.2

getMolFormula

public java.lang.String getMolFormula(int n)
Gets the molecule formula. Should be called after the nth molecule has been loaded.

Specified by:
getMolFormula in interface JMViewIface
Parameters:
n - molecule cell number
Returns:
the molecule formula
Since:
Marvin 4.0.2

evaluateChemicalTerms

public 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. Should be called after the n-th molecule has been loaded.

Examples:
 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.

Specified by:
evaluateChemicalTerms in interface JMViewIface
Parameters:
expression - the Chemical Terms expression
n - molecule cell number
Returns:
the result of the evaluation
Since:
Marvin 5.1

isChemicalTermsExpressionSyntaxError

public boolean isChemicalTermsExpressionSyntaxError()
Returns 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).

Specified by:
isChemicalTermsExpressionSyntaxError in interface JMViewIface
Returns:
true, if the last evaluated Chemical Terms expression is syntactically not correct
Since:
Marvin 5.1.2

addMol

public void addMol(java.lang.String s)
Starts loading molecules in a separate thread. Sets molecules in empty cells. Experimental: for internal use only.

Specified by:
addMol in interface JMViewIface
Parameters:
s - molecule file contents, URL, or (Unix) filename
Since:
Marvin 3.4.1, 07/16/2004

addMol

public void addMol(java.lang.String s,
                   java.lang.String opts)
Starts loading molecules in a separate thread. Sets molecules in empty cells. Experimental: for internal use only. The file format and/or import options can be specified if the second argument is in one of the following forms: "options", "format:", or "format:options".

Specified by:
addMol in interface JMViewIface
Parameters:
s - molecule file contents, URL, or (Unix) filename
opts - options or null
Since:
Marvin 3.4.1, 07/16/2004

setMol

public void setMol(java.lang.String s)
Starts loading molecules in a separate thread. Sets molecules in consecutive cells starting from cell0.

Specified by:
setMol in interface JMViewIface
Parameters:
s - molecule file contents, URL, or (Unix) filename
Since:
Marvin 3.4.1, 07/08/2004

setMol

public void setMol(java.lang.String s,
                   java.lang.String opts)
Starts loading molecules in a separate thread. Sets molecules in consecutive cells starting from cell0. The file format and/or import options can be specified if the second argument is in one of the following forms: "options", "format:", or "format:options". See the text formats and their options on the File Formats in Marvin page.

Specified by:
setMol in interface JMViewIface
Parameters:
s - molecule file contents, URL, or (Unix) filename
opts - options or null
Since:
Marvin 3.4.1, 07/08/2004

setM

public void setM(int n,
                 java.lang.String s)
Starts loading a molecule into the nth cell in a separate thread.

Specified by:
setM in interface JMViewIface
Parameters:
n - molecule cell number (0 for simple viewer)
s - molecule file contents, URL, or (Unix) filename

setM

public void setM(int n,
                 java.lang.String s,
                 java.lang.String opts)
Starts loading a molecule into the nth cell in a separate thread. The file format and/or import options can be specified if the third argument is in one of the following forms: "options", "format:", or "format:options". See the text formats and their options on the File Formats in Marvin page.

Specified by:
setM in interface JMViewIface
Parameters:
n - molecule cell number (0 for simple viewer)
s - molecule file contents, URL, or (Unix) filename
opts - options or null
Since:
Marvin 3.3

getL

public java.lang.String getL(int i)
Gets a label.

Specified by:
getL in interface JMViewIface
Parameters:
i - the label index
Returns:
the label

setL

public void setL(int i,
                 java.lang.String s)
Sets a label.

Specified by:
setL in interface JMViewIface
Parameters:
i - the label index
s - the label

getC

public boolean getC(int i)
Gets the state of a checkbox.

Specified by:
getC in interface JMViewIface
Parameters:
i - the checkbox index
Returns:
true if checked, false if unchecked

setC

public void setC(int i,
                 boolean s)
Sets the state of a checkbox.

Specified by:
setC in interface JMViewIface
Parameters:
i - the checkbox index
s - true to check, false to uncheck

setActionB

public void setActionB(int i,
                       java.lang.String s)
Sets the action string (URL or JavaScript expression) of a button.

Specified by:
setActionB in interface JMViewIface
Parameters:
i - the button number
s - action string

setActionC

public void setActionC(int i,
                       boolean c,
                       java.lang.String s)
Sets one of the two action strings (JavaScript expressions) of a checkbox.

Specified by:
setActionC in interface JMViewIface
Parameters:
i - the button number
c - checked (true) or unchecked (false) state
s - action string

getT

public java.lang.String getT(int i)
Gets the value of a text field.

Specified by:
getT in interface JMViewIface
Parameters:
i - the text field index
Returns:
the text

setT

public void setT(int i,
                 java.lang.String s)
Gets the value of a text field.

Specified by:
setT in interface JMViewIface
Parameters:
i - the text field index
s - the text

getCellCount

public int getCellCount()
Gets the number of cells in the table.

Specified by:
getCellCount in interface JMViewIface
Returns:
the number of cells, or 1 if the viewer is not a table
Since:
Marvin 2.1.1

getSelectedIndex

public int getSelectedIndex()
Gets the index of the molecule that is selected by the user.

Specified by:
getSelectedIndex in interface JMViewIface
Returns:
the cell index or -1 if no molecule is selected
Since:
Marvin 2.1

setSelectedIndex

public void setSelectedIndex(int i)
Selects a molecule.

Specified by:
setSelectedIndex in interface JMViewIface
Parameters:
i - the cell index or -1 to unselect
Since:
Marvin 2.2

getAtomCount

public int getAtomCount(int i)
Gets the number of atoms in the specified molecule cell.

Specified by:
getAtomCount in interface JMViewIface
Parameters:
i - molecule cell index
Returns:
the number of atoms, or 0 if there is no such cell
Since:
Marvin 2.6

selectAllAtoms

public boolean selectAllAtoms(int i,
                              boolean v)
Select or unselect all atoms in the specified molecule.

Specified by:
selectAllAtoms in interface JMViewIface
Parameters:
i - molecule cell index
v - select (true) or unselect (false)
Returns:
true if the operation was succesful, false if there is no such molecule
Since:
Marvin 2.6

selectAtom

public boolean selectAtom(int i,
                          int atom,
                          boolean v)
Select or unselect an atom in the specified molecule.

Specified by:
selectAtom in interface JMViewIface
Parameters:
i - molecule cell index
atom - atom index
v - select (true) or unselect (false)
Returns:
true if the operation was succesful, false if there is no such molecule or atom
Since:
Marvin 2.6

isSelected

public boolean isSelected(int i,
                          int atom)
Is the specified atom selected?

Specified by:
isSelected in interface JMViewIface
Parameters:
i - molecule cell index
atom - atom index
Returns:
true if selected, false if not
Since:
Marvin 2.6

isAtomSetVisible

public boolean isAtomSetVisible(int id)
Is the specified atom set visible?

Specified by:
isAtomSetVisible in interface JMViewIface
Parameters:
id - atom set identifier (0, ..., 63)
Returns:
true if the set is visible, false if not
Since:
Marvin 3.3

setAtomSetVisible

public void setAtomSetVisible(int id,
                              boolean v)
Set the visibility of the specified atom set.

Specified by:
setAtomSetVisible in interface JMViewIface
Parameters:
id - atom set identifier (0, ..., 63)
v - visibility
Since:
Marvin 3.3

setAtomSetColor

public void setAtomSetColor(int i,
                            int rgb)
Sets the color of an atom set.

Specified by:
setAtomSetColor in interface JMViewIface
Parameters:
i - atom set identifier (0, ..., 63)
rgb - 24-bit RGB color value
Since:
Marvin 3.3

setAtomSetSeq

public boolean setAtomSetSeq(int i,
                             int atom,
                             int id)
Sets the set sequence number of the atom.

Specified by:
setAtomSetSeq in interface JMViewIface
Parameters:
i - molecule cell index
atom - atom index
id - a number between 0 and 63. 0 is the default set. It contains all atoms that are not in another set.
Returns:
true if the operation was succesful, false if there is no such molecule or atom
Since:
Marvin 3.3

setBondSetColor

public void setBondSetColor(int i,
                            int rgb)
Sets the color of a bond set.

Specified by:
setBondSetColor in interface JMViewIface
Parameters:
i - bond set identifier (1, ..., 63)
rgb - 24-bit RGB color value
Since:
Marvin 3.3

setBondSetSeq

public boolean setBondSetSeq(int i,
                             int j1,
                             int j2,
                             int id)
Sets the set sequence number of a bond.

Specified by:
setBondSetSeq in interface JMViewIface
Parameters:
i - molecule cell index
j1 - first atom index
j2 - second atom index
id - a number between 0 and 31
Returns:
true if the operation was succesful, false if there is no such molecule or bond
Since:
Marvin 3.3

setBondSetSeqAll

public boolean setBondSetSeqAll(int i,
                                int id)
Sets the set sequence number for each bond.

Specified by:
setBondSetSeqAll in interface JMViewIface
Parameters:
i - molecule cell index
id - a number between 0 and 31
Returns:
true if the operation was succesful, false if there is no such molecule or bond
Since:
Marvin 3.3

isSetVisible

public boolean isSetVisible(int id)
Deprecated. as of Marvin 3.3, replaced by isAtomSetVisible

Parameters:
id - atom set identifier (0, ..., 63)
Returns:
true if the set is visible, false if not

setSetVisible

public void setSetVisible(int id,
                          boolean v)
Deprecated. as of Marvin 3.3, replaced by setAtomSetVisible

Parameters:
id - atom set identifier (0, ..., 63)
v - visibility

setSetColor

public void setSetColor(int i,
                        int rgb)
Deprecated. as of Marvin 3.3, replaced by setAtomSetColor

Parameters:
i - atom set identifier (1, ..., 63)
rgb - 24-bit RGB color value

setSetSeq

public boolean setSetSeq(int i,
                         int atom,
                         int id)
Deprecated. as of Marvin 3.3, replaced by setAtomSetSeq

Parameters:
i - molecule cell index
atom - atom index
id - a number between 0 and 63
Returns:
true if the operation was succesful, false if there is no such molecule or atom
Since:
Marvin 2.9.3

getTabScale

public double getTabScale(int i)
Gets the magnification for a molecule cell. The scale that would be used in non-window mode is returned even if the cell is its window.

Specified by:
getTabScale in interface JMViewIface
Parameters:
i - molecule cell index
Returns:
the magnification, or -1 if it still cannot be determined
Since:
Marvin 2.9.2

getBestTabScale

public double getBestTabScale(int i)
Gets the best scale value for a molecule cell.

Specified by:
getBestTabScale in interface JMViewIface
Parameters:
i - the cell index
Returns:
the best scaling factor
Since:
Marvin 2.9.2

getBestTabScale

public double getBestTabScale()
Gets the smallest best scale value in the molecule table.

Specified by:
getBestTabScale in interface JMViewIface
Returns:
the best scaling factor
Since:
Marvin 2.9.2

hasValenceError

public boolean hasValenceError(int i)
Determines if the molecule in the specified cell has a valence error on any of its atoms.

Specified by:
hasValenceError in interface JMViewIface
Parameters:
i - the cell index
Returns:
true if there is an atom with valence error, false if there is no valence error or there is no molecule in the cell
Since:
Marvin 4.1.3 11/13/2006

focusGained

public void focusGained(java.awt.event.FocusEvent e)

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)

Specified by:
focusLost in interface java.awt.event.FocusListener

setParentApplet

public void setParentApplet(javax.swing.JApplet parent)

Specified by:
setParentApplet in interface MAppletIface
Since:
5.1.6 (Not included in 5.2.0)