chemaxon.marvin.common
Class UserSettings

java.lang.Object
  extended by chemaxon.marvin.common.UserSettings
All Implemented Interfaces:
DispOptConsts, CopyOptConstants, java.io.Serializable

public class UserSettings
extends java.lang.Object
implements java.io.Serializable, DispOptConsts, CopyOptConstants

User settings.

Since:
Marvin 3.0, 12/16/2002
Version:
5.0, 09/26/2007
Author:
Peter Csizmadia, Tamas Vertse
See Also:
Serialized Form

Field Summary
static boolean DEFAULT_BOND_IN_HAND
          Default state of bond in hand option, i.e the bond is shown with the cursor in insert bond mode.
static boolean DEFAULT_LONE_PAIR_AUTOCALC
          Default state of automatic lone pair calculation.
static double DEFAULT_SKETCH_ARROW_HEAD_LENGTH
          Default arrow head length.
static double DEFAULT_SKETCH_ARROW_HEAD_WIDTH
          Default arrow head width.
static int DEFAULT_SKETCH_RECENT_FILE_LIST_SIZE
          The default size of sketchRecentFileList
static int DEFAULT_VIEW_RECENT_FILE_LIST_SIZE
          The default size of viewRecentFileList
static int MAX_SKETCH_RECENT_FILE_LIST_SIZE
          The maximum size of sketchRecentFileList
static int MAX_VIEW_RECENT_FILE_LIST_SIZE
          The maximum size of viewRecentFileList
static int MIN_SKETCH_RECENT_FILE_LIST_SIZE
          The minimum size of sketchRecentFileList
static int MIN_VIEW_RECENT_FILE_LIST_SIZE
          The minimum size of viewRecentFileList
static int MYTEMPLATES_GROUP_INDEX
          The index of the My Templates group in the templates list.
 
Fields inherited from interface chemaxon.marvin.paint.DispOptConsts
ABS_FLAG, ANYBOND_AUTO, ANYBOND_AUTO_S, ANYBOND_DASHED, ANYBOND_DASHED_S, ANYBOND_MASK, ANYBOND_OFFSET, ANYBOND_SOLID, ANYBOND_SOLID_S, ANYBOND_STYLES, ATMAP_FLAG, ATNUM_FLAG, ATSYM_FLAG, BALLSTICK, BALLSTICK_RENDERING_S, BONDLEN_FLAG, CARBON_VIS_INCHAIN, CARBON_VIS_INCHAIN_S, CARBON_VIS_MASK, CARBON_VIS_OFF, CARBON_VIS_OFF_S, CARBON_VIS_OFFSET, CARBON_VIS_ON, CARBON_VIS_ON_S, CARBON_VIS_STYLES, COLOR_SCHEMES, COLORS_MASK, COLORS_OFFSET, CPK_SCHEME, CPK_SCHEME_S, DAYLIGHT_DOWNWEDGE_FLAG, DAYLIGHT_DOWNWEDGE_S, DOWNWEDGE_MODES, DOWNWEDGE_OFFSET, EXPLICITH_FLAG, EZ_FLAG, GRINV_FLAG, GROUP_SCHEME, GROUP_SCHEME_S, IMPLICITH_ALL, IMPLICITH_ALL_S, IMPLICITH_HETERO, IMPLICITH_HETERO_S, IMPLICITH_HETEROTERM, IMPLICITH_HETEROTERM_S, IMPLICITH_LEVELS, IMPLICITH_MASK, IMPLICITH_OFF, IMPLICITH_OFF_S, LP_AUTO_FLAG, LP_FLAG, MDL_DOWNWEDGE_S, MM_MASK, MM_MODES, MM_OFFSET, MM_ROT3D, MM_ROTZ, MM_ZOOM, MM_ZOOMROT, MONO_SCHEME, MONO_SCHEME_S, QUALITY_MASK, QUALITY_OFFSET, RENDERING_MASK, RENDERING_OFFSET, RENDERING_STYLES, RGROUPS_FLAG, RS_ALL, RS_ALL_S, RS_MASK, RS_OFF, RS_OFF_S, RS_OFFSET, RS_OPTIONS, RS_SELECTED, RS_SELECTED_S, SET_SCHEME_FLAG, SHAPELY_SCHEME, SHAPELY_SCHEME_S, SPACEFILL, SPACEFILL_RENDERING_S, STICKS, STICKS_RENDERING_S, WIREFRAME, WIREFRAME_RENDERING_S, WIREKNOBS, WIREKNOBS_RENDERING_S
 
