|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.swing.WordHoardSettings
public class WordHoardSettings
Global settings for WordHoard.
This class holds the static values of global settings used by many other WordHoard classes. This includes the global string resource bundle and the current user information, including the user ID of the currently logged in user. All of these settings are stored in protected variables to allow access but disallow changes once they are initialized at start up.
The WordHoard resource bundle contains definitions for all the string constants used in WordHoardCalc. Once the resource strings have been initialized in the initializeSettings method you can access the strings by calling getString:
String s = WordHoardSettings.getString( "mystring" , "my string" );
To get the userID of the currently logged in user, use
String userID = WordHoardSettings.getUserID();
The userID is null if the user is not logged in.
Field Summary | |
---|---|
protected static int |
botSlop
Bottom window slop. |
protected static boolean |
buildProgramRunning
True if a WordHoard build program is running and needs to access the main WordHoard database directly. |
protected static int |
growSlop
Grow box slop. |
protected static java.lang.String |
programBanner
The program banner (title and version number) |
protected static java.lang.String |
programCodebase
The WebStart code base. |
protected static javax.swing.ImageIcon |
programIcon
The WordHoard large icon. |
protected static java.lang.String |
programIconFileName
The WordHoard large icon file name. |
protected static javax.swing.ImageIcon |
programLogo
The WordHoard logo. |
protected static java.lang.String |
programLogoFileName
The WordHoard logo file name. |
protected static java.lang.String |
programPrompt
The script interpreter prompt. |
protected static javax.swing.ImageIcon |
programSmallIcon
The WordHoard small icon. |
protected static java.lang.String |
programSmallIconFileName
The WordHoard small icon file name. |
protected static java.lang.String |
programTitle
The program name. |
protected static java.lang.String |
programVersion
The program version. |
protected static java.lang.String |
programWebSite
The program web site. |
protected static java.util.ResourceBundle |
resourceBundle
The resource strings. |
protected static java.lang.String |
resourceName
Resource bundle path/name. |
protected static int |
topSlop
Top window slop. |
protected static boolean |
useScreenMenuBar
True to use screen menu bar on Mac OS. |
protected static boolean |
warnWhenQuitting
True to issue warning when quitting WordHoard. |
Constructor Summary | |
---|---|
protected |
WordHoardSettings()
Can't instantiate but can override. |
Method Summary | |
---|---|
static int |
getBotSlop()
Gets the bottom window slop. |
static boolean |
getBuildProgramRunning()
Get flag telling if build program is running or not. |
static boolean |
getCanManageAccounts()
Get the user's account manager status. |
static int |
getGrowSlop()
Gets the grow box slop. |
static Account |
getLoginAccount()
Gets the login account. |
static java.lang.String |
getName()
Get the user's name. |
static java.lang.String |
getProgramBanner()
Get the program banner. |
static javax.swing.ImageIcon |
getProgramIcon()
Get the program icon. |
static javax.swing.ImageIcon |
getProgramLogo()
Get the program logo. |
static java.lang.String |
getProgramPrompt()
Get the program prompt. |
static javax.swing.ImageIcon |
getProgramSmallIcon()
Get the small program icon. |
static java.lang.String |
getProgramTitle()
Get the program title. |
static java.lang.String |
getProgramVersion()
Get the program version. |
static java.lang.String |
getString(java.lang.String resourceName)
Get string from ResourceBundle. |
static java.lang.String |
getString(java.lang.String resourceName,
java.lang.String defaultValue)
Get string from ResourceBundle. |
static java.lang.String[] |
getStrings(java.lang.String resourceName,
java.lang.String[] defaults)
Parse ResourceBundle for a String array. |
static int |
getTopSlop()
Gets the top window slop. |
static java.lang.String |
getUserID()
Get the user ID. |
static boolean |
getUseScreenMenuBar()
Returns true to use the screen menu bar on Mac OS X. |
static boolean |
getWarnWhenQuitting()
Get "warn when quitting" flag. |
static java.lang.String |
getWebSiteURL()
Get the WordHoard web site URL. |
static void |
initializeSettings(boolean noAWT)
Initialize WordHoard settings. |
static boolean |
isCurrentUser(java.lang.String userID)
Check if a user ID is for the currently logged in user. |
static boolean |
isEmptyUserID(java.lang.String userID)
Check for null or empty user ID. |
static boolean |
isLoggedIn()
Check if user logged in. |
static void |
loadPreferences()
Read preferences. |
static void |
savePreferences()
Save preferences. |
static void |
setBuildProgramRunning(boolean isBuild)
Enable or disable build program running. |
static java.lang.String[] |
tokenize(java.lang.String input)
Split string into a series of substrings on whitespace boundries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.ResourceBundle resourceBundle
protected static java.lang.String programTitle
protected static java.lang.String programVersion
protected static java.lang.String programBanner
protected static java.lang.String programWebSite
protected static java.lang.String programPrompt
protected static java.lang.String programLogoFileName
protected static javax.swing.ImageIcon programLogo
protected static java.lang.String programIconFileName
protected static javax.swing.ImageIcon programIcon
protected static java.lang.String programSmallIconFileName
protected static javax.swing.ImageIcon programSmallIcon
protected static java.lang.String programCodebase
protected static int topSlop
protected static int botSlop
protected static int growSlop
protected static boolean warnWhenQuitting
protected static boolean buildProgramRunning
protected static java.lang.String resourceName
protected static boolean useScreenMenuBar
Constructor Detail |
---|
protected WordHoardSettings()
Method Detail |
---|
public static void initializeSettings(boolean noAWT)
noAWT
- Avoid any class that might require AWT or Swing. public static java.lang.String getString(java.lang.String resourceName, java.lang.String defaultValue)
resourceName
- Name of resource to retrieve.defaultValue
- Default value for resource.
Underline "_" characters are replaced by spaces.
public static java.lang.String getString(java.lang.String resourceName)
resourceName
- Name of resource to retrieve.
Underline "_" characters are replaced by spaces.
public static java.lang.String[] getStrings(java.lang.String resourceName, java.lang.String[] defaults)
resourceName
- Name of resource.defaults
- Array of default string values.
public static Account getLoginAccount()
public static java.lang.String getUserID()
If "buildProgramRunning" is true, return "system" as the user ID. This is for use by build programs only.
public static java.lang.String getName()
public static boolean isCurrentUser(java.lang.String userID)
userID
- The user ID to check.
public static boolean isLoggedIn()
public static boolean isEmptyUserID(java.lang.String userID)
userID
- User ID to check.
public static boolean getCanManageAccounts()
public static java.lang.String getProgramBanner()
public static java.lang.String getProgramPrompt()
public static java.lang.String getProgramTitle()
public static javax.swing.ImageIcon getProgramLogo()
public static javax.swing.ImageIcon getProgramIcon()
public static javax.swing.ImageIcon getProgramSmallIcon()
public static java.lang.String getProgramVersion()
public static java.lang.String[] tokenize(java.lang.String input)
input
- Input string.
This is useful for retrieving an array of strings from the resource file. Underline "_" characters are replaced by spaces.
public static void savePreferences()
public static void loadPreferences()
public static java.lang.String getWebSiteURL()
public static int getTopSlop()
public static int getBotSlop()
public static int getGrowSlop()
public static boolean getWarnWhenQuitting()
public static void setBuildProgramRunning(boolean isBuild)
isBuild
- Set to true to use direct database access for
create/modify/update oprations instead of going
through WordHoard server. Set to false for
normal WordHoard client use. public static boolean getBuildProgramRunning()
public static boolean getUseScreenMenuBar()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |