Package de.saar.chorus.domgraph
Class UserProperties
java.lang.Object
de.saar.chorus.domgraph.UserProperties
A class representing user-specific properties which are stored in a File
".utool" in the user's home directory.
If there is no such file, all properties are initialized with a default value.
If the file contains only some of the properties, the other properties are initialized
with their default value.
To add a new property type,
1) specify an enum with its name and default value in the
PropertyNames
2) implement convenient / necessary getters and setters- Author:
- Michaela Regneri
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThis adds a single example directory to the current list of directories.static booleanstatic Stringstatic Stringstatic Propertiesstatic StringThe "utool working directory" is the last directory checked manually for any kind of files.static booleanIf there have been changes, the properties are saved to the .utool file.static voidsetDefaultInputCodec(String codec) This changes the current default input codec.static voidsetDefaultOutputCodec(String codec) This changes the current default output codec.static voidsetExampleDirectories(String dirs) This changes all example directories to the path (or path list) specified in dirs.static voidIndicates the last 'active' directory the user has accessed via Ubench.
-
Constructor Details
-
UserProperties
public UserProperties()
-
-
Method Details
-
saveProperties
public static boolean saveProperties()If there have been changes, the properties are saved to the .utool file. TODO so far, "changes" mean the user has called one of the setters. perhaps one should be more precise here?- Returns:
- true if updates have been stored; false if there went something wrong or there were no updates.
-
allowExperimentalCodecs
public static boolean allowExperimentalCodecs()- Returns:
- true if experimental codecs are integrated
-
getExampleDirectories
- Returns:
- A
Listof the example directories represented as Strings.
-
setExampleDirectories
This changes all example directories to the path (or path list) specified in dirs. Multiple paths must be separated by the system specific path separator.- Parameters:
dirs-
-
addExampleDirectory
This adds a single example directory to the current list of directories.- Parameters:
dir- the new directory
-
getDefaultInputCodec
- Returns:
- the name of the default input codec
-
setDefaultInputCodec
This changes the current default input codec.- Parameters:
codec- the new default input codec
-
getDefaultOutputCodec
- Returns:
- the name of the default output codec
-
setDefaultOutputCodec
This changes the current default output codec.- Parameters:
codec- the new default output codec
-
getWorkingDirectory
The "utool working directory" is the last directory checked manually for any kind of files. It is only used and changed in Ubench.- Returns:
- the last directory in use
- See Also:
-
setWorkingDirectory
Indicates the last 'active' directory the user has accessed via Ubench.- Parameters:
dir- the last directory in use- See Also:
-
Ubench#setLastPath()
-
getDefaults
- Returns:
- A
Propertiesobject containing default values for all properties defined inPropertyNames
-