Package jmri.jmrit.logix
Class WarrantPreferences
java.lang.Object
jmri.beans.UnboundBean
jmri.beans.Bean
jmri.util.prefs.AbstractPreferencesManager
jmri.jmrit.logix.WarrantPreferences
- All Implemented Interfaces:
BeanInterface,PropertyChangeFirer,PropertyChangeProvider,JmriServiceProviderInterface,PreferencesManager
Hold configuration data for Warrants, includes Speed Map
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic 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 TypeMethodDescriptionGet a map of signal head appearances.(package private) StringgetAppearanceValue(String key) static WarrantPreferencesGet the default instance.intfinal floatGet the layout scale.(package private) int(package private) float(package private) FloatgetSpeedNameValue(String key) final floatGet the throttle increment.floatfinal intGet the time increment.(package private) booleangetTrace()voidinitialize(Profile profile) Initialize the PreferencesManager with preferences associated with the provided Profile.voidloadLayoutParams(org.jdom2.Element layoutParm) voidvoidsave()voidsavePreferences(Profile profile) Save the preferences that this provider manages for the provided Profile.protected voidsetAppearances(ArrayList<WarrantPreferencesPanel.DataPair<String, String>> appearanceMap) (package private) voidsetInterpretation(int interp) voidsetLayoutScale(float scale) Set the layout scale.(package private) voidsetSearchDepth(int depth) void(package private) voidsetSpeedAssistance(float f) protected voidsetSpeedNames(ArrayList<WarrantPreferencesPanel.DataPair<String, Float>> speedNameMap) voidsetThrottleIncrement(float increment) Set the throttle increment.voidsetThrottleScale(float scale) voidsetTimeIncrement(int increment) Set the time increment.(package private) voidsetTrace(boolean t) booleanstore(org.jdom2.Element root) Methods inherited from class jmri.util.prefs.AbstractPreferencesManager
addInitializationException, getInitializationExceptions, getProvides, getRequires, isInitialized, isInitializedWithExceptions, isInitializing, requireAllOther, requiresNoInitializedWithExceptions, requiresNoInitializedWithExceptions, setInitialized, setInitializingMethods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setProperty
-
Field Details
-
LAYOUT_PARAMS
- See Also:
-
LAYOUT_SCALE
- See Also:
-
SEARCH_DEPTH
- See Also:
-
SPEED_MAP_PARAMS
- See Also:
-
RAMP_PREFS
- See Also:
-
TIME_INCREMENT
- See Also:
-
THROTTLE_SCALE
- See Also:
-
RAMP_INCREMENT
- See Also:
-
STEP_INCREMENTS
- See Also:
-
SPEED_NAME_PREFS
- See Also:
-
SPEED_NAMES
- See Also:
-
INTERPRETATION
- See Also:
-
APPEARANCE_PREFS
- See Also:
-
APPEARANCES
- See Also:
-
SHUT_DOWN
- See Also:
-
NO_MERGE
- See Also:
-
PROMPT
- See Also:
-
MERGE_ALL
- See Also:
-
TRACE
- See Also:
-
SPEED_ASSISTANCE
- See Also:
-
-
Constructor Details
-
WarrantPreferences
public WarrantPreferences()
-
-
Method Details
-
getDefault
Get the default instance.- Returns:
- the default instance, creating it if necessary
-
openFile
-
loadLayoutParams
-
save
-
store
-
getLayoutScale
Get the layout scale.- Returns:
- the scale
-
setLayoutScale
Set the layout scale.- Parameters:
scale- the scale
-
getThrottleScale
-
setThrottleScale
-
getSearchDepth
int getSearchDepth() -
setSearchDepth
-
getTrace
boolean getTrace() -
setTrace
-
getSpeedAssistance
float getSpeedAssistance() -
setSpeedAssistance
-
getSpeedNameEntryIterator
-
getSpeedNameValue
-
getSpeedNames
-
setSpeedNames
protected void setSpeedNames(@Nonnull ArrayList<WarrantPreferencesPanel.DataPair<String, Float>> speedNameMap) -
getAppearanceEntryIterator
-
getAppearanceValue
-
getAppearances
Get a map of signal head appearances.- Returns:
- a map of appearances or an empty map if none are defined
-
setAppearances
protected void setAppearances(ArrayList<WarrantPreferencesPanel.DataPair<String, String>> appearanceMap) -
getInterpretation
-
setInterpretation
-
getTimeIncrement
Get the time increment.- Returns:
- the time increment in milliseconds
-
setTimeIncrement
Set the time increment.- Parameters:
increment- the time increment in milliseconds
-
getThrottleIncrement
Get the throttle increment.- Returns:
- the throttle increment
-
setThrottleIncrement
Set the throttle increment.- Parameters:
increment- the throttle increment
-
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.- 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
-
setShutdown
-
getShutdown
-
savePreferences
Description copied from interface:PreferencesManagerSave the preferences that this provider manages for the provided Profile.- 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
-