chemaxon.marvin.beans
Class MarvinPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JRootPane
                  extended by chemaxon.marvin.beans.MarvinPane
All Implemented Interfaces:
java.awt.event.ComponentListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
MSketchPane, MViewPane

public abstract class MarvinPane
extends javax.swing.JRootPane
implements java.awt.event.KeyListener, java.beans.PropertyChangeListener, java.awt.event.ComponentListener

Ancestor of the Marvin Beans.

Version:
5.2, 02/11/2009
Author:
Peter Csizmadia, Tamas Vertse
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JRootPane
javax.swing.JRootPane.AccessibleJRootPane, javax.swing.JRootPane.RootLayout
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
protected  chemaxon.marvin.common.swing.MolPanel molPanel
          Underlying panel.
protected  java.lang.String params
          Parameter string.
protected static java.awt.Container topLevelContainer
          The top level container of the pane
static java.lang.String VERSION
          Marvin version.
 
Fields inherited from class javax.swing.JRootPane
COLOR_CHOOSER_DIALOG, contentPane, defaultButton, defaultPressAction, defaultReleaseAction, ERROR_DIALOG, FILE_CHOOSER_DIALOG, FRAME, glassPane, INFORMATION_DIALOG, layeredPane, menuBar, NONE, PLAIN_DIALOG, QUESTION_DIALOG, WARNING_DIALOG
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
protected MarvinPane()
          Constructor.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds an action listener.
 javax.swing.JMenu addHelpMenu(java.awt.Container m)
          Adds the help menu to a parent menu.
 void addMenuBarChangeListener(chemaxon.marvin.common.swing.MenuBarChangeListener l)
          Adds a menubar change listener.
 javax.swing.JMenu addToolsMenu(java.awt.Container m)
          Deprecated. Not used.
 boolean arePopupMenusEnabled()
          Are popup menus enabled?
 void beginHourglass()
          Changes the cursor to hourglass at the beginning of a long operation.
 void closeWindows()
          Closes all windows opened by this MarvinPane.
 void componentHidden(java.awt.event.ComponentEvent ev)
          Hides windows if the parent frame is hidden.
 void componentMoved(java.awt.event.ComponentEvent ev)
          Does nothing.
 void componentResized(java.awt.event.ComponentEvent ev)
          Does nothing.
 void componentShown(java.awt.event.ComponentEvent ev)
          Shows windows if the parent frame is hidden.
static javax.swing.JMenu createMenu(java.util.ResourceBundle rc, java.lang.String key)
          Deprecated. as of Marvin 3.3.1, replaced by SwingUtil.createMenu
abstract  void doPaste()
          Invokes Paste actions.
 void endHourglass()
          Changes the hourglass cursor back to normal at the end of a long operation.
 void exit()
          Closes all windows opened by this MarvinPane and saves user initialization file.
 boolean getAtomNumbersVisible()
          Deprecated. as of Marvin 2.9.13, replaced by isAtomNumbersVisible.
 java.awt.Color getAtomSetColor(int i)
          Gets the color of an atom set.
 double getAtomsize()
          Gets the atom size.
 double getBallRadius()
          Gets the ball radius in units of covalent radius.
 double getBondSpacing()
          Gets the double bond spacing.
 double getBondWidth()
          Deprecated. as of Marvin 4.1, replaced by getBondSpacing()
 int getChiralitySupport()
          Gets chirality support level.
 int getCleanDim()
          Gets the number of space dimensions for cleaning.
 java.lang.String getColorScheme()
          Gets the color scheme.
 chemaxon.marvin.common.swing.CommonActions getCommonActions()
          Deprecated.  
 int getDebug()
          Gets the debugging level.
 java.io.File getDirectory()
          Sets the working directory.
 int getDispopts()
          Gets display options.
 int getDispQuality()
          Gets the display quality.
 java.lang.String getDownWedge()
          Gets the wedge bond display convention.
 boolean getExplicitH()
          Deprecated. since 5.4 returns false. will be unsupported in 5.5
 java.io.File getFile()
          Gets the current molecule file.
 java.lang.String getFormat()
          Gets the default molecule file format.
 java.lang.String getImplicitH()
          Query the display method of implicit hydrogens.
 long getInvisibleSets()
          Gets the visibility of the specified atom sets.
 boolean getLabels()
          Deprecated. use isAtomSymbolsVisible() instead
 boolean getLonePairsVisible()
          Tests whether lone pairs are visible.
 java.awt.Color getMolbg()
          Gets the molecule background color.
 chemaxon.marvin.common.swing.MolPanel getMolPanel()
          Returns the underlying panel.
 java.lang.String getParameter(java.lang.String key)
          Gets a parameter.
 java.lang.String getParams()
          Gets the parameter string.
 boolean getPopupMenusEnabled()
          Are popup menus enabled?
 boolean getReadGlobalGUIProperties()
          Deprecated. since Marvin 5.1 when this and the getSaveGlobalGUIProperties() function have been merged.
 java.lang.String getRendering()
          Gets the rendering style.
