LineScale

The LineScale is used to give a grade as an answer to a question. The scale that is used can be specified with any limits and number of decimals. Labeled ticks can be placed anywhere on the line.

Here is an example of a grade bar with range from 0.0 to 10.0 with one decimal and labelled ticks:

[image of a LineScale]

The line scale component has the same base component as the GradeBar many of the parameters are the same.

First, the following parameters are special to the line scale component only:

Parameter Value Description R/O
class LineScale Class alias for a line scale component. Req.
ticks choice format string Set ticks and optionally labels to line positions corresponding to a grade. Opt.
labelfont font name The font used for tick labels. Opt.
sliderOffset pixels The offset from the component's left and right edge to the start of the grading line. Opt.
knobSize pixels The size of the slider knob. Default is 10. Larger values can be used if knob is too small for screen. Changing knob size also changes the thickness of the slider's line. Opt.
answerWhen moved or released Whether to send an answer events when subjects is dragging the knob (moved) or just when the mouse button is released (released). Default is moved (to behave the same as the GradeBar). Opt.
lineLength pixels The minimum length of the slider line. If not set, it is calculated automatically based on other components on the answering panel. (The total width of the component is at least lineLength + 2 * sliderOffset). Opt.

The rest of the parameters are the same as in GradeBar. However, some parameters have different default values for the LineScale than to the GradeBar.

Parameter Value Description R/O
question text The question shown to subject. Req.
minimum number The minimum of the scale. Default is 0.0. Opt.
maximum number The maximum of the scale. Default is 5.0. Opt.
decimals number of decimals Number of decimals in the grade. Default is 1. Opt.
questionfont font name The font used for question text. Opt.
showValue true or false Whether to show the current value numerically to the subject. In line scale, the default is false. Opt.
showLabels true or false Whether to show the adjectives to the subject. In line scale, the default is false. Opt.
choiceformat choice format string Give adjectives to certain ranges of values. Default is no adjectives. This is different from the ticks and tick labels. Opt.
defaultAnswer number Set the initial value (and the position) of the grade when the question is initialized or reset. A special value 'random' can be used to initialize the value with a new random number every time the component is reset. If this option is left out, the default answer is the midpoint of the minimum and maximum of the scale. Opt.

Ticks and tick labels

Ticks can be placed on the scaling line to mark grades. A tick can optionally have a label associated with it. Ticks and labels are added by setting the ticks parameter. The format of the parameter is very much like the ChoiceFormat formatting pattern (more information about the choice format can be found in the Java's ChoiceFormat API).

The following example should help you to make your own ticks. It produces the ticks shown in the LineScale picture above.

   # Set ticks and labels
   qA.ticks=0.0#Very Lo-Fi|2.5/1#Rather Lo-Fi|5.0#Midway|7.5/1#Rather Hi-Fi|10.0#Very Hi-Fi

The first tick is placed at the position on the line that corresponds to the grade 0.0. Label 'Very Lo-Fi' is also assigned to that tick.

The second tick is placed to the position that corresponds to the grade 2.5 with a label 'Rather Lo-Fi'. The label is also placed one line below the first label. Larger numbers (1, 2, 3, 4, etc.) can also be used to place the label more lower. This is helpful if there are many labels and they would overlap.

If a tick without a label is wanted, just leave out the '#label' off (for example, '1.0|2.0|3.0' would place three ticks without labels).

Any number of labels and ticks can be added at any place of the line (except outside the range of the line).


· UI index · Document index ·

Last modified: Wed Dec 22 13:29:54 EET 1999