org.opensourcephysics.tools
Interface Translator

All Known Implementing Classes:
TranslatorTool

public interface Translator


Method Summary
 void associate(java.lang.Object obj, java.lang.Class type)
          Associates an object with a class for property lookup purposes.
 java.lang.String getProperty(java.lang.Class type, java.lang.String key)
          Gets the localized value of a property for the specified class.
 java.lang.String getProperty(java.lang.Class type, java.lang.String key, java.lang.String defaultValue)
          Gets the localized value of a property for the specified class.
 java.lang.String getProperty(java.lang.Object obj, java.lang.String key)
          Gets the localized value of a property for the specified object.
 java.lang.String getProperty(java.lang.Object obj, java.lang.String key, java.lang.String defaultValue)
          Gets the localized value of a property for the specified object.
 void setVisible(boolean visible)
          Sets the visibility.
 void showProperties(java.lang.Class type)
          Shows the properties for the specified class.
 

Method Detail

getProperty

java.lang.String getProperty(java.lang.Class type,
                             java.lang.String key)
Gets the localized value of a property for the specified class. If no localized value is found, the key is returned.

Parameters:
type - the class requesting the localized value
key - the string to localize
Returns:
the localized string

getProperty

java.lang.String getProperty(java.lang.Class type,
                             java.lang.String key,
                             java.lang.String defaultValue)
Gets the localized value of a property for the specified class. If no localized value is found, the defaultValue is returned.

Parameters:
type - the class requesting the localized value
key - the string to localize
defaultValue - the default if no localized value found
Returns:
the localized string

getProperty

java.lang.String getProperty(java.lang.Object obj,
                             java.lang.String key)
Gets the localized value of a property for the specified object. The object must first be associated with a class. If no localized value is found, the key is returned.

Parameters:
obj - the object requesting the localized value
key - the string to localize
Returns:
the localized string

getProperty

java.lang.String getProperty(java.lang.Object obj,
                             java.lang.String key,
                             java.lang.String defaultValue)
Gets the localized value of a property for the specified object. The object must first be associated with a class. If no localized value is found, the defaultValue is returned.

Parameters:
obj - the object requesting the localized value
key - the string to localize
defaultValue - the default if no localized value found
Returns:
the localized string

associate

void associate(java.lang.Object obj,
               java.lang.Class type)
Associates an object with a class for property lookup purposes.

Parameters:
obj - the object needing translations
type - the class

showProperties

void showProperties(java.lang.Class type)
Shows the properties for the specified class.

Parameters:
type - the class

setVisible

void setVisible(boolean visible)
Sets the visibility.

Parameters:
visible - true to set this visible