Class UserSettings

java.lang.Object
chemaxon.marvin.common.UserSettings
All Implemented Interfaces:
chemaxon.marvin.services.ServicesConfigURLProvider

@PublicApi public class UserSettings extends Object implements chemaxon.marvin.services.ServicesConfigURLProvider
Represents the settings of the MarvinSketch and MarvinView applications. Loads the default configuration, and the configuration properties that are stored in the configuration file that is given. The default constructor uses the marvin.properties file. The class loads files from the Chemaxon configuration directory in the home directory of the user.

This class uses different containers to store the properties, one for the default settings one for the settings that are different from the default and has to be stored between two session, they called as the persistent properties, and a temporary store for the properties that are required only for the actual session of the application.

The class gives specific getters and setters for the persistent properties but developers can use the setPersistentProperty and getPersistentProperty to define properties that has to be stored. The very default properites can be found in this file: chemaxon/marvin/common/UserSettings_defaultprops.properties The persistent properties are stored in the %USER_HOME%/chemaxon/marvin.properties or in the ~/.chemaxon/marvin.properties file, or in this directories, but the given filename, if constructing the object with a filename.

Since:
Marvin 3.0, 12/16/2002
  • Field Details

    • PROPERTY_TYPE_TRANSIENT

      public static final String PROPERTY_TYPE_TRANSIENT
      Constant to use as the type parameter of getPropertyMap(String) method to get the properties that are being stored temporary, and will not be saved to the properties file.
      Since:
      Marvin 5.4
      See Also:
    • PROPERTY_TYPE_PERSISTENT

      public static final String PROPERTY_TYPE_PERSISTENT
      Constant to use as the type parameter of getPropertyMap(String) method to get the properties set by setProperty(String, String) method or by the setter methods.
      Since:
      Marvin 5.4
      See Also:
    • PROPERTY_TYPE_DEFAULT

      public static final String PROPERTY_TYPE_DEFAULT
      Constant to use as the type parameter of getPropertyMap(String) method to get the default properties.
      Since:
      Marvin 5.4
      See Also:
    • PROPERTY_TYPE_ALL

      public static final String PROPERTY_TYPE_ALL
      Constant to use as the type parameter of getPropertyMap(String) method to get all properties that are stored.
      Since:
      Marvin 5.4
      See Also:
    • MAX_RECENT_FILE_LIST_SIZE

      public static final int MAX_RECENT_FILE_LIST_SIZE
      The maximum size of sketchRecentFileList
      Since:
      Marvin 5.4
      See Also:
    • MIN_RECENT_FILE_LIST_SIZE

      public static final int MIN_RECENT_FILE_LIST_SIZE
      The minimum size of sketchRecentFileList
      Since:
      Marvin 5.4
      See Also:
    • MARVIN_CONFIG_DEFAULT_PATH

      public static final String MARVIN_CONFIG_DEFAULT_PATH
      The default configuration file path inside the chemaxon settings directory in user home.
      Since:
      Marvin 5.4
      See Also:
  • Constructor Details

    • UserSettings

      public UserSettings()
      Construct a UserSettings object based on the default configuration, and the marvin.properties file stored in the chemaxon settings directory in the home directory of the user.
    • UserSettings

      public UserSettings(String configFileName)
      Construct a UserSettings object based on the default configuration, and the file stored in the chemaxon settings directory in the home of the user.
      Parameters:
      configFileName - the name of the config file name in the chemaxon settings directory.
      Since:
      Marvin 5.4
    • UserSettings

      public UserSettings(InputStream input)
    • UserSettings

      public UserSettings(UserSettings settings)
      Copy consturctor. Creates a new UserSettings object based on the one given as a parameter. It copies every property from the given UserSettings object one by one.
      Parameters:
      settings - the object to copy.
      Since:
      Marvin 5.4
  • Method Details

    • getPropertyMap

      public Map<String,String> getPropertyMap()
      Shortcut to getPropertyMap(UserSettings.PROPERTY_TYPE_ALL)
      Returns:
      all properties that are stored in this object as a map.
      Since:
      Marvin 5.4
    • getPropertyMap

      public Map<String,String> getPropertyMap(String type)
      Returns a map of properties from the given type.
      Parameters:
      type - the type of the properties that should be returned in the map.
      Returns:
      the map of the properties in the given type.
      See Also:
    • asProperties

      public Properties asProperties(String type)
    • save

      public void save(String comment) throws IOException
      Save the persistent properties to the config file set by the constructor.
      Parameters:
      comment - comment at the beginning of file
      Throws:
      IOException - error occurred while saving
    • save

      public void save(String fileName, String comment) throws IOException
      Save the persistent properties to the file given as the first parameter. The config file will be placed into the chemaxon settings directory in the home directory of the user.
      Parameters:
      fileName - the name of the config file.
      comment - the comment that will be place to the beginning of the saved file
      Throws:
      IOException - if the file cannot be written.
    • addOwner

      public void addOwner(PropertyChangeListener o)
      Adds an owner, that should be notified about the changes in the properties. One UserSettings object can have more owners.
      Parameters:
      o - the owner
    • removeOwner

      public void removeOwner(PropertyChangeListener o)
      Removes an owner.
      Parameters:
      o - the owner
    • getOwnerCount

      public int getOwnerCount()
      Gets the current number of owners.
      Returns:
      the number of owners of this UserSettings object
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener l)
      Add a property change listener
      Parameters:
      l - the property change listener
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener l)
      Remove a property change listener
      Parameters:
      l - the property change listener
    • getDefaultProperty

      public String getDefaultProperty(String key)
      Gets the value of the given key in the default configuration or null if the key does not exist.
      Parameters:
      key - the key of the value that has to be returned.
      Returns:
      the default value of the property or null
      Since:
      Marvin 5.4
    • getProperty

      public String getProperty(String key)
      Returns the value for the given key. If the key is not found in the persistent properties, then returns the value from the transient properties. If it did not find the key, then returns null.
      Parameters:
      key - the key of the value that has to be returned.
      Returns:
      the property value or null
      Since:
      Marvin 5.4
    • setProperty

      public void setProperty(String key, String value)
      Sets a property for the given key with the given value. Properties are stored in the config file, if the value is different from the default value.
      Parameters:
      key - the key for the property.
      value - the value of the property.
      Since:
      Marvin 5.4
    • setProperty

      public void setProperty(String key, String value, boolean isPersistent)
      Sets a property for the given key with the given value. Properties are stored in the config file, if the value is different from the default value and isPersistent is true.
      Parameters:
      key - the key for the property.
      value - the value of the property.
      isPersistent - if set to false, and persistent properties not contains the given key, then stores the value in a temporary storage, and the property will not be saved into the config file. If true, then the method does the same as the setProperty(String, String) method.
      Since:
      Marvin 5.4
    • removeAllProperty

      public void removeAllProperty()
      Removes all property that are stored in this UserSettings object. It does not hurt the default values.
    • setTerminalBondDeletionStyle

      public void setTerminalBondDeletionStyle(String style)
      Sets the bond deletion style. Meaningful values: "withAtom", "withoutAtom" If either is set, the terminal bond is being deleted with the eraser tool with or without the atom by default, and the opposite if the ALT button is pressed while clicking.
      Parameters:
      style - the default operation style
    • getTerminalBondDeletionStyle

      public String getTerminalBondDeletionStyle()
      Gets the terminal bon deletion style.
      Returns:
      the bond deletion style.
    • setAutoCheckStructure

      public void setAutoCheckStructure(boolean b)
      Turn on automatic Structure checking
      Parameters:
      b - true (on) / false (off)
    • isAutoCheckStructure

      public boolean isAutoCheckStructure()
      Tells whether the automatic structure checking is enabled or not
      Returns:
      true if enabled false otherwise.
    • getViewColorScheme

      public String getViewColorScheme()
      Gets the viewer's default color scheme.
      Returns:
      the color scheme
    • setViewColorScheme

      public void setViewColorScheme(String c)
      Sets the viewer's default color scheme.
      Parameters:
      c - the color scheme. (See the colorScheme parameter.)
    • getSketchColorScheme

      public String getSketchColorScheme()
      Gets the sketcher's default color scheme.
      Returns:
      the color scheme
    • setSketchColorScheme

      public void setSketchColorScheme(String c)
      Sets the sketcher's default color scheme.
      Parameters:
      c - the color scheme. (See the colorScheme parameter.)
    • getSketchMolbg2d

      public Color getSketchMolbg2d()
      Gets the sketcher's default 2D molecule background color.
      Returns:
      the color
      Since:
      Marvin 4.1, 01/26/2006
    • setSketchMolbg2d

      public void setSketchMolbg2d(Color c)
      Sets the sketcher's default 2D molecule background color.
      Parameters:
      c - the color
      Since:
      Marvin 4.1, 01/26/2006
    • getSketchMolbg3d

      public Color getSketchMolbg3d()
      Gets the sketcher's default 3D molecule background color.
      Returns:
      the color
      Since:
      Marvin 4.1, 01/26/2006
    • setSketchMolbg3d

      public void setSketchMolbg3d(Color c)
      Sets the sketcher's default 3D molecule background color.
      Parameters:
      c - the color
      Since:
      Marvin 4.1, 01/26/2006
    • getViewMolbg2d

      public Color getViewMolbg2d()
      Gets the viewer's default molecule background color for 2D.
      Returns:
      the color
      Since:
      Marvin 3.1.3
    • setViewMolbg2d

      public void setViewMolbg2d(Color c)
      Sets the default molecule background color for the 2D viewer.
      Parameters:
      c - the color
      Since:
      Marvin 3.1.3
    • getViewMolbg3d

      public Color getViewMolbg3d()
      Gets the viewer's default molecule background color for 3D.
      Returns:
      the color
      Since:
      Marvin 3.1.3
    • setViewMolbg3d

      public void setViewMolbg3d(Color c)
      Sets the default molecule background color for the 3D viewer.
      Parameters:
      c - the color
      Since:
      Marvin 3.1.3
    • getSketchImplicitH

      public String getSketchImplicitH()
      Gets the display method of implicit hydrogens for the sketcher.
      Returns:
      the method
    • setSketchImplicitH

      public void setSketchImplicitH(String s)
      Sets the display method of implicit hydrogens for the sketcher.
      Parameters:
      s - the method. (See the implicitH parameter.)
    • getViewImplicitH

      public String getViewImplicitH()
      Gets the display method of implicit hydrogens for the viewer.
      Returns:
      the method
    • setViewImplicitH

      public void setViewImplicitH(String s)
      Sets the display method of implicit hydrogens for the viewer.
      Parameters:
      s - the method. (See the implicitH parameter.)
    • getViewAnyBond

      public String getViewAnyBond()
      Gets the default any bond drawing style in the viewer.
      Returns:
      "auto", "dashed" or "solid"
    • setViewAnyBond

      public void setViewAnyBond(String v)
      Sets the default any bond drawing style in the viewer.
      Parameters:
      v - "auto", "dashed" or "solid"
    • getSketchAnyBond

      public String getSketchAnyBond()
      Gets the default any bond drawing style in the sketcher.
      Returns:
      "auto", "dashed" or "solid"
    • setSketchAnyBond

      public void setSketchAnyBond(String v)
      Sets the default any bond drawing style in the sketcher.
      Parameters:
      v - "auto", "dashed" or "solid"
    • getDownWedge

      public String getDownWedge()
      Gets the wedge bond display convention. Down wedge points downward in MDL's convention, upward (at the chiral center) in Daylight's.
      Returns:
      "mdl" or "daylight"
    • setDownWedge

      public void setDownWedge(String s)
      Sets the convention to use for displaying a down wedge.
      Parameters:
      s - "mdl" or "daylight"
    • getCoordinateBondStyle

      public String getCoordinateBondStyle()
      Gets the "coordinative" bond line style when both atoms are single.
      Returns:
      "solid" or "arrow"
    • setCoordinateBondStyle

      public void setCoordinateBondStyle(String s)
      Sets the "coordinative" bond line style when both atoms are single.
      Parameters:
      s - "solid" or "arrow"
    • getCoordinateBondStyleAtMulticenter

      public String getCoordinateBondStyleAtMulticenter()
      Gets the "coordinative" bond line style when one of the atoms is multicenter.
      Returns:
      "solid" or "hashed"
    • setCoordinateBondStyleAtMulticenter

      public void setCoordinateBondStyleAtMulticenter(String s)
      Sets the "coordinative" bond line style when one of the atoms is multicenter.
      Parameters:
      s - "solid" or "hashed"
    • 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
    • getCopyAsFormat

      public String getCopyAsFormat()
      Gets the selected format from the Copy As dialog.
      Returns:
      the selected format
      Since:
      5.0 10/05/2007
    • setCopyAsFormat

      public void setCopyAsFormat(String fmt)
      Sets the selected format in the Copy As dialog.
      Parameters:
      fmt - copy as format to select
      Since:
      5.0 10/05/2007
    • getDefaultSaveFormat

      public String getDefaultSaveFormat()
      Gets the default molecule format in the "Save As" dialog.
      Returns:
      the format string
      Since:
      Marvin 4.1.19 07/06/2007
    • setDefaultSaveFormat

      public void setDefaultSaveFormat(String s)
      Sets the default molecule format in the "Save As" dialog. If the user saves a structure into a new file, "mrv" is the selected output format, in default. Use this method to change it. Example: To select "MDL SDfile" in "Files of Type" combo of the save dialog, set "sdf" as default save format.
       settings.setDefaultSaveFormat("sdf");
       
      Parameters:
      s - the format
      Since:
      Marvin 4.1.19 07/06/2007
      See Also:
    • isValenceErrorVisibleInView

      public boolean isValenceErrorVisibleInView()
      Are valence errors visible in MarvinView?
      Returns:
      True, if valence errors are shown
      Since:
      Marvin 5.0.1
    • setValenceErrorVisibleInView

      public void setValenceErrorVisibleInView(boolean v)
      Show or hide valence errors in MarvinView
      Parameters:
      v - underline valence errors if true
      Since:
      Marvin 5.0.1
    • isvalidateSgroupsAtCreation

      public boolean isvalidateSgroupsAtCreation()
      Is the validation of the possible sgroups and allow only the chemically correct ones on sgroups creation and edit dialog.
      Returns:
      true if validation is on, false otherwise.
    • setvalidateSgroupsAtCreation

      public void setvalidateSgroupsAtCreation(boolean b)
      Set the validation of the possible sgroups and allow only the chemically correct ones on sgroups creation and edit dialog.
      Parameters:
      b - true means validate, false means not validate
    • isValenceErrorVisible

      public boolean isValenceErrorVisible()
      Are valence errors visible?
      Returns:
      True, if valence errors are shown
    • setValenceErrorVisible

      public void setValenceErrorVisible(boolean v)
      Show or hide valence errors
      Parameters:
      v - underline valence errors if true
    • isEZVisible

      public boolean isEZVisible()
      Are E/Z labels visible?
      Returns:
      True, if E/Z labels are shown
    • setEZVisible

      public void setEZVisible(boolean v)
      Show or hide E/Z labels
      Parameters:
      v - show E/Z labels if true
    • getChiralitySupport

      public String getChiralitySupport()
      Gets the chirality support parameter.
      Returns:
      off/selected/all
      See Also:
    • setChiralitySupport

      public void setChiralitySupport(String v)
      Sets the chirality support parameter.
      Parameters:
      v - off/selected/all
      See Also:
    • getAbsoluteLabelVisible

      public String getAbsoluteLabelVisible()
      Are Absolute labels visible?
      Returns:
      True, if Absolute labels are shown
    • setAbsoluteLabelVisible

      public void setAbsoluteLabelVisible(String v)
      Show or hide Abolute labels
      Parameters:
      v - show Absolute labels if true
    • isLonePairAutoCalc

      public boolean isLonePairAutoCalc()
      Returns the state of the automatic lone pair calculation.
      Returns:
      true if lone pairs are calculated automatically
    • setLonePairAutoCalc

      public void setLonePairAutoCalc(boolean v)
      Sets the state of the automatic lone pair calculation. In case of automatic calculation on, the visibility of lone pairs should also be set to have the results displayed properly.
      Parameters:
      v - true if lone pairs should be calculated automatically
    • getSketchRendering2d

      public String getSketchRendering2d()
      Gets the rendering style for the 2D sketcher.
      Returns:
      the style
      Since:
      Marvin 4.1, 01/26/2006
    • setSketchRendering2d

      public void setSketchRendering2d(String s)
      Sets the rendering style for the 2D sketcher.
      Parameters:
      s - the style. (See the rendering parameter.)
      Since:
      Marvin 4.1, 01/26/2006
    • getSketchRendering3d

      public String getSketchRendering3d()
      Gets the rendering style for the 3D sketcher.
      Returns:
      the style
      Since:
      Marvin 4.1, 01/26/2006
    • setSketchRendering3d

      public void setSketchRendering3d(String s)
      Sets the rendering style for the 3D sketcher.
      Parameters:
      s - the style. (See the rendering parameter.)
      Since:
      Marvin 4.1, 01/26/2006
    • getViewRendering2d

      public String getViewRendering2d()
      Gets the rendering style for the 2D viewer.
      Returns:
      the style
      Since:
      Marvin 3.1.3
    • setViewRendering2d

      public void setViewRendering2d(String s)
      Sets the rendering style for the 2D viewer.
      Parameters:
      s - the style. (See the rendering parameter.)
      Since:
      Marvin 3.1.3
    • getViewRendering3d

      public String getViewRendering3d()
      Gets the rendering style for the 3D viewer.
      Returns:
      the style
      Since:
      Marvin 3.1.3
    • setViewRendering3d

      public void setViewRendering3d(String s)
      Sets the rendering style for the 3D viewer.
      Parameters:
      s - the style. (See the rendering parameter.)
      Since:
      Marvin 3.1.3
    • getViewNavmode2d

      public String getViewNavmode2d()
      Gets the navigation mode for the 2D viewer.
      Returns:
      the navigation mode
      Since:
      Marvin 3.1.3
    • setViewNavmode2d

      public void setViewNavmode2d(String s)
      Sets the navigation mode for the 2D viewer.
      Parameters:
      s - the navigation mode. (See the navmode parameter.)
      Since:
      Marvin 3.1.3
    • getViewNavmode3d

      public String getViewNavmode3d()
      Gets the navigation mode for the 3D viewer.
      Returns:
      the navigation mode
      Since:
      Marvin 3.1.3
    • setViewNavmode3d

      public void setViewNavmode3d(String s)
      Sets the navigation mode for the 3D viewer.
      Parameters:
      s - the navigation mode. (See the navmode parameter.)
      Since:
      Marvin 3.1.3
    • getClean2dOpts

      public String getClean2dOpts()
      Gets the 2D cleaning options.
      Returns:
      the cleaning options
      Since:
      Marvin 3.1.3
    • setClean2dOpts

      public void setClean2dOpts(String s)
      Sets the 2D cleaning options.
      Parameters:
      s - the cleaning options. (See the clean2dOpts parameter.)
      Since:
      Marvin 3.1.3
    • isCleanHOptionEnabled

      public boolean isCleanHOptionEnabled()
      Returns true if the H option for cleaning is enabled.
      Returns:
      true if an explicit hydrogen atom is added to chiral centers having no terminal atoms
      Since:
      Marvin 5.1.5
    • setCleanHOptionEnabled

      public void setCleanHOptionEnabled(boolean b)
      Sets to add an explicit hydrogen atom to chiral centers having no terminal atoms when 2D cleaning is performed.
      Parameters:
      b - true to add Hydrogen atoms
      Since:
      Marvin 5.4
    • isViewAtomMarkEnabled

      public boolean isViewAtomMarkEnabled()
      Returns true if atom mark and highlight is enabled in View.
      Returns:
      true if atom mark and highlight is enabled in View.
      Since:
      Marvin 5.8
    • setViewAtomMarkEnabled

      public void setViewAtomMarkEnabled(boolean b)
      Sets atom mark and highlight visibility in Marvin View.
      Parameters:
      b - true to add Hydrogen atoms
      Since:
      Marvin 5.8
    • setCleanHOption

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setCleanHOption(boolean b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of release 5.4, replaced by setCleanHOptionEnabled(boolean)
      Sets to add an explicit hydrogen atom to chiral centers having no terminal atoms when 2D cleaning is performed.
      Parameters:
      b - true to add Hydrogen atoms
      Since:
      Marvin 5.1.5, 20/12/2008
    • getClean3dOpts

      public String getClean3dOpts()
      Gets the 3D cleaning options.
      Returns:
      the cleaning options
      Since:
      Marvin 3.1.3
    • setClean3dOpts

      public void setClean3dOpts(String s)
      Sets the 3D cleaning options.
      Parameters:
      s - the cleaning options. (See the clean2dOpts parameter.)
      Since:
      Marvin 3.1.3
    • getAromatizeMethod

      public int getAromatizeMethod()
      Gets the aromatize method.
      Returns:
      MoleculeGraph.AROM_BASIC or MoleculeGraph.AROM_GENERAL
      Since:
      Marvin 4.1, 09/01/2005
    • setAromatizeMethod

      public void setAromatizeMethod(int method)
      Sets the aromatize method.
      Parameters:
      method - MoleculeGraph.AROM_BASIC or MoleculeGraph.AROM_GENERAL
      Since:
      Marvin 4.1, 09/01/2005
    • getAtomMappingMethod

      public int getAtomMappingMethod()
      Gets the atom mapping method.
      Returns:
      MolEditor.MAPATOMS_CHANGING or MolEditor.MAPATOMS_COMPLETE or MolEditor.MAPATOMS_MATCHING
      Since:
      Marvin 5.0, 09/26/2007
    • setAtomMappingMethod

      public void setAtomMappingMethod(int method)
      Sets the atom mapping method.
      Parameters:
      method - MolEditor.MAPATOMS_CHANGING or MolEditor.MAPATOMS_COMPLETE or MolEditor.MAPATOMS_MATCHING
      Since:
      Marvin 5.0, 09/26/2007
    • getAtomNumberingType

      public int getAtomNumberingType()
      Gets the atom numbering type.
      Returns:
      0 for no numbering, 1 for atom numbers and 2 for IUPAC numbering.
    • setAtomNumberingType

      public void setAtomNumberingType(int type)
      Sets the atom numbering type.
      Parameters:
      type - 0 for no numbering, 1 for atom numbers and 2 for IUPAC numbering.
    • getAtomFont

      public Font getAtomFont()
      Gets the atom symbol font name.
      Returns:
      the font name
      Since:
      Marvin 3.4, 06/16/2004
    • setAtomFont

      public void setAtomFont(Font f)
      Sets the atom symbol font name.
      Parameters:
      f - the font name
      Since:
      Marvin 3.4, 06/16/2004
    • getAtomSize

      public double getAtomSize()
      Gets the atom size in C-C bond length units.
      Returns:
      the atom size
      Since:
      Marvin 3.4, 06/16/2004
    • setAtomSize

      public void setAtomSize(double r)
      Sets the atom size in C-C bond length units.
      Parameters:
      r - the atom size. (See the atomsize parameter.)
      Since:
      Marvin 3.4, 06/16/2004
    • getBoldBondWidth

      public double getBoldBondWidth()
      Gets the bold bond width in pt.
      Returns:
      the bond length of C-C bond length in pt units.
    • setBoldBondWidth

      public void setBoldBondWidth(double w)
      Sets the bold bond width in pt.
      Parameters:
      w - the bold bond width of C-C bond bonds in pt units.
      Since:
      Marvin 15.2.16, 2/13/2015
    • getBondLength

      public double getBondLength()
      Gets the bond length in pt.
      Returns:
      the bond length of C-C bond length in pt units.
    • setBondLength

      public void setBondLength(double w)
      Sets the bond length in pt.
      Parameters:
      w - the bond length of C-C bond bonds in pt units.
      Since:
      Marvin 4.1, 10/19/2005
    • getBondSpacing

      public double getBondSpacing()
      Gets the double bond spacing.
      Returns:
      the bond spacing in C-C bond length units.
      Since:
      Marvin 4.1, 10/19/2005
    • setBondSpacing

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

      width = w*1.54 Å = w*scale pixels

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

      public double getBondHashSpacing()
      Gets the bond hash spacing.
      Returns:
      the bond hash spacing in C-C bond length units.
      Since:
      Marvin 4.1, 10/19/2005
    • setBondHashSpacing

      public void setBondHashSpacing(double w)
      Sets the bond hash spacing.
      Parameters:
      w - the bond hash spacing in C-C bond length units.
      Since:
      Marvin 4.1, 10/19/2005
    • getFogFactor

      public int getFogFactor()
      Gets the fog factor.
      Returns:
      the fog factor in a range from MolPainterCommon.NO_FOG to MolPainterCommon.STRONG_FOG.
    • setFogFactor

      public void setFogFactor(int w)
      Sets the fog factor.
      Parameters:
      w - the fog factor in a range from MolPainterCommon.NO_FOG to MolPainterCommon.STRONG_FOG.
    • isAutomaticFogEnabled

      public boolean isAutomaticFogEnabled()
      Gets the state of automatic fog calculation mode.
      Returns:
      true if the fog is automatically calculated, false if the custom fog is applied.
    • isAutomaticReactionEnabled

      public boolean isAutomaticReactionEnabled()
      Gets the state of automatic reaction calculation mode.
      Returns:
      true if the reactions are automatically calculated, false otherwise.
    • setAutomaticFogEnabled

      public void setAutomaticFogEnabled(boolean enable)
      Sets the fog to automatic calculation mode.
      Parameters:
      enable - True to enable automatic fog calculation. False to enable custom fog and disable automatic fog calculation.
    • setAutomaticReactionEnabled

      public void setAutomaticReactionEnabled(boolean enable)
      Sets the calculation of reaction plus signs to automatic.
      Parameters:
      enable - True to enable automatic fog calculation. False to enable custom fog and disable automatic fog calculation.
    • setPeptideDisplayType

      public void setPeptideDisplayType(String type)
      Sets the peptide displaying tpye. Valid values are "1-letter" and "3-letter"
      Parameters:
      type - the peptide display type
    • getPeptideDisplayType

      public String getPeptideDisplayType()
      Gets the current peptide display type
      Returns:
      the peptide display type
    • getWireThickness

      public double getWireThickness()
      Gets the bond thickness in wireframe mode.
      Returns:
      the bond thickness
      Since:
      Marvin 3.4, 06/16/2004
    • setWireThickness

      public void setWireThickness(double d)
      Sets the bond thickness in wireframe mode.
      Parameters:
      d - the bond thickness
      Since:
      Marvin 3.4, 06/16/2004
    • getStickThickness

      public double getStickThickness()
      Gets the stick diameter for ball and stick mode.
      Returns:
      the stick thickness
      Since:
      Marvin 3.4, 06/16/2004
    • setStickThickness

      public void setStickThickness(double d)
      Sets the stick diameter for ball and stick mode.
      Parameters:
      d - the stick thickness
      Since:
      Marvin 3.4, 06/16/2004
    • getBallRadius

      public double getBallRadius()
      Gets the ball radius for ball and stick mode.
      Returns:
      the ball radius
      Since:
      Marvin 3.4, 06/16/2004
    • setBallRadius

      public void setBallRadius(double r)
      Sets the ball radius for ball and stick mode.
      Parameters:
      r - the ball radius
      Since:
      Marvin 3.4, 06/16/2004
    • getSketchArrowHeadLength

      public double getSketchArrowHeadLength()
      Gets the current arrow head length.
      Returns:
      the arrow head length
      Since:
      Marvin 3.5, 07/01/2004
    • setSketchArrowHeadLength

      public void setSketchArrowHeadLength(double d)
      Sets the arrow head length.
      Parameters:
      d - the arrow head length
      Since:
      Marvin 3.5, 07/01/2004
    • getSketchArrowHeadWidth

      public double getSketchArrowHeadWidth()
      Gets the current arrow head width.
      Returns:
      the arrow head width
      Since:
      Marvin 3.5, 07/01/2004
    • setSketchArrowHeadWidth

      public void setSketchArrowHeadWidth(double d)
      Sets the arrow head width.
      Parameters:
      d - the arrow head width
      Since:
      Marvin 3.5, 07/01/2004
    • getSketchArrowTailLength

      public double getSketchArrowTailLength()
      Gets the current arrow tail length.
      Returns:
      the arrow tail length
      Since:
      Marvin 3.5, 07/01/2004
    • setSketchArrowTailLength

      public void setSketchArrowTailLength(double d)
      Sets the arrow tail length.
      Parameters:
      d - the arrow tail length
      Since:
      Marvin 3.5, 07/01/2004
    • getSketchArrowTailWidth

      public double getSketchArrowTailWidth()
      Gets the current arrow tail width.
      Returns:
      the arrow tail width
      Since:
      Marvin 3.5, 07/01/2004
    • setSketchArrowTailWidth

      public void setSketchArrowTailWidth(double d)
      Sets the arrow tail width.
      Parameters:
      d - the arrow tail width
      Since:
      Marvin 3.5, 07/01/2004
    • getViewRecentFileList

      public List<String> getViewRecentFileList()
      Gets the recent files' list in MarvinView, the last item is the most recent. The list has a maximum of getViewRecentFileListSize() element.
      Returns:
      List recentFiles - List of recently used files' path
      Since:
      Marvin 5.0.1
    • addToViewRecentFileList

      public void addToViewRecentFileList(File f)
      Add an element to marvinview's recent file list
      Parameters:
      f - the File which has to be added to the List
      Since:
      Marvin 5.0.1
    • getViewRecentFileListSize

      public int getViewRecentFileListSize()
      Gets the recent file list requested size, based on a preferences setting
      Returns:
      the recent file list size.
      Since:
      Marvin 5.1
    • setViewRecentFileListSize

      public void setViewRecentFileListSize(int size)
      Sets the recent file list requested size, if it is smaller than zero, then the size will be zero, if it is more than 10 then the size will be 10.
      Parameters:
      size - the requested size.
      Since:
      Marvin 5.1
    • removeViewRecentFile

      public void removeViewRecentFile(File f)
      Remove a file from marvinview's recent file list
      Parameters:
      f - the File which has to remove from the list
    • getSketchRecentFileList

      public List<String> getSketchRecentFileList()
      Gets the recent files' list at marvinsketch, the last item is the most recent. The list has a maximum of SKETCH_RECENT_FILE_LIST_SIZE element.
      Returns:
      List recentFiles - List of recently used files' paths'
      Since:
      Marvin 5.0.1
    • addToSketchRecentFileList

      public void addToSketchRecentFileList(File f)
      Add an element to marvinsketch's recent file list
      Parameters:
      f - the File which has to be added to the List
      Since:
      Marvin 5.0.1
    • removeSketchRecentFile

      public void removeSketchRecentFile(File f)
      Remove a file from marvinsketch's recent file list
      Parameters:
      f - the File which has to remove from the list
    • getSketchRecentFileListSize

      public int getSketchRecentFileListSize()
      Gets the recent file list requested size, based on a preferences setting
      Returns:
      the recent file list size.
      Since:
      Marvin 5.1
    • setSketchRecentFileListSize

      public void setSketchRecentFileListSize(int size)
      Sets the recent file list requested size, if it is smaller than zero, then the size will be zero, if it is more than MAX_RECENT_FILE_LIST_SIZE then the size will be the value of MAX_RECENT_FILE_LIST_SIZE
      Parameters:
      size - the requested size.
      Since:
      Marvin 5.1
    • getLoadSaveLocation

      public String getLoadSaveLocation()
      Gets the load/save filechooser working directory selection method names, based on the preferences dialog. This method names: saveLastLocation, saveStartupLocation, and saveCustomLocation. If the $HOME/[.]chemaxon/marvin.properties contains other value, the function will defaults to saveLastLocation.
      Returns:
      the setting for load and save location based on preferences.
    • setLoadSaveLocation

      public void setLoadSaveLocation(String s)
      Sets the load/save filechooser working directory selection method names, based on the preferences dialog. This method names: saveLastLocation, saveStartupLocation, and saveCustomLocation. If the String parameter is null then the setting will be deleted from userprops
      Parameters:
      s - the selection method name (case sensitive).
    • getLoadWorkingDir

      public File getLoadWorkingDir()
      Gets the filechooser's default working directory, if it is set, and the filechooser working directory selection method is saveCustomLocation. Otherwise return null.
      Returns:
      null, or the default filechooser working directory set on the preferences dialog.
    • setLoadWorkingDir

      public void setLoadWorkingDir(String s)
      Sets the filechooser's default working directory, if the filechooser working directory selection method is saveCustomLocation. Does nothing otherwise If the parameter is null, then the setting will deleted from userprops.
      Parameters:
      s - the path of the directory which has to been set.
    • 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
    • getViewLoadWorkingDir

      public File getViewLoadWorkingDir()
      Based on the preferences this funtion returns the proper working directory for the MarvinView application's load filechooser.
      • If set on the preferences panel the startup directory, then returns the value in the user.dir system property or null if it can't be reached.
      • If set on the preferences panel the last used directory, then returns the value of the last used directory for loading, and it remembers the earlier runnings. If in the $HOME/[.]chemaxon/marvin.properties there is nothing about the last used directory, then returns the user.home system property, or null if it can't be reached.
      • If set on the preferences panel the custom directory, then returns the value which is set on the preferences panel. Or if only the custom directroy using is set, but no directory for use the function returns null
      Returns:
      the working directory for the load filechooser in MarvinView application
      Since:
      Marvin 5.0.1
    • setViewLoadWorkingDir

      public void setViewLoadWorkingDir(String s)
      Sets the load working directory for MarvinView load filechooser. This value is stored in $HOME/[.]chemaxon/marvin.properties file The value is taking effect when on the preferences the user set either the last directory or the startup directory usage for loading. If the String parameter is null then the setting will be deleted from userprops
      Parameters:
      s - the absolute path of the directory.
      Since:
      Marvin 5.0.1
    • getViewSaveWorkingDir

      public File getViewSaveWorkingDir()
      Not implemented yet, don't use it.
      Since:
      Marvin 5.0.1
    • setViewSaveWorkingDir

      public void setViewSaveWorkingDir(String s)
      Not implemented, don't use it.
      Parameters:
      s - the absolut path of the directory.
      Since:
      Marvin 5.0.1
    • getSketchLoadWorkingDir

      public File getSketchLoadWorkingDir()
      Based on the preferences this funtion returns the proper working directory for the MarvinSketch application's load filechooser.
      • If set on the preferences panel the startup directory, then returns the value in the user.dir system property or null if it can't be reached.
      • If set on the preferences panel the last used directory, then returns the value of the last used directory for loading, and it remembers the earlier runnings. If in the $HOME/[.]chemaxon/marvin.properties there is nothing about the last used directory, then returns the user.home system property, or null if it can't be reached.
      • If set on the preferences panel the custom directory, then returns the value which is set on the preferences panel. Or if only the custom directroy using is set, but no directory for use the function returns null
      Returns:
      the working directory for the load filechooser in MarvinSketch application
      Since:
      Marvin 5.0.1
    • setSketchLoadWorkingDir

      public void setSketchLoadWorkingDir(String s)
      Sets the load working directory for MarvinSketch load filechooser. This value is stored in $HOME/[.]chemaxon/marvin.properties file The value is taking effect when on the preferences the user set either the last directory or the startup directory usage for loading. If the String parameter is null then the setting will be deleted from userprops
      Parameters:
      s - the absolute path of the directory.
      Since:
      Marvin 5.0.1
    • getSketchSaveWorkingDir

      public File getSketchSaveWorkingDir()
      Not implemented yet don't use it.
      Since:
      Marvin 5.0.1
    • setSketchSaveWorkingDir

      public void setSketchSaveWorkingDir(String s)
      Not implemented yet, don't use it.
      Parameters:
      s - the absolut path of the directory.
      Since:
      Marvin 5.0.1
    • setSaveLoadZoomFactorToMRV

      public void setSaveLoadZoomFactorToMRV(boolean b)
      Tells wether to save the zoom factor information to mrv files or not.
      Parameters:
      b - if true, marvin will save the zoom factor.
    • getSaveLoadZoomFactorToMRV

      public boolean getSaveLoadZoomFactorToMRV()
      Tells if marvin save the zoom factor to mrv or not.
      Returns:
      true if the zoom factor saving is on.
    • setSaveGUIPropertiesInMRV

      public void setSaveGUIPropertiesInMRV(boolean flag)
      Sets whether the GUI properties should be saved when saving as a Marvin file
      Parameters:
      flag - if true, many GUI properties will be saved within the <Marvin ...> tag
      Since:
      Marvin 5.0
    • getSaveGUIPropertiesInMRV

      public boolean getSaveGUIPropertiesInMRV()
      Returns:
      true if we want to save GUI properties in the Marvin file
      Since:
      Marvin 5.0
    • getViewCarbonVisibility

      public String getViewCarbonVisibility()
      Gets the default carbon displaying style in the viewer.
      Returns:
      the style
    • setViewCarbonVisibility

      public void setViewCarbonVisibility(String v)
      Sets the default carbon visibility style in the viewer.
      Parameters:
      v - the style
    • getViewLigandOrderVisibility

      public String getViewLigandOrderVisibility()
      Gets the default ligand order displaying style in the viewer.
      Returns:
      the style
    • setViewLigandOrderVisibility

      public void setViewLigandOrderVisibility(String v)
      Sets the default ligand order visibility style in the viewer.
      Parameters:
      v - the style
    • getSketchCarbonVisibility

      public String getSketchCarbonVisibility()
      Gets the default carbon displaying style in the sketcher.
      Returns:
      the style
    • setSketchCarbonVisibility

      public void setSketchCarbonVisibility(String v)
      Sets the default carbon visibility style in the sketcher.
      Parameters:
      v - the style
    • getSketchLigandOrderVisibility

      public String getSketchLigandOrderVisibility()
      Gets the default ligand order displaying style in the sketcher.
      Returns:
      the style
    • setSketchLigandOrderVisibility

      public void setSketchLigandOrderVisibility(String v)
      Sets the default ligand order visibility style in the sketcher.
      Parameters:
      v - the style
    • isTransformationEnabled

      public boolean isTransformationEnabled()
      Gets the transformation enabled/disabled.
      Returns:
      true if on
    • setTransformationEnabled

      public void setTransformationEnabled(boolean v)
      Enable/disable transformation
      Parameters:
      v - enabled if true
    • getViewLayout

      public int getViewLayout()
      Gets the table layout of the Viewer.
      Returns:
      the MarvinView layout identifier.
    • setViewLayout

      public void setViewLayout(int v)
      Set the layout of MarvinView. If invalid value passed, TableOptions.VH_AUTO will be used.
      Parameters:
      v - the layout id
      See Also:
    • getRLogicVisible

      public String getRLogicVisible()
      Tells whether the R-logic is visible if exists
      Returns:
      on/off
    • setRLogicVisible

      public void setRLogicVisible(String v)
      Sets R-logic visibility
      Parameters:
      v - (visible)/off(invisible)
    • isAtomPropertiesVisible

      public boolean isAtomPropertiesVisible()
      Tells wheter the atom properties are visible or not if exist.
      Returns:
      true/false
    • setAtomPropertiesVisible

      public void setAtomPropertiesVisible(boolean v)
      Sets atom properties visibility.
      Parameters:
      v - true(visible)/false(invisible)
    • getCheckerConfigFileName

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public String getCheckerConfigFileName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getCheckerConfigURL() instead. Deprecated in 5.12.
      Returns:
      the name of the configuration file for StructureChecker in marvin Sketch
      Since:
      5.4
    • setCheckerConfigFileName

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setCheckerConfigFileName(String checkerConfigFileName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setCheckerConfigURL(String) instead. Deprecated in 5.12 Sets the name of the configuration file for StructureChecker in marvin sketch
      Parameters:
      checkerConfigFileName - the name of the configuration file
      Since:
      5.4
    • getServicesConfigURL

      public String getServicesConfigURL()
      Returns the URL of configuration for Services in marvin sketch
      Specified by:
      getServicesConfigURL in interface chemaxon.marvin.services.ServicesConfigURLProvider
      Returns:
      the URL of configuration for Services in marvin sketch
      Since:
      5.6
    • setServicesConfigURL

      public void setServicesConfigURL(String servicesConfigURL)
      Sets the URL of the configuration for Services in marvin
      Parameters:
      servicesConfigURL - the configuration URL
      Since:
      5.6
    • getCheckerConfigURL

      public String getCheckerConfigURL()
      Returns the URL of configuration for Checkers in marvin sketch.
      Returns:
      the URL of configuration for Checkers in marvin sketch
      Since:
      5.12
    • setCheckerConfigURL

      public void setCheckerConfigURL(String checkerConfigURL)
      Sets the URL of the configuration for Checkers in marvin sketch.
      Parameters:
      checkerConfigURL - the configuration URL
      Since:
      5.12
    • getExternalCheckerConfigURL

      public String getExternalCheckerConfigURL()
      Returns the URL of the configuration file containing the list of external Checkers in marvin sketch.
      Returns:
      the URL of the configuration file containing the list of external Checkers in marvin sketch.
      Since:
      6.1
    • setExternalCheckerConfigURL

      public void setExternalCheckerConfigURL(String checkerConfigURL)
      Sets the URL of the configuration file containing the list of external Checkers in marvin sketch.
      Parameters:
      checkerConfigURL - the URL of the configuration file containing the list of external Checkers in marvin sketch.
      Since:
      6.1
    • isValencePropertyVisible

      public boolean isValencePropertyVisible()
      Tells wheter the atom valence property is visible or not.
      Returns:
      true/false
    • setValencePropertyVisible

      public void setValencePropertyVisible(boolean v)
      Sets atom valence property visibility.
      Parameters:
      v - true(visible)/false(invisible)
    • isLigandErrorVisible

      public boolean isLigandErrorVisible()
      Tells wheter the bond's ligand error is visible or not.
      Returns:
      true/false
    • setLigandErrorVisible

      public void setLigandErrorVisible(boolean v)
      Show or hide ligand errors
      Parameters:
      v - show ligand errors by coloring to red if true
    • setShowMultiMoleculeOnEditSource

      public void setShowMultiMoleculeOnEditSource(boolean show)
    • isShowMultiMoleculeOnEditSource

      public boolean isShowMultiMoleculeOnEditSource()
    • getImageImportServiceURL

      public String getImageImportServiceURL()
    • setImageImportServiceURL

      public void setImageImportServiceURL(String url)
    • getNameIOServiceURL

      public String getNameIOServiceURL()
    • setNameIOServiceURL

      public void setNameIOServiceURL(String url)
    • getPageFormat

      public PageFormat getPageFormat(String s)
      Gets the specified PageFormat
      Parameters:
      s - panelType (sketch / view)
      Returns:
      the loaded PageFormat
    • setPageFormat

      public void setPageFormat(PageFormat pageFormat, String s)
      Parameters:
      s - panelType (sketch / view)
    • isDisplayLonePairsAsLine

      public boolean isDisplayLonePairsAsLine()
    • setDisplayLonePairsAsLine

      public void setDisplayLonePairsAsLine(boolean value)
    • isDisplayChargeWithCircle

      public boolean isDisplayChargeWithCircle()
    • setDisplayChargeWithCircle

      public void setDisplayChargeWithCircle(boolean value)
    • setDocumentStyleName

      public void setDocumentStyleName(String name)
    • setDocumentStyleName

      public void setDocumentStyleName(String name, boolean valuesAlreadySet)
    • getDocumentStyleName

      public String getDocumentStyleName()
    • isAminoAcidBondColoringEnabled

      public boolean isAminoAcidBondColoringEnabled()
      Gets wether the user uses peptide bridge coloring or not.
      Returns:
      true, if user uses peptide bridge coloring.
    • setAminoAcidBondColoringEnabled

      public void setAminoAcidBondColoringEnabled(boolean b)
      Sets wether the user uses peptide bridge coloring or not.
      Parameters:
      b - if false, than we won't use peptide bridge coloring.
    • isAdvancedSave

      public boolean isAdvancedSave()
      Gets wether the useres uses advanced save or not.
      Returns:
      true, if user uses advanced save options.
    • setAdvancedSave

      public void setAdvancedSave(boolean advanced)
      Sets wether the user prefers advanced svae or not.
      Parameters:
      advanced - if false, than we won't use advanced save.
    • isStartupSelectorShown

      public boolean isStartupSelectorShown()
    • setStartupSelectorShown

      public void setStartupSelectorShown(boolean shown)
    • isZoomToScaffoldOnLoad

      public boolean isZoomToScaffoldOnLoad()
    • setZoomToScaffoldOnLoad

      public void setZoomToScaffoldOnLoad(boolean zoomToScaffoldOnLoad)
    • isMPVisible

      public boolean isMPVisible()
    • setMPVisible

      public void setMPVisible(boolean b)
    • getLastSketchFrameSize

      public Dimension getLastSketchFrameSize()
    • setLastSketchFrameSize

      public void setLastSketchFrameSize(Dimension d)
    • getAnalysisBoxTerms

      public String getAnalysisBoxTerms()
    • setAnalysisBoxTerms

      public void setAnalysisBoxTerms(String terms)
    • needsAnalysisBoxWarning

      public boolean needsAnalysisBoxWarning()
    • setAnalysisBoxWarning

      public void setAnalysisBoxWarning()
    • setAllowExperimentalFeatures

      public void setAllowExperimentalFeatures(boolean b)
    • isExperimentalFeaturesAreAllowed

      public boolean isExperimentalFeaturesAreAllowed()
    • setSaveBOM

      public void setSaveBOM(boolean b)
    • isSaveBOM

      public boolean isSaveBOM()
    • getLastViewFrameSize

      public Dimension getLastViewFrameSize()
    • setLastViewFrameSize

      public void setLastViewFrameSize(Dimension d)
    • isGridVisible

      public boolean isGridVisible()
    • setGridVisible

      public void setGridVisible(boolean gridVisible)
    • getDataCollectionConsent

      public Consent getDataCollectionConsent()
    • getOrCreateUUID

      public String getOrCreateUUID()
    • setDataCollectionConsent

      public void setDataCollectionConsent(Consent consent)
    • getLastLicense

      public chemaxon.marvin.collecting.LastLicense getLastLicense()
      For internal use only.
    • setLastLicense

      public void setLastLicense(chemaxon.marvin.collecting.LastLicense lastLicense)
      For internal use only.
    • getDataCollectionServer

      public String getDataCollectionServer()