|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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"
DefaultUserMessagePreferences| Method Summary | |
|---|---|
void |
addComboBoxLastSelection(String comboBoxName,
String lastValue)
Adds the last selection of a combo box. |
void |
addPropertyChangeListener(PropertyChangeListener l)
|
void |
allowSave()
|
void |
disallowSave()
|
void |
finishLoading()
|
String |
getChoiceDescription(String strClass,
String item)
Returns the a meaningful description of a given item in a given class or group. |
String |
getChoiceName(String strClass,
int n)
Returns the nth item name in a given class |
HashMap<Integer,String> |
getChoiceOptions(String strClass,
String item)
Returns a map of the value against description of the different items in a given class. |
String |
getClassDescription(String strClass)
Returns the description of a class/group registered with the preferences. |
String |
getComboBoxLastSelection(int n)
returns the ComboBox Value at position n |
String |
getComboBoxLastSelection(String comboBoxName)
returns the last selected value in a given combobox |
String |
getComboBoxName(int n)
returns the ComboBox Name at position n |
int |
getComboBoxSelectionSize()
returns the number of comboBox options saved |
int |
getMultipleChoiceDefaultOption(String strClass,
String choice)
Returns the default value of a given item in a given class |
ArrayList<String> |
getMultipleChoiceList(String strClass)
Returns a list of all the multiple choice items registered with a given class. |
int |
getMultipleChoiceOption(String strClass,
String item)
Returns the current value of a given item in a given class |
int |
getMultipleChoiceSize(String strClass)
Returns the number of Mulitple Choice items registered with a given class. |
String |
getPreferenceItemDescription(String strClass,
String item)
Returns the description of the given item preference in the given class |
String |
getPreferenceItemName(String strClass,
int n)
Returns the itemName of the n preference in the given class |
ArrayList<String> |
getPreferenceList(String strClass)
Returns a list of preferences that are registered against a specific class. |
ArrayList<String> |
getPreferencesClasses()
Returns a list of the classes registered with the preference manager. |
int |
getPreferencesSize(String strClass)
returns the combined size of both types of items registered. |
boolean |
getPreferenceState(String strClass,
String item)
Returns the state of a given item registered against a specific class or item. |
Object |
getProperty(String strClass,
Object key)
Retrieve the value associated with a key in a given class If no value has been set for that key, returns null. |
Set<Object> |
getPropertyKeys(String strClass)
Retrieve the complete current set of keys for a given class. |
boolean |
getSaveWindowLocation(String strClass)
|
boolean |
getSaveWindowSize(String strClass)
|
Dimension |
getScreen()
|
boolean |
getSessionPreferenceState(String name)
Enquire as to the state of a user preference for the current session. |
boolean |
getSimplePreferenceState(String name)
Enquire as to the state of a user preference. |
ArrayList<String> |
getSimplePreferenceStateList()
Returns an ArrayList of the checkbox states set as true. |
String |
getTableColumnAtNum(String table,
int i)
Get a name for a column at index i |
boolean |
getTableColumnHidden(String table,
String column)
Get the stored column hidden state for a given table |
int |
getTableColumnOrder(String table,
String column)
Get the stored position of the column for a given table |
int |
getTableColumnSort(String table,
String column)
Get the stored column sort order for a given table |
int |
getTableColumnWidth(String table,
String column)
Get the stored column width for a given table |
List<String> |
getTablesColumnList(String table)
Get a list of all the column settings for a specific table |
List<String> |
getTablesList()
Get a list of all the table preferences stored |
ArrayList<String> |
getWindowList()
|
Point |
getWindowLocation(String strClass)
Returns the x,y location of a given Window |
Dimension |
getWindowSize(String strClass)
Returns the width, height size of a given Window |
boolean |
isWindowPositionSaved(String strClass)
Do we have a saved window position for the class |
void |
messageItemDetails(String strClass,
String item,
String description,
HashMap<Integer,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. |
void |
messageItemDetails(String strClass,
String item,
String description,
String[] msgOption,
int[] msgNumber,
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. |
void |
preferenceItemDetails(String strClass,
String item,
String description)
Register details about a perticular preference, so that it can be displayed in the GUI and provide a meaning full description when presented to the user. |
void |
removePropertyChangeListener(PropertyChangeListener l)
|
void |
resetChangeMade()
|
void |
setClassDescription(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(String comboBoxName,
String lastValue)
sets the last selected value in a given combobox |
void |
setLoading()
|
void |
setMultipleChoiceOption(String strClass,
String choice,
int value)
Sets the value of a given item in a given class, by its integer value |
void |
setMultipleChoiceOption(String strClass,
String choice,
String value)
Sets the value of a given item in a given class, by its string description |
void |
setPreferenceState(String strClass,
String item,
boolean state)
Used to save the state of checkboxes which can suppress messages from being displayed. |
void |
setProperty(String strClass,
Object key,
Object value)
Attach a key/value pair to the given class, which can be retrieved later. |
void |
setSaveWindowLocation(String strClass,
boolean b)
|
void |
setSaveWindowSize(String strClass,
boolean b)
|
void |
setSessionPreferenceState(String name,
boolean state)
Used to surpress messages for the current session, the information is not stored, can not be changed via the GUI. |
void |
setSimplePreferenceState(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 initialised. |
void |
setTableColumnPreferences(String table,
String column,
int order,
int width,
int sort,
boolean hidden)
Stores the details of a tables column, so that it can be saved and re-applied when jmri is re-started |
void |
setWindowLocation(String strClass,
Point location)
Saves the last location of a given component on the screen. |
void |
setWindowSize(String strClass,
Dimension dim)
Saves the last size 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 size is not stored |
void |
showErrorMessage(String title,
String message,
String classString,
String item,
boolean sessionOnly,
boolean alwaysRemember)
Show an error message ("don't forget ...") with a given dialog title and user message. |
void |
showInfoMessage(String title,
String message,
String classString,
String item)
Show an info message ("don't forget ...") |
void |
showInfoMessage(String title,
String message,
String classString,
String item,
boolean sessionOnly,
boolean alwaysRemember)
Show an info message ("don't forget ...") with a given dialog title and user message. |
void |
showWarningMessage(String title,
String message,
String classString,
String item,
boolean sessionOnly,
boolean alwaysRemember)
Show a warning message ("don't forget ...") with a given dialog title and user message. |
| Method Detail |
|---|
void setLoading()
void finishLoading()
boolean getSimplePreferenceState(String name)
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.
void setSimplePreferenceState(String name,
boolean state)
name - A unique name to identify the state being storedstate - simple boolean.ArrayList<String> getSimplePreferenceStateList()
void setPreferenceState(String strClass,
String item,
boolean state)
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.
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.
boolean getPreferenceState(String strClass,
String item)
void preferenceItemDetails(String strClass,
String item,
String description)
strClass - A string form of the class that the preference is stored or grouped withitem - The specific item that is being stored.description - A meaningful decription of the item that the user will understand.ArrayList<String> getPreferenceList(String strClass)
String getPreferenceItemName(String strClass,
int n)
String getPreferenceItemDescription(String strClass,
String item)
boolean getSessionPreferenceState(String name)
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.
void setSessionPreferenceState(String name,
boolean state)
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.
name - A unique identifer for preference.state - void resetChangeMade()
void showInfoMessage(String title,
String message,
String classString,
String item)
title - Message Box titlemessage - Message to be displayedclassString - String value of the calling classitem - String value of the specific item this is used for
void showErrorMessage(String title,
String message,
String classString,
String item,
boolean sessionOnly,
boolean alwaysRemember)
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
void showInfoMessage(String title,
String message,
String classString,
String item,
boolean sessionOnly,
boolean alwaysRemember)
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
void showWarningMessage(String title,
String message,
String classString,
String item,
boolean sessionOnly,
boolean alwaysRemember)
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
void addComboBoxLastSelection(String comboBoxName,
String lastValue)
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 combobox
String getComboBoxLastSelection(String comboBoxName)
void setComboBoxLastSelection(String comboBoxName,
String lastValue)
int getComboBoxSelectionSize()
String getComboBoxName(int n)
String getComboBoxLastSelection(int n)
Dimension getScreen()
void allowSave()
void disallowSave()
void removePropertyChangeListener(PropertyChangeListener l)
void addPropertyChangeListener(PropertyChangeListener l)
String getClassDescription(String strClass)
ArrayList<String> getPreferencesClasses()
void setClassDescription(String strClass)
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.
void messageItemDetails(String strClass,
String item,
String description,
String[] msgOption,
int[] msgNumber,
int defaultOption)
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 itemmsgOption - Description of each option valid option.msgNumber - The references number against which the Description is refering too.defaultOption - The default option for the given item.
void messageItemDetails(String strClass,
String item,
String description,
HashMap<Integer,String> options,
int defaultOption)
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.
HashMap<Integer,String> getChoiceOptions(String strClass,
String item)
strClass - Class or group of the given itemitem - the item which we wish to return the details about.int getMultipleChoiceSize(String strClass)
ArrayList<String> getMultipleChoiceList(String strClass)
String getChoiceName(String strClass,
int n)
String getChoiceDescription(String strClass,
String item)
int getMultipleChoiceOption(String strClass,
String item)
int getMultipleChoiceDefaultOption(String strClass,
String choice)
void setMultipleChoiceOption(String strClass,
String choice,
String value)
void setMultipleChoiceOption(String strClass,
String choice,
int value)
int getPreferencesSize(String strClass)
void setWindowLocation(String strClass,
Point location)
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
strClass - This is a unique identifier for window location being savedlocation - The x,y location of the window given in a Point
void setWindowSize(String strClass,
Dimension dim)
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 size is not stored
strClass - This is a unique identifier for window size being saveddim - The width, height size of the window given in a DimensionPoint getWindowLocation(String strClass)
Dimension getWindowSize(String strClass)
ArrayList<String> getWindowList()
boolean isWindowPositionSaved(String strClass)
strClass -
boolean getSaveWindowSize(String strClass)
boolean getSaveWindowLocation(String strClass)
void setSaveWindowSize(String strClass,
boolean b)
void setSaveWindowLocation(String strClass,
boolean b)
void setProperty(String strClass,
Object key,
Object value)
Object getProperty(String strClass,
Object key)
Set<Object> getPropertyKeys(String strClass)
void setTableColumnPreferences(String table,
String column,
int order,
int width,
int sort,
boolean hidden)
table - The reference for the tablecolumn - The column nameorder - The position that the column appears in the headerwidth - The width of the columnsort - The sort order of the columnhidden - Should the column be hidden
int getTableColumnOrder(String table,
String column)
table - The reference for the tablecolumn - The column name
int getTableColumnWidth(String table,
String column)
table - The reference for the tablecolumn - The column name
int getTableColumnSort(String table,
String column)
table - The reference for the tablecolumn - The column name
boolean getTableColumnHidden(String table,
String column)
table - The reference for the tablecolumn - The column name
String getTableColumnAtNum(String table,
int i)
table - The reference for the tablei - The column index
returns null if not found, otherwise the column nameList<String> getTablesList()
List<String> getTablesColumnList(String table)
table -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||