Class spt.applets.AppletParamParser
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class spt.applets.AppletParamParser

java.lang.Object
   |
   +----spt.applets.AppletParamParser

public class AppletParamParser
extends Object
A utility class that knows how to parse a wide variety of applet parameters (int, Colors, URLs, etc.)

Constructor Index

 o AppletParamParser(Applet)

Method Index

 o applyBGColorParam()
Gets the color specified by the BGCOLOR parameter and sets the applet background to it.
 o applyFGBGColorParam()
Processes FGCOLOR and BGCOLOR at once.
 o applyFGColorParam()
Gets the color specified by the FGCOLOR parameter and sets the applet foreground to it.
 o applyFontParam()
Gets the font specified by the FONT parameter and sets the applet font to it.
 o getBoolean(String)
Get a Boolean parameter.
 o getBoolean(String, boolean)
Return a Boolean or default value if it doesn't exist.
 o getBorderStyle()
Gets border style useful for the BorderComponent class.
 o getColor(String)
Get a Color parameter.
 o getColor(String, Color)
Return a Color or default value if it doesn't exist.
 o getDouble(String)
Get a Double parameter.
 o getDouble(String, float)
Return a Double or default value if it doesn't exist.
 o getFloat(String)
Get a Float parameter.
 o getFloat(String, float)
Return a Float or default value if it doesn't exist.
 o getFont(String)
Get a Font parameter.
 o getFont(String, Font)
Return a Font or default value if it doesn't exist.
 o getInteger(String)
Get an Integer parameter.
 o getInteger(String, int)
Return an Integer or default value if it doesn't exist.
 o getParameter(String)
Get the value of a parameter in String format.
 o getParameter(String, String)
Get a String parameter or return a default value if it doesn't exist.
 o getURL(String)
Get a URL parameter.
 o getURL(String, URL)
Return a URL or default value if it doesn't exist.
 o parameterExists(String)
Was the parameter supplied?

Constructors

 o AppletParamParser
  public AppletParamParser(Applet a)

Methods

 o parameterExists
  public boolean parameterExists(String name)
Was the parameter supplied?
 o getParameter
  public String getParameter(String name)
Get the value of a parameter in String format. Returns null if no parameter exists. (Really just calls the applet version of the function).
See Also:
getParameter
 o getParameter
  public String getParameter(String name,
                             String defaultVal)
Get a String parameter or return a default value if it doesn't exist.
 o getBoolean
  public Boolean getBoolean(String name)
Get a Boolean parameter. A true value is the string "TRUE", "YES" or "1", all case insensitive. False is anything else. null is returned if it doesn't exist.
See Also:
Boolean
 o getBoolean
  public Boolean getBoolean(String name,
                            boolean defaultVal)
Return a Boolean or default value if it doesn't exist.
 o getInteger
  public Integer getInteger(String name)
Get an Integer parameter. null is returned if it doesn't exist.
See Also:
Integer
 o getInteger
  public Integer getInteger(String name,
                            int defaultVal)
Return an Integer or default value if it doesn't exist.
 o getFloat
  public Float getFloat(String name)
Get a Float parameter. null is returned if it doesn't exist.
See Also:
Float
 o getFloat
  public Float getFloat(String name,
                        float defaultVal)
Return a Float or default value if it doesn't exist.
 o getDouble
  public Double getDouble(String name)
Get a Double parameter. null is returned if it doesn't exist.
See Also:
Double
 o getDouble
  public Double getDouble(String name,
                          float defaultVal)
Return a Double or default value if it doesn't exist.
 o getColor
  public Color getColor(String name)
Get a Color parameter. null is returned if it doesn't exist. Colors can be in several formats.
See Also:
StringUtil, Color
 o getColor
  public Color getColor(String name,
                        Color defaultVal)
Return a Color or default value if it doesn't exist.
 o getURL
  public URL getURL(String name) throws MalformedURLException
Get a URL parameter. null is returned if it doesn't exist. URLs can be relative or absolute.
See Also:
URL
 o getURL
  public URL getURL(String name,
                    URL defaultVal) throws MalformedURLException
Return a URL or default value if it doesn't exist.
 o getFont
  public Font getFont(String name)
Get a Font parameter. null is returned if it doesn't exist. Fonts are specified as: "FontName,Style,Point" (e.g. "Helvetica,BOLD,14"). Style can be one of: PLAIN, BOLD, ITALIC or BOLDITALIC.
See Also:
Font
 o getFont
  public Font getFont(String name,
                      Font defaultVal)
Return a Font or default value if it doesn't exist.
 o getBorderStyle
  public int getBorderStyle()
Gets border style useful for the BorderComponent class.
See Also:
BorderedComponent
 o applyBGColorParam
  public void applyBGColorParam()
Gets the color specified by the BGCOLOR parameter and sets the applet background to it.
 o applyFGColorParam
  public void applyFGColorParam()
Gets the color specified by the FGCOLOR parameter and sets the applet foreground to it.
 o applyFGBGColorParam
  public void applyFGBGColorParam()
Processes FGCOLOR and BGCOLOR at once.
 o applyFontParam
  public void applyFontParam()
Gets the font specified by the FONT parameter and sets the applet font to it.

All Packages  Class Hierarchy  This Package  Previous  Next  Index