ACOP Wheelswitch

AcopWheelswitch

Description

AcopWheelswitch is a displayer which can show a single double value. The wheelswitch can be used as a component which controls settable connection points.

The displayer consists of several digits and an up/down button. In normal mode digits present the value, which is read from the remote connection point. When the user presses the up/down button the wheelswitch assumes the settable mode - in this case the user can enter the value he wants to set on the remote property. All digits are also sensible to mouse wheel movement.

Code examples

The following lines show an example how to use the features of the AcopWheelswitch.

Common features

For features shared with other ACOP Beans see this page.

Value format

The wheelswitch formats the displayed number according to its formatter. If we want to display the number in radial units we can use a radial formatter:

wheelswitch.setFormatter(new RadialWheelswitchFormatter());

Or we want to display a normal decimal number:

wheelswitch.setFormatter(new WheelswitchFormatter());

Value monitoring

If wheelswitch is used as a monitor, we want to be notified when the value exceeds the preset bounds. The wheelswitch may visually indicate this by tilting the border:

wheelswitch.setTiltingEnabled(true);

If we don't want to change the values at all (just use the wheelswitch as a monitor displayer) we can put it in the read only mode

wheelswitch.setEditable(false);

Other properties

Other properties of the wheelswitch can also simply be adjusted by calling the appropriate setter methods. These properties include maximum/minimum value background/foreground color, title etc:

wheelswitch.setMaximum(100);
wheelswitch.setMinimum(5.2);
wheelswitch.setBackground(Color.RED);
wheelswitch.setForeground(Color.GREEN);

Complete source code for examples

See the complete source code used in this examples.