chemaxon.marvin.common
Class UserSettings

java.lang.Object
  extended by chemaxon.marvin.common.UserSettings

public class UserSettings
extends java.lang.Object

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
Version:
Marvin 5.4 08/17/2010
Author:
Istvan Fajth

Field Summary
static java.lang.String CLEAN_H_OPTION
          Deprecated. defaults have been moved to configuration file.
static boolean DEFAULT_BOND_IN_HAND
          Deprecated. defaults have been moved to configuration file. if you need the default value use
static boolean DEFAULT_LONE_PAIR_AUTOCALC
          Deprecated. defaults have been moved to configuration file.
static double DEFAULT_SKETCH_ARROW_HEAD_LENGTH
          Deprecated. use MPolyline.DEFAULT_ARROW_HEAD_LENGTH instead.
static double DEFAULT_SKETCH_ARROW_HEAD_WIDTH
          Deprecated. use MPolyline.DEFAULT_ARROW_HEAD_WIDTH instead.
static int DEFAULT_SKETCH_RECENT_FILE_LIST_SIZE
          Deprecated. defaults have been moved to configuration file.
static int DEFAULT_VIEW_RECENT_FILE_LIST_SIZE
          Deprecated. defaults have been moved to configuration file.
static java.lang.String MARVIN_CONFIG_DEFAULT_PATH
          The default configuration file path inside the chemaxon settings directory in user home.
static int MAX_RECENT_FILE_LIST_SIZE
          The maximum size of sketchRecentFileList
static int MAX_SKETCH_RECENT_FILE_LIST_SIZE
          Deprecated. defaults have been moved to configuration file.
static int MAX_VIEW_RECENT_FILE_LIST_SIZE
          Deprecated. defaults have been moved to configuration file.
static int MIN_RECENT_FILE_LIST_SIZE
          The minimum size of sketchRecentFileList
static int MIN_SKETCH_RECENT_FILE_LIST_SIZE
          Deprecated. defaults have been moved to configuration file.
static int MIN_VIEW_RECENT_FILE_LIST_SIZE
          Deprecated. defaults have been moved to configuration file.
static int MYTEMPLATES_GROUP_INDEX
          Deprecated. use TemplateHandler.MYTEMPLATES_GROUP_INDEX instead.
static java.lang.String PROPERTY_TYPE_ALL
          Constant to use as the type parameter of getPropertyMap(String) method to get all properties that are stored.
static java.lang.String PROPERTY_TYPE_DEFAULT
          Constant to use as the type parameter of getPropertyMap(String) method to get the default properties.
static java.lang.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.
static java.lang.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.
 
Constructor Summary
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(java.io.InputStream input)
           
UserSettings(java.lang.String configFileName)
          Construct a UserSettings object based on the defaul configuration, and the file stored in the chemaxon settings directory in the home of the user.
UserSettings(UserSettings settings)
          Copy consturctor.
 
Method Summary
 void addOwner(java.beans.PropertyChangeListener o)
          Adds an owner, that should be notified about the changes in the properties.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a property change listener
 void addTo(java.util.Properties p)
          Deprecated. since 5.4. use p.putAll with the persistent properties
 void addToSketchRecentFileList(java.io.File f)
          Add an element to marvinsketch's recent file list
 void addToViewRecentFileList(java.io.File f)
          Add an element to marvinview's recent file list
 void addWithLCKeysTo(java.util.Properties p)
          Deprecated. since 5.4 no replacements.
 boolean checkBeforeSave(java.util.Properties p, java.util.Vector<java.lang.String> changed)
          Deprecated. since 5.4 use the isEmpty method of getPropertiesDescriptionChangedByOtherApp() method to retreive the return value of this method. If you really need it.
 java.lang.String get(java.lang.String key)
          Deprecated. since 5.4 use getProperty(String) instead.
 java.lang.String getAbsoluteLabelVisible()
          Are Absolute labels visible?
 int getAromatizeMethod()
          Gets the aromatize method.
 java.awt.Font getAtomFont()
          Gets the atom symbol font name.
 int getAtomMappingMethod()
          Gets the atom mapping method.
 double getAtomSize()
          Gets the atom size in C-C bond length units.
 double getBallRadius()
          Gets the ball radius for ball and stick mode.
 double getBondSpacing()
          Gets the double bond spacing.
 java.lang.String getCheckerConfigFileName()
           
 java.lang.String getChiralitySupport()
          Gets the chirality support parameter.
 java.lang.String getClean2dOpts()
          Gets the 2D cleaning options.
 java.lang.String getClean3dOpts()
          Gets the 3D cleaning options.
 java.lang.String getCoordinateBondStyle()
          Gets the "coordinative" bond line style when both atoms are single.
 java.lang.String getCoordinateBondStyleAtMulticenter()
          Gets the "coordinative" bond line style when one of the atoms is multicenter.
 java.lang.String getCopyAsFormat()
          Gets the selected format from the Copy As dialog.
static java.lang.String getDefaultMyTemplatesValue()
          Deprecated. since 5.4 use TemplateHandler.DEFAULT_MY_TEMPLATES_VALUE instead.
 java.lang.String getDefaultProperty(java.lang.String key)
          Gets the value of the given key in the default configuration or null if the key does not exist.
 java.lang.String getDefaultSaveFormat()
          Gets the default molecule format in the "Save As" dialog.