static java.util.ResourceBundle getResourceBundle(java.lang.String name)
          Utility method to get a resource bundle.
 boolean getSaveGlobalGUIProperties()
          Checks whether we have to read GUI properties from a .MRV file
 java.awt.Color getSetColor(int i)
          Deprecated. as of Marvin 3.3, replaced by getAtomSetColor
 double getStickThickness()
          Gets the stick thickness.
 java.awt.Container getTopLevelContainer()
           
 UserSettings getUserSettings()
          Gets the user settings object.
 double getWireThickness()
          Gets the line thickness for wireframe mode.
protected  void init(chemaxon.marvin.common.swing.MolPanel m)
          Initializes the content pane.
protected  void init(chemaxon.marvin.common.swing.MolPanel m, boolean start)
          Initializes the content pane.
static void initAction(javax.swing.Action action, java.util.ResourceBundle rc, java.lang.String key, javax.swing.KeyStroke accel)
          Deprecated. as of Marvin 3.3.1, replaced by SwingUtil.initAction
static void initButton(javax.swing.AbstractButton b, java.util.ResourceBundle rc, java.lang.String key)
          Deprecated. as of Marvin 3.3.1, replaced by SwingUtil.initButton
 boolean isAtomMappingVisible()
          Determines the visibility of the atom mapping.
 boolean isAtomNumbersVisible()
          Determines the visibility of the atom numbers.
 boolean isAtomSymbolsVisible()
          Tests the visibility of the atom symbols in 3D.
 boolean isBondLengthVisible()
          Gets the bond length display option.
 boolean isExitCanceled()
          Check whether exiting is allowed or not.
 boolean isExperimentalEnabled()
          Tests whether experimental features are enabled.
 boolean isEzVisible()
          Gets the E/Z display option.
 boolean isGrinv()
          Deprecated. as of Marvin 3.5, use isGrinvVisible() instead
 boolean isGrinvVisible()
          Gets the visibility of the graph invariants.
 boolean isPrintEnabled()
          Determines if the File->Print menu item is enabled or not.
 boolean isRgroupsVisible()
          Determines the visibility of R-group defintions.
 boolean isSaveIniEnabled()
          Automatically saves user settings to an initialization file.
 boolean isSetColoringEnabled()
          Is the atom/bond set coloring enabled?
 void keyPressed(java.awt.event.KeyEvent ev)
          Handles key events.
 void keyReleased(java.awt.event.KeyEvent ev)
          Handles key events.
 void keyTyped(java.awt.event.KeyEvent ev)
          Handles key events.
 void propertyChange(java.beans.PropertyChangeEvent ev)
          Handles "ancestor" events or sets parameters if a bean property is changed.
protected static MDocument readDoc(java.io.ObjectInput in)
           
 void readExternal(java.io.ObjectInput in)
          Restores object state.
protected static Molecule readMol(java.io.ObjectInput in)
           
