Calendar Component v5.1
www.calendarcomponent.com

com.imagine.component.calendar.applet.util
Class ParameterReader

java.lang.Object
  extended bycom.imagine.component.calendar.applet.util.ParameterReader

public class ParameterReader
extends java.lang.Object

Utility class to read values of different types from an applet parameters.


Constructor Summary
ParameterReader()
           
 
Method Summary
static boolean getBoolean(javax.swing.JApplet source, java.lang.String paramName, boolean defaultValue)
          Read a boolean value from the specified paramName.
static java.awt.Color getColor(javax.swing.JApplet source, java.lang.String paramName, int defaultRGB)
          Read a Color value from the specified paramName.
static double getDoubleParam(javax.swing.JApplet source, java.lang.String paramName, double defaultValue)
          Read a double value from the specified paramName.
static java.awt.Font getFont(javax.swing.JApplet source, java.lang.String paramName, java.lang.String defaultName, int defaultStyle, int defaultSize)
          Read a Font value from the specified paramName.
static int[] getIntArray(javax.swing.JApplet source, java.lang.String paramName, int[] defaultValue)
          Read an int array value from the specified paramName.
static int getIntParam(javax.swing.JApplet source, java.lang.String paramName, int defaultValue)
          Read an int value from the specified paramName.
static int getIntParam(javax.swing.JApplet source, java.lang.String paramName, int base, int defaultValue)
          Read an int value from the specified paramName in the specified base.
static java.lang.String getStringParameter(javax.swing.JApplet source, java.lang.String paramName, java.lang.String defaultValue)
          Read a String value from the specified paramName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterReader

public ParameterReader()
Method Detail

getIntParam

public static int getIntParam(javax.swing.JApplet source,
                              java.lang.String paramName,
                              int defaultValue)
Read an int value from the specified paramName. If the paramName is not found the value returned is defaultValue.

Parameters:
source - The source applet.
paramName - The parameter from which the value is read.
defaultValue - The default value returned in case the paramName is not found.
Returns:
An int value read from the specified paramName. If the paramName is not found the value returned is defaultValue.

getIntParam

public static int getIntParam(javax.swing.JApplet source,
                              java.lang.String paramName,
                              int base,
                              int defaultValue)
Read an int value from the specified paramName in the specified base. If the paramName is not found the value returned is defaultValue.

Parameters:
source - The source applet.
paramName - The parameter from which the value is read.
base - The numeration base.
defaultValue - The default value returned in case the paramName is not found.
Returns:
An int value read from the specified paramName in the specified base. If the paramName is not found the value returned is defaultValue.

getDoubleParam

public static double getDoubleParam(javax.swing.JApplet source,
                                    java.lang.String paramName,
                                    double defaultValue)
Read a double value from the specified paramName. If the paramName is not found the value returned is defaultValue.

Parameters:
source - The source applet.
paramName - The parameter from which the value is read.
defaultValue - The default value returned in case the paramName is not found.
Returns:
A double value read from the specified paramName. If the paramName is not found the value returned is defaultValue.

getStringParameter

public static java.lang.String getStringParameter(javax.swing.JApplet source,
                                                  java.lang.String paramName,
                                                  java.lang.String defaultValue)
Read a String value from the specified paramName. If the paramName is not found the value returned is defaultValue.

Parameters:
source - The source applet.
paramName - The parameter from which the value is read.
defaultValue - The default value returned in case the paramName is not found.
Returns:
A String value read from the specified paramName. If the paramName is not found the value returned is defaultValue.

getColor

public static java.awt.Color getColor(javax.swing.JApplet source,
                                      java.lang.String paramName,
                                      int defaultRGB)
Read a Color value from the specified paramName. If the paramName is not found the value returned is computed from defaultRGB parameter.

Parameters:
source - The source applet.
paramName - The parameter from which the value is read.
defaultRGB - The default value for color.
Returns:
A Color value read from the specified paramName. If the paramName is not found the value returned is computed from defaultRGB parameter.

getFont

public static java.awt.Font getFont(javax.swing.JApplet source,
                                    java.lang.String paramName,
                                    java.lang.String defaultName,
                                    int defaultStyle,
                                    int defaultSize)
Read a Font value from the specified paramName. If the paramName is not found the value returned is computed from the parameters defaultName, defaultStyle, defaultSize.

Parameters:
source - The source applet.
paramName - The parameter from which the value is read.
defaultName - The default font name.
defaultStyle - The default font style.
defaultSize - The default font size.
Returns:
A Font value read from the specified paramName. If the paramName is not found the value returned is computed from the parameters defaultName, defaultStyle, defaultSize.

getBoolean

public static boolean getBoolean(javax.swing.JApplet source,
                                 java.lang.String paramName,
                                 boolean defaultValue)
Read a boolean value from the specified paramName. If the paramName is not found the value returned is defaultValue.

Parameters:
source - The source applet.
paramName - The parameter from which the value is read.
defaultValue - The default value returned in case the paramName is not found.
Returns:
A boolean value read from the specified paramName. If the paramName is not found the value returned is defaultValue.

getIntArray

public static int[] getIntArray(javax.swing.JApplet source,
                                java.lang.String paramName,
                                int[] defaultValue)
Read an int array value from the specified paramName. If the paramName is not found the value returned is defaultValue.

Parameters:
source - The source applet.
paramName - The parameter from which the value is read.
defaultValue - The default value returned in case the paramName is not found.
Returns:
An int array value read from the specified paramName. If the paramName is not found the value returned is defaultValue.

Calendar Component v5.1
www.calendarcomponent.com