Fields inherited from interface chemaxon.marvin.util.CopyOptConstants
COPY_AS_IMAGE_BITMAP, COPY_AS_IMAGE_EMF, COPY_AS_OLE, COPY_AS_TEXT, FMT_EMF, FMT_IMAGE, FMT_MOL, FMT_MRV, FMT_OLE, FMT_PLAINTEXT, FMT_RXN, FMT_SMILES, FMT_STRING, FMT_STRUCTURE
 
Constructor Summary
UserSettings()
           
 
Method Summary
 void addOwner(java.beans.PropertyChangeListener o)
          Adds an owner.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add bean property change listener
 void addTo(java.util.Properties p)
          Puts all properties into the specified Properties object.
 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)
          Puts all properties into the specified Properties object, with lower case names.
 boolean checkBeforeSave(java.util.Properties p, java.util.Vector changed)
          Compares current user preferences file contents with settings stored in this object.
 java.lang.String get(java.lang.String key)
          Gets a property.
 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 getClean2dOpts()
          Gets the 2D cleaning options.
 java.lang.String getClean3dOpts()
          Gets the 3D cleaning options.
 java.lang.String getCopyAsFormat()
          Gets the selected format from the Copy As dialog.
 java.lang.String getCopyOpts()
          Determines the options for the Copy command.
static java.lang.String getDefaultCopyAsFormat()
          Determines the default format in the Copy As dialog.
static java.lang.String getDefaultCopyOpts()
          Determines the default copy options setting on the current platform.
static java.lang.String getDefaultMyTemplatesValue()
          Returns the value to be stored for the empty My Templates group.
 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.
 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()
          Returns the key used for storing My Templates.
 java.lang.String getMyTemplatesValue()
          Returns the stored value of My Templates group, or the default value if it is empty.
static java.lang.String getMyTemplatesValue(java.util.Properties props)
          Returns the value of My Templates group stored in the given Properties, or the default value if it is empty.
 int getOwnerCount()
          Gets the current number of owners.
 boolean getReadGUIPropertiesFromMRV()
          Deprecated. since Marvin 5.1 when this and the previous function have been merged.
 boolean getSaveGUIPropertiesInMRV()
           
 boolean getSaveLoadZoomFactorToMRV()
           
 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.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 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.
static java.util.List getSupportedCopyAsFormats()
          Returns all supported formats by Copy As on the current platform.
 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()
          Gets the default visibility of explicit hydrogens in the viewer.
 java.lang.String getViewImplicitH()
          Gets the display method of implicit hydrogens for 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 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 isBondDraggedAlong()
          Is the currently used bond shown at the mouse cursor?
 boolean isLonePairAutoCalc()
          Returns the state of the automatic lone pair calculation.
 boolean isReactionErrorVisible()
          Are reaction errors visible?