protected static void readResources(java.lang.Class cl, java.lang.String fname)
          Reads resources from the specified file.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes an action listener.
 void setAtomMappingVisible(boolean v)
          Shows or hides the atom mapping.
 void setAtomNumbersVisible(boolean v)
          Shows or hides the atom numbers.
 void setAtomSetColor(int i, java.awt.Color color)
          Sets the color of an atom set.
 void setAtomsize(double r)
          Sets the atom size.
 void setAtomSymbolsVisible(boolean v)
          Shows or hides the atom symbols in 3D.
 void setBallRadius(double r)
          Sets the ball radius in units of covalent radius.
 void setBondLengthVisible(boolean v)
          Sets the bond length display option.
 void setBondSetColor(int i, java.awt.Color color)
          Sets the color of a bond set.
 void setBondSpacing(double w)
          Sets the double bond spacing.
 void setBondWidth(double w)
          Deprecated. as of Marvin 4.1, replaced by setBondSpacing(double)
 void setChiralitySupport(int l)
          Sets chirality support to show or hide the R/S labels.
 void setCleanDim(int d)
          Sets the space dimensions for cleaning.
 void setColorScheme(java.lang.String s)
          Sets the color scheme.
 void setDebug(int debug)
          Switches on the debug messages.
 void setDirectory(java.io.File wd)
          Sets the working directory, if the Load/Save is in Last Opened Mode.
 void setDispopts(int f)
          Sets display options.
 void setDispQuality(int q)
          Sets the display quality.
 void setDownWedge(java.lang.String s)
          Sets the wedge bond display convention.
 void setEnabled(boolean b)
          Enables or disables this component, depending on the value of the parameter b.
 void setExperimentalEnabled(boolean v)
          Enable or disable experimental features.
 void setExplicitH(boolean show)
          Deprecated. since 5.4 does nothing, will not be supported after 5.5
 void setEzVisible(boolean v)
          Sets the E/Z display option.
 void setFile(java.io.File f)
          Sets the current molecule file but does not load it.
 void setFormat(java.lang.String fmt)
          Sets the default molecule file format.
 void setGlobalGUIProperties(MPropertyContainer gp)
           
 void setGrinv(boolean v)
          Deprecated. as of Marvin 3.5, use setGrinvVisible(boolean) instead
 void setGrinvVisible(boolean v)
          Shows or hides the graph invariants.
 void setImplicitH(java.lang.String s)
          Sets the display method of implicit hydrogens.
 void setInvisibleSets(long v)
          Sets the visibility of the specified atom sets.
 void setLabels(boolean v)
          Deprecated. use setAtomSymbolsVisible(v) instead
 void setLonePairsVisible(boolean v)
          Shows or hides (implicit) lone pairs.
 void setMolbg(java.awt.Color c)
          Sets the molecule background color.
 void setParams(java.lang.String s)
          Sets the parameter string.
 void setPopupMenusEnabled(boolean b)
          Allows popup menus.
 void setPrintEnabled(boolean b)
          Set the accessibility of the Print menu item in the File menu.
 void setRendering(java.lang.String s)
          Sets the rendering style.
 void setRgroupsVisible(boolean b)
          Shows or hides R-group definitions.
 void setSaveIniEnabled(boolean v)
          Enables or disables automatic preference saving.
 void setSetColor(int i, java.awt.Color color)
          Deprecated. as of Marvin 3.3, replaced by setAtomSetColor
 void setSetColoringEnabled(boolean v)
          Enable or disable atom/bond set coloring.
 void setStickThickness(double d)
          Sets the stick thickness.
 void setTopLevelContainer(java.awt.Container tlc)
          Sets the top level container (JFrame, JDialog, etc) of the pane.
 void setUserSettings(UserSettings settings)
          Sets the user settings object.
 void setWireThickness(double d)
          Sets the line thickness for wireframe mode.
 void showErrorDialog(java.lang.String msg, java.lang.Throwable ex)
          Show error dialog.
 void showFileDialog(java.lang.String what, Molecule mol)
          Shows an Open or Save file dialog.
 void showFileOpenDialog()
          Shows file open dialog.
 void writeExternal(java.io.ObjectOutput out)
          Saves object state.
protected static void writeMol(java.io.ObjectOutput out, Molecule mol)
           
 
Methods inherited from class javax.swing.JRootPane
addImpl, addNotify, createContentPane, createGlassPane, createLayeredPane, createRootLayout, getAccessibleContext, getContentPane, getDefaultButton, getGlassPane, getJMenuBar, getLayeredPane, getMenuBar, getUI, getUIClassID, getWindowDecorationStyle, isOptimizedDrawingEnabled, isValidateRoot, paramString, removeNotify, setContentPane, setDefaultButton, setDoubleBuffered, setGlassPane, setJMenuBar, setLayeredPane, setMenuBar, setUI, setWindowDecorationStyle, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Marvin version.


molPanel

protected chemaxon.marvin.common.swing.MolPanel molPanel
Underlying panel.


params

protected java.lang.String params
Parameter string.


topLevelContainer

protected static java.awt.Container topLevelContainer
The top level container of the pane

Constructor Detail

MarvinPane

protected MarvinPane()
Constructor.

Method Detail

addMenuBarChangeListener

public void addMenuBarChangeListener(chemaxon.marvin.common.swing.MenuBarChangeListener l)
Adds a menubar change listener.

Parameters:
l - the menubar change listener
Since:
Marvin 4.1, 11/14/2005

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds an action listener.

Parameters:
l - the action listener
Since:
Marvin 3.3

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes an action listener.

Parameters:
l - the action listener
Since:
Marvin 3.3

init

protected void init(chemaxon.marvin.common.swing.MolPanel m)
Initializes the content pane.

Parameters:
m - the MolPanel

init

protected void init(chemaxon.marvin.common.swing.MolPanel m,
                    boolean start)
Initializes the content pane.

Parameters:
m - the MolPanel
start - enable (true) or disable (false) molecule/template structure/abbreviated group loading
Since:
Marvin 3.4.2, 08/03/2004

getMolPanel

public chemaxon.marvin.common.swing.MolPanel getMolPanel()
Returns the underlying panel.

Returns:
the underlying panel
Since:
Marvin 5.0

keyPressed

public void keyPressed(java.awt.event.KeyEvent ev)
Handles key events. @param ev the event object

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent ev)
Handles key events. @param ev the event object

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent ev)
Handles key events. @param ev the event object

