Interface UserPreferencesManager
-
- All Known Implementing Classes:
JmriUserPreferencesManager
public interface UserPreferencesManager
Interface for the User Preferences Manager.The User Message Preference Manager keeps track of the options that a user has selected in messages where they have selected "Remember this setting for next time"
- See Also:
JmriUserPreferencesManager
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PREFERENCES_UPDATED
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener l)
void
finishLoading()
boolean
getCheckboxPreferenceState(java.lang.String name, boolean defaultState)
Enquire as to the state of a user preference.java.lang.String
getChoiceDescription(java.lang.String strClass, java.lang.String item)
Get the a meaningful description of a given item in a given class or group.java.lang.String
getChoiceName(java.lang.String strClass, int n)
Get the nth item name in a given class.java.util.HashMap<java.lang.Integer,java.lang.String>
getChoiceOptions(java.lang.String strClass, java.lang.String item)
Returns a map of the value against description of the different items in a given class.java.lang.String
getClassDescription(java.lang.String strClass)
Get the description of a class/group registered with the preferences.java.lang.String
getComboBoxLastSelection(java.lang.String comboBoxName)
The last selected value in a given combo box.int
getMultipleChoiceDefaultOption(java.lang.String strClass, java.lang.String choice)
Returns the default value of a given item in a given classjava.util.ArrayList<java.lang.String>
getMultipleChoiceList(java.lang.String strClass)
Get a list of all the multiple choice items registered with a given class.int
getMultipleChoiceOption(java.lang.String strClass, java.lang.String item)
Get the current value of a given item in a given class.int
getMultipleChoiceSize(java.lang.String strClass)
Get the number of Multiple Choice items registered with a given class.java.lang.String
getPreferenceItemDescription(java.lang.String strClass, java.lang.String item)
Returns the description of the given item preference in the given classjava.lang.String
getPreferenceItemName(java.lang.String strClass, int n)
Returns the itemName of the n preference in the given classjava.util.ArrayList<java.lang.String>
getPreferenceList(java.lang.String strClass)
Returns a list of preferences that are registered against a specific class.java.util.ArrayList<java.lang.String>
getPreferencesClasses()
Get the list of the classes registered with the preference manager.int
getPreferencesSize(java.lang.String strClass)
Get the combined size of both types of items registered.boolean
getPreferenceState(java.lang.String strClass, java.lang.String item)
Returns the state of a given item registered against a specific class or item.java.lang.Object
getProperty(java.lang.String strClass, java.lang.String key)
Retrieve the value associated with a key in a given class If no value has been set for that key, returns null.java.util.Set<java.lang.String>
getPropertyKeys(java.lang.String strClass)
Retrieve the complete current set of keys for a given class.boolean
getSaveWindowLocation(java.lang.String strClass)
boolean
getSaveWindowSize(java.lang.String strClass)
java.awt.Dimension
getScreen()
boolean
getSessionPreferenceState(java.lang.String name)
Enquire as to the state of a user preference for the current session.boolean
getSimplePreferenceState(java.lang.String name)
Enquire as to the state of a user preference.java.util.ArrayList<java.lang.String>
getSimplePreferenceStateList()
Returns an ArrayList of the check box states set as true.java.util.ArrayList<java.lang.String>
getWindowList()
java.awt.Point
getWindowLocation(java.lang.String strClass)
Get the x,y location of a given Window.java.awt.Dimension
getWindowSize(java.lang.String strClass)
Returns the width, height size of a given Windowboolean
hasProperties(java.lang.String strClass)
Check if there are properties for the given classboolean
isSaveAllowed()
Check if saving preferences is allowed.void
removePropertyChangeListener(java.beans.PropertyChangeListener l)
void
resetChangeMade()
void
setCheckboxPreferenceState(java.lang.String name, boolean state)
This is used to remember the last selected state of a checkBox and thus allow that checkBox to be set to a true state when it is next initialized.void
setClassDescription(java.lang.String strClass)
Given that we know the class as a string, we will try and attempt to gather details about the preferences that has been added, so that we can make better sense of the details in the preferences window.void
setComboBoxLastSelection(java.lang.String comboBoxName, java.lang.String lastValue)
Set the last selected value in a given combo box.void
setLoading()
void
setMessageItemDetails(java.lang.String strClass, java.lang.String item, java.lang.String description, java.util.HashMap<java.lang.Integer,java.lang.String> options, int defaultOption)
Add descriptive details about a specific message box, so that if it needs to be reset in the preferences, then it is easily identifiable. displayed to the user in the preferences GUI.void
setMultipleChoiceOption(java.lang.String strClass, java.lang.String choice, int value)
Sets the value of a given item in a given class, by its integer value.void
setMultipleChoiceOption(java.lang.String strClass, java.lang.String choice, java.lang.String value)
Sets the value of a given item in a given class, by its string description.void
setPreferenceItemDetails(java.lang.String strClass, java.lang.String item, java.lang.String description)
Register details about a particular preference, so that it can be displayed in the GUI and provide a meaning full description when presented to the user.void
setPreferenceState(java.lang.String strClass, java.lang.String item, boolean state)
Used to save the state of checkboxes which can suppress messages from being displayed.void
setProperty(java.lang.String strClass, java.lang.String key, java.lang.Object value)
Attach a key/value pair to the given class, which can be retrieved later.void
setSaveAllowed(boolean saveAllowed)
Set if saving preferences is allowed.void
setSaveWindowLocation(java.lang.String strClass, boolean b)
Set if window locations should be saved for a given class.void
setSaveWindowSize(java.lang.String strClass, boolean b)
Set if window sizes should be saved for a given class.void
setSessionPreferenceState(java.lang.String name, boolean state)
Used to suppress messages for the current session, the information is not stored, can not be changed via the GUI.void
setSimplePreferenceState(java.lang.String name, boolean state)
This is used to remember the last selected state of a checkBox and thus allow that checkBox to be set to a true state when it is next initialized.void
setWindowLocation(java.lang.String strClass, java.awt.Point location)
Saves the last location of a given component on the screen.void
setWindowSize(java.lang.String strClass, java.awt.Dimension dim)
Saves the last size of a given component on the screenvoid
showErrorMessage(java.awt.Component parentComponent, java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show an error message ("don't forget ...") with a given dialog title and user message.void
showErrorMessage(java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show an error message ("don't forget ...") with a given dialog title and user message.void
showInfoMessage(java.awt.Component parentComponent, java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item)
Show an info message ("don't forget ...") with a given dialog title and user message.void
showInfoMessage(java.awt.Component parentComponent, java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show an info message ("don't forget ...") with a given dialog title and user message.void
showInfoMessage(java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item)
Show an info message ("don't forget ...") with a given dialog title and user message.void
showInfoMessage(java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show an info message ("don't forget ...") with a given dialog title and user message.void
showWarningMessage(java.awt.Component parentComponent, java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show a warning message ("don't forget ...") with a given dialog title and user message.void
showWarningMessage(java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show a warning message ("don't forget ...") with a given dialog title and user message.
-
-
-
Field Detail
-
PREFERENCES_UPDATED
static final java.lang.String PREFERENCES_UPDATED
- See Also:
- Constant Field Values
-
-
Method Detail
-
setLoading
void setLoading()
-
finishLoading
void finishLoading()
-
getSimplePreferenceState
boolean getSimplePreferenceState(java.lang.String name)
Enquire as to the state of a user preference.Preferences that have not been set will be considered to be false.
The name is free-form, but to avoid ambiguity it should start with the package name (package.Class) for the primary using class.
- Parameters:
name
- the name of the preference- Returns:
- the state or false if never set
-
setSimplePreferenceState
void setSimplePreferenceState(java.lang.String name, boolean state)
This is used to remember the last selected state of a checkBox and thus allow that checkBox to be set to a true state when it is next initialized. This can also be used anywhere else that a simple yes/no, true/false type preference needs to be stored.It should not be used for remembering if a user wants to suppress a message as there is no means in the GUI for the user to reset the flag. setPreferenceState() should be used in this instance The name is free-form, but to avoid ambiguity it should start with the package name (package.Class) for the primary using class.
- Parameters:
name
- A unique name to identify the state being storedstate
- simple boolean
-
getCheckboxPreferenceState
boolean getCheckboxPreferenceState(java.lang.String name, boolean defaultState)
Enquire as to the state of a user preference.Preferences that have not been set will be considered to be defaultState.
The name is free-form, but to avoid ambiguity it should start with the package name (package.Class) for the primary using class.
- Parameters:
name
- the name of the preferencedefaultState
- the default state if not set- Returns:
- the state or defaultState if never set
-
setCheckboxPreferenceState
void setCheckboxPreferenceState(java.lang.String name, boolean state)
This is used to remember the last selected state of a checkBox and thus allow that checkBox to be set to a true state when it is next initialized. This can also be used anywhere else that a simple yes/no, true/false type preference needs to be stored.It should not be used for remembering if a user wants to suppress a message as there is no means in the GUI for the user to reset the flag. setPreferenceState() should be used in this instance The name is free-form, but to avoid ambiguity it should start with the package name (package.Class) for the primary using class.
- Parameters:
name
- A unique name to identify the state being storedstate
- simple boolean
-
getSimplePreferenceStateList
java.util.ArrayList<java.lang.String> getSimplePreferenceStateList()
Returns an ArrayList of the check box states set as true.- Returns:
- list of simple preferences names
-
setPreferenceState
void setPreferenceState(java.lang.String strClass, java.lang.String item, boolean state)
Used to save the state of checkboxes which can suppress messages from being displayed. This method should be used by the initiating code in conjunction with the preferenceItemDetails. Here the items are stored against a specific class and access to change them is made available via the GUI, in the preference manager.The strClass parameter does not have to be the exact class name of the initiating code, but can be one where the information is related and therefore can be grouped together with.
Both the strClass and item although free form, should make up a unique reference.
- Parameters:
strClass
- The class that this preference should be stored or grouped with.item
- The specific item that is to be storedstate
- Boolean state of the item.
-
getPreferenceState
boolean getPreferenceState(java.lang.String strClass, java.lang.String item)
Returns the state of a given item registered against a specific class or item.- Parameters:
strClass
- name of the class for this preferenceitem
- name of the item for which the state is being retrieved- Returns:
- the state or false if not set
-
setPreferenceItemDetails
void setPreferenceItemDetails(java.lang.String strClass, java.lang.String item, java.lang.String description)
Register details about a particular preference, so that it can be displayed in the GUI and provide a meaning full description when presented to the user.- Parameters:
strClass
- A string form of the class that the preference is stored or grouped withitem
- The specific item that is being storeddescription
- A meaningful description of the item that the user will understand
-
getPreferenceList
java.util.ArrayList<java.lang.String> getPreferenceList(java.lang.String strClass)
Returns a list of preferences that are registered against a specific class.- Parameters:
strClass
- the class name- Returns:
- the list of preference names
-
getPreferenceItemName
@CheckForNull java.lang.String getPreferenceItemName(java.lang.String strClass, int n)
Returns the itemName of the n preference in the given class- Parameters:
strClass
- the name of the classn
- the position in an array- Returns:
- the name of the preference or null if non-existent
-
getPreferenceItemDescription
@CheckForNull java.lang.String getPreferenceItemDescription(java.lang.String strClass, java.lang.String item)
Returns the description of the given item preference in the given class- Parameters:
strClass
- the name of the classitem
- the name of the item- Returns:
- the description of the preference
-
getSessionPreferenceState
boolean getSessionPreferenceState(java.lang.String name)
Enquire as to the state of a user preference for the current session.Preferences that have not been set will be considered to be false.
The name is free-form, but to avoid ambiguity it should start with the package name (package.Class) for the primary using class.
- Parameters:
name
- the name of the preference- Returns:
- the state or false if not set
-
setSessionPreferenceState
void setSessionPreferenceState(java.lang.String name, boolean state)
Used to suppress messages for the current session, the information is not stored, can not be changed via the GUI.This can be used to help prevent over loading the user with repetitive error messages such as turnout not found while loading a panel file due to a connection failing. The name is free-form, but to avoid ambiguity it should start with the package name (package.Class) for the primary using class.
- Parameters:
name
- A unique identifier for preference.state
- suppression state of the item.
-
resetChangeMade
void resetChangeMade()
-
showInfoMessage
void showInfoMessage(java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item)
Show an info message ("don't forget ...") with a given dialog title and user message. Use a given preference name to determine whether to show it in the future. The combination of the classString and item parameters should form a unique value.- Parameters:
title
- message Box titlemessage
- message to be displayedclassString
- name of the calling classitem
- name of the specific item this is used for
-
showInfoMessage
void showInfoMessage(@CheckForNull java.awt.Component parentComponent, java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item)
Show an info message ("don't forget ...") with a given dialog title and user message. Use a given preference name to determine whether to show it in the future. The combination of the classString and item parameters should form a unique value.- Parameters:
parentComponent
- Used to improve Dialog display, can be null.title
- message Box titlemessage
- message to be displayedclassString
- name of the calling classitem
- name of the specific item this is used for
-
showErrorMessage
void showErrorMessage(java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show an error message ("don't forget ...") with a given dialog title and user message. Use a given preference name to determine whether to show it in the future. added flag to indicate that the message should be suppressed JMRI session only. The classString and item parameters should form a unique value- Parameters:
title
- Message Box titlemessage
- Message to be displayedclassString
- String value of the calling classitem
- String value of the specific item this is used forsessionOnly
- Means this message will be suppressed in this JMRI session and not be rememberedalwaysRemember
- Means that the suppression of the message will be saved
-
showErrorMessage
void showErrorMessage(@CheckForNull java.awt.Component parentComponent, java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show an error message ("don't forget ...") with a given dialog title and user message. Use a given preference name to determine whether to show it in the future. Flag to indicate that the message should be suppressed JMRI session only. The classString and item parameters should form a unique value.- Parameters:
parentComponent
- Used to improve Dialog display, can be null.title
- Message Box titlemessage
- Message to be displayedclassString
- String value of the calling classitem
- String value of the specific item this is used forsessionOnly
- Means this message will be suppressed in this JMRI session and not be rememberedalwaysRemember
- Means that the suppression of the message will be saved
-
showInfoMessage
void showInfoMessage(java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show an info message ("don't forget ...") with a given dialog title and user message. Use a given preference name to determine whether to show it in the future. added flag to indicate that the message should be suppressed JMRI session only. The classString and item parameters should form a unique value- Parameters:
title
- Message Box titlemessage
- Message to be displayedclassString
- String value of the calling classitem
- String value of the specific item this is used forsessionOnly
- Means this message will be suppressed in this JMRI session and not be rememberedalwaysRemember
- Means that the suppression of the message will be saved
-
showInfoMessage
void showInfoMessage(@CheckForNull java.awt.Component parentComponent, java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show an info message ("don't forget ...") with a given dialog title and user message. Use a given preference name to determine whether to show it in the future. Flag to indicate that the message should be suppressed JMRI session only. The classString and item parameters should form a unique value.- Parameters:
parentComponent
- Used to improve Dialog display, can be null.title
- Message Box titlemessage
- Message to be displayedclassString
- String value of the calling classitem
- String value of the specific item this is used forsessionOnly
- Means this message will be suppressed in this JMRI session and not be rememberedalwaysRemember
- Means that the suppression of the message will be saved
-
showWarningMessage
void showWarningMessage(java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show a warning message ("don't forget ...") with a given dialog title and user message. Use a given preference name to determine whether to show it in the future. added flag to indicate that the message should be suppressed JMRI session only. The classString and item parameters should form a unique value- Parameters:
title
- Message Box titlemessage
- Message to be displayedclassString
- String value of the calling classitem
- String value of the specific item this is used forsessionOnly
- Means this message will be suppressed in this JMRI session and not be rememberedalwaysRemember
- Means that the suppression of the message will be saved
-
showWarningMessage
void showWarningMessage(@CheckForNull java.awt.Component parentComponent, java.lang.String title, java.lang.String message, java.lang.String classString, java.lang.String item, boolean sessionOnly, boolean alwaysRemember)
Show a warning message ("don't forget ...") with a given dialog title and user message. Use a given preference name to determine whether to show it in the future. Flag to indicate that the message should be suppressed JMRI session only. The classString and item parameters should form a unique value.- Parameters:
parentComponent
- Used to improve Dialog display, can be null.title
- Message Box titlemessage
- Message to be displayedclassString
- String value of the calling classitem
- String value of the specific item this is used forsessionOnly
- Means this message will be suppressed in this JMRI session and not be rememberedalwaysRemember
- Means that the suppression of the message will be saved
-
getComboBoxLastSelection
@CheckForNull java.lang.String getComboBoxLastSelection(java.lang.String comboBoxName)
The last selected value in a given combo box.- Parameters:
comboBoxName
- the combo box name- Returns:
- the selected value
-
setComboBoxLastSelection
void setComboBoxLastSelection(java.lang.String comboBoxName, java.lang.String lastValue)
Set the last selected value in a given combo box.The name is free-form, but to avoid ambiguity it should start with the package name (package.Class) for the primary using class, followed by an identifier for the combo box.
- Parameters:
comboBoxName
- the combo box namelastValue
- the selected value
-
getScreen
java.awt.Dimension getScreen()
-
isSaveAllowed
boolean isSaveAllowed()
Check if saving preferences is allowed.- Returns:
- true if saving is allowed; false otherwise
-
setSaveAllowed
void setSaveAllowed(boolean saveAllowed)
Set if saving preferences is allowed. When setting true, preferences will be saved immediately if needed.Note only set false if a number of preferences will be set together to avoid excessive disk I/O while setting preferences.
Note remember to allow saving as soon as blocking saving is no longer needed.
- Parameters:
saveAllowed
- true to allow saving; false to block saving
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener l)
-
addPropertyChangeListener
void addPropertyChangeListener(java.beans.PropertyChangeListener l)
-
getClassDescription
@Nonnull java.lang.String getClassDescription(java.lang.String strClass)
Get the description of a class/group registered with the preferences.- Parameters:
strClass
- the class name- Returns:
- the description
-
getPreferencesClasses
@Nonnull java.util.ArrayList<java.lang.String> getPreferencesClasses()
Get the list of the classes registered with the preference manager.- Returns:
- the list of class names
-
setClassDescription
void setClassDescription(java.lang.String strClass)
Given that we know the class as a string, we will try and attempt to gather details about the preferences that has been added, so that we can make better sense of the details in the preferences window.This looks for specific methods within the class called "getClassDescription" and "setMessagePreferenceDetails". If found it will invoke the methods, this will then trigger the class to send details about its preferences back to this code.
- Parameters:
strClass
- description to use for the class
-
setMessageItemDetails
void setMessageItemDetails(java.lang.String strClass, java.lang.String item, java.lang.String description, java.util.HashMap<java.lang.Integer,java.lang.String> options, int defaultOption)
Add descriptive details about a specific message box, so that if it needs to be reset in the preferences, then it is easily identifiable. displayed to the user in the preferences GUI.- Parameters:
strClass
- String value of the calling class/groupitem
- String value of the specific item this is used for.description
- A meaningful description that can be used in a label to describe the itemoptions
- A map of the integer value of the option against a meaningful description.defaultOption
- The default option for the given item.
-
getChoiceOptions
java.util.HashMap<java.lang.Integer,java.lang.String> getChoiceOptions(java.lang.String strClass, java.lang.String item)
Returns a map of the value against description of the different items in a given class. This information can then be used to build a Combo box.- Parameters:
strClass
- Class or group of the given itemitem
- the item which we wish to return the details about.- Returns:
- map of choices
-
getMultipleChoiceSize
int getMultipleChoiceSize(java.lang.String strClass)
Get the number of Multiple Choice items registered with a given class.- Parameters:
strClass
- the class name- Returns:
- number of items
-
getMultipleChoiceList
java.util.ArrayList<java.lang.String> getMultipleChoiceList(java.lang.String strClass)
Get a list of all the multiple choice items registered with a given class.- Parameters:
strClass
- the class name- Returns:
- list of item names
-
getChoiceName
java.lang.String getChoiceName(java.lang.String strClass, int n)
Get the nth item name in a given class.- Parameters:
strClass
- the class namen
- the position- Returns:
- the item name
-
getChoiceDescription
java.lang.String getChoiceDescription(java.lang.String strClass, java.lang.String item)
Get the a meaningful description of a given item in a given class or group.- Parameters:
strClass
- the class nameitem
- the item name- Returns:
- the item description
-
getMultipleChoiceOption
int getMultipleChoiceOption(java.lang.String strClass, java.lang.String item)
Get the current value of a given item in a given class.- Parameters:
strClass
- the class nameitem
- the item name- Returns:
- the value
-
getMultipleChoiceDefaultOption
int getMultipleChoiceDefaultOption(java.lang.String strClass, java.lang.String choice)
Returns the default value of a given item in a given class- Parameters:
strClass
- the class namechoice
- the item name- Returns:
- the default value
-
setMultipleChoiceOption
void setMultipleChoiceOption(java.lang.String strClass, java.lang.String choice, java.lang.String value)
Sets the value of a given item in a given class, by its string description.- Parameters:
strClass
- the class namechoice
- the item namevalue
- the item value description
-
setMultipleChoiceOption
void setMultipleChoiceOption(java.lang.String strClass, java.lang.String choice, int value)
Sets the value of a given item in a given class, by its integer value.- Parameters:
strClass
- the class namechoice
- the item namevalue
- the item value
-
getPreferencesSize
int getPreferencesSize(java.lang.String strClass)
Get the combined size of both types of items registered.- Parameters:
strClass
- the class name- Returns:
- number of registered preferences
-
setWindowLocation
void setWindowLocation(java.lang.String strClass, java.awt.Point location)
Saves the last location of a given component on the screen.The jmri.util.JmriJFrame, will automatically use the class name of the frame if the class name returned is equal to jmri.util.JmriJFrame, the location is not stored
- Parameters:
strClass
- This is a unique identifier for window location being savedlocation
- The x,y location of the window given in a Point
-
setWindowSize
void setWindowSize(java.lang.String strClass, java.awt.Dimension dim)
Saves the last size of a given component on the screenThe jmri.util.JmriJFrame, will automatically use the class name of the frame if the class name returned is equal to jmri.util.JmriJFrame, the size is not stored
- Parameters:
strClass
- This is a unique identifier for window size being saveddim
- The width, height size of the window given in a Dimension
-
getWindowLocation
java.awt.Point getWindowLocation(java.lang.String strClass)
Get the x,y location of a given Window.- Parameters:
strClass
- the class name- Returns:
- the location
-
getWindowSize
java.awt.Dimension getWindowSize(java.lang.String strClass)
Returns the width, height size of a given Window- Parameters:
strClass
- the class name- Returns:
- the size
-
getWindowList
java.util.ArrayList<java.lang.String> getWindowList()
-
hasProperties
boolean hasProperties(java.lang.String strClass)
Check if there are properties for the given class- Parameters:
strClass
- class to check- Returns:
- true if properties for strClass are maintained; false otherwise
-
getSaveWindowSize
boolean getSaveWindowSize(java.lang.String strClass)
-
getSaveWindowLocation
boolean getSaveWindowLocation(java.lang.String strClass)
-
setSaveWindowSize
void setSaveWindowSize(java.lang.String strClass, boolean b)
Set if window sizes should be saved for a given class. Method has no effect if strClass is null or equalsjmri.util.JmriJFrame
.- Parameters:
strClass
- name of the classb
- true if window sizes should be saved; false otherwise
-
setSaveWindowLocation
void setSaveWindowLocation(java.lang.String strClass, boolean b)
Set if window locations should be saved for a given class. Method has no effect if strClass is null or equalsjmri.util.JmriJFrame
.- Parameters:
strClass
- name of the classb
- true if window locations should be saved; false otherwise
-
setProperty
void setProperty(java.lang.String strClass, java.lang.String key, java.lang.Object value)
Attach a key/value pair to the given class, which can be retrieved later. These are not bound properties as yet, and don't throw events on modification. Key must not be null.- Parameters:
strClass
- class to usekey
- Prior to 4.3.5, this could be an Object.value
- value to use
-
getProperty
java.lang.Object getProperty(java.lang.String strClass, java.lang.String key)
Retrieve the value associated with a key in a given class If no value has been set for that key, returns null.- Parameters:
strClass
- class to usekey
- item to retrieve- Returns:
- stored value
-
getPropertyKeys
java.util.Set<java.lang.String> getPropertyKeys(java.lang.String strClass)
Retrieve the complete current set of keys for a given class.- Parameters:
strClass
- class to use- Returns:
- complete set of keys
-
-