[ Configurable Applets | JCM Project Page ]

Common Applet Params for
Configurable JCM Applets



This page lists the applet params that are processed by the GenericGraphApplet class. These params can be used in many of the configurable JCM applets, such as SimpleGraph, which are defined as subclasses of GenericGraphApplet. Each subclass can define other applet parameters, and might even choose to ignore some of these or to change the defaults listed here. See the individual applets for details.

Note that Param Names are case-sensitive, but that param values are not.

If the value of a param is a list of numbers, the numbers can be separated by either spaces or commas.

If the value of a param is a color, it can be specified as a list of three numbers in the range from 0 to 255. These numbers give the red, green, and blue components of the color. A color can also be specified as one of Java's standard color names: white, black, red, green, blue, yellow, cyan, magenta, lightGray, gray, darkGray, pink, and magenta.



Param Name Type Default Description
LaunchButtonName String (none) If this is defined, then the applet appears as a button on the Web page, which will launch a separate, resizable window when clicked. This param gives the name that appears on the button. (The applet is also shown as a button if the size of the applet is 100 or less.)
FrameTitle String (name of class) Specifies a title for the separate window that is opened, when the applet is shown on the web page as a button.
FrameSize List of 2 numbers (none) Provides a size for the separate window. If no value is provided, then the window size is set to 550, 400.
BackgroundColor Color Gray The background color for the applet as a whole.
ForegroundColor Color Black The background color for the applet as a whole.
PanelBackground Color lightGray The background color for the limit control panel and input panel, if they exist.
Insets integer 3 The number of pixels between the edges of the applet and the components that it contains.
CanvasColor Color White The background color for the display canvas.
Limits List of 4 numbers -5, 5, -5, 5 The xmin, xmax, ymin, and ymax values that specify the range of coordinate values to show on the display canvas.
UseLimitsPanel yes/no yes If value is not "no", a limit control panel is added to the applet, with input boxes and buttons for controlling the range of coordinate values on the display canvas.
TwoColumnLimits yes/no no If the value is "yes", arrange the components in the limit control panel into two columns, instead of one, if possible. (This is ignored if "UseLimitsPanel" is "no".)
LimitsOnLeft yes/no no If the value is "yes", place the limit control panel to the left of the display canvas instead of to the right. (This is ignored if "UseLimitsPanel" is "no".)
SetLimitsButton yes/no yes Add a "SetLimits" button to the limit control panel. (This is ignored if "UseLimitsPanel" is "no".)
UseZoomButtons yes/no no Add a "Zoom In" button and a "Zoom Out" button to the limit control panel. (This is ignored if "UseLimitsPanel" is "no".)
UseRestoreButton yes/no no Add a "Restore" button to the limit control panel. (This is ignored if "UseLimitsPanel" is "no".)
UseEqualizeButton yes/no no Add a "Equalize Axes" button to the limit control panel. (This is ignored if "UseLimitsPanel" is "no".)
AxesColor Color Blue The basic color for the axes that are drawn on the display canvas.
AxesLightColor Color light blue The color used to draw an axis if the actual axis lies outside the display canvas.
XLabel String (none) The label that appears on the x-axis, generally the name of the independent variable.
YLabel String (none) The label that appears on the y-axis.
LabelColor Color black The color of the labels (if any) on the x-axis
BorderWidth integer 2 The width, in pixels, of the border drawn around the display canvas. If the value is zero, no border is added.
BorderColor Color black The color of the border (if any) drawn around the display canvas.
UseGrid yes/no no If the value is "yes", then a grid of horizontal and vertical lines is added to the canvas.
GridColor Color 220 220 220 The color of the grid of lines shown on the canvas, if any. This is ignored if UseGrid is "no".
UseMouseZoom yes/no no If the value is "yes", then the user can zoom in and out on the display canvas using the mouse. The user clicks to zoom in on a point or shift-clicks to zoom out from a point. The user can also drag the mouse to draw a small rectangle that is then zoomed to fill the entire canvas.
UsePanner yes/no no If this is set to "yes", then the user can "pan" a coordinate rectangle by right-clicking and dragging on the display canvas.
Variable String x Name of an independent variable, which is added to the parser so that it can be used in expressions.
XName String (same as Variable) Name of the horizontal variable on the canvas, usually x. This is only used for labeling the input boxes in a limit control panel.
YName String y Name of the vertical variable on the canvas, usually y. This is only used for labeling the input boxes in a limit control panel.
UseFunctionInput yes/no yes If the value is not "no", then an input box is added to the applet where the user can type in a function.
Function String "abs() ^ x" The initial contents of the function input box. This is ignored by GenericGraphApplet if the value of "UseFunctionInput" is "no", but it is used by some sub-classes. For example, if "UseFunctionInput" is "no", the SimpleGraph applet will still display the function defined by the "Function" parameter.
FunctionLabel String "f(x) = " A label that appears to the right of the function input box, except that if the value is "none" then no label appears. (This is ignored if "UseFunctionInput" is "no".)
UseComputeButton yes/no yes If the value is not "no", then a ComputeButton is added to the right of the function input box. Clicking on this button has the same effect as pressing return in the function input box. (This is ignored if "UseFunctionInput" is "no".)
ComputeButtonName String "New Function" The label that appears on the ComputeButton. (This is ignored if "UseFunctionInput" is "no" or if "UseComputeButton" is "no".)
PanelTitle String (none) If defined, and if there is no example menu for the applet, and if the applet is not shown in a separate window, then this string is used as a title at the top of the applet.
PanelBackground Color lightGray The background color for the title at the top of the applet (if any).
PanelForeground Color 200,0,0 The color of the text in the title at the top of the applet (if any).
StandardFunctions yes/no yes If this is not "no", then all the standard functions such as sin(x) and abs(x) are added to the parser so that they can be used in expressions.
Booleans yes/no yes If this is not "no", then the parser is configured so that conditional expressions such as "(x > 1)? x+1 : x^2-2" can be used in expression.
OptionalStars yes/no no If this is not "no", then the parser is configured so that the "*" operator can be omitted. Then, for example, "2 x" means two times x.
OptionalParens yes/no no If this is not "no", then the parser is configured so that parentheses are optional around the arguments of standard functions. A standard function applies to the factor that follows it. A factor can use the operations of multiplication, division, and exponentiation, but not addition or subtractions. Thus, "sin x + 1" means "sin(x) + 1" while "sin x * cos x" means "sin(x*cos(x))".
Factorials yes/no no If this is not "no", then the parser is configured to recognize the factorial operator, as in "n!".
Summations yes/no no If this is not "no", then the parser is configured to recognize summations such as "sum(i,1,5,x^i)". The first parameter must be a variable name, and this is the summation variable. The next two arguments are expressions that give the limits on the summation. The last arguement is the general term in the summation. You should keep in mind that summing over a lot of terms takes a lot of time if you do it for all the points on a graph!
Define,
Define1,
Define2,
...
String (none) These params can be used to define functions to be added to the parser. Functions defined in this way can then be used in expressions that are parsed by the parser. You can use "Define1" whether or not you use "Define". However, to use "Define2", you must also use "Define1". To use "Define3", you must also use "Define2". And so forth. The value of one of these parameters can be a function definition in a form such as "f(x)=x^2" or "max(a,b) = a > b ? a : b", or it can be given as a table of values. The syntax for defining functions as tables is as follows: First comes the word "table". The next item can optionally be one of the table styles "smooth", "linear", or "step". The default is "smooth". Then values can be specified for the table. If the next word is "intervals", it should be followed by numbers giving the number of intervals, the minimum x, and the maximum x, and y-values for up to (intervals+1) points. The x-values of the points are evenly distributed between xmin and xmax. If the word "intervals" is not specified, the remaining items are numbers giving pairs of (x,y)-values. Items can be separated by spaces, tabs, and commas.
Example,
Example1,
Example2,
...
String (none) These params can be used to define examples that are presented to the user in a menu at the top of the applet. You can use "Example1" whether or not you use "Example". However, to use "Example2", you must also use "Example1". To use "Example3", you must also use "Example2". And so forth. The value should be a string that contains a ";". The part of the string before the first ";" appears in the example menu as a name for the example. The rest of the string is information needed for the example, such as the definition of a function. GenericGraphApplet simply builds the example menu. The strings must be interpreted by a subclass of GenericGraphApplet.
UseLoadButton yes/no yes If the value is "yes", then examples are displayed in a pop-up menu with a "Load" button next to it. Clicking the Load button loads the example shown in the pop-up menu; selecting a new example in the menu doesn't do anything. This is appropriate if there is a function input box and the example menu is thought of as another way of inputting a function. If the value of this param is set to "no", there is no Load button, and when an item is selected from the pop-up example menu, that example is loaded immediately. This is appropriate if you just want the applet to act as a galary of examples. This param is ignored if there are no examples.
LoadFirstExample yes/no (see discussion) If this is set to "yes", and if at least one example string has been defined, then the first example string is loaded when the applet is created, or when the frame is first loaded. What this means depends on how examples are interpreted in the subclasses, but it is likely to override the values of other applet parameters such as "Function". If the value of "UseLoadButton" is "yes", then the default value for "LoadFirstExample" is "no". If the value of "UseLoadButton" is "no", then the default for "LoadFirstExample" is "yes" (since it's likely in this case that you want the displayed example to match the example selected in the example menu).

[ Configurable Applets | JCM Project Page ]