This is an old revision of the document!
Table of Contents
Spinner
com.ergotech.vib.graphics.swing.SwingSpinner
Image Examples
Overview
The Spinner graphic is a More Layout input control used to select or enter an integer value.
A user can change the value by clicking the spinner controls or by entering a value in the display area.
Spinner limits the selected value between the configured Low Value and High Value.
Common Uses
- Entering an integer value
- Incrementing or decrementing a value
- Setting a numeric value within a range
- Sending user input into application logic
- Creating operator input controls
- Updating another display or logic component
Input Behavior
Spinner accepts input through updateDisplayedValue.
The input can come from a data source, Constant, or another logic component.
The input updates the displayed Spinner value.
If the input value is higher than High Value, the Spinner displays the high value. If the input value is lower than Low Value, the Spinner displays the low value.
Output Behavior
Spinner sends its current value through PrimaryOutPort.
The PrimaryOutPort can be connected to a display-type graphic or another logic component.
This allows the Spinner value to be used as user input for another part of the application.
A new output value is generated when the user changes the Spinner value.
Spinner-Specific Behavior
Spinner is designed for integer value input.
Spinner-specific settings include:
- Name Sets the name of the Spinner graphic.
- Enabled Controls whether the user can interact with the Spinner.
- Font Controls the font used by the Spinner.
- High Value Sets the maximum allowed value.
- Low Value Sets the minimum allowed value.
- Text Color Sets the display text color.
- Background Color Sets the Spinner background color.
- Visible Controls whether the Spinner is shown.
Logic Ports
In the Logic Editor, Spinner includes these default ports:
- PrimaryOutPort
- updateDisplayedValue
The PrimaryOutPort sends the current Spinner value.
The updateDisplayedValue port updates the displayed Spinner value from a data source, Constant, or another logic component.
Range Behavior
Spinner uses Low Value and High Value to limit the value that can be displayed or output.
For example, with Low Value set to `0.0` and High Value set to `100.0`, the Spinner value is limited to that range.
If a decimal value is entered, Spinner uses the integer value.
Notes
Use Spinner when a user needs to enter or adjust an integer value.
Use Slider when the user should select a value by moving a slider.
Use ProgressBar when a value should be shown as progress instead of edited by the user.
