Package org.opensourcephysics.tools
Class ToolsRes
java.lang.Object
org.opensourcephysics.tools.ToolsRes
ToolsRes provides access to string resources for OSPControls and fires a
property change event when the locale changes.
- Version:
- 1.0
- Author:
- Wolfgang Christian
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPropertyChangeListener(String property, PropertyChangeListener listener) Adds a PropertyChangeListener.static StringGets the language for this locale.static StringGets the localized value of a string.static voidremovePropertyChangeListener(String property, PropertyChangeListener listener) Removes a PropertyChangeListener.static voidSets the locale.
-
Field Details
-
OSP_PROPERTY_LOCALE
- See Also:
-
-
Method Details
-
getString
Gets the localized value of a string. If no localized value is found, the key is returned surrounded by exclamation points.- Parameters:
key- the string to localize- Returns:
- the localized string
-
getLanguage
Gets the language for this locale.- Returns:
- String
-
setLocale
Sets the locale.- Parameters:
loc- the locale
-
addPropertyChangeListener
Adds a PropertyChangeListener.- Parameters:
property- the name of the property (only "locale" accepted)listener- the object requesting property change notification
-
removePropertyChangeListener
Removes a PropertyChangeListener.- Parameters:
property- the name of the property (only "locale" accepted)listener- the listener requesting removal
-