Class ToolsRes

java.lang.Object
org.opensourcephysics.tools.ToolsRes

public class ToolsRes extends Object
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 Details

  • Method Details

    • getString

      public static String getString(String key)
      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

      public static String getLanguage()
      Gets the language for this locale.
      Returns:
      String
    • setLocale

      public static void setLocale(Locale loc)
      Sets the locale.
      Parameters:
      loc - the locale
    • addPropertyChangeListener

      public static void addPropertyChangeListener(String property, PropertyChangeListener listener)
      Adds a PropertyChangeListener.
      Parameters:
      property - the name of the property (only "locale" accepted)
      listener - the object requesting property change notification
    • removePropertyChangeListener

      public static void removePropertyChangeListener(String property, PropertyChangeListener listener)
      Removes a PropertyChangeListener.
      Parameters:
      property - the name of the property (only "locale" accepted)
      listener - the listener requesting removal