Class Prefs
Once you have retrieved the Preferences object and modified it, you must save it before MASON is terminated.
How this works with Java's Preferences: All preferences start with a certain path and then add a namespace onto it. Global preferences have a path which starts with "edu/gmu/mason/global/" -- Display2D's namespace is "Display2D", so for example, Display2D's global preferences are "edu/gmu/mason/global/Display2D". App-specific preferences also have unique paths. For example, HeatBugs's preferences path is "edu/gmu/mason/app/sim/app/heatbugs/", so Display2D's app preferences, when used with Heatbugs, is "edu/gmu/mason/app/sim/app/heatbugs/Display2D". You don't need to be concerned with this if you just want to retrieve and/or delete preferences objects.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Preferences
getAppPreferences
(GUIState simulation, String namespace) Returns app-specific preferences for MASON, with the given additional prefix as a namespace.static Preferences
getGlobalPreferences
(String namespace) Returns the global preferences for MASON, with the given additional prefix as a namespace.static boolean
removeAppPreferences
(GUIState simulation, String namespace) Deletes certain app-specific preferences for MASON, with the given additional prefix as a namespace.static boolean
removeGlobalPreferences
(String namespace) Deletes certain global preferences for MASON, with the given additional prefix as a namespace.static boolean
save
(Preferences prefs) Saves a given Preferences.
-
Field Details
-
MASON_PREFERENCES
- See Also:
-
APP_PREFERENCES
- See Also:
-
-
Constructor Details
-
Prefs
public Prefs()
-
-
Method Details
-
getGlobalPreferences
Returns the global preferences for MASON, with the given additional prefix as a namespace. -
getAppPreferences
Returns app-specific preferences for MASON, with the given additional prefix as a namespace. -
removeGlobalPreferences
Deletes certain global preferences for MASON, with the given additional prefix as a namespace. -
removeAppPreferences
Deletes certain app-specific preferences for MASON, with the given additional prefix as a namespace. -
save
Saves a given Preferences.
-