static java.lang.String getDescription(java.lang.String key, java.lang.String val)
          Gets the human readable description of a property.
 java.lang.String getDownWedge()
          Gets the wedge bond display convention.
 int getFogFactor()
          Gets the fog factor.
 java.lang.String getImageImportServiceURL()
           
 java.lang.String getLoadSaveLocation()
          Gets the load/save filechooser working directory selection method names, based on the preferences dialog.
 java.io.File getLoadWorkingDir()
          Gets the filechooser's default working directory, if it is set, and the filechooser working directory selection method is saveCustomLocation.
static java.lang.String getMyTemplatesKey()
          Deprecated. since 5.4 use TemplateHandler.MYTEMPLATES_KEY instead.
 java.lang.String getMyTemplatesValue()
          Deprecated. since 5.4
static java.lang.String getMyTemplatesValue(java.util.Properties props)
          Deprecated. since 5.4 no replacements
 int getOwnerCount()
          Gets the current number of owners.
 java.awt.print.PageFormat getPageFormat(java.lang.String s)
          Gets the specified PageFormat
 java.lang.String getPeptideDisplayType()
          Gets the current peptide display type
 java.util.Vector<java.lang.String> getPropertiesDescriptionChangedByOtherApp()
          The method collects the changes in the config file, if its timestamp was changed.
 java.lang.String getProperty(java.lang.String key)
          Returns the value for the given key.
 java.util.Map<java.lang.String,java.lang.String> getPropertyMap()
          Shortcut to getPropertyMap(UserSettings.PROPERTY_TYPE_ALL)
 java.util.Map<java.lang.String,java.lang.String> getPropertyMap(java.lang.String type)
          Returns a map of properties from the given type.
 boolean getReadGUIPropertiesFromMRV()
          Deprecated. As of release 5.1, replaced by getSaveGUIPropertiesInMRV(). It will be removed in a future version of Marvin.
 java.lang.String getRLogicVisible()
          Tells whether the R-logic is visible if exists
 boolean getSaveGUIPropertiesInMRV()
           
 boolean getSaveLoadZoomFactorToMRV()
          Tells if marvin save the zoom factor to mrv or not.
 java.lang.String getServicesConfigURL()
          Returns the URL of configuration for Services in marvin sketch
 java.lang.String getSketchAnyBond()
          Gets the default any bond drawing style in the sketcher.
 double getSketchArrowHeadLength()
          Gets the current arrow head length.
 double getSketchArrowHeadWidth()
          Gets the current arrow head width.
 double getSketchArrowTailLength()
          Gets the current arrow tail length.
 double getSketchArrowTailWidth()
          Gets the current arrow tail width.
 java.lang.String getSketchCarbonVisibility()
          Gets the default carbon displaying style in the sketcher.
 java.lang.String getSketchColorScheme()
          Gets the sketcher's default color scheme.
 java.lang.String getSketchImplicitH()
          Gets the display method of implicit hydrogens for the sketcher.
 java.lang.String getSketchLigandOrderVisibility()
          Gets the default ligand order displaying style in the sketcher.
 java.io.File getSketchLoadWorkingDir()
          Based on the preferences this funtion returns the proper working directory for the MarvinSketch application's load filechooser.
 java.awt.Color getSketchMolbg2d()
          Gets the sketcher's default 2D molecule background color.
 java.awt.Color getSketchMolbg3d()
          Gets the sketcher's default 3D molecule background color.
 java.util.List<java.lang.String> getSketchRecentFileList()
          Gets the recent files' list at marvinsketch, the last item is the most recent.
 int getSketchRecentFileListSize()
          Gets the recent file list requested size, based on a preferences setting
 java.lang.String getSketchRendering2d()
          Gets the rendering style for the 2D sketcher.
 java.lang.String getSketchRendering3d()
          Gets the rendering style for the 3D sketcher.
 java.io.File getSketchSaveWorkingDir()
          Not implemented yet don't use it.
 double getStickThickness()
          Gets the stick diameter for ball and stick mode.
 java.lang.String getTerminalBondDeletionStyle()
          Gets the terminal bon deletion style.
 java.lang.String getViewAnyBond()
          Gets the default any bond drawing style in the viewer.
 java.lang.String getViewCarbonVisibility()
          Gets the default carbon displaying style in the viewer.
 java.lang.String getViewColorScheme()
          Gets the viewer's default color scheme.
 boolean getViewExplicitH()
          Deprecated. As of release 5.3, this method is deprecated and has no replacement. It will be removed in a future version of Marvin.
 java.lang.String getViewImplicitH()
          Gets the display method of implicit hydrogens for the viewer.
 int getViewLayout()
          Gets the table layout of the Viewer.
 java.lang.String getViewLigandOrderVisibility()
          Gets the default ligand order displaying style in the viewer.
 java.io.File getViewLoadWorkingDir()
          Based on the preferences this funtion returns the proper working directory for the MarvinView application's load filechooser.
 java.awt.Color getViewMolbg2d()
          Gets the viewer's default molecule background color for 2D.
 java.awt.Color getViewMolbg3d()
          Gets the viewer's default molecule background color for 3D.
 java.lang.String getViewNavmode2d()
          Gets the navigation mode for the 2D viewer.
 java.lang.String getViewNavmode3d()
          Gets the navigation mode for the 3D viewer.
 java.util.List<java.lang.String> getViewRecentFileList()
          Gets the recent files' list in MarvinView, the last item is the most recent.
 int getViewRecentFileListSize()
          Gets the recent file list requested size, based on a preferences setting
 java.lang.String getViewRendering2d()
          Gets the rendering style for the 2D viewer.
 java.lang.String getViewRendering3d()
          Gets the rendering style for the 3D viewer.
 java.io.File getViewSaveWorkingDir()
          Not implemented yet, don't use it.
 double getWireThickness()
          Gets the bond thickness in wireframe mode.
 boolean isAtomPropertiesVisible()
          Tells wheter the atom properties are visible or not if exist.
 boolean isAutoCheckStructure()
          Tells whether the automatic structure checking is enabled or not
 boolean isAutomaticFogEnabled()
          Gets the state of automatic fog calculation mode.
 boolean isBondDraggedAlong()
          Is the currently used bond shown at the mouse cursor?
 boolean isCleanHOptionEnabled()
          Returns true if the H option for cleaning is enabled.
 boolean isDisplayChargeWithCircle()
           
 boolean isDisplayLonePairsAsLine()
           
 boolean isEZVisible()
          Are E/Z labels visible?
 boolean isLigandErrorVisible()
          Tells wheter the bond's ligand error is visible or not.
 boolean isLonePairAutoCalc()
          Returns the state of the automatic lone pair calculation.
 boolean isReactionErrorVisible()
          Deprecated. 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 visible?

 boolean isShowMultiMoleculeOnEditSource()
           
 boolean isTransformationEnabled()
          Gets the transformation enabled/disabled.
 boolean isValenceErrorVisible()
          Are valence errors visible?
 boolean isValenceErrorVisibleInView()
          Are valence errors visible in MarvinView?
 boolean isValencePropertyVisible()
          Tells wheter the atom valence property is visible or not.
 boolean isvalidateSgroupsAtCreation()
          Is the validation of the possible sgroups and allow only the chemically correct ones on sgroups creation and edit dialog.
 boolean isViewAtomMarkEnabled()
          Returns true if atom mark and highlight is enabled in View.
 java.util.Enumeration<java.lang.Object> keys()
          Deprecated. in 5.4 use the keySet method on the result of getPropertyMap() instead.
 void put(java.lang.String key, java.lang.String v)
          Deprecated. since 5.4 use setProperty(String, String) or setProperty(String, String, boolean) instead.
 void removeAllProperty()
          Removes all property that are stored in this UserSettings object.
 void removeOwner(java.beans.PropertyChangeListener o)
          Removes an owner.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove a property change listener
 void removeSketchRecentFile(java.io.File f)
          Remove a file from marvinsketch's recent file list
 void removeViewRecentFile(java.io.File f)
          Remove a file from marvinview's recent file list
 void save(java.lang.String comment)
          Save the persistent properties to the config file set by the constructor.
 void save(java.lang.String comment, boolean templatesOnly)
          Deprecated. As of Marvin 5.3, use save(String).
 void save(java.lang.String fileName, java.lang.String comment)
          Save the persistent properties to the file given as the first parameter.
 void setAbsoluteLabelVisible(java.lang.String v)
          Show or hide Abolute labels
 void setAromatizeMethod(int method)
          Sets the aromatize method.
 void setAtomFont(java.awt.Font f)
          Sets the atom symbol font name.
 void setAtomMappingMethod(int method)
          Sets the atom mapping method.
 void setAtomPropertiesVisible(boolean v)
          Sets atom properties visibility.
 void setAtomSize(double r)
          Sets the atom size in C-C bond length units.
 void setAutoCheckStructure(boolean b)
          Turn on automatic Structure checking
 void setAutomaticFogEnabled(boolean enable)
          Sets the fog to automatic calculation mode.
 void setBallRadius(double r)
          Sets the ball radius for ball and stick mode.
 void setBondDraggedAlong(boolean v)
          Sets the visibility of the currently used bond at the mouse cursor.
 void setBondSpacing(double w)
          Sets the double bond spacing.
 void setCheckerConfigFileName(java.lang.String checkerConfigFileName)
          Sets the name of the configuration file for StructureChecker in marvin sketch
 void setChiralitySupport(java.lang.String v)
          Sets the chirality support parameter.
 void setClean2dOpts(java.lang.String s)
          Sets the 2D cleaning options.
 void setClean3dOpts(java.lang.String s)
          Sets the 3D cleaning options.
 void setCleanHOption(boolean b)
          Deprecated. As of release 5.4, replaced by setCleanHOptionEnabled(boolean)
 void setCleanHOptionEnabled(boolean b)
          Sets to add an explicit hydrogen atom to chiral centers having no terminal atoms when 2D cleaning is performed.
 void setCoordinateBondStyle(java.lang.String s)
          Sets the "coordinative" bond line style when both atoms are single.
 void setCoordinateBondStyleAtMulticenter(java.lang.String s)
          Sets the "coordinative" bond line style when one of the atoms is multicenter.
 void setCopyAsFormat(java.lang.String fmt)
          Sets the selected format in the Copy As dialog.
 void setDefaultSaveFormat(java.lang.String s)
          Sets the default molecule format in the "Save As" dialog.
 void setDisplayChargeWithCircle(boolean value)
           
 void setDisplayLonePairsAsLine(boolean value)
           
 void setDownWedge(java.lang.String s)
          Sets the convention to use for displaying a down wedge.
 void setEZVisible(boolean v)
          Show or hide E/Z labels
 void setFogFactor(int w)
          Sets the fog factor.
 void setImageImportServiceURL(java.lang.String url)
           
 void setLigandErrorVisible(boolean v)
          Show or hide ligand errors
 void setLoadSaveLocation(java.lang.String s)
          Sets the load/save filechooser working directory selection method names, based on the preferences dialog.
 void setLoadWorkingDir(java.lang.String s)
          Sets the filechooser's default working directory, if the filechooser working directory selection method is saveCustomLocation.
 void setLonePairAutoCalc(boolean v)
          Sets the state of the automatic lone pair calculation.
 void setPageFormat(java.awt.print.PageFormat pageFormat, java.lang.String s)
           
 void setPeptideDisplayType(java.lang.String type)
          Sets the peptide displaying tpye.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets a property for the given key with the given value.
 void setProperty(java.lang.String key, java.lang.String value, boolean isPersistent)
          Sets a property for the given key with the given value.
 void setReactionErrorVisible(boolean v)
          Deprecated. As of Version 5.3.2, this method is deprecated and has no replacement. It will be removed in a future version of Marvin.
 void setReadGUIPropertiesFromMRV(boolean flag)
          Deprecated. As of release 5.1, replaced by setSaveGUIPropertiesInMRV(boolean). It will be removed in a future version of Marvin.
 void setRLogicVisible(java.lang.String v)
          Sets R-logic visibility
 void setSaveGUIPropertiesInMRV(boolean flag)
          Sets whether the GUI properties should be saved when saving as a Marvin file
 void setSaveLoadZoomFactorToMRV(boolean b)
          Tells wether to save the zoom factor information to mrv files or not.
 void setServicesConfigURL(java.lang.String servicesConfigURL)
          Sets the URL of the configuration for Services in marvin
 void setShowMultiMoleculeOnEditSource(boolean show)
           
 void setSketchAnyBond(java.lang.String v)
          Sets the default any bond drawing style in the sketcher.
 void setSketchArrowHeadLength(double d)
          Sets the arrow head length.
 void setSketchArrowHeadWidth(double d)
          Sets the arrow head width.
 void setSketchArrowTailLength(double d)
          Sets the arrow tail length.
 void setSketchArrowTailWidth(double d)
          Sets the arrow tail width.
 void setSketchCarbonVisibility(java.lang.String v)
          Sets the default carbon visibility style in the sketcher.
 void setSketchColorScheme(java.lang.String c)
          Sets the sketcher's default color scheme.
 void setSketchImplicitH(java.lang.String s)
          Sets the display method of implicit hydrogens for the sketcher.
 void setSketchLigandOrderVisibility(java.lang.String v)
          Sets the default ligand order visibility style in the sketcher.
 void setSketchLoadWorkingDir(java.lang.String s)
          Sets the load working directory for MarvinSketch load filechooser.
 void setSketchMolbg2d(java.awt.Color c)
          Sets the sketcher's default 2D molecule background color.
 void setSketchMolbg3d(java.awt.Color c)
          Sets the sketcher's default 3D molecule background color.
 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
 void setSketchRendering2d(java.lang.String s)
          Sets the rendering style for the 2D sketcher.
 void setSketchRendering3d(java.lang.String s)
          Sets the rendering style for the 3D sketcher.
 void setSketchSaveWorkingDir(java.lang.String s)
          Not implemented yet, don't use it.
 void setStickThickness(double d)
          Sets the stick diameter for ball and stick mode.
 void setTerminalBondDeletionStyle(java.lang.String style)
          Sets the bond deletion style.
 void setTransformationEnabled(boolean v)
          Enable/disable transformation
 void setValenceErrorVisible(boolean v)
          Show or hide valence errors
 void setValenceErrorVisibleInView(boolean v)
          Show or hide valence errors in MarvinView
 void setValencePropertyVisible(boolean v)
          Sets atom valence property visibility.
 void setvalidateSgroupsAtCreation(boolean b)
          Set the validation of the possible sgroups and allow only the chemically correct ones on sgroups creation and edit dialog.
 void setViewAnyBond(java.lang.String v)
          Sets the default any bond drawing style in the viewer.
 void setViewAtomMarkEnabled(boolean b)
          Sets atom mark and highlight visibility in Marvin View.
 void setViewCarbonVisibility(java.lang.String v)
          Sets the default carbon visibility style in the viewer.
 void setViewColorScheme(java.lang.String c)
          Sets the viewer's default color scheme.
 void setViewExplicitH(boolean v)
          Deprecated. As of release 5.3, this method is deprecated and has no replacement. It will be removed in a future version of Marvin.
 void setViewImplicitH(java.lang.String s)
          Sets the display method of implicit hydrogens for the viewer.
 void setViewLayout(int v)
          Set the layout of MarvinView.
 void setViewLigandOrderVisibility(java.lang.String v)
          Sets the default ligand order visibility style in the viewer.
 void setViewLoadWorkingDir(java.lang.String s)
          Sets the load working directory for MarvinView load filechooser.
 void setViewMolbg2d(java.awt.Color c)
          Sets the default molecule background color for the 2D viewer.
 void setViewMolbg3d(java.awt.Color c)
          Sets the default molecule background color for the 3D viewer.
 void setViewNavmode2d(java.lang.String s)
          Sets the navigation mode for the 2D viewer.
 void setViewNavmode3d(java.lang.String s)
          Sets the navigation mode for the 3D viewer.
 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.
 void setViewRendering2d(java.lang.String s)
          Sets the rendering style for the 2D viewer.
 void setViewRendering3d(java.lang.String s)
          Sets the rendering style for the 3D viewer.
 void setViewSaveWorkingDir(java.lang.String s)
          Not implemented, don't use it.
 void setWireThickness(double d)
          Sets the bond thickness in wireframe mode.
 boolean tryToLoad()
          Deprecated. since Marvin 5.4 no replacements.
 boolean tryToLoad(java.util.Properties props)
          Deprecated. since Marvin 5.4 no replacements.
 boolean tryToLoadTemplates()
          Deprecated. since 5.4 no replacements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_TYPE_TRANSIENT

