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.)
-
AppletParamParser(Applet)
-
-
applyBGColorParam()
- Gets the color specified by the BGCOLOR parameter and sets
the applet background to it.
-
applyFGBGColorParam()
- Processes FGCOLOR and BGCOLOR at once.
-
applyFGColorParam()
- Gets the color specified by the FGCOLOR parameter and sets
the applet foreground to it.
-
applyFontParam()
- Gets the font specified by the FONT parameter and sets
the applet font to it.
-
getBoolean(String)
- Get a Boolean parameter.
-
getBoolean(String, boolean)
- Return a Boolean or default value if it doesn't exist.
-
getBorderStyle()
- Gets border style useful for the BorderComponent class.
-
getColor(String)
- Get a Color parameter.
-
getColor(String, Color)
- Return a Color or default value if it doesn't exist.
-
getDouble(String)
- Get a Double parameter.
-
getDouble(String, float)
- Return a Double or default value if it doesn't exist.
-
getFloat(String)
- Get a Float parameter.
-
getFloat(String, float)
- Return a Float or default value if it doesn't exist.
-
getFont(String)
- Get a Font parameter.
-
getFont(String, Font)
- Return a Font or default value if it doesn't exist.
-
getInteger(String)
- Get an Integer parameter.
-
getInteger(String, int)
- Return an Integer or default value if it doesn't exist.
-
getParameter(String)
- Get the value of a parameter in String format.
-
getParameter(String, String)
- Get a String parameter or return a default value if it
doesn't exist.
-
getURL(String)
- Get a URL parameter.
-
getURL(String, URL)
- Return a URL or default value if it doesn't exist.
-
parameterExists(String)
- Was the parameter supplied?
AppletParamParser
public AppletParamParser(Applet a)
parameterExists
public boolean parameterExists(String name)
- Was the parameter supplied?
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
getParameter
public String getParameter(String name,
String defaultVal)
- Get a String parameter or return a default value if it
doesn't exist.
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
getBoolean
public Boolean getBoolean(String name,
boolean defaultVal)
- Return a Boolean or default value if it doesn't exist.
getInteger
public Integer getInteger(String name)
- Get an Integer parameter. null is returned if it doesn't exist.
- See Also:
- Integer
getInteger
public Integer getInteger(String name,
int defaultVal)
- Return an Integer or default value if it doesn't exist.
getFloat
public Float getFloat(String name)
- Get a Float parameter. null is returned if it doesn't exist.
- See Also:
- Float
getFloat
public Float getFloat(String name,
float defaultVal)
- Return a Float or default value if it doesn't exist.
getDouble
public Double getDouble(String name)
- Get a Double parameter. null is returned if it doesn't exist.
- See Also:
- Double
getDouble
public Double getDouble(String name,
float defaultVal)
- Return a Double or default value if it doesn't exist.
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
getColor
public Color getColor(String name,
Color defaultVal)
- Return a Color or default value if it doesn't exist.
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
getURL
public URL getURL(String name,
URL defaultVal) throws MalformedURLException
- Return a URL or default value if it doesn't exist.
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
getFont
public Font getFont(String name,
Font defaultVal)
- Return a Font or default value if it doesn't exist.
getBorderStyle
public int getBorderStyle()
- Gets border style useful for the BorderComponent class.
- See Also:
- BorderedComponent
applyBGColorParam
public void applyBGColorParam()
- Gets the color specified by the BGCOLOR parameter and sets
the applet background to it.
applyFGColorParam
public void applyFGColorParam()
- Gets the color specified by the FGCOLOR parameter and sets
the applet foreground to it.
applyFGBGColorParam
public void applyFGBGColorParam()
- Processes FGCOLOR and BGCOLOR at once.
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