static boolean isSupportedCopyOpt(java.lang.String s)
          Checks if the specified copy format is supported on the current platform.
 boolean isValenceErrorVisible()
          Are valence errors visible?
 boolean isValenceErrorVisibleInView()
          Are valence errors visible in MarvinView?
 void put(java.lang.String key, java.lang.String v)
          Sets a property.
 void removeOwner(java.beans.PropertyChangeListener o)
          Removes an owner.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove bean property change listener
 void save(java.lang.String comment)
          Save preferences into initialization file.
 void save(java.lang.String comment, boolean templatesOnly)
          Save only the templates into initialization file.
 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 setAtomSize(double r)
          Sets the atom size in C-C bond length units.
 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 setClean2dOpts(java.lang.String s)
          Sets the 2D cleaning options.
 void setClean3dOpts(java.lang.String s)
          Sets the 3D cleaning options.
 void setCopyAsFormat(java.lang.String s)
          Sets the selected format in the Copy As dialog.
 boolean setCopyOpts(java.lang.String s)
          Sets the options for the Copy command.
 void setDefaultSaveFormat(java.lang.String s)
          Sets the default molecule format in the "Save As" dialog.
 void setDownWedge(java.lang.String s)
          Sets the convention to use for displaying a down wedge.
 void setLoadSaveLocation(java.lang.String s)
          Gets 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 setReactionErrorVisible(boolean v)
          Show or hide reaction errors
 void setReadGUIPropertiesFromMRV(boolean flag)
          Deprecated. since Marvin 5.1 when this and the previous function have been merged.
 void setSaveGUIPropertiesInMRV(boolean flag)
          Sets whether the GUI properties should be saved when saving as a Marvin file
 void setSaveLoadZoomFactorToMRV(boolean b)
           
 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 viewer.
 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 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_SKETCH_RECENT_FILE_LIST_SIZE then the size will be the value of MAX_SKETCH_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 setValenceErrorVisible(boolean v)
          Show or hide valence errors
 void setValenceErrorVisibleInView(boolean v)
          Show or hide valence errors in MarvinView
 void setViewAnyBond(java.lang.String v)
          Sets the default any bond drawing style in the viewer.
 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)
          Sets the default visibility of explicit hydrogens in the viewer.
 void setViewImplicitH(java.lang.String s)
          Sets the display method of implicit hydrogens for 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 MAX_VIEW_RECENT_FILE_LIST_SIZE then the size will be the value of MAX_VIEW_RECENT_FILE_LIST_SIZE
 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()
          Try to load preferences from initialization file.
 boolean tryToLoad(java.util.Properties props)
          Try to load preferences from initialization file.
 boolean tryToLoadTemplates()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SKETCH_ARROW_HEAD_LENGTH

public static final double DEFAULT_SKETCH_ARROW_HEAD_LENGTH
Default arrow head length.

Since:
Marvin 3.5, 07/01/2004
See Also:
Constant Field Values

DEFAULT_SKETCH_ARROW_HEAD_WIDTH

public static final double DEFAULT_SKETCH_ARROW_HEAD_WIDTH
Default arrow head width.

Since:
Marvin 3.5, 07/01/2004
See Also:
Constant Field Values

MYTEMPLATES_GROUP_INDEX

public static final int MYTEMPLATES_GROUP_INDEX
The index of the My Templates group in the templates list.

Since:
Marvin 4.0.4, 01/10/2006
See Also:
Constant Field Values

MAX_VIEW_RECENT_FILE_LIST_SIZE

public static final int MAX_VIEW_RECENT_FILE_LIST_SIZE
The maximum size of viewRecentFileList

Since:
Marvin 5.0.1
See Also:
Constant Field Values

MIN_VIEW_RECENT_FILE_LIST_SIZE

public static final int MIN_VIEW_RECENT_FILE_LIST_SIZE
The minimum size of viewRecentFileList

See Also:
Constant Field Values

DEFAULT_VIEW_RECENT_FILE_LIST_SIZE

public static final int DEFAULT_VIEW_RECENT_FILE_LIST_SIZE
The default size of viewRecentFileList

Since:
Marvin 5.1
See Also:
Constant Field Values

MAX_SKETCH_RECENT_FILE_LIST_SIZE

public static final int MAX_SKETCH_RECENT_FILE_LIST_SIZE
The maximum size of sketchRecentFileList

