SDM CSlider Widget
(Since sdm V0.3)

CSlider widget is a swing component bean. It provide a convenient means for allowing a user to control a device property's value in a control system.

It is recommend to not manipulate label using JSlider setPaintTicks, setPaintLabels, setMajorTickSpacin and setMinorTickSpacing methods. Instead of using labelstyle property vserse setLabelstyle call. There are three label style can be selected and default label style is LABEL_NONE. If the LABEL_AXIS is used, the tick mark and display range will appear on the CSlider widget (Fig. 1). Addition to the tick mark and display range, a border with the property's value as title will be added on the widget if LABEL_VALUE is selected (Fig. 2).

A CSlider with LABEL_AXIS Fig. 1
A CSlider with LABEL_VALUE Fig. 2


The orientation of the CSilder widget can be set using JSlider setOrientation method.

CSlider widget use a range sytle property to specify which Minimum and Maximum values to use. Currently there are two range style RANGE_FROM_PROPERTY and RANGE_STATIC implemented (RANGE_AUTO will be added next release). Default is RANGE_FROM_PROPERTY which means using the controlLow and the controlHigh from control system as the Minimum and Maximum values. The two setMinimum and setMaximum calls will force the rangeStyle to RANGE_STATIC and use the Minimum and Maximum values set by user. The default Minimum and Maximum values are 0 and 100.0. If the RANGE_STATIC is used and the Minimum and/or Maximum value is not be set, the default value will be used.

To adjust the value user can drag the thumb or click on the face of the slider. When the thumb is dragged, only a change larger than precision will be sent to the control system. The precision value will be obtained from control system if it is available. Otherwise use the default value of 1% of the control range. The user also can set the procision using setExtent method. When clicking on the face, the value of the property will increase or decrease one unit depend on the clicking position. When CSlider is focued, user also can use Page Up and Page Down key to adjust the slider. The value will jump unit set by setExtent method. The default extent is equal to precision. But we find out the setExtent method is not working right. When presses PgUp or PgDn key, the value always "jump" 3 units and ignores the value set using setExtent method.