Class MViewPane

All Implemented Interfaces:
ComponentListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible
Direct Known Subclasses:
MViewRenderer

@PublicAPI public class MViewPane extends MarvinPane
The MarvinView 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:
  • Field Details

    • VIEW_ONLY

      public static final int VIEW_ONLY
      Editing mode identifier meaning the structures cannot be edited.
      See Also:
    • EDITABLE

      public static final int EDITABLE
      Editing mode identifier meaning the structures can be edited with the Edit > Structure menu or double click and launches MarvinView in a new window.
      See Also:
    • SKETCHABLE

      public static final int SKETCHABLE
      Editing mode identifier meaning the structures can be edited with the Edit > Structure menu or double click and launches MarvinSketch in a new window.
      See Also:
  • Constructor Details

    • MViewPane

      public MViewPane()
      Constructs the viewer.
      Throws:
      LicenseException - if no valid license found
    • MViewPane

      public MViewPane(UserSettings settings)
      Constructs the viewer with the specified user settings.
      Parameters:
      settings - the user settings
      Throws:
      LicenseException - if no valid license found
      Since:
      Marvin 3.0
  • Method Details

    • getCommonActions

      @Deprecated public chemaxon.marvin.common.swing.action.CommonActions getCommonActions()
      Deprecated.
      Gets the common actions.
      Overrides:
      getCommonActions in class MarvinPane
      Returns:
      the actions
      Since:
      Marvin 5.0, 11/17/2006
    • makeSaveAsMenu

      public void makeSaveAsMenu(Container menu)
      Creates the "Save As" menu and adds it to the specified parent menu.
      Parameters:
      menu - the parent menu
      Since:
      Marvin 4.1, 03/29/2006
    • makeRecentFileListMenu

      public void makeRecentFileListMenu(Container menu)
      Read the recent file list from marvin.properties, and add it to the specified parent menu.
      Parameters:
      menu - the parent menu
      Since:
      Marvin 5.0.2
    • makeEditMenu

      public void makeEditMenu(Container menu)
      Adds menu items to the specified Edit menu.
      Parameters:
      menu - the Edit menu
    • makeViewMenu

      public void makeViewMenu(Container menu)
      Adds menu items to the specified View menu.
      Parameters:
      menu - the View menu
    • makeStructureMenu

      public void makeStructureMenu(Container menu)
    • makeToolsMenu

      Deprecated, for removal: This API element is subject to removal in a future version.
      As of Marvin 3.4, MarvinPane.addToolsMenu(java.awt.Container) should be used.
      Makes the Tools menu.
    • makeHelpMenu

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void makeHelpMenu(Container menu)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of Marvin 3.4, MarvinPane.addHelpMenu(java.awt.Container) should be used.
      Add menu items to the specified Help menu.
      Parameters:
      menu - the Help menu
    • getTableSupport

      public TableSupport getTableSupport()
      Gets an object that helps to build and use a viewer table.
      Since:
      Marvin 5.2, 02/14/2009
    • addPropertyChangeListener

      public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
      Adds a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property.

      If listener is null, no exception is thrown and no action is performed.

      For the list of used properties, please visit MarvinView: parameters and events

      Overrides:
      addPropertyChangeListener in class Container
      Parameters:
      propertyName - the name of the property to listen on
      listener - the PropertyChangeListener to be added
    • getRecordIDBackground

      public Color getRecordIDBackground(int k)
      Gets the highlight color of a record.
      Parameters:
      k - record index
      Returns:
      the color if the record is highlighted, null otherwise
      Since:
      Marvin 5.2, 02/22/2009
    • setRecordIDBackground

      public void setRecordIDBackground(int k, Color color)
      Highlights a record by setting the background of its identifier field.
      Parameters:
      k - record index
      color - the highlight color or null to restore the default color
      Since:
      Marvin 5.2, 02/22/2009
    • getRecordIDForeground

      public Color getRecordIDForeground(int k)
      Gets the foreground color of a record.
      Parameters:
      k - record index
      Returns:
      the color if the record is highlighted, null otherwise
      Since:
      Marvin 5.2.1, 04/14/2009
    • setRecordIDForeground

      public void setRecordIDForeground(int k, Color color)
      Highlights a record by setting the foreground of its identifier field.
      Parameters:
      k - record index
      color - the highlight color or null to restore the default color
      Since:
      Marvin 5.2.1, 04/14/2009
    • setSetSeq

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public boolean setSetSeq(int i, int atom, int id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of Marvin 3.3, replaced by setAtomSetSeq
      Parameters:
      i - molecule cell index
      atom - atom index
      id - a number between 0 and 63. 0 is the default set. It contains all atoms that are not in another set.
      Returns:
      true if the operation was succesful, false if there is no such molecule or atom
      Since:
      Marvin 2.9.13
    • getTopLeftIndex

      public int getTopLeftIndex()
      Gets the index of the top left cell.
      Returns:
      the top left cell index
      Since:
      Marvin 4.1.3, 11/07/2006
    • setTopLeftIndex

      public void setTopLeftIndex(int v)
      Scrolls to the specified cell.
      Parameters:
      v - top left cell index
      Since:
      Marvin 4.1.3, 11/07/2006
    • getCanvasComponent

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public JComponent getCanvasComponent(int i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of Marvin 3.0, replaced by getVisibleCellComponent
    • getVisibleCellComponent

      public JComponent getVisibleCellComponent(int i)
      Gets the canvas of the specified cell in a GridBag layout based table. This method is required to add new eventlistener to MarvinView. (E.g.: creating a custom popup menu. ) Example:
       for (int i = 0; i < viewPane.getVisibleCellCount(); i++) {
           JComponent comp = viewPane.getVisibleCellComponent(i);
           comp.addMouseListener(actionListener);
           comp.add(customPopupMenu);
       }
       

      Do not refer not visible cells and avoid using of absolute indexes, they can cause false result at scrolling. If you do not know relative index you can do this:

       int visibleIndex = viewPane.getVisibleCellIndex(absoluteIndex);
       if (visibleIndex != -1) {
           JComponent comp = viewPane.getCanvasComponent(visibleIndex);
       }
       
      Parameters:
      i - visible index of the cell. If Viewer is not a table, set index to 0.
      Returns:
      component of the cell
      Since:
      Marvin 3.0
      See Also:
    • getVisibleCellCount

      public int getVisibleCellCount()
      Gets the number of the visible cells in a GridBag layout based table.
      Returns:
      numbers of the visible cells or 0 in case of another layout
      Since:
      Marvin 3.0
    • getVisibleCellIndex

      public int getVisibleCellIndex(int absoluteIndex)
      Determines the visible cell index of a cell
      Parameters:
      absoluteIndex - absolute index of the cell
      Returns:
      relative index of the cell between visible cells or -1, if cell is not visible.
      Since:
      Marvin 3.0
    • getAbsoluteCellIndex

      public int getAbsoluteCellIndex(int visibleIndex)
      Determines the absolute cell index of a visible cell
      Parameters:
      visibleIndex - relative index of the visible cell
      Returns:
      absolute index of the cell.
      Since:
      Marvin 3.0
    • getAbsoluteCellIndex

      public int getAbsoluteCellIndex(JComponent component)
      Determines in which cell the specified component is located.
      Parameters:
      component - canvas specified component where the molecule is displayed
      Returns:
      absolute cell index of the specified component or -1, if component is not in any cell.
      Since:
      Marvin 3.0
    • getAnimated

      public String getAnimated()
      Gets index of animated cells of the table (or simple viewer).
      Returns:
      List of index of animated cells in String format (separated by ",") or empty string if no cell selected. Returns null, if animation has not been set yet.
      Since:
      Marvin 2.9.11
    • isAnimated

      public boolean isAnimated(int index) throws ArrayIndexOutOfBoundsException
      Selected cell is animated or not.
      Parameters:
      index - Cell index. (0 for simple viewer).
      Returns:
      true if cell is animated, else false.
      Throws:
      ArrayIndexOutOfBoundsException - index out of range (index < 0 || index >= number of cells)
      Since:
      Marvin 2.9.11
    • setAtomSetSeq

      public boolean setAtomSetSeq(int i, int atom, int id)
      Sets the set sequence number of the atom.
      Parameters:
      i - molecule cell index
      atom - atom index
      id - a number between 0 and 63. 0 is the default set. It contains all atoms that are not in another set.
      Returns:
      true if the operation was succesful, false if there is no such molecule or atom
      Since:
      Marvin 3.3
    • setAnimated

      public void setAnimated(boolean animated)
      Starts or stops animation in each cells of the table or in the simple viewer.
      Parameters:
      animated - True to start animation, false to stop it.
      Since:
      Marvin 2.9.11
    • setAnimated

      public void setAnimated(int index, boolean animated)
      Sets animation of a cell of the table.
      Parameters:
      index - Index of specified cell (0 for simple viewer).
      animated - True to start animation, false to stop it.
      Since:
      Marvin 2.9.11
    • getDocuments

      public MDocument[] getDocuments()
      Gets the array of documents.

      The size of the array equals to the number of the last non-empty molecule cell.

      Note that using this method is not recommended if the input is a molecule file or any kind of MDocSource, because it returns null for non-cached molecules. The thread-safe way to query molecules in such cases is by creating a record access task, see TableSupport.scheduler

      Returns:
      the array of molecules
      Since:
      Marvin 4.0, 06/30/2005
    • getDocStorage

      public MDocStorage getDocStorage()
      Gets the sparse dynamic document storage.

      Note that MDocStorage should only be used via record access tasks if the input is an MDocSource, see TableSupport.scheduler.

      Returns:
      the storage object
      Since:
      Marvin 4.1, 04/17/2006
    • getM

      public Molecule getM(int n)
      Gets the nth molecule in memory.

      Note that using this method is not recommended if the input is a molecule file or any kind of MDocSource, because it returns null for non-cached molecules. The thread-safe way to query molecules in such cases is by creating a record access task, see TableSupport.scheduler.

      Parameters:
      n - molecule cell number (0 for simple viewer)
      Returns:
      the molecule or null if the record is not in cache
    • setM

      public void setM(int n, Molecule... mols)
      Sets the nth animation or structure.
      Parameters:
      n - molecule cell number (0 for simple viewer)
      mols - the animation sequence or the structure
    • getM

      public String getM(int n, String fmt)
      Gets the nth molecule in a text format.

      For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table. The format descriptor string can also contain export options. Format and options are separated by a colon, multiple options can be separated by commas. See the text formats and their options on the File Formats in Marvin page. Examples:

       s1 = mview.getM(0, "mol");
       s2 = mview.getM(0, "smiles:a-H"); // aromatize and remove Hydrogens
       

      Note that using this method is not recommended if the input is a molecule file or any kind of MDocSource, because it returns null for non-cached molecules. The thread-safe way to query molecules in such cases is by creating a record access task, see TableSupport.scheduler.

      Parameters:
      n - molecule cell number
      fmt - the format descriptor string
      Returns:
      the molecule in the specified format
    • setM

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setM(int n, String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of Marvin 5.2.5, it is recommended to import the molecule in advance, e.g. by using MolImporter, then set the cell synchronously using setM(int, Molecule...). The reason is to simplify the public API and minimize the risk of related concurrency problems in user codes.
    • setM

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setM(int n, String s, String opts)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of Marvin 5.2.5, it is recommended to import the molecule in advance, e.g. by using MolImporter, then set the cell synchronously using setM(int, Molecule...). The reason is to simplify the public API and minimize the risk of related concurrency problems in user codes.
    • setM

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setM(int n, File f, String opts)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of Marvin 5.2.5, it is recommended to import the molecule in advance, e.g. by using MolImporter, then set the cell synchronously using setM(int, Molecule...). The reason is to simplify the public API and minimize the risk of related concurrency problems in user codes.
    • getDocument

      public MDocument getDocument(int i)
      Gets the nth document.

      Note that using this method is not recommended if the input is a molecule file or any kind of MDocSource, because it returns null for non-cached molecules. The thread-safe way to query molecules in such cases is by creating a record access task, see TableSupport.scheduler.

      Parameters:
      i - cell index
      Returns:
      the document
      Since:
      Marvin 3.4, 06/03/2004
    • setDocument

      public void setDocument(int i, MDocument doc)
      Sets the document
      Parameters:
      i - cell number (0 for simple viewer)
      doc - the document
      Since:
      Marvin 3.4, 06/03/2004
    • getL

      public String getL(int i)
      Gets a label.
      Parameters:
      i - the label index
      Returns:
      the label
    • setL

      public void setL(int i, String s)
      Sets a label in a GridBagView table.
      Parameters:
      i - the label index
      s - the label
    • getC

      public boolean getC(int i)
      Gets the state of a checkbox in a GridBagView table.
      Parameters:
      i - the checkbox index
      Returns:
      the state
    • setC

      public void setC(int i, boolean s)
      Sets the state of a checkbox in a GridBagView table.
      Parameters:
      i - the checkbox index
      s - the state
    • setActionB

      public void setActionB(int i, String s)
      Sets the action string (URL or JavaScript expression) of a button in a GridBagView table.
      Parameters:
      i - the button index
      s - action string
    • setActionC

      public void setActionC(int i, String s)
      Sets one of the two action strings (JavaScript expressions) of a checkbox in a GridBagView table.
      Parameters:
      i - two times the checkbox index plus 0 for unchecked, 1 for checked state
      s - action string
    • getT

      public String getT(int i)
      Gets a text field value in a GridBagView table.
      Parameters:
      i - text field index
      Returns:
      text
    • setT

      public void setT(int i, String s)
      Sets a text field in a GridBagView table.
      Parameters:
      i - text field index
      s - text
    • getCellCount

      public int getCellCount()
      Gets the number of molecule cells in the table. Header cells are not counted.
      Returns:
      the number of cells, or 1 if the viewer is not a table
    • getNavmode

      public String getNavmode()
      Gets the mouse drag action.
      Returns:
      "translate", "zoom", "rotZ" or "rot3d"
    • setNavmode

      public void setNavmode(String s)
      Sets the mouse drag action.
      Parameters:
      s - "translate", "zoom", "rotZ" or "rot3d"
    • getEditable

      public int getEditable()
      Returns the mode that determines if the structure is editable.
      Returns:
      VIEW_ONLY (0) if molecules can be viewed only, EDITABLE (1) if they are editable with MarvinView, SKETCHABLE (2) if they are editable with MarvinSketch.
    • setEditable

      public void setEditable(int e)
      Sets the mode that determines if the structure is editable. If the structure is allowed to be edited, the Edit > Structure menu or the double mouse click performs the editing.

      VIEW_ONLY: editing is disabled,
      EDITABLE: editing is enabled and launches MarvinView in a new window,
      SKETCHABLE: editing is enabled and launches MarvinSketch in a new window.

      Parameters:
      e - identifier of the mode
    • isSelectable

      public boolean isSelectable()
      Are the cells selectable?
      Returns:
      true if selectable, false otherwise
      See Also:
    • setSelectable

      public void setSelectable(boolean v)
      Enables the user to select a cell by clicking on it or using the cursor movement keys.
      Parameters:
      v - true to enable, false to disable cell selection
      See Also:
    • getSelectedIndex

      public int getSelectedIndex()
      Gets the index of the molecule that is selected by the user.
      Returns:
      the cell index or -1 if no molecule is selected
      See Also:
    • setSelectedIndex

      public void setSelectedIndex(int i)
      Selects a molecule.
      Parameters:
      i - the cell index or -1 to unselect
      See Also:
    • getBorderWidth

      public int getBorderWidth()
      Gets the width of the border between cells.
      Returns:
      the border width
    • setBorderWidth

      public void setBorderWidth(int w)
      Sets the width of the border between cells.
      Parameters:
      w - the border width
    • getAnimFPS

      public double getAnimFPS()
      Gets the frames per second for animations.
      Returns:
      frames per second
    • setAnimFPS

      public void setAnimFPS(double r)
      Sets the frames per second for animations.
      Parameters:
      r - frames per second
    • getAnimDelay

      public double getAnimDelay()
      Gets the repeat delay for animations.
      Returns:
      delay in seconds
    • setAnimDelay

      public void setAnimDelay(double delay)
      Sets the repeat delay for animations.
      Parameters:
      delay - seconds
    • isAnimSync

      public boolean isAnimSync()
      Gets the animation synchronization. Animations are synchronized if they start at the same time, even if repeated.
      Returns:
      true if synchronized, false otherwise
    • setAnimSync

      public void setAnimSync(boolean sync)
      Sets the animation synchronization.
      Parameters:
      sync - true to synchronize, false to omit synchronization
    • getWinScale

      public double getWinScale()
      Gets the magnification in the zoom windows.
      Returns:
      displayed length of a C-C bond in pixels
    • setWinScale

      public void setWinScale(double scale)
      Sets the magnification in the zoom windows.
      Parameters:
      scale - displayed length of a C-C bond in pixels
    • getTabScale

      public double getTabScale()
      Gets the magnification in the molecule cells.
      Returns:
      displayed length of a C-C bond in pixels, or -1 if scaling is automatic
    • getTabScale

      public double getTabScale(int i)
      Gets the magnification for a molecule cell. The scale that would be used in non-window mode is returned even if the cell is in its own window.
      Parameters:
      i - the molecule cell index
      Returns:
      displayed length of a C-C bond in pixels, or -1 if scaling is automatic
      Since:
      Marvin 2.9.2
    • setTabScale

      public void setTabScale(double scale)
      Sets the magnification in the molecule cells.
      Parameters:
      scale - displayed length of a C-C bond in pixels, or -1 for automatic scaling
    • getBestTabScale

      public double getBestTabScale(int i)
      Gets the best scale value for a molecule cell.
      Parameters:
      i - the cell index
      Returns:
      displayed length of a C-C bond in pixels
      Since:
      Marvin 2.9.2
    • getBestTabScale

      public double getBestTabScale()
      Gets the smallest best scale value in the molecule table.
      Returns:
      displayed length of a C-C bond in pixels
      Since:
      Marvin 2.9.2
    • getAutoTabScale

      public boolean getAutoTabScale()
      Is tab scale automatically changed?
      Returns:
      true if tab scale is automatically changed, false otherwise
      Since:
      Marvin 2.9.2
    • setAutoTabScale

      public void setAutoTabScale(boolean a)
      Allows or disallows automatic changing of tab scale.
      Parameters:
      a - true to allow, false to disallow
    • print

      public void print()
      Prints the molecule table.
    • getRotationMatrix

      public CTransform3D getRotationMatrix(int cellIndex)
      Gets the rotation part of the transformation matrix.
      Parameters:
      cellIndex - the molecule cell index
      Returns:
      the transformation or null if the specified cell does not exist
      Since:
      Marvin 5.2.4, 08/09/2009
    • applyRotationMatrix

      public void applyRotationMatrix(int cellIndex)
      Applies the rotation part of the viewing transformation matrix on the atom coordinates in the specified molecule cell. The transformation matrix is multiplied by the inverse of the rotation.
      Parameters:
      cellIndex - the molecule cell index
    • applyRotationMatrices

      public void applyRotationMatrices()
      Applies the rotation part of the viewing transformation matrix on the atom coordinates in all molecule cells.
    • openSketcher

      public boolean openSketcher(int index)
      Opens the sketcher window with the molecule from the specified cell if the viewer is editable.
      Parameters:
      index - the cell index
      Returns:
      True, if opening of the editor window is allowed, else false.
      Since:
      Marvin 4.1 07/20/2006
      See Also:
    • isViewWindowOpened

      public boolean isViewWindowOpened(int index)
      Checks whether the view canvas of the specified cell is detached into a separate window or not.
      Parameters:
      index - the cell index
      Returns:
      True, if it is in separate window, else false.
      Since:
      Marvin 5.1.4 12/04/2008
    • isSketchWindowOpened

      public boolean isSketchWindowOpened(int index)
      Checks whether the molecule from the specified cell is opened in a sketcher window or not.
      Parameters:
      index - the cell index
      Returns:
      True, if it is in a sketcher window, else false.
      Since:
      Marvin 5.1.4 12/04/2008
    • openWindow

      public boolean openWindow(int index)
      Detaches the view canvas of the specified cell into a separate window if the viewer is detachable.
      Parameters:
      index - the cell index
      Returns:
      True, if detaching is allowed, else false.
      Since:
      Marvin 4.1 07/20/2006
      See Also:
    • closeWindow

      public void closeWindow(int index)
      Closes the detached viewer window of the specified cell.
      Parameters:
      index - the cell index
      Since:
      Marvin 4.1 07/20/2006
    • closeSketcher

      public void closeSketcher(int index)
      Closes the sketcher window that belongs the the specified cell.
      Parameters:
      index - the cell index
      Since:
      Marvin 5.1.4 Marvin 12/04/2008
    • destroySketcher

      public void destroySketcher()
      Closes all detached sketcher windows.
      Since:
      Marvin 4.1 07/20/2006
    • isDetachable

      public boolean isDetachable()
      Gets the detachable property.
      Returns:
      true if the opening of the selected structure in a separated window is allowed. False if the opening of the window is disabled.
      See Also:
    • setDetachable

      public void setDetachable(boolean b)
      Sets the detachable property.
      Parameters:
      b - true to allow opening a new window with selected structure. False if it is not allowed.
      See Also:
    • getVisibleButtonB

      public AbstractButton getVisibleButtonB(int i)
      Gets the i-th button in the visible area of the viewer. This index differs from the absolute index if the viewer is scrollable.
      Parameters:
      i - button index
      Returns:
      the GUI component
      Since:
      Marvin 3.0
      See Also:
    • getVisibleButtonC

      public AbstractButton getVisibleButtonC(int i)
      Gets the i-th checkbox in the visible area of the viewer. This index differs from the absolute index if the viewer is scrollable.
      Parameters:
      i - checkbox index
      Returns:
      the GUI component
      Since:
      Marvin 3.0
      See Also:
    • indexOfButtonC

      public int indexOfButtonC(AbstractButton checkbox)
      Gets the index of the checkbox in the visible area of the viewer.
      Parameters:
      checkbox - a GUI component which implements a checkbox.
      Returns:
      index of the checkbox if it is in the visible area of the viewer. Returns -1 if object is not found there.
      Since:
      Marvin 3.0
      See Also:
    • indexOfButtonB

      public int indexOfButtonB(AbstractButton button)
      Gets the index of the button on the visible area of the viewer.
      Parameters:
      button - a GUI component which implements a button.
      Returns:
      index of the button if it is in the visible area of the viewer. Returns -1 if object is not found there.
      Since:
      Marvin 3.0
      See Also:
    • getFieldFont

      public Font getFieldFont(String key)
      Gets the font of a named field in a table.
      Parameters:
      key - the field name or null to get the default font
      Returns:
      the font
      Since:
      Marvin 5.0, 11/17/2007
    • setFieldFont

      public void setFieldFont(String key, Font f)
      Sets the font for a named field in a table.
      Parameters:
      key - the field name or null to set the default font
      f - the font
      Since:
      Marvin 5.0, 11/17/2007
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Saves object state. For internal use only! This method does not implement the Externalizable interface. It is called by the writeExternal method of class MView, which does implement it.
      Overrides:
      writeExternal in class MarvinPane
      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/02
    • readExternal

      public void readExternal(ObjectInput in) throws IOException
      Restores object state. For internal use only! This method does not implement the Externalizable interface. It is called by the readExternal method of class MView, which does implement it.
      Overrides:
      readExternal in class MarvinPane
      Parameters:
      in - the stream to read data from in order to restore the object
      Throws:
      IOException - if I/O errors occur
      ClassNotFoundException - If the class for an object being restored cannot be found.
      Since:
      Marvin 3.5, 2004/11/02
    • setEnabled

      public void setEnabled(boolean enabled)
      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 MarvinPane.setEnabled(boolean).
      Overrides:
      setEnabled in class MarvinPane
      Parameters:
      enabled - If true, this component is enabled; otherwise this component is disabled.
      Since:
      Marvin 4.1.6
    • isDraggable

      public boolean isDraggable()
      Determines whether mouse dragged evens are allowed or not.
      Returns:
      True to allow, false to deny.
      Since:
      Marvin 4.1.6
    • setDraggable

      public void setDraggable(boolean enabled)
      Allows or denies mouse dragged events in cells.
      Parameters:
      enabled - True to allow, false to deny.
      Since:
      Marvin 4.1.6
    • doPaste

      public void doPaste()
      Invokes Paste action.
      Specified by:
      doPaste in class MarvinPane
      Since:
      Marvin 5.0
    • isValenceErrorVisibleInView

      public boolean isValenceErrorVisibleInView()
      Are valence errors highlighted?
      Returns:
      True, if valence errors are highlighted with underline.
      Since:
      Marvin 5.0.1
    • setValenceErrorVisibleInView

      public void setValenceErrorVisibleInView(boolean v)
      Shows or hides valence errors
      Parameters:
      v - True, underlines atom symbols in case valence errors.
      Since:
      Marvin 5.0.1
    • setPreferredSize

      public void setPreferredSize(Dimension sz)
      Sets the preferred size of the component.
      Overrides:
      setPreferredSize in class JComponent
      Parameters:
      sz - the preferred size
      Since:
      Marvin 5.2, 02/15/2009
    • getPreferredSize

      public Dimension getPreferredSize()
      Gets the preferred size of the component.
      Overrides:
      getPreferredSize in class JComponent
      Returns:
      the preferred size
      Since:
      Marvin 5.2, 02/15/2009
    • componentResized

      public void componentResized(ComponentEvent event)
      Description copied from class: MarvinPane
      Does nothing.
      Specified by:
      componentResized in interface ComponentListener
      Overrides:
      componentResized in class MarvinPane
      Parameters:
      event - the event object
    • getMolPanel

      public chemaxon.marvin.view.swing.ViewPanel getMolPanel()
      Description copied from class: MarvinPane
      Returns the underlying panel.
      Overrides:
      getMolPanel in class MarvinPane
      Returns:
      the underlying panel