public static final java.lang.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:
Constant Field Values

PROPERTY_TYPE_PERSISTENT

public static final java.lang.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:
Constant Field Values

PROPERTY_TYPE_DEFAULT

public static final java.lang.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:
Constant Field Values

PROPERTY_TYPE_ALL

public static final java.lang.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:
Constant Field Values

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:
Constant Field Values

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:
Constant Field Values

MARVIN_CONFIG_DEFAULT_PATH

public static final java.lang.String MARVIN_CONFIG_DEFAULT_PATH
The default configuration file path inside the chemaxon settings directory in user home.

Since:
Marvin 5.4
See Also:
DotfileUtil.getDotDir(), Constant Field Values

DEFAULT_SKETCH_ARROW_HEAD_LENGTH

@Deprecated
public static final double DEFAULT_SKETCH_ARROW_HEAD_LENGTH
Deprecated. use MPolyline.DEFAULT_ARROW_HEAD_LENGTH instead.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

DEFAULT_SKETCH_ARROW_HEAD_WIDTH

@Deprecated
public static final double DEFAULT_SKETCH_ARROW_HEAD_WIDTH
Deprecated. use MPolyline.DEFAULT_ARROW_HEAD_WIDTH instead.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

MYTEMPLATES_GROUP_INDEX

@Deprecated
public static final int MYTEMPLATES_GROUP_INDEX
Deprecated. use TemplateHandler.MYTEMPLATES_GROUP_INDEX instead.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

CLEAN_H_OPTION

@Deprecated
public static final java.lang.String CLEAN_H_OPTION
Deprecated. defaults have been moved to configuration file.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

MAX_VIEW_RECENT_FILE_LIST_SIZE

@Deprecated
public static final int MAX_VIEW_RECENT_FILE_LIST_SIZE
Deprecated. defaults have been moved to configuration file.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

MIN_VIEW_RECENT_FILE_LIST_SIZE

@Deprecated
public static final int MIN_VIEW_RECENT_FILE_LIST_SIZE
Deprecated. defaults have been moved to configuration file.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

DEFAULT_VIEW_RECENT_FILE_LIST_SIZE

@Deprecated
public static final int DEFAULT_VIEW_RECENT_FILE_LIST_SIZE
Deprecated. defaults have been moved to configuration file.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

MAX_SKETCH_RECENT_FILE_LIST_SIZE

@Deprecated
public static final int MAX_SKETCH_RECENT_FILE_LIST_SIZE
Deprecated. defaults have been moved to configuration file.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

MIN_SKETCH_RECENT_FILE_LIST_SIZE

@Deprecated
public static final int MIN_SKETCH_RECENT_FILE_LIST_SIZE
Deprecated. defaults have been moved to configuration file.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

DEFAULT_SKETCH_RECENT_FILE_LIST_SIZE

