Package chemaxon.marvin.beans
Class MSketchPane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JRootPane
chemaxon.marvin.beans.MarvinPane
chemaxon.marvin.beans.MSketchPane
- All Implemented Interfaces:
ComponentListener
,ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
The MarvinSketch Bean.
In order to use this class one needs to install a valid license:
LicenseHandler lm = LicenseHandler.getInstance(); lm.setLicenseFile(path_to_license_file);
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JRootPane
JRootPane.AccessibleJRootPane, JRootPane.RootLayout
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Atom mode.static final int
Bond mode.static final int
Delete mode.static final int
Offset of flags in sketch mode.static final int
Sketch mode mask.static final int
Select mode.static final int
Lasso select mode.Fields inherited from class chemaxon.marvin.beans.MarvinPane
molPanel, params, topLevelContainer, 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_DIALOG
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
ConstructorDescriptionConstructs the sketcher.MSketchPane
(UserSettings settings) Constructs the sketcher with the specified user settings object.MSketchPane
(UserSettings settings, boolean loadtmpl) Constructs the sketcher with the specified user settings object.MSketchPane
(UserSettings settings, boolean loadtmpl, JComponent parent) Constructs the sketcher with the specified user settings object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Adds aPropertyChangeListener
for a specific property.void
Puts the molecule into the center of the display.void
Reset undo queue.void
doPaste()
Invokes Paste action.boolean
Returns autoscale property.double[]
Gets the size of the bounding rectangle.Determines canvas component of MarvinSketch.chemaxon.marvin.common.swing.action.CommonActions
Deprecated.static double
Returns the default scale factor which is equivalent to 100% magnification.Gets the document.getImage
(double scale) Gets the canvas contents as an image using a scale factor.
Examples:
To get an image with a scale factor equivalent to 100% magnification:getImage(getDefaultScale());
To get an image with the actual scale factor:getImage(getScale());
Gets the canvas contents as an image scaled to fit in the specified rectangle.double
getMag()
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 2.8.1, replaced by getScale()double
Gets the merge distance.getMol()
Returns the clone of the current molecule being on the canvas.Gets the molecule in a text format.chemaxon.marvin.sketch.swing.SketchPanel
Returns the underlying panel.Deprecated, for removal: This API element is subject to removal in a future version.usegetMol(String)
insteadGet the object at the mouse pointer.Gets the current molecule piece in the specified format.boolean
Is reaction drawing supported?double
getScale()
Returns the scale factor of the current magnification.Gets a clone of the selection.int
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.5, replaced byisBondDraggedAlong()
int
Gets the sketching mode.double
Gets the sticking distance.int
getUndo()
Gets the maximum undo depth.boolean
Is the currently used bond shown at the mouse cursor?boolean
Determines if the File->Close menu item is enabled or not.boolean
Gets whether the confirmation dialog will be appear or not by exit.boolean
Determines whether the original molecule that is loaded in is modified or not.boolean
Deprecated, for removal: This API element is subject to removal in a future version.As of Version 5.3.2, this method is deprecated and has no replacement.boolean
Are valence errors highlighted?void
Handles property change events.void
Restores object state.void
redo()
Invokes a redo command.void
setAutoScale
(boolean as) Sets the autoscale property.void
setBondDraggedAlong
(boolean v) Sets the visibility of the currently used bond at the mouse cursor.void
setCloseEnabled
(boolean b) Set the accessibility of the Close menu item in the File menu.void
setConfirmExit
(boolean b) Sets to drop confirmation dialog about exit or not.void
setDisabledGroupTypes
(List<String> disabledGroupTypes) void
setDocument
(MDocument doc) Sets the document.void
setMag
(double m) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 2.8.1, replaced by setScale()void
setMergedst
(double d) Sets the merge distance.void
Sets the molecule.void
Deprecated, for removal: This API element is subject to removal in a future version.usesetMol(Molecule)
instead of this method.void
Sets the molecule.void
Starts loading a molecule into the sketcher.void
Starts loading a molecule into the sketcher.void
setMrvWithSettings
(String mrvsource) Deprecated, for removal: This API element is subject to removal in a future version.usesetMol(String)
void
Sets the molecule piece.void
setReactionSupport
(boolean v) Allows or disallows reaction drawing.void
setScale
(double m) Sets the scale factor and changes magnification of the canvas.void
setSimpView
(int v) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.5, replaced bysetBondDraggedAlong(boolean)
void
setSketchMode
(int mode) Sets the sketching mode.void
setStickdst
(double d) Sets the sticking distance.void
setUndo
(int u) Sets the maximum undo depth.void
setValenceErrorVisible
(boolean v) Shows or hides valence errorsvoid
This method is used in startup time to throw up a skin selector dialog.void
undo()
Invokes an undo command.void
Saves object state.Methods inherited from class chemaxon.marvin.beans.MarvinPane
addActionListener, addHelpMenu, addMenuBarChangeListener, addToolsMenu, arePopupMenusEnabled, beginHourglass, closeWindows, componentHidden, componentMoved, componentResized, componentShown, createMenu, endHourglass, exit, getAtomNumberingType, getAtomSetColor, getAtomsize, getBallRadius, getBoldBondWidth, getBondLength, getBondSpacing, getBondWidth, getChiralitySupport, getCleanDim, getColorScheme, getDebug, getDirectory, getDispopts, getDownWedge, getFile, getFormat, getImplicitH, getInvisibleSets, getLabels, getLonePairsVisible, getMarginSize, getMolbg, getParameter, getParams, getPopupMenusEnabled, getReadGlobalGUIProperties, getRendering, getResourceBundle, getSaveGlobalGUIProperties, getSetColor, getStickThickness, getTopLevelContainer, getUserSettings, getWireThickness, init, init, initAction, initButton, isAtomMappingVisible, isAtomNumbersVisible, isAtomSymbolsVisible, isBondLengthVisible, isExitCanceled, isExperimentalEnabled, isEzVisible, isGrinv, isGrinvVisible, isMPVisible, isPrintEnabled, isRgroupsVisible, isSaveIniEnabled, isSetColoringEnabled, isSgroupDataFormatted, readDoc, readMol, readResources, removeActionListener, setAtomMappingVisible, setAtomNumberingType, setAtomNumbersVisible, setAtomSetColor, setAtomsize, setAtomSymbolsVisible, setBallRadius, setBoldBondWidth, setBondLength, setBondLengthVisible, setBondSetColor, setBondSpacing, setBondWidth, setChiralitySupport, setCleanDim, setColorScheme, setDebug, setDirectory, setDispopts, setDownWedge, setEnabled, setExperimentalEnabled, setEzVisible, setFile, setFormat, setGlobalGUIProperties, setGrinv, setGrinvVisible, setImplicitH, setInvisibleSets, setLabels, setLonePairsVisible, setMarginSize, setMolbg, setMPVisible, setParams, setPopupMenusEnabled, setPrintEnabled, setRendering, setRgroupsVisible, setSaveIniEnabled, setSetColor, setSetColoringEnabled, setSgroupDataFormatted, setStickThickness, setTopLevelContainer, setUserSettings, setWireThickness, showErrorDialog, showFileDialog, showFileOpenDialog, writeMol
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, 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, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, 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, 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
-
SM_SELECT
public static final int SM_SELECTSelect mode.- Since:
- 4.0, 02/17/2004
- See Also:
-
SM_DELETE
public static final int SM_DELETEDelete mode.- Since:
- 4.0, 02/17/2004
- See Also:
-
SM_ATOM
public static final int SM_ATOMAtom mode. Additional flags must be used to specify the element type. Example:setSketchMode(MSketchPane.SM_Atom | (6 << MSketchPane.SM_FLAGS_OFF));
- Since:
- 4.0, 02/17/2004
- See Also:
-
SM_BOND
public static final int SM_BONDBond mode. Additional flags must be used to specify the bond type. Example:setSketchMode(MSketchPane.SM_BOND | (1 << MSketchPane.SM_FLAGS_OFF));
- Since:
- 4.0, 02/17/2004
- See Also:
-
SM_SELECT_LASSO
public static final int SM_SELECT_LASSOLasso select mode.- See Also:
-
SM_MASK
public static final int SM_MASKSketch mode mask.- Since:
- 4.0, 02/17/2004
- See Also:
-
SM_FLAGS_OFF
public static final int SM_FLAGS_OFFOffset of flags in sketch mode.- Since:
- 4.0, 02/17/2004
- See Also:
-
-
Constructor Details
-
MSketchPane
public MSketchPane()Constructs the sketcher.- Throws:
LicenseException
- if no valid license found
-
MSketchPane
Constructs the sketcher with the specified user settings object.- Parameters:
settings
- the user settings- Throws:
LicenseException
- if no valid license found- Since:
- Marvin 3.0
-
MSketchPane
Constructs the sketcher with the specified user settings object.- Parameters:
settings
- the user settingsloadtmpl
- load template structures and abbreviated groups immediately (true
) or not (false
)- Throws:
LicenseException
- if no valid license found- Since:
- Marvin 3.4.2
-
MSketchPane
Constructs the sketcher with the specified user settings object.- Parameters:
settings
- the user settingsloadtmpl
- load template structures and abbreviated groups immediately (true
) or not (false
)parent
- the parent Component of the MSketchPane- Throws:
LicenseException
- if no valid license found- Since:
- Marvin 5.12
-
-
Method Details
-
getCanvasComponent
Determines canvas component of MarvinSketch. This method is required to add new eventlistener to MarvinSketch. (e.g.: getCanvasComponent().addMouseListener(actionListener); This method is required for creating a custom popup menu.)- Returns:
- Canvas component of MarvinSketch.
- Since:
- Marvin 2.9.12
- See Also:
-
setAutoScale
public void setAutoScale(boolean as) Sets the autoscale property. If autoscale is true the molecule is sized to fit on the molecule panel.- Parameters:
as
- set to true to enable autoscale
-
getAutoScale
public boolean getAutoScale()Returns autoscale property.- Returns:
- true, if autoscale is enabled
-
propertyChange
Handles property change events.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classMarvinPane
- Parameters:
ev
- the event object
-
addPropertyChangeListener
Adds aPropertyChangeListener
for a specific property. The listener will be invoked only when a call onfirePropertyChange
names that specific property.If listener is
null
, no exception is thrown and no action is performed.- Overrides:
addPropertyChangeListener
in classContainer
- Parameters:
propertyName
- the name of the property to listen onlistener
- thePropertyChangeListener
to be added
-
getMol
Returns the clone of the current molecule being on the canvas. In case this molecule is changed, it will not affect the content of the canvas.- Returns:
- the molecule
-
getMol
Gets the molecule in a text format. 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 = msketch.getMol("mol"); s2 = msketch.getMol("smiles:a-H"); // aromatize and remove Hydrogens
- Parameters:
fmt
- the format descriptor string- Returns:
- the molecule in the specified format
-
setMol
Sets the molecule. Initialization is always performed.- Parameters:
m
- the molecule
-
setMol
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setMol(Molecule m, boolean init) Deprecated, for removal: This API element is subject to removal in a future version.usesetMol(Molecule)
instead of this method.Sets the molecule.- Parameters:
m
- the moleculeinit
- parameter is not used
-
setMol
Starts loading a molecule into the sketcher. The argument can be a molecule in text format, or a reference/URL to a molecule file. The file format and/or import options can be specified if the argument is in one of the following forms: "file{options}", "file{format:}", or "file{format:options}". See the text formats and their options on the File Formats in Marvin page.
Examples:
setMol(dir+fileSeparator+"foo.xyz.gz{gzip:xyz:f1.4C4}");
setMol("CCCC=O");- Parameters:
s
- molfile contents, URL or (Unix) filename
-
setMol
Starts loading a molecule into the sketcher. The first argument can be a molecule in text format, or a reference/URL to a molecule file. 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.- Parameters:
s
- molfile contents, URL or (Unix) filenameopts
- options or null- Since:
- Marvin 3.3
-
setMol
Sets the molecule. The file format and/or import options can be specified with the opts argument 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.
Example: setMol(new File(dir, "foo.xyz.gz"), "gzip:xyz:f1.4C4");- Parameters:
f
- the molecule fileopts
- import options or null
-
getDocument
Gets the document.- Returns:
- the document
- Since:
- Marvin 3.4, 06/03/2004
-
setDocument
Sets the document.- Parameters:
doc
- the document- Since:
- Marvin 3.4, 06/03/2004
-
getSelection
Gets a clone of the selection.- Returns:
- the selection
-
getObjectAtPointer
Get the object at the mouse pointer.- Returns:
- a MolAtom or MolBond object.
-
getPiece
Gets the current molecule piece in the specified format.- Parameters:
fmt
- the format- Returns:
- the piece in the specified molecule file format
- See Also:
-
setPiece
Sets the molecule piece.- Parameters:
s
- the piece in some molecule file format
-
getImage
Gets the canvas contents as an image using a scale factor.
Examples:
To get an image with a scale factor equivalent to 100% magnification:getImage(getDefaultScale());
To get an image with the actual scale factor:getImage(getScale());
- Parameters:
scale
- the absolute scale factor, seegetScale()
- Returns:
- the molecule image
- Since:
- Marvin 4.0, 07/09/2005
-
getImage
Gets the canvas contents as an image scaled to fit in the specified rectangle. The best width/height ratio can be determined using thegetBoundRectSize()
method.- Parameters:
size
- the image size- Returns:
- the molecule image
- Since:
- Marvin 4.0, 07/09/2005
-
getBoundRectSize
public double[] getBoundRectSize()Gets the size of the bounding rectangle.- Returns:
- two-element array containing the width and height in C-C bond length units
- Since:
- Marvin 4.0, 07/09/2005
- See Also:
-
getDefaultScale
public static double getDefaultScale()Returns the default scale factor which is equivalent to 100% magnification.- Returns:
- default displayed length of a C-C bond in pixels
-
getScale
public double getScale()Returns the scale factor of the current magnification. The scale factor determines the displayed size of a Carbon-Carbon single bond measured in pixels. In case the magnification is 100%, the returned scale factor equals with the value ofgetDefaultScale()
.- Returns:
- displayed length of a C-C bond in pixels
- See Also:
-
setScale
public void setScale(double m) Sets the scale factor and changes magnification of the canvas. The scale factor determines the displayed size of a Carbon-Carbon single bond measured in pixels. In case the value ofgetDefaultScale()
is set, the magnification of the canvas will be set to 100%.- Parameters:
m
- displayed length of a C-C bond in pixels- See Also:
-
getStickdst
public double getStickdst()Gets the sticking distance.- Returns:
- the stick distance in C-C bond length units
- See Also:
-
setStickdst
public void setStickdst(double d) Sets the sticking distance.- Parameters:
d
- the stick distance in C-C bond length units- See Also:
-
getMergedst
public double getMergedst()Gets the merge distance.- Returns:
- the merge distance in C-C bond length units
- See Also:
-
setMergedst
public void setMergedst(double d) Sets the merge distance.- Parameters:
d
- the merge distance in C-C bond length units- See Also:
-
getUndo
public int getUndo()Gets the maximum undo depth.- Returns:
- maximum history length
-
setUndo
public void setUndo(int u) Sets the maximum undo depth.- Parameters:
u
- maximum history length
-
getReactionSupport
public boolean getReactionSupport()Is reaction drawing supported?- Returns:
- true if supported, false otherwise
-
setReactionSupport
public void setReactionSupport(boolean v) Allows or disallows reaction drawing.- Parameters:
v
- true to allow, false to disallow
-
isReactionErrorVisible
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean isReactionErrorVisible()Deprecated, for removal: This API element is subject to removal in a future version.As of Version 5.3.2, this method is deprecated and has no replacement. It will be removed in a future version of Marvin.Are reaction errors highlighted?
- Returns:
false
- Since:
- Marvin 2.9.13
-
isValenceErrorVisible
public boolean isValenceErrorVisible()Are valence errors highlighted?- Returns:
- True, if valence errors are highlighted with underline.
- Since:
- Marvin 2.9.13
-
setValenceErrorVisible
public void setValenceErrorVisible(boolean v) Shows or hides valence errors- Parameters:
v
- True, underlines atom symbols in case valence errors.- Since:
- Marvin 2.9.13
-
isBondDraggedAlong
public boolean isBondDraggedAlong()Is the currently used bond shown at the mouse cursor?- Returns:
- true if the bond is dragged along by the mouse cursor, false otherwise
- Since:
- Marvin 3.5, 09/30/2004
-
setBondDraggedAlong
public void setBondDraggedAlong(boolean v) Sets the visibility of the currently used bond at the mouse cursor.- Parameters:
v
- true to drag along the bond by the mouse cursor, false to hide it- Since:
- Marvin 3.5, 09/30/2004
-
setSketchMode
public void setSketchMode(int mode) Sets the sketching mode.- Parameters:
mode
- the sketching mode- Since:
- Marvin 4.0
- See Also:
-
getSketchMode
public int getSketchMode()Gets the sketching mode.- Returns:
- the sketching mode or -1 for special modes
- Since:
- Marvin 4.0
- See Also:
-
getSimpView
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.5, replaced byisBondDraggedAlong()
Gets the visibility of the object in hand.- Returns:
- 0 normally, 1 if the objects in hand are invisible
-
setSimpView
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 3.5, replaced bysetBondDraggedAlong(boolean)
Hides the object in hand.- Parameters:
v
- 0 for normal behaviour, 1 to hide bond in hand
-
getMag
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 2.8.1, replaced by getScale()- Returns:
- the magnification
-
setMag
Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 2.8.1, replaced by setScale()- Parameters:
m
- the magnification
-
writeExternal
Saves object state. For internal use only! This method does not implement the Externalizable interface. It is called by thewriteExternal
method of classMSketch
, which does implement it.- Overrides:
writeExternal
in classMarvinPane
- 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 thereadExternal
method of classMSketch
, which does implement it.- Overrides:
readExternal
in classMarvinPane
- 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
-
getMrvWithSettings
Deprecated, for removal: This API element is subject to removal in a future version.usegetMol(String)
insteadGets the molecule in the sketcher with its current settings in MRV format.- Returns:
- the MRV source
- Since:
- 4.0 07/01/2005
- See Also:
-
setMrvWithSettings
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setMrvWithSettings(String mrvsource) Deprecated, for removal: This API element is subject to removal in a future version.usesetMol(String)
Sets the molecule and its display settings. Settings can be imported if the MRV source includes display infos.- Parameters:
mrvsource
- the MRV source- Since:
- 4.0 07/01/2005
- See Also:
-
isCloseEnabled
public boolean isCloseEnabled()Determines if the File->Close menu item is enabled or not.- Returns:
- True, if Close is enabled in the menu, else false.
- Since:
- 4.0 07/05/2005
- See Also:
-
setCloseEnabled
public void setCloseEnabled(boolean b) Set the accessibility of the Close menu item in the File menu.- Parameters:
b
- True to enable close operation from the file menu. False to set it to disabled.- Since:
- 4.0 07/05/2005
- See Also:
-
undo
public void undo()Invokes an undo command. -
redo
public void redo()Invokes a redo command. -
setConfirmExit
public void setConfirmExit(boolean b) Sets to drop confirmation dialog about exit or not.- Parameters:
b
- True, confirmation dialog will be appear by exit if modifications were not saved, else false.
-
isConfirmExit
public boolean isConfirmExit()Gets whether the confirmation dialog will be appear or not by exit.- Returns:
- True, confirmation dialog will be appear by exit if modifications were not saved, else false.
-
isLoadedMolModified
public boolean isLoadedMolModified()Determines whether the original molecule that is loaded in is modified or not.- Returns:
- If modified returns with true, else false.
- Since:
- 5.0.2 02/29/2008
-
doPaste
public void doPaste()Invokes Paste action.- Specified by:
doPaste
in classMarvinPane
- Since:
- Marvin 5.0
-
clearHistory
public void clearHistory()Reset undo queue.- Since:
- Marvin 4.1.11 07/06/2007
-
getCommonActions
Deprecated.Description copied from class:MarvinPane
Gets the common actions. For internal use only.- Overrides:
getCommonActions
in classMarvinPane
- Returns:
- the actions
-
centralizeMoleculeDisplay
public void centralizeMoleculeDisplay()Puts the molecule into the center of the display. -
setDisabledGroupTypes
-
getDisabledGroupTypes
-
showStartupSelector
public void showStartupSelector()This method is used in startup time to throw up a skin selector dialog. -
getMolPanel
public chemaxon.marvin.sketch.swing.SketchPanel getMolPanel()Description copied from class:MarvinPane
Returns the underlying panel. For internal use only.- Overrides:
getMolPanel
in classMarvinPane
- Returns:
- the underlying panel
-