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 intDefines the maximum numbers of recent files presented in the recent file menu.static final StringThe preferred amplitude for photon and gluon objects.static final StringA boolean preference indicating whether to use antialias or not.static final StringA boolean preference indicating whether to draw arrows or not.static final StringThe preferred arrow inset.static final StringThe preferred arrow length.static final StringThe preferred arrow poaition.static final StringThe preferred arrow width.static final StringThe preferred HTML browser.static final StringThe preferred canvas background color.static final StringThe preferred Object color.static final StringThe preferred color space.static final StringThe default action.static final StringThe preferred separation of double line objects.static final StringThe preferred dvips path.static final StringThe preferred text editor.static final StringThe preferred canvas background color.static final StringA boolean preference indicating whether the grid is on or off.static final StringThe preferred grid size.static final StringThe preferred grid style.static final StringThe preferred grid type.static final StringThe preferred language.static final StringThe preferred latex path.static final StringThe preferred line width.static final StringThe preferred Look and Feel (as of 2.0, the Class Name).static final StringThe preferred Postscript font family.static final StringThe preferred postscript text rotation angle.static final StringThe preferred Postscript font size.static final StringThe preferred Postscript font style.static final StringThe preferred postscript viewer.static final StringThe preferred screen size - x dimension.static final StringThe preferred screen size - y dimension.static final StringA boolean preference indicating whether to show the gridbar bar or not.static final StringA boolean preference indicating whether to show the start-up splash window or not.static final StringA boolean preference indicating whether to show the status bar or not.static final StringA boolean preference indicating whether to show the tool bar or not.static final StringA boolean preference indicating whether snapping is on or off.static final StringThe preferred TeX alignment.static final StringThe preferred LaTeX text rotation angle.static final StringThe preferred TeX font size.static final StringThe preferred Text color.static final StringThe preferred undo depth.static final StringThe current user directory.static final StringThe version of the preferences.static final StringThe preferred default vertex size. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddRecentFile(String st) Adds the given absolute path name to the list of recntly opened files.static voidSets all recent files to empty Strings.static booleangetBooleanPref(String name) Returns the preference with 'name' as a boolean, or throws a IllegalArgumentException if it does not correspond to a boolean.static floatgetFloatPref(String name) Returns the preference with 'name' as a float, or throws a IllegalArgumentException if it does not correspond to a float.static intgetIntPref(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 StringgetStringPref(String name) Returns the preference with 'name' as a String, or throws a IllegalArgumentException if it does not correspond to a String.static voidSets the Preferences for the current session from the Preferences node.static voidRe-sets the given Preference to its default value.static voidSaves the current set of Preferences to the user Preferences node, so they will be used in later sessions.static voidSaves the last visited files in the Preferences node.static voidsetBooleanPref(String name, boolean newPref) Sets the preference with 'name' to the boolean value of newPref.static voidsetFloatPref(String name, float newPref) Sets the preference with 'name' to the float value of newPref.static voidsetIntPref(String name, int newPref) Sets the preference with 'name' to the int value newPref.static voidsetRecentFiles(String[] filePaths) Set the recently opened files to the given array of absolute path names.static voidRestore the preferences to a previous state.static voidsetStringPref(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.
-