[VCLab-Main] [Software] [Local Slider Applet]
| This applet realizes a slider for changing of a given value within an interval [min,max] in steps of given size. Moving the slider the value will be assigned to a JavaScript variable. Optionally a JavaScript statement can be executed. |
The following is the minimal form shown using an example:
<applet code=lslider.class archive="lslider.jar" name="sliderval" height="50" width="200" MAYSCRIPT>
</applet>
This statement will generate a slider element of 200 x 50 pixels and assign the value to the JavaScript variable sliderval. The applet shown below is generated by this statement.
Parameters ---- Methods ---- Examples ----- Download
<applet code=slider.class archive="lslider.jar" height="50" width="200" |
<param name="name" value="value"> | Parameter Type | Code Syntax |
|---|---|
| Applet name |
<applet name="appletname" ...>
appletname = slider (default)This optional parameter is part of the applet main statement
and not included in the optional parameter section. It is the applet object
name on the page. The name can be used for referencing the applet when using
slider applet methods. |
| Slider variable |
<param name="var" value="JavaScript variable">Name identifier of the JavaScript variable associated with the slider. The default name is the name of the applet as given above by appletname. If appletname is not specified slider is used. |
| Lower limit |
<param name="min" value="low">The lower limit of the slider is given by low. The default value is -1. |
| Upper limit |
<param name="max" value="high">The upper limit of the slider is given by high. The default value is 1. |
| Start value |
<param name="x0" value="start">When starting the applet this start value is taken as the initial value. If not specified, the mean value of the range [low,high] is taken. |
| Step size |
<param name="steps" value="number of steps">Moving the slider, the value is changed in small increments, which are specified by the number of steps which divide the range [low,high]. |
| Slider orientation |
<param name="orientation" value="direction">
direction = horizontal (default)
vertical |
| Text fields | The lower limit, the upper limit and the actual
value of the slider can be displayed and entered in text fields. These fields
have different default positions depending on the slider orientation.
<param name="text" value="position"> |
| Text columns |
<param name="textcols" value="number of text columns">The number of character positions in the text fields is given by number of text columns. The default value is 4. |
| Lower limit lock |
<param name="minlock" value="lock">
lock = false (default)
trueIf this value ist true, changing of the lower limit in the text
field is not possible. |
| Upper limit lock |
<param name="maxlock" value="lock">
lock = false (default)
trueIf this value ist true, changing of the upper limit in the text
field is not possible. |
| Surrounding background color | The default surrounding (applet) background color
can be modified by the hex value rrggbb <param name="bgcolor" value="rrggbb"> |
| Text foreground color | The applet text default foreground color
(default: black) can be modified by the hex value rrggbb <param name="tfgcolor" value="rrggbb"> |
| Text background color | The applet text default background color
(default: white) can be modified by the hex value rrggbb <param name="tbgcolor" value="rrggbb"> |
| Slider background color | The default slider background color can be
modified by the hex value rrggbb <param name="sbgcolor" value="rrggbb"> |
| JavaScript expression execution |
<param name="script" value="JavaScript statements">JavaScript string to be executed after a slider move. This action is performed after the slider variable has been set. The JavaScript statements are restricted: it is not possible to call any Java applet or plugin methods directly or indirectly via this JavaScript interface. |
| Methods | Syntax |
|---|---|
| Set values | <applet name>.setValue(low, value,
high) This method modifies als values in the text fields and the slider values. |
| Set value | <applet name>.setValue(value ) This method modifies the value of the slider and the text field. |
| Get value | <applet name>.getValue() This method returns the current slider value. This method is only available in version >= 3.10. |
| Enable/Disable text input | <applet name>.setEnabled(boolvalue) boolvalue = true: the text field input of this applet is enabled. boolvalue = false: the text field input of this applet is disabled. |
| Disable text input | <applet name>.disable() The text field input of this applet is disabled. Not available in Java 1.1 version. Use setEnabled. |
| Enable text input | <applet name>.enable() The text field input of this applet is enabled. Not available in Java 1.1 version. Use setEnabled. |
| Example Type | Code | Example |
|---|---|---|
| Sliders without text |
<APPLET CODE="lslider.class" ARCHIVE="lslider.jar" HEIGHT="20" WIDTH="100" |
|
<APPLET CODE="lslider.class" ARCHIVE="lslider.jar" |
||
| Sliders
with text with/without lock option, different text sizes and script parameter |
<APPLET CODE="lslider.class" ARCHIVE="lslider.jar" |
|
<APPLET CODE="lslider.class" ARCHIVE="lslider.jar" |
||
<APPLET CODE="lslider.class" ARCHIVE="lslider.jar" |
||
| Slider methods
enable/disable and action parameter |
<FORM> <APPLET CODE="lslider.class" ARCHIVE="lslider.jar" |
|
| Slider methods
setValue getValue |
<APPLET CODE="lslider.class" ARCHIVE="lslider.jar" <FORM NAME="f" |
The local slider applet can be downloaded below.
[VCLab-Main] [Software] [Local Slider Applet]