@Deprecated
public static final int DEFAULT_SKETCH_RECENT_FILE_LIST_SIZE
Deprecated. defaults have been moved to configuration file.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

DEFAULT_LONE_PAIR_AUTOCALC

@Deprecated
public static final boolean DEFAULT_LONE_PAIR_AUTOCALC
Deprecated. defaults have been moved to configuration file.
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values

DEFAULT_BOND_IN_HAND

@Deprecated
public static final boolean DEFAULT_BOND_IN_HAND
Deprecated. defaults have been moved to configuration file. if you need the default value use
This constant is deprecated in Marvin 5.4 will be deleted in Marvin 5.5

See Also:
Constant Field Values
Constructor Detail

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(java.lang.String configFileName)
Construct a UserSettings object based on the defaul 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(java.io.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 Detail

getDescription

public static java.lang.String getDescription(java.lang.String key,
                                              java.lang.String val)
Gets the human readable description of a property.

Parameters:
key - the property name
val - the property value or null
Returns:
the human readable description or the key if no description found

getPropertyMap

public java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.lang.String> getPropertyMap(java.lang.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:
PROPERTY_TYPE_ALL, PROPERTY_TYPE_DEFAULT, PROPERTY_TYPE_PERSISTENT, PROPERTY_TYPE_TRANSIENT

save

public void save(java.lang.String comment)
          throws java.io.IOException
Save the persistent properties to the config file set by the constructor.

Parameters:
comment - comment at the beginning of file
Throws:
java.io.IOException - error occured while saving

save

public void save(java.lang.String fileName,
                 java.lang.String comment)
          throws java.io.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:
java.io.IOException - if the file cannot be written.

getPropertiesDescriptionChangedByOtherApp

public java.util.Vector<java.lang.String> getPropertiesDescriptionChangedByOtherApp()
The method collects the changes in the config file, if its timestamp was changed. This method can be used if the application should notify the user about the conflicting changes happened in the config file, since it was loaded in this app.

Returns:
the human readable descriptions of the properties that have been changed in the background with the new value.

addOwner

public void addOwner(java.beans.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(java.beans.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(java.beans.PropertyChangeListener l)
Add a property change listener

Parameters:
l - the property change listener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a property change listener

Parameters:
l - the property change listener

getDefaultProperty

public java.lang.String getDefaultProperty(java.lang.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 java.lang.String getProperty(java.lang.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(java.lang.String key,
                        java.lang.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(java.lang.String key,
                        java.lang.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(java.lang.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 java.lang.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 java.lang.String getViewColorScheme()
Gets the viewer's default color scheme.

Returns:
the color scheme

setViewColorScheme

public void setViewColorScheme(java.lang.String c)
Sets the viewer's default color scheme.

Parameters:
c - the color scheme. (See the colorScheme parameter.)

getSketchColorScheme

public java.lang.String getSketchColorScheme()
Gets the sketcher's default color scheme.

Returns:
the color scheme

setSketchColorScheme

public void setSketchColorScheme(java.lang.String c)
Sets the sketcher's default color scheme.

Parameters:
c - the color scheme. (See the colorScheme parameter.)

getSketchMolbg2d

public java.awt.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(java.awt.Color c)
Sets the sketcher's default 2D molecule background color.

Parameters:
c - the color
Since:
Marvin 4.1, 01/26/2006

getSketchMolbg3d

public java.awt.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(java.awt.Color c)
Sets the sketcher's default 3D molecule background color.

Parameters:
c - the color
Since:
Marvin 4.1, 01/26/2006

getViewMolbg2d

public java.awt.Color getViewMolbg2d()
Gets the viewer's default molecule background color for 2D.

Returns:
the color
Since:
Marvin 3.1.3

setViewMolbg2d

public void setViewMolbg2d(java.awt.Color c)
Sets the default molecule background color for the 2D viewer.

Parameters:
c - the color
Since:
Marvin 3.1.3

getViewMolbg3d

public java.awt.Color getViewMolbg3d()
Gets the viewer's default molecule background color for 3D.

Returns:
the color
Since:
Marvin 3.1.3

setViewMolbg3d

public void setViewMolbg3d(java.awt.Color c)
Sets the default molecule background color for the 3D viewer.

Parameters:
c - the color
Since:
Marvin 3.1.3

getSketchImplicitH

public java.lang.String getSketchImplicitH()
Gets the display method of implicit hydrogens for the sketcher.

Returns:
the method

setSketchImplicitH

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

Parameters:
s - the method. (See the implicitH parameter.)

getViewImplicitH

public java.lang.String getViewImplicitH()
Gets the display method of implicit hydrogens for the viewer.

Returns:
the method

setViewImplicitH

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

Parameters:
s - the method. (See the implicitH parameter.)

getViewAnyBond

public java.lang.String getViewAnyBond()
Gets the default any bond drawing style in the viewer.

Returns:
"auto", "dashed" or "solid"

setViewAnyBond

public void setViewAnyBond(java.lang.String v)
Sets the default any bond drawing style in the viewer.

Parameters:
v - "auto", "dashed" or "solid"

getSketchAnyBond

public java.lang.String getSketchAnyBond()
Gets the default any bond drawing style in the sketcher.

Returns:
"auto", "dashed" or "solid"

setSketchAnyBond

public void setSketchAnyBond(java.lang.String v)
Sets the default any bond drawing style in the sketcher.

Parameters:
v - "auto", "dashed" or "solid"

getDownWedge

public java.lang.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(java.lang.String s)
Sets the convention to use for displaying a down wedge.

Parameters:
s - "mdl" or "daylight"

getCoordinateBondStyle

public java.lang.String getCoordinateBondStyle()
Gets the "coordinative" bond line style when both atoms are single.

Returns:
"solid" or "arrow"

setCoordinateBondStyle

public void setCoordinateBondStyle(java.lang.String s)
Sets the "coordinative" bond line style when both atoms are single.

Parameters:
s - "solid" or "arrow"

getCoordinateBondStyleAtMulticenter

public java.lang.String getCoordinateBondStyleAtMulticenter()
Gets the "coordinative" bond line style when one of the atoms is multicenter.

Returns:
"solid" or "hashed"

setCoordinateBondStyleAtMulticenter

public void setCoordinateBondStyleAtMulticenter(java.lang.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 java.lang.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(java.lang.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 java.lang.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(java.lang.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:
MarvinPane.setFormat(String)

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 java.lang.String getChiralitySupport()
Gets the chirality support parameter.

Returns:
off/selected/all
See Also:
ParameterConstants.CHIRALITY_SUPPORT

setChiralitySupport

public void setChiralitySupport(java.lang.String v)
Sets the chirality support parameter.

Parameters:
v - off/selected/all
See Also:
ParameterConstants.CHIRALITY_SUPPORT

getAbsoluteLabelVisible

public java.lang.String getAbsoluteLabelVisible()
Are Absolute labels visible?

Returns:
True, if Absolute labels are shown

setAbsoluteLabelVisible

public void setAbsoluteLabelVisible(java.lang.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 java.lang.String getSketchRendering2d()
Gets the rendering style for the 2D sketcher.

Returns:
the style
Since:
Marvin 4.1, 01/26/2006

setSketchRendering2d

public void setSketchRendering2d(java.lang.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 java.lang.String getSketchRendering3d()
Gets the rendering style for the 3D sketcher.

Returns:
the style
Since:
Marvin 4.1, 01/26/2006

setSketchRendering3d

public void setSketchRendering3d(java.lang.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 java.lang.String getViewRendering2d()
Gets the rendering style for the 2D viewer.

Returns:
the style
Since:
Marvin 3.1.3

setViewRendering2d

public void setViewRendering2d(java.lang.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 java.lang.String getViewRendering3d()
Gets the rendering style for the 3D viewer.

Returns:
the style
Since:
Marvin 3.1.3

setViewRendering3d

public void setViewRendering3d(java.lang.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 java.lang.String getViewNavmode2d()
Gets the navigation mode for the 2D viewer.

Returns:
the navigation mode
Since:
Marvin 3.1.3

setViewNavmode2d

public void setViewNavmode2d(java.lang.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 java.lang.String getViewNavmode3d()
Gets the navigation mode for the 3D viewer.

Returns:
the navigation mode
Since:
Marvin 3.1.3

setViewNavmode3d

public void setViewNavmode3d(java.lang.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 java.lang.String getClean2dOpts()
Gets the 2D cleaning options.

Returns:
the cleaning options
Since:
Marvin 3.1.3

setClean2dOpts

public void setClean2dOpts(java.lang.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
public void setCleanHOption(boolean b)
Deprecated. 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 java.lang.String getClean3dOpts()
Gets the 3D cleaning options.

Returns:
the cleaning options
Since:
Marvin 3.1.3

setClean3dOpts

public void setClean3dOpts(java.lang.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

getAtomFont

public java.awt.Font getAtomFont()
Gets the atom symbol font name.

Returns:
the font name
Since:
Marvin 3.4, 06/16/2004

setAtomFont

public void setAtomFont(java.awt.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

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

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.

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.

setPeptideDisplayType

public void setPeptideDisplayType(java.lang.String type)
Sets the peptide displaying tpye. Valid values are "1-letter" and "3-letter"

Parameters:
type - the peptide display type

getPeptideDisplayType

public java.lang.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 java.util.List<java.lang.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(java.io.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(java.io.File f)
Remove a file from marvinview's recent file list

Parameters:
f - the File which has to remove from the list

getSketchRecentFileList

public java.util.List<java.lang.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(java.io.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(java.io.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 java.lang.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(java.lang.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 java.io.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(java.lang.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.

getViewLoadWorkingDir

public java.io.File getViewLoadWorkingDir()
Based on the preferences this funtion returns the proper working directory for the MarvinView application's load filechooser.

Returns:
the working directory for the load filechooser in MarvinView application
Since:
Marvin 5.0.1

setViewLoadWorkingDir

public void setViewLoadWorkingDir(java.lang.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 java.io.File getViewSaveWorkingDir()
Not implemented yet, don't use it.

Since:
Marvin 5.0.1

setViewSaveWorkingDir

public void setViewSaveWorkingDir(java.lang.String s)
Not implemented, don't use it.

Parameters:
s - the absolut path of the directory.
Since:
Marvin 5.0.1

getSketchLoadWorkingDir

public java.io.File getSketchLoadWorkingDir()
Based on the preferences this funtion returns the proper working directory for the MarvinSketch application's load filechooser.

Returns:
the working directory for the load filechooser in MarvinSketch application
Since:
Marvin 5.0.1

setSketchLoadWorkingDir

public void setSketchLoadWorkingDir(java.lang.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 java.io.File getSketchSaveWorkingDir()
Not implemented yet don't use it.

Since:
Marvin 5.0.1

setSketchSaveWorkingDir

public void setSketchSaveWorkingDir(java.lang.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 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 java.lang.String getViewCarbonVisibility()
Gets the default carbon displaying style in the viewer.

Returns:
the style

setViewCarbonVisibility

public void setViewCarbonVisibility(java.lang.String v)
Sets the default carbon visibility style in the viewer.

Parameters:
v - the style

getViewLigandOrderVisibility

public java.lang.String getViewLigandOrderVisibility()
Gets the default ligand order displaying style in the viewer.

Returns:
the style

setViewLigandOrderVisibility

public void setViewLigandOrderVisibility(java.lang.String v)
Sets the default ligand order visibility style in the viewer.

Parameters:
v - the style

getSketchCarbonVisibility

public java.lang.String getSketchCarbonVisibility()
Gets the default carbon displaying style in the sketcher.

Returns:
the style

setSketchCarbonVisibility

public void setSketchCarbonVisibility(java.lang.String v)
Sets the default carbon visibility style in the sketcher.

Parameters:
v - the style

getSketchLigandOrderVisibility

public java.lang.String getSketchLigandOrderVisibility()
Gets the default ligand order displaying style in the sketcher.

Returns:
the style

setSketchLigandOrderVisibility

public void setSketchLigandOrderVisibility(java.lang.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:
TableOptions.VH_AUTO, TableOptions.VH_GRIDBAG, TableOptions.VH_SPREADSHEET

getRLogicVisible

public java.lang.String getRLogicVisible()
Tells whether the R-logic is visible if exists

Returns:
on/off

setRLogicVisible

public void setRLogicVisible(java.lang.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

public java.lang.String getCheckerConfigFileName()
Returns:
the name of the configuration file for StructureChecker in marvin Sketch
Since:
5.4

setCheckerConfigFileName

public void setCheckerConfigFileName(java.lang.String checkerConfigFileName)
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 java.lang.String getServicesConfigURL()
Returns the URL of configuration for Services in marvin sketch

Returns:
the URL of configuration for Services in marvin sketch
Since:
5.6

setServicesConfigURL

public void setServicesConfigURL(java.lang.String servicesConfigURL)
Sets the URL of the configuration for Services in marvin

Parameters:
servicesConfigURL - the configuration URL
Since:
5.6

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 java.lang.String getImageImportServiceURL()

setImageImportServiceURL

public void setImageImportServiceURL(java.lang.String url)

getPageFormat

public java.awt.print.PageFormat getPageFormat(java.lang.String s)
Gets the specified PageFormat

Parameters:
s - panelType (sketch / view)
Returns:
the loaded PageFormat

setPageFormat

public void setPageFormat(java.awt.print.PageFormat pageFormat,
                          java.lang.String s)
Parameters:
pageFormat -
s - panelType (sketch / view)

isDisplayLonePairsAsLine

public boolean isDisplayLonePairsAsLine()

setDisplayLonePairsAsLine

public void setDisplayLonePairsAsLine(boolean value)

isDisplayChargeWithCircle

public boolean isDisplayChargeWithCircle()

setDisplayChargeWithCircle

public void setDisplayChargeWithCircle(boolean value)

put

@Deprecated
public void put(java.lang.String key,
                           java.lang.String v)
Deprecated. since 5.4 use setProperty(String, String) or setProperty(String, String, boolean) instead.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 Currently it is set the value for the key in persitent properties, if it is exists otherwise add a session property.


get

@Deprecated
public java.lang.String get(java.lang.String key)
Deprecated. since 5.4 use getProperty(String) instead.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5


keys

@Deprecated
public java.util.Enumeration<java.lang.Object> keys()
Deprecated. in 5.4 use the keySet method on the result of getPropertyMap() instead.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5


addTo

@Deprecated
public void addTo(java.util.Properties p)
Deprecated. since 5.4. use p.putAll with the persistent properties

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5

See Also:
getPropertyMap(String)

addWithLCKeysTo

@Deprecated
public void addWithLCKeysTo(java.util.Properties p)
Deprecated. since 5.4 no replacements.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 Use the exact keys, reference them by consants, or reach them thru methods from this class. Or implement this functionality on your own when you need it.

Parameters:
p - the target object

tryToLoad

@Deprecated
public boolean tryToLoad()
Deprecated. since Marvin 5.4 no replacements.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 The constructor do the work of this method.

Returns:
true

tryToLoad

@Deprecated
public boolean tryToLoad(java.util.Properties props)
Deprecated. since Marvin 5.4 no replacements.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 The constructor do the work of this method.

Returns:
true

tryToLoadTemplates

@Deprecated
public boolean tryToLoadTemplates()
Deprecated. since 5.4 no replacements

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 Template library, and the template handling have completely changed in 5.3 This method is not necessary anymore. And does nothing since 5.4

Returns:
false

getMyTemplatesKey

@Deprecated
public static java.lang.String getMyTemplatesKey()
Deprecated. since 5.4 use TemplateHandler.MYTEMPLATES_KEY instead.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 Template library, and the template handling have completely changed in 5.3 This method is not necessary anymore. And returns TemplateHandler.MYTEMPLATES_KEY


getMyTemplatesValue

@Deprecated
public static java.lang.String getMyTemplatesValue(java.util.Properties props)
Deprecated. since 5.4 no replacements

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 Template library, and the template handling have completely changed in 5.3 This method is not necessary anymore. And returns null.

Parameters:
props -

getMyTemplatesValue

@Deprecated
public java.lang.String getMyTemplatesValue()
Deprecated. since 5.4

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 Template library, and the template handling have completely changed in 5.3 This method is not necessary anymore. And returns null.


getDefaultMyTemplatesValue

@Deprecated
public static java.lang.String getDefaultMyTemplatesValue()
Deprecated. since 5.4 use TemplateHandler.DEFAULT_MY_TEMPLATES_VALUE instead.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5 Template library, and the template handling have completely changed in 5.3 This method is not necessary anymore. And returns TemplateHandler.DEFAULT_MY_TEMPLATES_VALUE


save

@Deprecated
public void save(java.lang.String comment,
                            boolean templatesOnly)
          throws java.io.IOException
Deprecated. As of Marvin 5.3, use save(String).

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5

Parameters:
templatesOnly -
Throws:
java.io.IOException

getViewExplicitH

@Deprecated
public boolean getViewExplicitH()
Deprecated. As of release 5.3, this method is deprecated and has no replacement. It will be removed in a future version of Marvin.

Gets the default visibility of explicit hydrogens in the viewer.

Returns:
false

setViewExplicitH

@Deprecated
public void setViewExplicitH(boolean v)
Deprecated. As of release 5.3, this method is deprecated and has no replacement. It will be removed in a future version of Marvin.

Unsupported method.

Parameters:
v -

isReactionErrorVisible

@Deprecated
public boolean isReactionErrorVisible()
Deprecated. 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 visible?

Returns:
false

setReactionErrorVisible

@Deprecated
public void setReactionErrorVisible(boolean v)
Deprecated. As of Version 5.3.2, this method is deprecated and has no replacement. It will be removed in a future version of Marvin.

Show or hide reaction errors

Parameters:
v - True to show reaction errors

checkBeforeSave

@Deprecated
public boolean checkBeforeSave(java.util.Properties p,
                                          java.util.Vector<java.lang.String> changed)
Deprecated. since 5.4 use the isEmpty method of getPropertiesDescriptionChangedByOtherApp() method to retreive the return value of this method. If you really need it.

This method is deprecated. Won't be supported after the next major release, and will be deleted in the major release after 5.5

Parameters:
p -

getReadGUIPropertiesFromMRV

@Deprecated
public boolean getReadGUIPropertiesFromMRV()
Deprecated. As of release 5.1, replaced by getSaveGUIPropertiesInMRV(). It will be removed in a future version of Marvin.

This method is not supported anymore, and it will be deleted in 5.5.


setReadGUIPropertiesFromMRV

@Deprecated
public void setReadGUIPropertiesFromMRV(boolean flag)
Deprecated. As of release 5.1, replaced by setSaveGUIPropertiesInMRV(boolean). It will be removed in a future version of Marvin.

Parameters:
flag - sets the reading flag. If true, GUI properties stored in MRV will be read (if there are any)
Since:
Marvin 5.0