Specified by:
keyReleased in interface java.awt.event.KeyListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent ev)
Handles "ancestor" events or sets parameters if a bean property is changed.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
ev - the event object

componentResized

public void componentResized(java.awt.event.ComponentEvent ev)
Does nothing.

Specified by:
componentResized in interface java.awt.event.ComponentListener
Parameters:
ev - the event object

componentMoved

public void componentMoved(java.awt.event.ComponentEvent ev)
Does nothing.

Specified by:
componentMoved in interface java.awt.event.ComponentListener
Parameters:
ev - the event object

componentShown

public void componentShown(java.awt.event.ComponentEvent ev)
Shows windows if the parent frame is hidden.

Specified by:
componentShown in interface java.awt.event.ComponentListener
Parameters:
ev - the event object

componentHidden

public void componentHidden(java.awt.event.ComponentEvent ev)
Hides windows if the parent frame is hidden.

Specified by:
componentHidden in interface java.awt.event.ComponentListener
Parameters:
ev - the event object

getPopupMenusEnabled

public boolean getPopupMenusEnabled()
Are popup menus enabled?

Returns:
true if the popup menus are enabled, else false
Since:
Marvin 2.9.12

arePopupMenusEnabled

public boolean arePopupMenusEnabled()
Are popup menus enabled?

Returns:
true if the popup menus are enabled, else false
Since:
Marvin 3.3

setPopupMenusEnabled

public void setPopupMenusEnabled(boolean b)
Allows popup menus. If you would like to use your own popup menu add MouseListener to the canvas of MarvinSketch or MarvinView and set builtin popup menus disabled.
Example:
//Create custom popup menu
...
sketchPane.getCanvasComponent().addMouseListener(actionListener);
sketchPane.setPopupMenusEnabled(false); //avoid to display both popup menus

Parameters:
b - True sets popup menus enabled, false sets them disabled.
Since:
Marvin 2.9.12
See Also:
MSketchPane.getCanvasComponent(), MViewPane.getVisibleCellComponent(int)

getParams

public java.lang.String getParams()
Gets the parameter string.

Returns:
the parameter string

setParams

public void setParams(java.lang.String s)
Sets the parameter string. Must be called before any other property setting method.
Example: MarvinView Table View Example
See also: MViewParams
Code example:
        molPanel.setParams(
"rows=2\n"+
"cols=2\n"+
"layout0=:2:2:M:1:0:1:1:c:b:1:1:L:0:0:1:1:c:n:0:1\n"+
"param0=:M:100:100:L:10b\n"+
"\n"+
"# MarvinSketch properties also have to be specified here for the\n"+
"# sketcher windows that can be launched using Edit/Structure.\n"+
"extrabonds=arom,wedge\n");

Parameters:
s - the parameter string

getParameter

public java.lang.String getParameter(java.lang.String key)
Gets a parameter. The return value is based on the contents of the parameter string, the bean properties file (MSketchPane.properties or MViewPane.properties) and the user's MarvinSketch configuration file (in case of MSketchPane).

Parameters:
key - the parameter name
Returns:
the value

getMolbg

public java.awt.Color getMolbg()
Gets the molecule background color.

Returns:
the color

setMolbg

public void setMolbg(java.awt.Color c)
Sets the molecule background color.

Parameters:
c - the color

getAtomsize

public double getAtomsize()
Gets the atom size.

Returns:
the atom size in C-C bond length units

setAtomsize

public void setAtomsize(double r)
Sets the atom size.

size = atomsize*1.54 Å = atomsize*scale points

Parameters:
r - the atom size in C-C bond length units

getBondSpacing

public double getBondSpacing()
Gets the double bond spacing.

Returns:
the bond spacing in C-C bond length units.
Since:
Marvin 4.1, 10/19/2005

setBondSpacing

public void setBondSpacing(double w)
Sets the double bond spacing.

width = w*1.54 Å = w*scale pixels

Parameters:
w - the bond spacing in C-C bond length units.
Since:
Marvin 4.1, 10/19/2005

getCleanDim

public int getCleanDim()
Gets the number of space dimensions for cleaning.

Returns:
2 or 3
Since:
Marvin 3.1.3

setCleanDim

public void setCleanDim(int d)
Sets the space dimensions for cleaning.

Parameters:
d - 2 or 3
Since:
Marvin 3.1.3

getDispopts

public int getDispopts()
Gets display options.

Returns:
the display options

setDispopts

public void setDispopts(int f)
Sets display options.

Parameters:
f - the display options

getColorScheme

public java.lang.String getColorScheme()
Gets the color scheme.

Returns:
MONO_SCHEME_S, CPK_SCHEME_S, SHAPELY_SCHEME_S or GROUP_SCHEME_S.
See Also:
DispOptConsts.COLOR_SCHEMES

setColorScheme

public void setColorScheme(java.lang.String s)
Sets the color scheme.

Parameters:
s - MONO_SCHEME_S, CPK_SCHEME_S, SHAPELY_SCHEME_S or GROUP_SCHEME_S.
See Also:
DispOptConsts.COLOR_SCHEMES

isSetColoringEnabled

public boolean isSetColoringEnabled()
Is the atom/bond set coloring enabled?

Returns:
true if enabled, false if disabled
Since:
Marvin 3.3

setSetColoringEnabled

public void setSetColoringEnabled(boolean v)
Enable or disable atom/bond set coloring.

Parameters:
v - true to enable, false to disable
Since:
Marvin 3.3

getRendering

public java.lang.String getRendering()
Gets the rendering style.

Returns:
WIREFRAME_RENDERING_S, WIREKNOBS_RENDERING_S, STICKS_RENDERING_S, BALLSTICK_RENDERING_S or SPACEFILL_RENDERING_S.
See Also:
DispOptConsts.RENDERING_STYLES

setRendering

public void setRendering(java.lang.String s)
Sets the rendering style.

Parameters:
s - WIREFRAME_RENDERING_S, WIREKNOBS_RENDERING_S, STICKS_RENDERING_S, BALLSTICK_RENDERING_S or SPACEFILL_RENDERING_S.
See Also:
DispOptConsts.RENDERING_STYLES

getDispQuality

public int getDispQuality()
Gets the display quality.

Returns:
the display quality
Since:
Marvin 3.5, 23/08/2004

setDispQuality

public void setDispQuality(int q)
Sets the display quality.

Parameters:
q - the display quality
Since:
Marvin 3.5, 23/08/2004

getWireThickness

public double getWireThickness()
Gets the line thickness for wireframe mode.

Returns:
wire thickness in Angstroms
Since:
Marvin 3.4, 06/08/2004

setWireThickness

public void setWireThickness(double d)
Sets the line thickness for wireframe mode.

Parameters:
d - wire thickness in Angstroms
Since:
Marvin 3.4, 06/08/2004

getStickThickness

public double getStickThickness()
Gets the stick thickness.

Returns:
stick thickness in Angstroms

setStickThickness

public void setStickThickness(double d)
Sets the stick thickness.

Parameters:
d - stick thickness in Angstroms

getBallRadius

public double getBallRadius()
Gets the ball radius in units of covalent radius.

Returns:
the ball radius

setBallRadius

public void setBallRadius(double r)
Sets the ball radius in units of covalent radius.

Parameters:
r - the ball radius

getDownWedge

public java.lang.String getDownWedge()
Gets the wedge bond display convention.

Returns:
"mdl" or "daylight"

setDownWedge

public void setDownWedge(java.lang.String s)
Sets the wedge bond display convention. Down wedge points downward in MDL's convention ("mdl"), upward (at the chiral center) in Daylight's ("daylight").

Parameters:
s - "mdl" or "daylight"

isAtomNumbersVisible

public boolean isAtomNumbersVisible()
Determines the visibility of the atom numbers.

Returns:
true if atom numbers are visible.
Since:
Marvin 2.9.13

setAtomNumbersVisible

public void setAtomNumbersVisible(boolean v)
Shows or hides the atom numbers.

Parameters:
v - shows the atom numbers if true, else hide them.

isAtomMappingVisible

public boolean isAtomMappingVisible()
Determines the visibility of the atom mapping.

Returns:
true if the atom mapping is visible.
Since:
Marvin 2.10.5

setAtomMappingVisible

public void setAtomMappingVisible(boolean v)
Shows or hides the atom mapping.

Parameters:
v - shows the atom mapping if true, else hide it.

isAtomSymbolsVisible

public boolean isAtomSymbolsVisible()
Tests the visibility of the atom symbols in 3D.

Returns:
true if the atom symbols are visible.
Since:
Marvin 3.0
See Also:
DispOptConsts.ATSYM_FLAG

setAtomSymbolsVisible

public void setAtomSymbolsVisible(boolean v)
Shows or hides the atom symbols in 3D.

Parameters:
v - shows the atom symbols if true, else hide them
Since:
Marvin 3.0
See Also:
DispOptConsts.ATSYM_FLAG

getLonePairsVisible

public boolean getLonePairsVisible()
Tests whether lone pairs are visible.

Returns:
true if lone pairs are visible, false otherwise
Since:
Marvin 4.0

setLonePairsVisible

public void setLonePairsVisible(boolean v)
Shows or hides (implicit) lone pairs.

Parameters:
v - true show, false hides lone pairs
Since:
Marvin 4.0

isGrinvVisible

public boolean isGrinvVisible()
Gets the visibility of the graph invariants.

Returns:
true if graph invariants are visible.
Since:
Marvin 3.5, 11/01/2004

setGrinvVisible

public void setGrinvVisible(boolean v)
Shows or hides the graph invariants.

