de.matthiasmann.twl
Interface ParameterMap

All Known Subinterfaces:
ThemeInfo

public interface ParameterMap


Method Summary
 Font getFont(java.lang.String name)
          Returns the font with the given name.
 Image getImage(java.lang.String name)
          Returns the image with the given name.
 MouseCursor getMouseCursor(java.lang.String name)
          Returns the mouse cursor with the given name.
 boolean getParameter(java.lang.String name, boolean defaultValue)
           
 Color getParameter(java.lang.String name, Color defaultValue)
           
<E extends java.lang.Enum<E>>
E
getParameter(java.lang.String name, E defaultValue)
           
 float getParameter(java.lang.String name, float defaultValue)
           
 int getParameter(java.lang.String name, int defaultValue)
           
 java.lang.String getParameter(java.lang.String name, java.lang.String defaultValue)
           
 ParameterList getParameterList(java.lang.String name)
          Returns a parameter list with the given name.
 ParameterMap getParameterMap(java.lang.String name)
          Returns a parameter map with the given name.
 java.lang.Object getParameterValue(java.lang.String name, boolean warnIfNotPresent)
          Retrives a parameter.
<T> T
getParameterValue(java.lang.String name, boolean warnIfNotPresent, java.lang.Class<T> clazz)
          Retrieves a parameter and ensures that it has the desired type.
<T> T
getParameterValue(java.lang.String name, boolean warnIfNotPresent, java.lang.Class<T> clazz, T defaultValue)
          Retrieves a parameter and ensures that it has the desired type.
 

Method Detail

getFont

Font getFont(java.lang.String name)
Returns the font with the given name. If no font with that name was found then the default font is returned.

Parameters:
name - The name of the font
Returns:
A font object

getImage

Image getImage(java.lang.String name)
Returns the image with the given name. If no image with that name was found then null is returned.

Parameters:
name - The name of the image.
Returns:
A image object or null.

getMouseCursor

MouseCursor getMouseCursor(java.lang.String name)
Returns the mouse cursor with the given name. If no mouse cursor with that name was found then null is returned.

Parameters:
name - The name of the mouse cursor.
Returns:
A mouse cursor object or null.

getParameterMap

ParameterMap getParameterMap(java.lang.String name)
Returns a parameter map with the given name. If no parameter map with that name was found then an empty map is returned.

Parameters:
name - The name of the parameter map.
Returns:
A parameter map object.

getParameterList

ParameterList getParameterList(java.lang.String name)
Returns a parameter list with the given name. If no parameter map with that name was found then an empty list is returned.

Parameters:
name - The name of the parameter list.
Returns:
A parameter list object.

getParameter

boolean getParameter(java.lang.String name,
                     boolean defaultValue)

getParameter

int getParameter(java.lang.String name,
                 int defaultValue)

getParameter

float getParameter(java.lang.String name,
                   float defaultValue)

getParameter

java.lang.String getParameter(java.lang.String name,
                              java.lang.String defaultValue)

getParameter

Color getParameter(java.lang.String name,
                   Color defaultValue)

getParameter

<E extends java.lang.Enum<E>> E getParameter(java.lang.String name,
                                             E defaultValue)

getParameterValue

java.lang.Object getParameterValue(java.lang.String name,
                                   boolean warnIfNotPresent)
Retrives a parameter.

Parameters:
name - the parameter name
warnIfNotPresent - if true and the parameter was not set then a warning is issued
Returns:
the parameter value

getParameterValue

<T> T getParameterValue(java.lang.String name,
                        boolean warnIfNotPresent,
                        java.lang.Class<T> clazz)
Retrieves a parameter and ensures that it has the desired type.

Type Parameters:
T - The desired return type generic
Parameters:
name - the parameter name
warnIfNotPresent - if true a warning is generated if the parameter was not found or has wrong type
clazz - the required data type
Returns:
the parameter value or null if the type does not match

getParameterValue

<T> T getParameterValue(java.lang.String name,
                        boolean warnIfNotPresent,
                        java.lang.Class<T> clazz,
                        T defaultValue)
Retrieves a parameter and ensures that it has the desired type.

Type Parameters:
T - The desired return type generic
Parameters:
name - the parameter name
warnIfNotPresent - if true a warning is generated if the parameter was not found or has wrong type
clazz - the required data type
defaultValue - the default value
Returns:
the parameter value or the defaultValue if the type does not match