Package net.sf.jaxodraw.util
Class JaxoPrefs
java.lang.Object
net.sf.jaxodraw.util.JaxoPrefs
Responsible for importing/exporting user preferences.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Defines the maximum numbers of recent files presented in the recent file menu.static final String
The preferred amplitude for photon and gluon objects.static final String
A boolean preference indicating whether to use antialias or not.static final String
A boolean preference indicating whether to draw arrows or not.static final String
The preferred arrow inset.static final String
The preferred arrow length.static final String
The preferred arrow poaition.static final String
The preferred arrow width.static final String
The preferred HTML browser.static final String
The preferred canvas background color.static final String
The preferred Object color.static final String
The preferred color space.static final String
The default action.static final String
The preferred separation of double line objects.static final String
The preferred dvips path.static final String
The preferred text editor.static final String
The preferred canvas background color.static final String
A boolean preference indicating whether the grid is on or off.static final String
The preferred grid size.static final String
The preferred grid style.static final String
The preferred grid type.static final String
The preferred language.static final String
The preferred latex path.static final String
The preferred line width.static final String
The preferred Look and Feel (as of 2.0, the Class Name).static final String
The preferred Postscript font family.static final String
The preferred postscript text rotation angle.static final String
The preferred Postscript font size.static final String
The preferred Postscript font style.static final String
The preferred postscript viewer.static final String
The preferred screen size - x dimension.static final String
The preferred screen size - y dimension.static final String
A boolean preference indicating whether to show the gridbar bar or not.static final String
A boolean preference indicating whether to show the start-up splash window or not.static final String
A boolean preference indicating whether to show the status bar or not.static final String
A boolean preference indicating whether to show the tool bar or not.static final String
A boolean preference indicating whether snapping is on or off.static final String
The preferred TeX alignment.static final String
The preferred LaTeX text rotation angle.static final String
The preferred TeX font size.static final String
The preferred Text color.static final String
The preferred undo depth.static final String
The current user directory.static final String
The version of the preferences.static final String
The preferred default vertex size. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addRecentFile
(String st) Adds the given absolute path name to the list of recntly opened files.static void
Sets all recent files to empty Strings.static boolean
getBooleanPref
(String name) Returns the preference with 'name' as a boolean, or throws a IllegalArgumentException if it does not correspond to a boolean.static float
getFloatPref
(String name) Returns the preference with 'name' as a float, or throws a IllegalArgumentException if it does not correspond to a float.static int
getIntPref
(String name) Returns the preference with 'name' as an integer, or throws a IllegalArgumentException if it does not correspond to an int.static String[]
Returns an array of recently opened files.getState()
State of preferences.static String
getStringPref
(String name) Returns the preference with 'name' as a String, or throws a IllegalArgumentException if it does not correspond to a String.static void
Sets the Preferences for the current session from the Preferences node.static void
Re-sets the given Preference to its default value.static void
Saves the current set of Preferences to the user Preferences node, so they will be used in later sessions.static void
Saves the last visited files in the Preferences node.static void
setBooleanPref
(String name, boolean newPref) Sets the preference with 'name' to the boolean value of newPref.static void
setFloatPref
(String name, float newPref) Sets the preference with 'name' to the float value of newPref.static void
setIntPref
(String name, int newPref) Sets the preference with 'name' to the int value newPref.static void
setRecentFiles
(String[] filePaths) Set the recently opened files to the given array of absolute path names.static void
Restore the preferences to a previous state.static void
setStringPref
(String name, String str) Sets the preference with 'name' to the string str.
-
Field Details
-
PREF_BROWSER
The preferred HTML browser.- See Also:
-
PREF_EDITOR
The preferred text editor.- See Also:
-
PREF_PSVIEWER
The preferred postscript viewer.- See Also:
-
PREF_LOOKNFEEL
The preferred Look and Feel (as of 2.0, the Class Name).- See Also:
-
PREF_LANGUAGE
The preferred language.- See Also:
-
PREF_GRIDTYPE
The preferred grid type.- See Also:
-
PREF_COLOR
The preferred Object color.- See Also:
-
PREF_PSFAMILY
The preferred Postscript font family.- See Also:
-
PREF_TEXTCOLOR
The preferred Text color.- See Also:
-
PREF_LATEXPATH
The preferred latex path.- See Also:
-
PREF_DVIPSPATH
The preferred dvips path.- See Also:
-
PREF_CANVASBACKGROUND
The preferred canvas background color.- See Also:
-
PREF_VERSION
The version of the preferences.- See Also:
-
PREF_GRIDCOLOR
The preferred canvas background color.- See Also:
-
PREF_USER_DIR
The current user directory.- See Also:
-
PREF_SCREENSIZEX
The preferred screen size - x dimension.- See Also:
-
PREF_SCREENSIZEY
The preferred screen size - y dimension.- See Also:
-
PREF_GRIDSIZE
The preferred grid size.- See Also:
-
PREF_AMPLITUDE
The preferred amplitude for photon and gluon objects.- See Also:
-
PREF_PSSTYLE
The preferred Postscript font style.- See Also:
-
PREF_PSSIZE
The preferred Postscript font size.- See Also:
-
PREF_TEXSIZE
The preferred TeX font size.- See Also:
-
PREF_TEXALIGN
The preferred TeX alignment.- See Also:
-
PREF_PSROTANGLE
The preferred postscript text rotation angle.- See Also:
-
PREF_TEXROTANGLE
The preferred LaTeX text rotation angle.- See Also:
-
PREF_DEFAULTACTION
The default action.- See Also:
-
PREF_UNDODEPTH
The preferred undo depth.- See Also:
-
PREF_COLORSPACE
The preferred color space.- See Also:
-
PREF_GRIDSTYLE
The preferred grid style.- See Also:
-
PREF_VERTEXSIZE
The preferred default vertex size.- See Also:
-
PREF_LINEWIDTH
The preferred line width.- See Also:
-
PREF_DLSEP
The preferred separation of double line objects.- See Also:
-
PREF_ARROWPOSITION
The preferred arrow poaition.- See Also:
-
PREF_ARROWLENGTH
The preferred arrow length.- See Also:
-
PREF_ARROWWIDTH
The preferred arrow width.- See Also:
-
PREF_ARROWINSET
The preferred arrow inset.- See Also:
-
PREF_SHOWTOOL
A boolean preference indicating whether to show the tool bar or not.- See Also:
-
PREF_SHOWSTATUS
A boolean preference indicating whether to show the status bar or not.- See Also:
-
PREF_ANTIALIAS
A boolean preference indicating whether to use antialias or not.- See Also:
-
PREF_ARROW
A boolean preference indicating whether to draw arrows or not.- See Also:
-
PREF_GRIDONOFF
A boolean preference indicating whether the grid is on or off.- See Also:
-
PREF_SNAPONOFF
A boolean preference indicating whether snapping is on or off.- See Also:
-
PREF_SHOWGRIDBAR
A boolean preference indicating whether to show the gridbar bar or not.- See Also:
-
PREF_SHOWSPLASHWINDOW
A boolean preference indicating whether to show the start-up splash window or not.- See Also:
-
MAX_RECENT_FILES
public static final int MAX_RECENT_FILESDefines the maximum numbers of recent files presented in the recent file menu.- See Also:
-
-
Method Details
-
getRecentFiles
Returns an array of recently opened files.- Returns:
- An array containing the absolute paths of recently opened files or empty Strings.
-
setRecentFiles
Set the recently opened files to the given array of absolute path names.- Parameters:
filePaths
- the absolute path names. If an entry is null, it will be replaced by an empty String.
-
clearRecentFiles
public static void clearRecentFiles()Sets all recent files to empty Strings. -
addRecentFile
Adds the given absolute path name to the list of recntly opened files.- Parameters:
st
- an absolute path name.
-
getStringPref
Returns the preference with 'name' as a String, or throws a IllegalArgumentException if it does not correspond to a String.- Parameters:
name
- The name of the preference.- Returns:
- The preference with 'name'.
-
getIntPref
Returns the preference with 'name' as an integer, or throws a IllegalArgumentException if it does not correspond to an int.- Parameters:
name
- The name of the preference.- Returns:
- The preference with 'name'.
-
getFloatPref
Returns the preference with 'name' as a float, or throws a IllegalArgumentException if it does not correspond to a float.- Parameters:
name
- The name of the preference.- Returns:
- The preference with 'name'.
-
getBooleanPref
Returns the preference with 'name' as a boolean, or throws a IllegalArgumentException if it does not correspond to a boolean.- Parameters:
name
- The name of the preference.- Returns:
- The preference with 'name'.
-
setStringPref
Sets the preference with 'name' to the string str.- Parameters:
name
- The name of the preference to be set.str
- the preference to be set.
-
setIntPref
Sets the preference with 'name' to the int value newPref.- Parameters:
name
- The name of the preference to be set.newPref
- The preference to be set.
-
setFloatPref
Sets the preference with 'name' to the float value of newPref.- Parameters:
name
- The name of the preference to be set.newPref
- The preference to be set.
-
setBooleanPref
Sets the preference with 'name' to the boolean value of newPref.- Parameters:
name
- The name of the preference to be set.newPref
- The preference to be set.
-
getState
State of preferences. The only use is to restore the current state later (after having made temporary changes) withsetState(java.util.Map)
.- Returns:
- Object
-
setState
Restore the preferences to a previous state.- Parameters:
value
- previous state to be set, obtained fromgetState()
.
-
initSessionPrefs
public static void initSessionPrefs()Sets the Preferences for the current session from the Preferences node. -
resetPref
Re-sets the given Preference to its default value.- Parameters:
name
- the name of the preference to re-set.
-
savePrefs
public static void savePrefs()Saves the current set of Preferences to the user Preferences node, so they will be used in later sessions. -
saveRecentFiles
public static void saveRecentFiles()Saves the last visited files in the Preferences node.
-