Class GuiLafPreferencesManager
- All Implemented Interfaces:
BeanInterface,PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault,JmriServiceProviderInterface,PreferencesManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intLargest font size a user can set the font size to (36).static final intSmallest font size a user can set the font size to other than zero (9).static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class jmri.beans.Bean
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidApply the existing look and feel.voidfirePropertyChange(String propertyName, boolean oldValue, boolean newValue) Fire a property change.voidfirePropertyChange(String propertyName, int oldValue, int newValue) Fire a property change.voidfirePropertyChange(String propertyName, Object oldValue, Object newValue) Fire a property change.intGet the default font size for the current Look and Feel.getFont()intgetInitializationExceptions(Profile profile) Get the set of exceptions thrown during initialization for the provided Profile.intJFileChooser TypeGet the name of the class implementing the preferred look and feel.intGet the set of Classes that this PreferencesManager can be registered as a provider of in theInstanceManager.Collection<Class<? extends PreferencesManager>>Get the set of PreferencesManagers that must be initialized prior to initializing this PreferencesManager.intGet the time a tooltip is displayed before being dismissed.voidinitialize(Profile profile) Initialize the PreferencesManager with preferences associated with the provided Profile.booleanisDirty()Check if preferences need to be saved.booleanbooleanbooleanisInitialized(Profile profile) Test if the PreferencesManager is initialized without errors for the provided Profile.booleanisInitializedWithExceptions(Profile profile) Test if the PreferencesManager is initialized, but threw anInitializationExceptionduring initialization, for the provided Profile.booleanbooleanbooleanCheck if application needs to restart to apply preferences.voidsavePreferences(Profile profile) Save the preferences that this provider manages for the provided Profile.voidCalled to load the current Look and Feel default font, based on looking up the "List.font".voidGet the default font size for the current Look and Feel, based on looking up the "List.font" size.voidsetEditorUseOldLocSize(boolean editorUseOldLocSize) voidSets a new fontvoidsetFontByName(String newFontName) Sets a new font by namevoidsetFontSize(int newFontSize) Set the new font size.voidsetGraphicTableState(boolean graphicTableState) voidsetJFileChooserFormat(int jFileChooserFormat) voidstatic voidsetLocaleMinimally(Profile profile) Stand-alone service routine to set the default Locale.voidsetLookAndFeel(String lookAndFeel) Set the name of the class implementing the preferred look and feel.voidsetMaxComboRows(int maxRows) Set a new value for the number of combo box rows to be displayed.voidsetNonStandardMouseEvent(boolean nonStandardMouseEvent) voidsetOblockEditTabbed(boolean tabbed) voidsetToolTipDismissDelay(int time) Sets the time a tooltip is displayed before it goes away.Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setProperty
-
Field Details
-
FONT_NAME
- See Also:
-
FONT_SIZE
- See Also:
-
LOCALE
- See Also:
-
LOOK_AND_FEEL
- See Also:
-
NONSTANDARD_MOUSE_EVENT
- See Also:
-
GRAPHIC_TABLE_STATE
- See Also:
-
OBLOCK_EDIT_TABBED
- See Also:
-
VERTICAL_TOOLBAR
- See Also:
-
SHOW_TOOL_TIP_TIME
- See Also:
-
EDITOR_USE_OLD_LOC_SIZE
- See Also:
-
JFILECHOOSER_FORMAT
- See Also:
-
MAX_COMBO_ROWS
- See Also:
-
MIN_FONT_SIZE
Smallest font size a user can set the font size to other than zero (9). A font size of 0 indicates that the system default font size will be used. -
MAX_FONT_SIZE
Largest font size a user can set the font size to (36). -
PROP_DIRTY
- See Also:
-
PROP_RESTARTREQUIRED
- See Also:
-
DEFAULT_FONT
- See Also:
-
-
Constructor Details
-
GuiLafPreferencesManager
public GuiLafPreferencesManager()
-
-
Method Details
-
initialize
Description copied from interface:PreferencesManagerInitialize the PreferencesManager with preferences associated with the provided Profile.Implementing classes should throw an InitializationException with a user readable localized message, since it most likely be displayed to the user. Implementing classes will still want to ensure that
PreferencesManager.isInitialized(jmri.profile.Profile)orPreferencesManager.isInitializedWithExceptions(jmri.profile.Profile)return true if throwing an InitializationException to ensure that the provider is not repeatedly initialized.- Specified by:
initializein interfacePreferencesManager- Parameters:
profile- the configuration profile used for this initialization; may be null to initialize for this user regardless of profile- Throws:
InitializationException- if the user needs to be notified of an issue that prevents regular use of the application
-
isInitialized
Description copied from interface:PreferencesManagerTest if the PreferencesManager is initialized without errors for the provided Profile. Note that although both this method andPreferencesManager.isInitializedWithExceptions(jmri.profile.Profile)can be false, if isInitializedWithExceptions(Profile) returns true, this method must return false.- Specified by:
isInitializedin interfacePreferencesManager- Parameters:
profile- the configuration profile to test against; may be null to test for exceptions thrown when initializing for this user regardless of profile- Returns:
- true if the provider is initialized without exceptions
-
getRequires
Description copied from interface:PreferencesManagerGet the set of PreferencesManagers that must be initialized prior to initializing this PreferencesManager. It is generally preferable to require an Interface or an abstract Class instead of a concrete Class, since that allows all (or any) concrete implementations of the required class to be initialized to provide required services for the requiring PreferencesManager instance.Note that for any set of PreferencesManagers with the same requirements, or with a circular dependency between each other, the order in which the PreferencesManagers in that set are initialized should be considered non-deterministic.
- Specified by:
getRequiresin interfacePreferencesManager- Returns:
- A set or list of classes. If there are no dependencies, return an empty set instead of null.
-
getProvides
Description copied from interface:PreferencesManagerGet the set of Classes that this PreferencesManager can be registered as a provider of in theInstanceManager.- Specified by:
getProvidesin interfacePreferencesManager- Returns:
- A set or list of classes. If this PreferencesManager provides an instance of no other Interfaces or abstract Classes than PreferencesManager, return an empty set instead of null.
-
savePreferences
Description copied from interface:PreferencesManagerSave the preferences that this provider manages for the provided Profile.- Specified by:
savePreferencesin interfacePreferencesManager- Parameters:
profile- the profile associated with the preferences to save; may be null to save preferences that apply to the current user regardless of profile
-
getLocale
- Returns:
- the locale
-
setLocale
- Parameters:
locale- the locale to set
-
getFont
- Returns:
- the currently selected font
-
setFont
Sets a new font- Parameters:
newFont- the new font to set
-
setFontByName
Sets a new font by name- Parameters:
newFontName- the name of the new font to set
-
getDefaultFont
- Returns:
- the current Look and Feel default font
-
setDefaultFont
Called to load the current Look and Feel default font, based on looking up the "List.font". -
getFontSize
- Returns:
- the currently selected font size
-
setFontSize
Set the new font size. If newFontSize is non-zero and less than 9, the font size is set to 9 or if greater than 36, the font size is set to 36.- Parameters:
newFontSize- the new font size to set
-
getDefaultFontSize
Get the default font size for the current Look and Feel.- Returns:
- the default font size
-
setDefaultFontSize
Get the default font size for the current Look and Feel, based on looking up the "List.font" size. -
setToolTipDismissDelay
Sets the time a tooltip is displayed before it goes away.Note that this preference takes effect immediately.
- Parameters:
time- the delay in seconds.
-
getToolTipDismissDelay
Get the time a tooltip is displayed before being dismissed.- Returns:
- the delay in seconds
-
isNonStandardMouseEvent
- Returns:
- the nonStandardMouseEvent
-
setNonStandardMouseEvent
- Parameters:
nonStandardMouseEvent- the nonStandardMouseEvent to set
-
isGraphicTableState
- Returns:
- the graphicTableState
-
setGraphicTableState
- Parameters:
graphicTableState- the graphicTableState to set
-
isOblockEditTabbed
- Returns:
- the graphicTableState
-
setOblockEditTabbed
- Parameters:
tabbed- the Editor interface to set (fasle = desktop)
-
getMaxComboRows
- Returns:
- the number of combo box rows to be displayed.
-
setMaxComboRows
Set a new value for the number of combo box rows to be displayed.- Parameters:
maxRows- The new value, zero for no limit
-
isEditorUseOldLocSize
- Returns:
- the editorUseOldLocSize value
-
setEditorUseOldLocSize
- Parameters:
editorUseOldLocSize- the editorUseOldLocSize value to set
-
getJFileChooserFormat
JFileChooser Type- Returns:
- 0 default, 1 List 2 Detail
-
setJFileChooserFormat
- Parameters:
jFileChooserFormat- the JFileChooser 0 default, 1 list, 2 detail
-
getLookAndFeel
Get the name of the class implementing the preferred look and feel. Note this may not be the in-use look and feel if the preferred look and feel is not available on the current platform; and will be overwritten if preferences are saved on a platform where the preferred look and feel is not available.- Returns:
- the look and feel class name
-
setLookAndFeel
Set the name of the class implementing the preferred look and feel. Note this change only takes effect after the application is restarted, because Java has some issues setting the look and feel correctly on already open windows.- Parameters:
lookAndFeel- the look and feel class name
-
applyLookAndFeel
Apply the existing look and feel. -
setLocaleMinimally
Stand-alone service routine to set the default Locale.Intended to be invoked early, as soon as a profile is available, to ensure the correct language is set as startup proceeds. Must be followed eventually by a complete
setLocale(java.util.Locale).- Parameters:
profile- The profile to get the locale from
-
isDirty
Check if preferences need to be saved.- Returns:
- true if preferences need to be saved
-
isRestartRequired
Check if application needs to restart to apply preferences.- Returns:
- true if preferences are only applied on application start
-
firePropertyChange
Fire a property change.- Specified by:
firePropertyChangein interfacePropertyChangeFirer- Overrides:
firePropertyChangein classBean- Parameters:
propertyName- the programmatic name of the property that was changedoldValue- the old value of the propertynewValue- the new value of the property
-
firePropertyChange
Fire a property change.- Specified by:
firePropertyChangein interfacePropertyChangeFirer- Overrides:
firePropertyChangein classBean- Parameters:
propertyName- the programmatic name of the property that was changedoldValue- the old value of the propertynewValue- the new value of the property
-
firePropertyChange
Fire a property change.- Specified by:
firePropertyChangein interfacePropertyChangeFirer- Overrides:
firePropertyChangein classBean- Parameters:
propertyName- the programmatic name of the property that was changedoldValue- the old value of the propertynewValue- the new value of the property
-
isInitializedWithExceptions
Description copied from interface:PreferencesManagerTest if the PreferencesManager is initialized, but threw anInitializationExceptionduring initialization, for the provided Profile. Note that although both this method andPreferencesManager.isInitialized(jmri.profile.Profile)can be false, if isInitialized(Profile) returns true, this method must return false.- Specified by:
isInitializedWithExceptionsin interfacePreferencesManager- Parameters:
profile- the configuration profile to test against; may be null to test for exceptions thrown when initializing for this user regardless of profile- Returns:
- true if the provide is initialized with exceptions
-
getInitializationExceptions
Description copied from interface:PreferencesManagerGet the set of exceptions thrown during initialization for the provided Profile.- Specified by:
getInitializationExceptionsin interfacePreferencesManager- Parameters:
profile- the configuration profile to test against; may be null to test for exceptions thrown when initializing for this user regardless of profile- Returns:
- A list of exceptions. If there are no exceptions, return an empty set instead of null.
-