Parameters:
v - true to show the graph invariants, false to hide them.
Since:
Marvin 3.5, 11/01/2004

getImplicitH

public java.lang.String getImplicitH()
Query the display method of implicit hydrogens.

Returns:
IMPLICITH_OFF_S, IMPLICITH_HETERO_S, IMPLICITH_HETEROTERM_S or IMPLICITH_ALL_S.
See Also:
DispOptConsts.IMPLICITH_LEVELS

setImplicitH

public void setImplicitH(java.lang.String s)
Sets the display method of implicit hydrogens.

Parameters:
s - IMPLICITH_OFF_S, IMPLICITH_HETERO_S, IMPLICITH_HETEROTERM_S or IMPLICITH_ALL_S.
See Also:
DispOptConsts.IMPLICITH_LEVELS

getExplicitH

@Deprecated
public boolean getExplicitH()
Deprecated. since 5.4 returns false. will be unsupported in 5.5

Are explicit hydrogens shown?

Returns:
true if shown, false if hidden

setExplicitH

@Deprecated
public void setExplicitH(boolean show)
Deprecated. since 5.4 does nothing, will not be supported after 5.5

Sets the display method of explicit hydrogens.

Parameters:
show - true to show, false to hide explicit hydrogens

getChiralitySupport

public int getChiralitySupport()
Gets chirality support level.

Returns:
the chirality support level.
See Also:
StereoConstants.CHIRALITYSUPPORT_NONE, StereoConstants.CHIRALITYSUPPORT_SELECTED, StereoConstants.CHIRALITYSUPPORT_ALL

setChiralitySupport

public void setChiralitySupport(int l)
Sets chirality support to show or hide the R/S labels.

Parameters:
l - chirality support level.
See Also:
StereoConstants.CHIRALITYSUPPORT_NONE, StereoConstants.CHIRALITYSUPPORT_SELECTED, StereoConstants.CHIRALITYSUPPORT_ALL

isEzVisible

public boolean isEzVisible()
Gets the E/Z display option.

Returns:
show (true) or hide (false)

setEzVisible

public void setEzVisible(boolean v)
Sets the E/Z display option.

Parameters:
v - show (true) or hide (false) E/Z

isBondLengthVisible

public boolean isBondLengthVisible()
Gets the bond length display option.

Returns:
show (true) or hide (false)
Since:
Marvin 3.5, 23/08/2004

setBondLengthVisible

public void setBondLengthVisible(boolean v)
Sets the bond length display option.

Parameters:
v - show (true) or hide (false)
Since:
Marvin 3.5, 23/08/2004
See Also:
DispOptConsts.BONDLEN_FLAG

getInvisibleSets

public long getInvisibleSets()
Gets the visibility of the specified atom sets.

Returns:
the invisibility mask

setInvisibleSets

public void setInvisibleSets(long v)
Sets the visibility of the specified atom sets. Set n is invisible if the n-th bit of the specified 64 bit number is 1.

Parameters:
v - invisibility mask
See Also:
getInvisibleSets()

getAtomSetColor

public java.awt.Color getAtomSetColor(int i)
Gets the color of an atom set.

Parameters:
i - atom set sequence number (0, ..., MolAtom.SETSEQ_MAX)
Returns:
the color
Since:
Marvin 3.3

setAtomSetColor

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

Parameters:
i - atom set sequence number (0, ..., MolAtom.SETSEQ_MAX)
color - the color
Since:
Marvin 3.3

setBondSetColor

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

Parameters:
i - bond set sequence number (1, ..., MolBond.SETSEQ_MAX)
color - the color
Since:
Marvin 3.3

getFormat

public java.lang.String getFormat()
Gets the default molecule file format.

Returns:
the format or "DEFAULT" if it is not specified

setFormat

public void setFormat(java.lang.String fmt)
Sets the default molecule file format. This setting also determine the format of molecule source in the Edit Source window.

Parameters:
fmt - the format string or null

getFile

public java.io.File getFile()
Gets the current molecule file.

Returns:
the file

setFile

public void setFile(java.io.File f)
Sets the current molecule file but does not load it.

Parameters:
f - the file

showFileDialog

public void showFileDialog(java.lang.String what,
                           Molecule mol)
Shows an Open or Save file dialog.

Parameters:
what - "open", "save" or "saveAs"
mol - the molecule to save or null

getDebug

public int getDebug()
Gets the debugging level.

Returns:
the debugging level

setDebug

public void setDebug(int debug)
Switches on the debug messages.

Parameters:
debug - debug level

closeWindows

public void closeWindows()
Closes all windows opened by this MarvinPane.


isExitCanceled

public boolean isExitCanceled()
Check whether exiting is allowed or not.

Returns:
true if the use cancels the exit operation, false otherwise
Since:
Marvin 3.1.4

exit

