Package chemaxon.marvin.beans
Class MarvinPane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JRootPane
chemaxon.marvin.beans.MarvinPane
- All Implemented Interfaces:
ComponentListener,ImageObserver,MenuContainer,PropertyChangeListener,Serializable,EventListener,Accessible
- Direct Known Subclasses:
MSketchPane,MViewPane
@PublicApi
public abstract class MarvinPane
extends JRootPane
implements PropertyChangeListener, ComponentListener
Ancestor of the Marvin Beans.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JRootPane
JRootPane.AccessibleJRootPane, JRootPane.RootLayoutNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected chemaxon.marvin.common.swing.MolPanelUnderlying panel.protected StringParameter string.protected static ContainerThe top level container of the panestatic final StringMarvin version.Fields inherited from class javax.swing.JRootPane
COLOR_CHOOSER_DIALOG, contentPane, defaultButton, ERROR_DIALOG, FILE_CHOOSER_DIALOG, FRAME, glassPane, INFORMATION_DIALOG, layeredPane, menuBar, NONE, PLAIN_DIALOG, QUESTION_DIALOG, WARNING_DIALOGFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an action listener.Adds the help menu to a parent menu.voidaddMenuBarChangeListener(chemaxon.marvin.common.swing.MenuBarChangeListener l) Adds a menubar change listener.Deprecated, for removal: This API element is subject to removal in a future version.Not used.booleanAre popup menus enabled?voidChanges the cursor to hourglass at the beginning of a long operation.voidCloses all windows opened by this MarvinPane.voidHides windows if the parent frame is hidden.voidDoes nothing.voidvoidShows windows if the parent frame is hidden.static JMenucreateMenu(ResourceBundle rc, String key) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3.1, replaced by SwingUtil.createMenuabstract voiddoPaste()Invokes Paste actions.voidChanges the hourglass cursor back to normal at the end of a long operation.voidexit()Closes all windows opened by this MarvinPane and saves user initialization file.intDetermines the atom numbering.getAtomSetColor(int i) Gets the color of an atom set.doubleGets the atom size.doubleGets the ball radius in units of covalent radius.doubleGets the C-C bold bond width in pt units.doubleGets the C-C bond length in pt units.doubleGets the bond spacing.doubleDeprecated, for removal: This API element is subject to removal in a future version.as of Marvin 4.1, replaced bygetBondSpacing()intGets chirality support level.intGets the number of space dimensions for cleaning.Gets the color scheme.chemaxon.marvin.common.swing.action.CommonActionsDeprecated.intgetDebug()Gets the debugging level.Sets the working directory.intGets display options.Gets the wedge bond display convention.getFile()Gets the current molecule file.Gets the default molecule file format.Query the display method of implicit hydrogens.longGets the visibility of the specified atom sets.booleanDeprecated, for removal: This API element is subject to removal in a future version.use isAtomSymbolsVisible() insteadbooleanTests whether lone pairs are visible.doubleGets the documents margin size.getMolbg()Gets the molecule background color.chemaxon.marvin.common.swing.MolPanelReturns the underlying panel.getParameter(String key) Gets a parameter.Gets the parameter string.booleanAre popup menus enabled?booleanDeprecated, for removal: This API element is subject to removal in a future version.since Marvin 5.1 when this and thegetSaveGlobalGUIProperties()function have been merged.Gets the rendering style.static ResourceBundlegetResourceBundle(String name) Utility method to get a resource bundle.booleanChecks whether we have to read GUI properties from a .MRV filegetSetColor(int i) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3, replaced by getAtomSetColordoubleGets the stick thickness.Gets the user settings object.doubleGets the line thickness for wireframe mode.protected voidinit(chemaxon.marvin.common.swing.MolPanel m) Initializes the content pane.protected voidinit(chemaxon.marvin.common.swing.MolPanel m, boolean start) Initializes the content pane.static voidinitAction(Action action, ResourceBundle rc, String key, KeyStroke accel) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3.1, replaced by SwingUtil.initActionstatic voidinitButton(AbstractButton b, ResourceBundle rc, String key) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3.1, replaced by SwingUtil.initButtonbooleanDetermines the visibility of the atom mapping.booleanDeprecated, for removal: This API element is subject to removal in a future version.in 6.2.0.booleanTests the visibility of the atom symbols in 3D.booleanGets the bond length display option.booleanCheck whether exiting is allowed or not.booleanTests whether experimental features are enabled.booleanGets the E/Z display option.booleanisGrinv()Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.5, use isGrinvVisible() insteadbooleanGets the visibility of the graph invariants.booleanGets the M/P display option.booleanDetermines if the File->Print menu item is enabled or not.booleanDetermines the visibility of R-group defintions.booleanAutomatically saves user settings to an initialization file.booleanIs the atom/bond set coloring enabled?booleanReturns whether the Sgroup data is formatted.voidHandles "ancestor" events or sets parameters if a bean property is changed.protected static MDocumentreadDoc(ObjectInput in) voidRestores object state.protected static MoleculereadMol(ObjectInput in) protected static voidreadResources(Class<?> cl, String fname) Reads resources from the specified file.voidRemoves an action listener.voidsetAtomMappingVisible(boolean v) Shows or hides the atom mapping.voidsetAtomNumberingType(int type) Sets the atom numbering.voidsetAtomNumbersVisible(boolean v) Deprecated, for removal: This API element is subject to removal in a future version.in 6.2.0.voidsetAtomSetColor(int i, Color color) Sets the color of an atom set.voidsetAtomsize(double r) Sets the atom size.voidsetAtomSymbolsVisible(boolean v) Shows or hides the atom symbols in 3D.voidsetBallRadius(double r) Sets the ball radius in units of covalent radius.voidsetBoldBondWidth(double w) Sets the bold bond width.voidsetBondLength(double l) Sets the bond length.voidsetBondLengthVisible(boolean v) Sets the bond length display option.voidsetBondSetColor(int i, Color color) Sets the color of a bond set.voidsetBondSpacing(double w) Sets the bond spacing.voidsetBondWidth(double w) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 4.1, replaced bysetBondSpacing(double)voidsetChiralitySupport(int l) Sets chirality support to show or hide the R/S labels.voidsetCleanDim(int d) Sets the space dimensions for cleaning.voidSets the color scheme.voidsetDebug(int debug) Switches on the debug messages.voidsetDirectory(File wd) Sets the working directory, if the Load/Save is in Last Opened Mode.voidsetDispopts(int f) Sets display options.voidSets the wedge bond display convention.voidsetEnabled(boolean b) Enables or disables this component, depending on the value of the parameter b.voidsetExperimentalEnabled(boolean v) Enable or disable experimental features.voidsetEzVisible(boolean v) Sets the E/Z display option.voidSets the current molecule file but does not load it.voidSets the default molecule file format.voidvoidsetGrinv(boolean v) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.5, use setGrinvVisible(boolean) insteadvoidsetGrinvVisible(boolean v) Shows or hides the graph invariants.voidSets the display method of implicit hydrogens.voidsetInvisibleSets(long v) Sets the visibility of the specified atom sets.voidsetLabels(boolean v) Deprecated, for removal: This API element is subject to removal in a future version.use setAtomSymbolsVisible(v) insteadvoidsetLonePairsVisible(boolean v) Shows or hides (implicit) lone pairs.voidsetMarginSize(double size) Sets the documents margin size.voidSets the molecule background color.voidsetMPVisible(boolean v) Sets the M/P display option.voidSets the parameter string.voidsetPopupMenusEnabled(boolean b) Allows popup menus.voidsetPrintEnabled(boolean b) Set the accessibility of the Print menu item in the File menu.voidSets the rendering style.voidsetRgroupsVisible(boolean b) Shows or hides R-group definitions.voidsetSaveIniEnabled(boolean v) Enables or disables automatic preference saving.voidsetSetColor(int i, Color color) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3, replaced by setAtomSetColorvoidsetSetColoringEnabled(boolean v) Enable or disable atom/bond set coloring.voidsetSgroupDataFormatted(boolean isFormatted) Sets if the Sgroup data to be formatted.voidsetStickThickness(double d) Sets the stick thickness.voidSets the top level container (JFrame, JDialog, etc) of the pane.voidsetUserSettings(UserSettings settings) Sets the user settings object.voidsetWireThickness(double d) Sets the line thickness for wireframe mode.voidshowErrorDialog(String msg, Throwable ex) Show error dialog.voidshowFileDialog(String what, Molecule mol) Shows an Open or Save file dialog.voidShows file open dialog.voidSaves object state.protected static voidwriteMol(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, updateUIMethods 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingOrigin, 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, updateMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
VERSION
Marvin version. -
molPanel
protected chemaxon.marvin.common.swing.MolPanel molPanelUnderlying panel. -
params
Parameter string. -
topLevelContainer
The top level container of the pane
-
-
Constructor Details
-
MarvinPane
protected MarvinPane()Constructor.
-
-
Method Details
-
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
Adds an action listener.- Parameters:
l- the action listener- Since:
- Marvin 3.3
-
removeActionListener
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 MolPanelstart- 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. For internal use only.- Returns:
- the underlying panel
- Throws:
LicenseException- if there is not any license set for using Marvin Beans in the given context. From Marvin 6.2- Since:
- Marvin 5.0
-
propertyChange
Handles "ancestor" events or sets parameters if a bean property is changed.- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
ev- the event object
-
componentResized
- Specified by:
componentResizedin interfaceComponentListener
-
componentMoved
Does nothing.- Specified by:
componentMovedin interfaceComponentListener- Parameters:
ev- the event object
-
componentShown
Shows windows if the parent frame is hidden.- Specified by:
componentShownin interfaceComponentListener- Parameters:
ev- the event object
-
componentHidden
Hides windows if the parent frame is hidden.- Specified by:
componentHiddenin interfaceComponentListener- 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:
-
getParams
Gets the parameter string.- Returns:
- the parameter string
-
setParams
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
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
Gets the molecule background color.- Returns:
- the color
-
setMolbg
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
-
getBoldBondWidth
public double getBoldBondWidth()Gets the C-C bold bond width in pt units.- Returns:
- the bold bond width of C-C bonds.
-
setBoldBondWidth
public void setBoldBondWidth(double w) Sets the bold bond width.- Parameters:
w- the bold bond width of C-C bonds in pt units.
-
getBondLength
public double getBondLength()Gets the C-C bond length in pt units.- Returns:
- the bond Length of C-C bonds.
-
setBondLength
public void setBondLength(double l) Sets the bond length.- Parameters:
l- the bond length of C-C bonds in pt units.
-
getBondSpacing
public double getBondSpacing()Gets the 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 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
Gets the color scheme.- Returns:
MONO_SCHEME_S,CPK_SCHEME_S,SHAPELY_SCHEME_SorGROUP_SCHEME_S.- See Also:
-
setColorScheme
Sets the color scheme.- Parameters:
s-MONO_SCHEME_S,CPK_SCHEME_S,SHAPELY_SCHEME_SorGROUP_SCHEME_S.- See Also:
-
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
Gets the rendering style.- Returns:
- the string representation of an enum value of type
RenderingStyle.
-
setRendering
Sets the rendering style.- Parameters:
s- the string representation of an enum value of typeRenderingStyle.
-
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
Gets the wedge bond display convention.- Returns:
- "mdl" or "daylight"
-
setDownWedge
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
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean isAtomNumbersVisible()Deprecated, for removal: This API element is subject to removal in a future version.in 6.2.0. Use getAtomNumberingType() instead.Determines the visibility of the atom numbers.- Returns:
- true if atom numbers are visible.
- Since:
- Marvin 2.9.13
-
getAtomNumberingType
public int getAtomNumberingType()Determines the atom numbering.- Returns:
- 0: off, 1: Atom numbers, 2: IUPAC numbering.
- Since:
- Marvin 6.2.0
-
setAtomNumbersVisible
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setAtomNumbersVisible(boolean v) Deprecated, for removal: This API element is subject to removal in a future version.in 6.2.0. Use setAtomNumberingType() insteadShows or hides the atom numbers.- Parameters:
v- shows the atom numbers if true, else hide them.
-
setAtomNumberingType
public void setAtomNumberingType(int type) Sets the atom numbering.- Parameters:
type- 0: off 1: Atom numbers 2: IUPAC numbering.- Since:
- Marvin 6.2.0
-
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:
-
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:
-
getLonePairsVisible
public boolean getLonePairsVisible()Tests whether lone pairs are visible.- Returns:
trueif lone pairs are visible,falseotherwise- Since:
- Marvin 4.0
-
setLonePairsVisible
public void setLonePairsVisible(boolean v) Shows or hides (implicit) lone pairs.- Parameters:
v-trueshow,falsehides lone pairs- Since:
- Marvin 4.0
-
setMarginSize
public void setMarginSize(double size) Sets the documents margin size.- Parameters:
size- the size of the margin- Since:
- Marvin 15.2.23, 2/16/2015
-
getMarginSize
public double getMarginSize()Gets the documents margin size.- Returns:
- the margin size
- Since:
- Marvin 15.2.23, 2/16/2015
-
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
Query the display method of implicit hydrogens.- Returns:
IMPLICITH_OFF_S,IMPLICITH_HETERO_S,IMPLICITH_HETEROTERM_SorIMPLICITH_ALL_S.- See Also:
-
setImplicitH
Sets the display method of implicit hydrogens.- Parameters:
s-IMPLICITH_OFF_S,IMPLICITH_HETERO_S,IMPLICITH_HETEROTERM_SorIMPLICITH_ALL_S.- See Also:
-
getChiralitySupport
public int getChiralitySupport()Gets chirality support level.- Always show atom chirality (R/S) and highlight possible chiral centers as well:
StereoConstants.CHIRALITYSUPPORT_ALL_POSSIBLE - Always show atom chirality (R/S):
StereoConstants.CHIRALITYSUPPORT_ALL - Do not show atom chirality (R/S):
StereoConstants.CHIRALITYSUPPORT_NONE
- Returns:
- the chirality support level.
- Always show atom chirality (R/S) and highlight possible chiral centers as well:
-
setChiralitySupport
public void setChiralitySupport(int l) Sets chirality support to show or hide the R/S labels.- Always show atom chirality (R/S) and highlight possible chiral centers as well:
StereoConstants.CHIRALITYSUPPORT_ALL_POSSIBLE - Always show atom chirality (R/S):
StereoConstants.CHIRALITYSUPPORT_ALL - Do not show atom chirality (R/S):
StereoConstants.CHIRALITYSUPPORT_NONE
- Parameters:
l- chirality support level.
- Always show atom chirality (R/S) and highlight possible chiral centers as well:
-
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
-
isMPVisible
public boolean isMPVisible()Gets the M/P display option.- Returns:
- show (true) or hide (false)
-
setMPVisible
public void setMPVisible(boolean v) Sets the M/P display option.- Parameters:
v- show (true) or hide (false) M/p
-
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:
-
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:
-
getAtomSetColor
Gets the color of an atom set.- Parameters:
i- atom set sequence number (0, ...,SETSEQ_MAX)- Returns:
- the color
- Since:
- Marvin 3.3
-
setAtomSetColor
Sets the color of an atom set.- Parameters:
i- atom set sequence number (0, ...,SETSEQ_MAX)color- the color- Since:
- Marvin 3.3
-
setBondSetColor
Sets the color of a bond set.- Parameters:
i- bond set sequence number (1, ...,SETSEQ_MAX)color- the color- Since:
- Marvin 3.3
-
getFormat
Gets the default molecule file format.- Returns:
- the format or "DEFAULT" if it is not specified
-
setFormat
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
Gets the current molecule file.- Returns:
- the file
-
setFile
Sets the current molecule file but does not load it.- Parameters:
f- the file
-
showFileDialog
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
Gets the user settings object.- Returns:
- the user settings object
- Since:
- Marvin 3.0
-
setUserSettings
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
Sets the working directory.- Returns:
- the working directory
- Since:
- Marvin 3.0
-
setDirectory
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:
trueif experimental features are enabled,falseotherwise- Since:
- Marvin 3.5, 11/04/2004
-
setExperimentalEnabled
public void setExperimentalEnabled(boolean v) Enable or disable experimental features.- Parameters:
v-trueenables,falsedisables experimental features- Since:
- Marvin 3.5, 11/04/2004
-
showFileOpenDialog
public void showFileOpenDialog()Shows file open dialog.- Since:
- Marvin 3.0
-
getCommonActions
Deprecated.Gets the common actions. For internal use only.- Returns:
- the actions
- Since:
- Marvin 5.0, 11/17/2006
-
addToolsMenu
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public JMenu addToolsMenu(Container m) Deprecated, for removal: This API element is subject to removal in a future version.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
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
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
Show error dialog.- Parameters:
msg- error messageex- the exception- Since:
- Marvin 3.5, 10/26/2004
-
readResources
Reads resources from the specified file.- Parameters:
cl- the class to read resources forfname- resource filename- Since:
- Marvin 3.0
-
writeExternal
Saves object state. For internal use only! This method does not implement the Externalizable interface. It is called by the writeExternal method of theMSketchandMViewclasses, which do implement it.- Parameters:
out- the stream to write the object to- Throws:
IOException- Includes any I/O exceptions that may occur- Since:
- Marvin 3.5, 2004/11/01
-
readExternal
Restores object state. For internal use only! This method does not implement the Externalizable interface. It is called by the readExternal method of theMSketchandMViewclasses, which do implement it.- Parameters:
in- the stream to read data from in order to restore the object- Throws:
IOException- if I/O errors occurClassNotFoundException- If the class for an object being restored cannot be found.- Since:
- Marvin 3.5, 2004/11/01
-
writeMol
- Throws:
IOException
-
readMol
- Throws:
IOException
-
readDoc
- Throws:
IOException
-
getBondWidth
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 4.1, replaced bygetBondSpacing()Gets bond spacing.- Returns:
- the bond spacing in bond length units
-
setBondWidth
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 4.1, replaced bysetBondSpacing(double)Sets bond spacing.- Parameters:
w- bond spacing in bond length units
-
getSetColor
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3, replaced by getAtomSetColor- Parameters:
i- atom set sequence number (0, ...,SETSEQ_MAX)- Returns:
- the color
-
setSetColor
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setSetColor(int i, Color color) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3, replaced by setAtomSetColor- Parameters:
i- atom set sequence number (0, ...,SETSEQ_MAX)color- the color
-
getLabels
Deprecated, for removal: This API element is subject to removal in a future version.use isAtomSymbolsVisible() instead -
setLabels
Deprecated, for removal: This API element is subject to removal in a future version.use setAtomSymbolsVisible(v) instead -
isGrinv
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.5, use isGrinvVisible() instead- Returns:
- true if graph invariants are visible.
- Since:
- Marvin 2.10.3
-
setGrinv
Deprecated, for removal: This API element is subject to removal in a future version.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
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static JMenu createMenu(ResourceBundle rc, String key) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3.1, replaced by SwingUtil.createMenu- Parameters:
rc- the resourceskey- name of the label resource- Returns:
- the menu
- Since:
- Marvin 3.3
-
initButton
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static void initButton(AbstractButton b, ResourceBundle rc, String key) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3.1, replaced by SwingUtil.initButton- Parameters:
b- the buttonrc- the resourceskey- name of the resource- Since:
- Marvin 3.3
-
initAction
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static void initAction(Action action, ResourceBundle rc, String key, KeyStroke accel) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.3.1, replaced by SwingUtil.initAction- Parameters:
action- the actionrc- the resourceskey- name of the resourceaccel- the accelerator or null- Since:
- Marvin 3.3
-
setTopLevelContainer
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
- Returns:
- the top level container (if set) or null
-
getReadGlobalGUIProperties
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean getReadGlobalGUIProperties()Deprecated, for removal: This API element is subject to removal in a future version.since Marvin 5.1 when this and thegetSaveGlobalGUIProperties()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
-
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:
setEnabledin classJComponent- 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
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:
-
setSgroupDataFormatted
public void setSgroupDataFormatted(boolean isFormatted) Sets if the Sgroup data to be formatted. The default value is true -
isSgroupDataFormatted
public boolean isSgroupDataFormatted()Returns whether the Sgroup data is formatted.
-