Since:
Marvin 5.0.1
See Also:
Constant Field Values

MIN_SKETCH_RECENT_FILE_LIST_SIZE

public static final int MIN_SKETCH_RECENT_FILE_LIST_SIZE
The minimum size of sketchRecentFileList

Since:
Marvin 5.1
See Also:
Constant Field Values

DEFAULT_SKETCH_RECENT_FILE_LIST_SIZE

public static final int DEFAULT_SKETCH_RECENT_FILE_LIST_SIZE
The default size of sketchRecentFileList

Since:
Marvin 5.1
See Also:
Constant Field Values

DEFAULT_LONE_PAIR_AUTOCALC

public static final boolean DEFAULT_LONE_PAIR_AUTOCALC
Default state of automatic lone pair calculation.

Since:
Marvin 5.1.1
See Also:
Constant Field Values

DEFAULT_BOND_IN_HAND

public static final boolean DEFAULT_BOND_IN_HAND
Default state of bond in hand option, i.e the bond is shown with the cursor in insert bond mode.

Since:
Marvin 5.1.1
See Also:
Constant Field Values
Constructor Detail

UserSettings

public UserSettings()
Method Detail

addOwner

public void addOwner(java.beans.PropertyChangeListener o)
Adds an owner.

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

put

public void put(java.lang.String key,
                java.lang.String v)
Sets a property.

Parameters:
key - property name
v - property value

get

public java.lang.String get(java.lang.String key)
Gets a property.

Parameters:
key - property name
Returns:
property value

addTo

public void addTo(java.util.Properties p)
Puts all properties into the specified Properties object.

Parameters:
p - the target object

addWithLCKeysTo

public void addWithLCKeysTo(java.util.Properties p)
Puts all properties into the specified Properties object, with lower case names.

Parameters:
p - the target object

tryToLoad

public boolean tryToLoad(java.util.Properties props)
Try to load preferences from initialization file.

Returns:
true if the file was loaded successfully, false if not

tryToLoad

public boolean tryToLoad()
Try to load preferences from initialization file.

Returns:
true if the file was loaded successfully, false if not

tryToLoadTemplates

public boolean tryToLoadTemplates()

save

public void save(java.lang.String comment)
          throws java.io.IOException
Save preferences into initialization file.

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

getMyTemplatesKey

public static java.lang.String getMyTemplatesKey()
Returns the key used for storing My Templates.

Returns:
"tmpls" concatenated with the template group index, 128

getMyTemplatesValue

public static java.lang.String getMyTemplatesValue(java.util.Properties props)
Returns the value of My Templates group stored in the given Properties, or the default value if it is empty.

Parameters:
props - container of the stored value
Returns:
stored property or the value returned by getDefaultMyTemplatesValue().

getMyTemplatesValue

public java.lang.String getMyTemplatesValue()
Returns the stored value of My Templates group, or the default value if it is empty.

Returns:
stored property or the value returned by getDefaultMyTemplatesValue().

getDefaultMyTemplatesValue

public static java.lang.String getDefaultMyTemplatesValue()
Returns the value to be stored for the empty My Templates group.

Returns:
name of the My Templates group without structures

save

public void save(java.lang.String comment,
                 boolean templatesOnly)
          throws java.io.IOException
Save only the templates into initialization file.

Parameters:
comment - comment at the beginning of file
templatesOnly - if only the templates to be saved
Throws:
java.io.IOException - error occured while saving

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add bean property change listener

Parameters:
l - the property change listener

removePropertyChangeListener

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

Parameters:
l - the property change listener

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.)

getViewExplicitH

public boolean getViewExplicitH()
Gets the default visibility of explicit hydrogens in the viewer.

Returns:
the visibility

setViewExplicitH

public void setViewExplicitH(boolean v)
Sets the default visibility of explicit hydrogens in the viewer.

