|
||||||||||
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 String |
FILE_NAME_REG
Default resource directory. |
static String |
optionsFileName
Options file name - user preferences. |
protected static String |
PATH_DATA
Default data directory. |
protected static String |
PATH_EDITOR
Default external viewer/editor. |
protected static String |
PATH_REG
Default path to registry database. |
protected static String |
PATH_RESOURCES
Default resource directory. |
protected static String |
PATH_SOURCE
Default source path. |
protected static String |
PATH_SYS_OPTIONS
Default file name of system preferences. |
static String |
pathData
Actual data directory. |
static String |
pathEditor
Actual external viewer/editor. |
static String |
pathReg
Actual path to registry database. |
static String |
pathResources
Actual resource directory. |
static String |
pathSource
Actual source path. |
protected static Properties |
pref
User options in "key->value" format. |
static String |
sysOptionsFileName
Options file name - system preferences. |
static String |
sysOptionsOrigFileName
Options file name - system preferences (original values). |
protected static Properties |
system
System options in "key->value" format. |
protected static HashSet<String> |
systemKeys
Keys which are updated in 'system' rather than in 'pref'. |
Constructor Summary | |
---|---|
Options()
|
Method Summary | |
---|---|
static String |
colorToHexString(Color c)
Converts Color to HexString (#AARRGGBB). |
static boolean |
getBoolean(String key)
Parses boolean parameter. |
static Color |
getColor(String key)
Parses color description and returns valid Color instance. |
static ImageIcon |
getIcon(String fileName)
Retrieves icon object from resource (JAR) or disk file. |
static int |
getInteger(String key)
Parses integer parameter w/o bounds checking. |
static int |
getInteger(String key,
int min,
int max,
int deflt)
Parses integer parameter and checks its bounds. |
static InputStream |
getResource(String fileName)
Retrieves resource stream object from URL resource (JAR). |
static String |
getString(String key)
Parses string parameter. |
static String |
getString(String key,
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(String key,
boolean b)
Sets the boolean parameter. |
static void |
set(String key,
Color c)
Sets the color parameter. |
static void |
set(String key,
int i)
Sets the integer parameter. |
static void |
set(String key,
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 String PATH_RESOURCES
public static String pathResources
protected static final String PATH_DATA
public static String pathData
public static final String FILE_NAME_REG
protected static final String PATH_REG
public static String pathReg
protected static final String PATH_SOURCE
public static String pathSource
protected static final String PATH_EDITOR
public static String pathEditor
public static String optionsFileName
public static String sysOptionsFileName
protected static final String PATH_SYS_OPTIONS
public static String sysOptionsOrigFileName
protected static Properties pref
protected static Properties system
protected static HashSet<String> systemKeys
Constructor Detail |
---|
public Options()
Method Detail |
---|
public static void init()
public static void save() throws IOException
IOException
reflect()
public static void load() throws IOException
IOException
interpret()
public static Color getColor(String key)
public static boolean getBoolean(String key)
public static int getInteger(String key, int min, int max, int deflt)
public static int getInteger(String key)
public static String getString(String key, String deflt)
public static String getString(String key)
null
in case of failure.
public static void interpret()
public static void reflect()
save()
operation.
public static String colorToHexString(Color c)
c
- Color to be converted (const).
public static void set(String key, String value)
interpret()
should be called to reflect all changes in working state variables.
public static void set(String key, Color c)
interpret()
should be called to reflect all changes in working state variables.
public static void set(String key, boolean b)
interpret()
should be called to reflect all changes in working state variables.
public static void set(String key, int i)
interpret()
should be called to reflect all changes in working state variables.
public static ImageIcon getIcon(String fileName)
public static InputStream getResource(String fileName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |