net.curre.prefcount
Class PrefCountRegistry

java.lang.Object
  extended by net.curre.prefcount.PrefCountRegistry

public class PrefCountRegistry
extends java.lang.Object

This is the central place for all prefcount settings and configuration data.

Created date: May 30, 2007

Author:
Yevgeny Nyden

Field Summary
static java.lang.String APPLICATION_NAME
          Application name.
static LocaleExt[] AVAILABLE_LOCALES
          Array of available locales in the application.
static java.lang.String DEFAULT_LOCALE_ID
          Default value for the locale ID (case insensitive language name).
static java.lang.String IMAGES_DIR
          Location of the images directory.
static java.lang.String SETTINGS_FILE_NAME
          Name of the settings file.
 
Method Summary
 PrefCountMenuBar addMainWindowMenuBar(javax.swing.JFrame frame, javax.swing.JPanel topPanel)
          Creates an appropriate menu bar for the main window and sets it on the mainWindow object.
 PrefCountMenuBar addPlayerDialogMenuBar(javax.swing.JFrame frame)
          Creates a menu bar for the player dialog window and sets it on the mainWindow.playerDialogFrame object.
 void doQuit()
          Disposes all frames and quits the application.
static LocaleExt getCurrentLocale()
          Returns the current locale.
static PrefCountRegistry getInstance()
          Returns the singleton instance of this class.
 LastInputPanel getLastInputPanel()
          Getter for the past input panel reference.
 MainWindow getMainWindow()
          Getter for the main window reference.
 java.lang.String getSettingsFilePath()
          Getter for property 'settingsFilePath' (absolute path to the settings file, including filename).
 void setCurrentLocale(java.lang.String localeId)
          Setter for the current locale.
 void setLastInputPanel(LastInputPanel lastInputPanel)
          Setter for the last input panel reference.
 void setMainWindow(MainWindow mainWindow)
          Setter for the main window reference.
 void setSettingsFilePath(java.lang.String settingsFilePath)
          Setter for property 'settingsFilePath' (absolute path to the settings file, including filename).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_NAME

public static final java.lang.String APPLICATION_NAME
Application name.

See Also:
Constant Field Values

IMAGES_DIR

public static final java.lang.String IMAGES_DIR
Location of the images directory.

See Also:
Constant Field Values

DEFAULT_LOCALE_ID

public static final java.lang.String DEFAULT_LOCALE_ID
Default value for the locale ID (case insensitive language name).

See Also:
Constant Field Values

SETTINGS_FILE_NAME

public static final java.lang.String SETTINGS_FILE_NAME
Name of the settings file.

See Also:
Constant Field Values

AVAILABLE_LOCALES

public static final LocaleExt[] AVAILABLE_LOCALES
Array of available locales in the application.

Method Detail

getInstance

public static PrefCountRegistry getInstance()
Returns the singleton instance of this class.

Returns:
The singleton instance of this class.

getCurrentLocale

public static LocaleExt getCurrentLocale()
Returns the current locale.

Returns:
The current locale.

setCurrentLocale

public void setCurrentLocale(java.lang.String localeId)
Setter for the current locale.

Parameters:
localeId - Identifier (case insensitive language name) for the locale to which to set.

getMainWindow

public MainWindow getMainWindow()
Getter for the main window reference.

Returns:
The reference to the main window object.

setMainWindow

public void setMainWindow(MainWindow mainWindow)
Setter for the main window reference.

Parameters:
mainWindow - Reference to the main window object.

getLastInputPanel

public LastInputPanel getLastInputPanel()
Getter for the past input panel reference.

Returns:
Reference to the last input panel.

setLastInputPanel

public void setLastInputPanel(LastInputPanel lastInputPanel)
Setter for the last input panel reference.

Parameters:
lastInputPanel - Reference to the last input panel to set.

getSettingsFilePath

public java.lang.String getSettingsFilePath()
Getter for property 'settingsFilePath' (absolute path to the settings file, including filename).

Returns:
Value for property 'settingsFilePath'.

setSettingsFilePath

public void setSettingsFilePath(java.lang.String settingsFilePath)
Setter for property 'settingsFilePath' (absolute path to the settings file, including filename).

Parameters:
settingsFilePath - Value to set for property 'settingsFilePath'.

doQuit

public void doQuit()
Disposes all frames and quits the application.


addMainWindowMenuBar

public PrefCountMenuBar addMainWindowMenuBar(javax.swing.JFrame frame,
                                             javax.swing.JPanel topPanel)
Creates an appropriate menu bar for the main window and sets it on the mainWindow object. Since sunstance LAF does not work with native Mac menu bar, an awt menu bar is created for the Mac platform; for other platforms, a swing menu bar is created.

Parameters:
frame - Frame to add menu bar to.
topPanel - Reference to the main window top panel - the language indicator icon will be added there on Mac OS.
Returns:
Reference to the created PrefCount menu bar.

addPlayerDialogMenuBar

public PrefCountMenuBar addPlayerDialogMenuBar(javax.swing.JFrame frame)
Creates a menu bar for the player dialog window and sets it on the mainWindow.playerDialogFrame object. This menu bar is created and added only when running on Mac OS platform.

Parameters:
frame - Reference to the frame to add this menu bar to.
Returns:
Reference to the created PrefCount menu bar or null of running on not Mac OS platform.


Copyright © 2008. All Rights Reserved.