de.matthiasmann.twl.theme
Class ParameterListImpl

java.lang.Object
  extended by de.matthiasmann.twl.theme.ParameterListImpl
All Implemented Interfaces:
ParameterList

public class ParameterListImpl
extends java.lang.Object
implements ParameterList


Method Summary
 Font getFont(int idx)
          Returns the font at the given list index.
 Image getImage(int idx)
          Returns the image at the given list index.
 MouseCursor getMouseCursor(int idx)
          Returns the mouse cursor at the given list index.
 boolean getParameter(int idx, boolean defaultValue)
           
 Color getParameter(int idx, Color defaultValue)
           
<E extends java.lang.Enum<E>>
E
getParameter(int idx, E defaultValue)
           
 float getParameter(int idx, float defaultValue)
           
 int getParameter(int idx, int defaultValue)
           
 java.lang.String getParameter(int idx, java.lang.String defaultValue)
           
 ParameterList getParameterList(int idx)
          Returns a parameter list at the given list index.
 ParameterMap getParameterMap(int idx)
          Returns a parameter map at the given list index.
 java.lang.Object getParameterValue(int idx)
          Retrives a parameter.
<T> T
getParameterValue(int idx, java.lang.Class<T> clazz)
          Retrieves a parameter and ensures that it has the desired type.
protected  java.lang.String getParentDescription()
           
 int getSize()
           
protected  void wrongParameterType(int idx, java.lang.Class<?> expectedType, java.lang.Class<?> foundType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSize

public int getSize()
Specified by:
getSize in interface ParameterList

getFont

public Font getFont(int idx)
Description copied from interface: ParameterList
Returns the font at the given list index. If no font with that name was found then the default font is returned.

Specified by:
getFont in interface ParameterList
Parameters:
idx - The index in the list
Returns:
A font object

getImage

public Image getImage(int idx)
Description copied from interface: ParameterList
Returns the image at the given list index. If no image with that name was found then null is returned.

Specified by:
getImage in interface ParameterList
Parameters:
idx - The index in the list
Returns:
A image object or null.

getMouseCursor

public MouseCursor getMouseCursor(int idx)
Description copied from interface: ParameterList
Returns the mouse cursor at the given list index. If no mouse cursor with that name was found then null is returned.

Specified by:
getMouseCursor in interface ParameterList
Parameters:
idx - The index in the list
Returns:
A mouse cursor object or null.

getParameterMap

public ParameterMap getParameterMap(int idx)
Description copied from interface: ParameterList
Returns a parameter map at the given list index. If no parameter map with that name was found then an empty map is returned.

Specified by:
getParameterMap in interface ParameterList
Parameters:
idx - The index in the list
Returns:
A parameter map object.

getParameterList

public ParameterList getParameterList(int idx)
Description copied from interface: ParameterList
Returns a parameter list at the given list index. If no parameter map with that name was found then an empty list is returned.

Specified by:
getParameterList in interface ParameterList
Parameters:
idx - The index in the list
Returns:
A parameter list object.

getParameter

public boolean getParameter(int idx,
                            boolean defaultValue)
Specified by:
getParameter in interface ParameterList

getParameter

public int getParameter(int idx,
                        int defaultValue)
Specified by:
getParameter in interface ParameterList

getParameter

public float getParameter(int idx,
                          float defaultValue)
Specified by:
getParameter in interface ParameterList

getParameter

public java.lang.String getParameter(int idx,
                                     java.lang.String defaultValue)
Specified by:
getParameter in interface ParameterList

getParameter

public Color getParameter(int idx,
                          Color defaultValue)
Specified by:
getParameter in interface ParameterList

getParameter

public <E extends java.lang.Enum<E>> E getParameter(int idx,
                                                    E defaultValue)
Specified by:
getParameter in interface ParameterList

getParameterValue

public java.lang.Object getParameterValue(int idx)
Description copied from interface: ParameterList
Retrives a parameter.

Specified by:
getParameterValue in interface ParameterList
Parameters:
idx - The index in the list
Returns:
the parameter value

getParameterValue

public <T> T getParameterValue(int idx,
                               java.lang.Class<T> clazz)
Description copied from interface: ParameterList
Retrieves a parameter and ensures that it has the desired type.

Specified by:
getParameterValue in interface ParameterList
Type Parameters:
T - The desired return type generic
Parameters:
idx - The index in the list
clazz - the required data type
Returns:
the parameter value or null if the type does not match

wrongParameterType

protected void wrongParameterType(int idx,
                                  java.lang.Class<?> expectedType,
                                  java.lang.Class<?> foundType)

getParentDescription

protected java.lang.String getParentDescription()