|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.gui.Options
public class Options
Class storing global Skel preferences.
Field Summary | |
---|---|
static java.lang.String |
FILE_NAME_REG
Default resource directory. |
static java.lang.String |
optionsFileName
Options file name - user preferences. |
protected static java.lang.String |
PATH_DATA
Default data directory. |
protected static java.lang.String |
PATH_EDITOR
Default external viewer/editor. |
protected static java.lang.String |
PATH_REG
Default path to registry database. |
protected static java.lang.String |
PATH_RESOURCES
Default resource directory. |
protected static java.lang.String |
PATH_SOURCE
Default source path. |
protected static java.lang.String |
PATH_SYS_OPTIONS
Default file name of system preferences. |
static java.lang.String |
pathData
Actual data directory. |
static java.lang.String |
pathEditor
Actual external viewer/editor. |
static java.lang.String |
pathReg
Actual path to registry database. |
static java.lang.String |
pathResources
Actual resource directory. |
static java.lang.String |
pathSource
Actual source path. |
protected static java.util.Properties |
pref
User options in "key->value" format. |
static java.lang.String |
sysOptionsFileName
Options file name - system preferences. |
static java.lang.String |
sysOptionsOrigFileName
Options file name - system preferences (original values). |
protected static java.util.Properties |
system
System options in "key->value" format. |
protected static java.util.HashSet<java.lang.String> |
systemKeys
Keys which are updated in 'system' rather than in 'pref'. |
Constructor Summary | |
---|---|
Options()
|
Method Summary | |
---|---|
static java.lang.String |
colorToHexString(java.awt.Color c)
Converts Color to HexString (#AARRGGBB). |
static boolean |
getBoolean(java.lang.String key)
Parses boolean parameter. |
static java.awt.Color |
getColor(java.lang.String key)
Parses color description and returns valid Color instance. |
static javax.swing.ImageIcon |
getIcon(java.lang.String fileName)
Retrieves icon object from resource (JAR) or disk file. |
static int |
getInteger(java.lang.String key)
Parses integer parameter w/o bounds checking. |
static int |
getInteger(java.lang.String key,
int min,
int max,
int deflt)
Parses integer parameter and checks its bounds. |
static java.io.InputStream |
getResource(java.lang.String fileName)
Retrieves resource stream object from URL resource (JAR). |
static java.lang.String |
getString(java.lang.String key)
Parses string parameter. |
static java.lang.String |
getString(java.lang.String key,
java.lang.String deflt)
Parses string parameter. |
static void |
init()
Loads preference files from the disk and [re-]initializes working values. |
static void |
interpret()
Interprets preference dictionaries. |
static void |
load()
Loads both preference files from disk to the dictionaries. |
static void |
reflect()
Fills both dictionaries with the actual working values. |
static void |
save()
Stores both preference files from dictionaries to disk files. |
static void |
set(java.lang.String key,
boolean b)
Sets the boolean parameter. |
static void |
set(java.lang.String key,
java.awt.Color c)
Sets the color parameter. |
static void |
set(java.lang.String key,
int i)
Sets the integer parameter. |
static void |
set(java.lang.String key,
java.lang.String value)
Sets the string parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String PATH_RESOURCES
public static java.lang.String pathResources
protected static final java.lang.String PATH_DATA
public static java.lang.String pathData
public static final java.lang.String FILE_NAME_REG
protected static final java.lang.String PATH_REG
public static java.lang.String pathReg
protected static final java.lang.String PATH_SOURCE
public static java.lang.String pathSource
protected static final java.lang.String PATH_EDITOR
public static java.lang.String pathEditor
public static java.lang.String optionsFileName
public static java.lang.String sysOptionsFileName
protected static final java.lang.String PATH_SYS_OPTIONS
public static java.lang.String sysOptionsOrigFileName
protected static java.util.Properties pref
protected static java.util.Properties system
protected static java.util.HashSet<java.lang.String> systemKeys
Constructor Detail |
---|
public Options()
Method Detail |
---|
public static void init()
public static void save() throws java.io.IOException
java.io.IOException
reflect()
public static void load() throws java.io.IOException
java.io.IOException
interpret()
public static java.awt.Color getColor(java.lang.String key)
public static boolean getBoolean(java.lang.String key)
public static int getInteger(java.lang.String key, int min, int max, int deflt)
public static int getInteger(java.lang.String key)
public static java.lang.String getString(java.lang.String key, java.lang.String deflt)
public static java.lang.String getString(java.lang.String key)
null
in case of failure.
public static void interpret()
public static void reflect()
save()
operation.
public static java.lang.String colorToHexString(java.awt.Color c)
c
- Color to be converted (const).
public static void set(java.lang.String key, java.lang.String value)
interpret()
should be called to reflect all changes in working state variables.
public static void set(java.lang.String key, java.awt.Color c)
interpret()
should be called to reflect all changes in working state variables.
public static void set(java.lang.String key, boolean b)
interpret()
should be called to reflect all changes in working state variables.
public static void set(java.lang.String key, int i)
interpret()
should be called to reflect all changes in working state variables.
public static javax.swing.ImageIcon getIcon(java.lang.String fileName)
public static java.io.InputStream getResource(java.lang.String fileName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |