Class GpadParm

java.lang.Object
  |
  +--GpadParm

public final class GpadParm
extends java.lang.Object

The GpadParm class is a container for parameters added to a GraphicPad component. The class contains constants that define Gpad parameter types.

Version:
1.19.1
Author:
Joseph E. Dever
See Also:
GpadComponent

Field Summary
static int ALIGNMENT
          Deprecated. No replacement
static int BOOLEAN
          Boolean parameter type
static int HEIGHT
          The height of the Paintlet canvas.
static int IMAGE
          Image parameter type.
static int INT
          Integer parameter type
static int JAVACOLOR
          Java color parameter type.
static int RGBCOLOR
          RGB color parameter type.
static int SOCKET
          Socket parameter type.
static int STRING
          String parameter type
static int VARIABLE
          Variable parameter type.
static int WIDTH
          The width of the Paintlet canvas.
 
Constructor Summary
GpadParm()
          Constructs a new GpadParm object.
 
Method Summary
 void addParm(java.lang.String parmName, int parmType)
          Adds a parameter name-type to this GpadParm object.
 java.util.Map getParmMap()
          Gets the map containing the parameter types that have been added to this GpadParm object.
 java.lang.Object getParmValue(java.lang.String parmName)
          Returns the value of a named component parameter as an Object type.
 void setParm(java.lang.String parmName, java.lang.Object parmVal)
          Sets the value of the named parameter to the specified Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING

public static final int STRING
String parameter type

INT

public static final int INT
Integer parameter type

BOOLEAN

public static final int BOOLEAN
Boolean parameter type

JAVACOLOR

public static final int JAVACOLOR
Java color parameter type. This parameter type is defined by the standard colors of the Color class.
See Also:
Color

RGBCOLOR

public static final int RGBCOLOR
RGB color parameter type. This parameter type is defined by red, green and blue color components, where each component has a value between 0 and 255 inclusive.
See Also:
Color

IMAGE

public static final int IMAGE
Image parameter type. This parameter type is usually an image file on the local file system.

ALIGNMENT

public static final int ALIGNMENT
Deprecated. No replacement


SOCKET

public static final int SOCKET
Socket parameter type. This parameter type represents a network connection.
See Also:
Socket

VARIABLE

public static final int VARIABLE
Variable parameter type. This parameter type represents a developer-defined parameter with arbitrary, user-selectable strings.
See Also:
GpadComponent.getVariableChoice(String)

WIDTH

public static final int WIDTH
The width of the Paintlet canvas.

HEIGHT

public static final int HEIGHT
The height of the Paintlet canvas.
Constructor Detail

GpadParm

public GpadParm()
Constructs a new GpadParm object.
Method Detail

getParmMap

public java.util.Map getParmMap()
Gets the map containing the parameter types that have been added to this GpadParm object. This method should not be used by component developers.

addParm

public void addParm(java.lang.String parmName,
                    int parmType)
Adds a parameter name-type to this GpadParm object. Component developers should use the addParameter method in the GpadComponent class.
Parameters:
parmName - the name of the parameter
parmType - the type of the parameter
See Also:
GpadComponent.addParameter(String,int)

setParm

public void setParm(java.lang.String parmName,
                    java.lang.Object parmVal)
Sets the value of the named parameter to the specified Object. This method is called by the gpad application. It associates the user-specified parameter value to the specified parameter name. These parameter values are made available to the component developer with the getParmValue method. The getParmValue method is normally invoked within the runComponent method of a component.
Parameters:
parmName - the name of the parameter
parmValue - the value of the parameter
See Also:
GpadComponent.addParameter(String,int), getParmValue(String)

getParmValue

public java.lang.Object getParmValue(java.lang.String parmName)
                              throws GpadParmException
Returns the value of a named component parameter as an Object type. This method is normally called in the runComponent method of a GpadComponent. The caller of this method must cast the returned object to the appropriate type. A GpadParmException is thrown if no value has been assigned to the named parameter.
Parameters:
parmName - the name of the parameter
Returns:
the Object associated with this parmName
Throws:
GpadParmException - if a named parameter has a null value
See Also:
GpadComponent.runComponent(), GpadParmException