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
-
PREF_EDITOR
-
PREF_PSVIEWER
-
PREF_LOOKNFEEL
The preferred Look and Feel (as of 2.0, the Class Name).- See Also:
-
PREF_LANGUAGE
-
PREF_GRIDTYPE
-
PREF_COLOR
-
PREF_PSFAMILY
-
PREF_TEXTCOLOR
-
PREF_LATEXPATH
-
PREF_DVIPSPATH
-
PREF_CANVASBACKGROUND
-
PREF_VERSION
-
PREF_GRIDCOLOR
-
PREF_USER_DIR
-
PREF_SCREENSIZEX
-
PREF_SCREENSIZEY
-
PREF_GRIDSIZE
-
PREF_AMPLITUDE
The preferred amplitude for photon and gluon objects.- See Also:
-
PREF_PSSTYLE
-
PREF_PSSIZE
-
PREF_TEXSIZE
-
PREF_TEXALIGN
-
PREF_PSROTANGLE
-
PREF_TEXROTANGLE
-
PREF_DEFAULTACTION
-
PREF_UNDODEPTH
-
PREF_COLORSPACE
-
PREF_GRIDSTYLE
-
PREF_VERTEXSIZE
-
PREF_LINEWIDTH
-
PREF_DLSEP
-
PREF_ARROWPOSITION
-
PREF_ARROWLENGTH
-
PREF_ARROWWIDTH
-
PREF_ARROWINSET
-
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
-
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
-
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.
-