Parameters:
v - the visibility. (See the explicitH 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"

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

getDefaultCopyAsFormat

public static java.lang.String getDefaultCopyAsFormat()
Determines the default format in the Copy As dialog.

Returns:
default format (the return value is platform dependent)
Since:
Marvin 5.0, 10/05/2007
See Also:
CopyOptConstants.FMT_STRUCTURE, CopyOptConstants.FMT_PLAINTEXT, CopyOptConstants.FMT_IMAGE, CopyOptConstants.FMT_EMF, CopyOptConstants.FMT_OLE

getSupportedCopyAsFormats

public static java.util.List getSupportedCopyAsFormats()
Returns all supported formats by Copy As on the current platform.

Returns:
list of supported formats
Since:
5.0 10/05/2007
See Also:
getDefaultCopyAsFormat()

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
See Also:
CopyOptConstants.FMT_STRUCTURE, CopyOptConstants.FMT_PLAINTEXT, CopyOptConstants.FMT_IMAGE, CopyOptConstants.FMT_EMF, CopyOptConstants.FMT_OLE

setCopyAsFormat

public void setCopyAsFormat(java.lang.String s)
Sets the selected format in the Copy As dialog.

Parameters:
s - copy as format to select (the value cannot be null)
Since:
5.0 10/05/2007
See Also:
CopyOptConstants.FMT_STRUCTURE, CopyOptConstants.FMT_PLAINTEXT, CopyOptConstants.FMT_IMAGE, CopyOptConstants.FMT_EMF, CopyOptConstants.FMT_OLE

setCopyOpts

public boolean setCopyOpts(java.lang.String s)
Sets the options for the Copy command. Specifies how to place the molecule to the clipboard. Multiple formats are acceptable. CopyOptConstants interface enumerates the valid options. A couple of options are not available on all platforms. Use isSupportedCopyOpt(String) to check it.

Parameters:
s - Comma separated list of options or null. The method evaluate the input string and accepts only supported options from it.
Returns:
If the specified list has included one or more unsupported format, returns with true, else false.
Since:
Marvin 4.1, 01/07/2006
See Also:
getCopyOpts(), getDefaultCopyOpts(), isSupportedCopyOpt(String), CopyOptConstants

getCopyOpts

public java.lang.String getCopyOpts()
Determines the options for the Copy command.

Returns:
Comma separated list of copy options or null if no specified format.
Since:
Marvin 4.1, 01/07/2006
See Also:
setCopyOpts(String), CopyOptConstants

getDefaultCopyOpts

public static java.lang.String getDefaultCopyOpts()
Determines the default copy options setting on the current platform.

Returns:
default settings (copy options in a comma separated list)
Since:
Marvin 4.1, 01/07/2006
See Also:
CopyOptConstants

isSupportedCopyOpt

public static boolean isSupportedCopyOpt(java.lang.String s)
Checks if the specified copy format is supported on the current platform.

Parameters:
s - checking copy format
Returns:
True, if the specified format is supported, else false.
Since:
Marvin 4.1, 01/07/2006
See Also:
CopyOptConstants

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

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

isReactionErrorVisible

public boolean isReactionErrorVisible()
Are reaction errors visible?

Returns:
True, if reaction errors are shown

setReactionErrorVisible

public void setReactionErrorVisible(boolean v)
Show or hide reaction errors

Parameters:
v - True to show reaction errors

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

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

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 getViewRecentFileList()
Gets the recent files' list in marvinview, the last item is the most recent. The list has a maximum of VIEW_RECENT_FILE_LIST_SIZE element.

Returns:
List recentFiles - List of recently used files' pathes'
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 MAX_VIEW_RECENT_FILE_LIST_SIZE then the size will be the value of MAX_VIEW_RECENT_FILE_LIST_SIZE

Parameters:
size - the requested size.
Since:
Marvin 5.1

getSketchRecentFileList

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

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 voi