public void exit()
Closes all windows opened by this MarvinPane and saves user initialization file.


getUserSettings

public UserSettings getUserSettings()
Gets the user settings object.

Returns:
the user settings object
Since:
Marvin 3.0

setUserSettings

public void setUserSettings(UserSettings settings)
Sets the user settings object.

Parameters:
settings - the user settings object
Since:
Marvin 3.0

isSaveIniEnabled

public boolean isSaveIniEnabled()
Automatically saves user settings to an initialization file.

Returns:
true if enabled, false if disabled
Since:
Marvin 2.8.3

setSaveIniEnabled

public void setSaveIniEnabled(boolean v)
Enables or disables automatic preference saving.

Parameters:
v - true to enable, false to disable
Since:
Marvin 2.8.3

getDirectory

public java.io.File getDirectory()
Sets the working directory.

Returns:
the working directory
Since:
Marvin 3.0

setDirectory

public void setDirectory(java.io.File wd)
Sets the working directory, if the Load/Save is in Last Opened Mode.

Parameters:
wd - the working directory
Since:
Marvin 3.0

isExperimentalEnabled

public boolean isExperimentalEnabled()
Tests whether experimental features are enabled.

Returns:
true if experimental features are enabled, false otherwise
Since:
Marvin 3.5, 11/04/2004

setExperimentalEnabled

public void setExperimentalEnabled(boolean v)
Enable or disable experimental features.

Parameters:
v - true enables, false disables experimental features
Since:
Marvin 3.5, 11/04/2004

showFileOpenDialog

public void showFileOpenDialog()
Shows file open dialog.

Since:
Marvin 3.0

getCommonActions

public chemaxon.marvin.common.swing.CommonActions getCommonActions()
Deprecated. 

Gets the common actions.

Returns:
the actions
Since:
Marvin 5.0, 11/17/2006

addToolsMenu

public javax.swing.JMenu addToolsMenu(java.awt.Container m)
Deprecated. Not used.

Adds the Tools menu.

Parameters:
m - the parent menu or menu bar
Returns:
the created menu
Since:
Marvin 3.4, 05/03/2004

addHelpMenu

public javax.swing.JMenu addHelpMenu(java.awt.Container m)
Adds the help menu to a parent menu.

Parameters:
m - the parent menu or menu bar
Returns:
the created menu
Since:
Marvin 3.4, 05/03/2004

getResourceBundle

public static java.util.ResourceBundle getResourceBundle(java.lang.String name)
Utility method to get a resource bundle. If the "LOCALES" resource is set and the current locale is listed, then also loads resources for to the corrent locale.

Parameters:
name - resource file path
Returns:
the resource bundle
Since:
Marvin 3.3

beginHourglass

public void beginHourglass()
Changes the cursor to hourglass at the beginning of a long operation.

Since:
Marvin 3.5, 10/31/2004

endHourglass

public void endHourglass()
Changes the hourglass cursor back to normal at the end of a long operation.

Since:
Marvin 3.5, 10/31/2004

showErrorDialog

public void showErrorDialog(java.lang.String msg,
                            java.lang.Throwable ex)
Show error dialog.

Parameters:
msg - error message
ex - the exception
Since:
Marvin 3.5, 10/26/2004

readResources

protected static void readResources(java.lang.Class cl,
                                    java.lang.String fname)
Reads resources from the specified file.

Parameters:
cl - the class to read resources for
fname - resource filename
Since:
Marvin 3.0

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Saves object state. For internal use only! This method does not implement the Externalizable interface. It is called by the writeExternal method of the MSketch and MView classes, which do implement it.

Parameters:
out - the stream to write the object to
Throws:
java.io.IOException - Includes any I/O exceptions that may occur
Since:
Marvin 3.5, 2004/11/01

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restores object state. For internal use only! This method does not implement the Externalizable interface. It is called by the readExternal method of the MSketch and MView classes, which do implement it.

Parameters:
in - the stream to read data from in order to restore the object
Throws:
java.io.IOException - if I/O errors occur
java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.
Since:
Marvin 3.5, 2004/11/01

writeMol

protected static void writeMol(java.io.ObjectOutput out,
                               Molecule mol)
                        throws java.io.IOException
Throws:
java.io.IOException

readMol

protected static Molecule readMol(java.io.ObjectInput in)
                           throws java.io.IOException
Throws:
java.io.IOException

readDoc

protected static MDocument readDoc(java.io.ObjectInput in)
                            throws java.io.IOException
Throws:
java.io.IOException

getBondWidth

public double getBondWidth()
Deprecated. as of Marvin 4.1, replaced by getBondSpacing()

Gets bond spacing.

Returns:
the bond spacing in bond length units

setBondWidth

public void setBondWidth(double w)
Deprecated. as of Marvin 4.1, replaced by setBondSpacing(double)

Sets bond spacing.

Parameters:
w - bond spacing in bond length units

getSetColor

public java.awt.Color getSetColor(int i)
Deprecated. as of Marvin 3.3, replaced by getAtomSetColor

Parameters:
i - atom set sequence number (0, ..., MolAtom.SETSEQ_MAX)
Returns:
the color

setSetColor

public void setSetColor(int i,
                        java.awt.Color color)
Deprecated. as of Marvin 3.3, replaced by setAtomSetColor

Parameters:
i - atom set sequence number (0, ..., MolAtom.SETSEQ_MAX)
color - the color

getLabels

public boolean getLabels()
Deprecated. use isAtomSymbolsVisible() instead


setLabels

public void setLabels(boolean v)
Deprecated. use setAtomSymbolsVisible(v) instead


getAtomNumbersVisible

public boolean getAtomNumbersVisible()
Deprecated. as of Marvin 2.9.13, replaced by isAtomNumbersVisible.


isGrinv

public boolean isGrinv()
Deprecated. as of Marvin 3.5, use isGrinvVisible() instead

Returns:
true if graph invariants are visible.
Since:
Marvin 2.10.3

setGrinv

public void setGrinv(boolean v)
Deprecated. as of Marvin 3.5, use setGrinvVisible(boolean) instead

Parameters:
v - true to show the graph invariants, false to hide them.
Since:
Marvin 2.10.3

createMenu

public static javax.swing.JMenu createMenu(java.util.ResourceBundle rc,
                                           java.lang.String key)
Deprecated. as of Marvin 3.3.1, replaced by SwingUtil.createMenu

Parameters:
rc - the resources
key - name of the label resource
Returns:
the menu
Since:
Marvin 3.3

initButton

public static void initButton(javax.swing.AbstractButton b,
                              java.util.ResourceBundle rc,
                              java.lang.String key)
Deprecated. as of Marvin 3.3.1, replaced by SwingUtil.initButton

Parameters:
b - the button
rc - the resources
key - name of the resource
Since:
Marvin 3.3

initAction

public static void initAction(javax.swing.Action action,
                              java.util.ResourceBundle rc,
                              java.lang.String key,
                              javax.swing.KeyStroke accel)
Deprecated. as of Marvin 3.3.1, replaced by SwingUtil.initAction

Parameters:
action - the action
rc - the resources
key - name of the resource
accel - the accelerator or null
Since:
Marvin 3.3

setTopLevelContainer

public void setTopLevelContainer(java.awt.Container tlc)
Sets the top level container (JFrame, JDialog, etc) of the pane. If the container (window) size is to be restored from the .mrv file this also have to be set when adding the MarvinPane instance to the content pane of the container.

Parameters:
tlc - the top level container

getTopLevelContainer

public java.awt.Container getTopLevelContainer()
Returns:
the top level container (if set) or null

getReadGlobalGUIProperties

public boolean getReadGlobalGUIProperties()
Deprecated. since Marvin 5.1 when this and the getSaveGlobalGUIProperties() function have been merged.

Checks whether we have to read GUI properties from a .MRV file

Returns:
true if we have a molPanel and according to its settings want to save properties
Since:
Marvin 5.0

getSaveGlobalGUIProperties

public boolean getSaveGlobalGUIProperties()
Checks whether we have to read GUI properties from a .MRV file

Returns:
true if we have a molPanel and according to its settings want to save properties
Since:
Marvin 5.1

setGlobalGUIProperties

public void setGlobalGUIProperties(MPropertyContainer gp)

setEnabled

public void setEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b. An enabled component can respond to user input and generate events. Components are enabled initially by default.
Note: Overwrites JComponent.setEnabled(boolean).

Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
b - If true, this component is enabled; otherwise this component is disabled.
Since:
Marvin 4.1.6

doPaste

public abstract void doPaste()
Invokes Paste actions.

Since:
Marvin 5.0

setRgroupsVisible

public void setRgroupsVisible(boolean b)
Shows or hides R-group definitions.

Parameters:
b - true to show, false to hide R-group definitions.
Since:
Marvin 5.0.4 05/21/2008

isRgroupsVisible

public boolean isRgroupsVisible()
Determines the visibility of R-group defintions.

Returns:
True if visible, else false.
Since:
Marvin 5.0.4 05/21/2008

isPrintEnabled

public boolean isPrintEnabled()
Determines if the File->Print menu item is enabled or not.

Returns:
True, if Print is enabled in the menu, else false.
Since:
5.4 09/06/2010
See Also:
setPrintEnabled(boolean)

setPrintEnabled

public void setPrintEnabled(boolean b)
Set the accessibility of the Print menu item in the File menu.

Parameters:
b - True to enable print operation from the file menu. False to set it to disabled.
Since:
5.4 09/06/2010
See Also:
isPrintEnabled()