Class JtvMultiCheckBoxes
public class JtvMultiCheckBoxes
extends JtvCluster
A cluster of multi-state check-box controls.
JtvMultiCheckBoxes extends JtvCluster to support items with more than two
states (checked/unchecked). Each item occupies a fixed number of bits in the
inherited 32-bit JtvCluster.value field. Pressing an item cycles it
through selRange states.
The display character for each state is taken from the states string
at the corresponding index (state 0 = states.charAt(0), etc.).
The flags parameter encodes the bit layout:
- Low byte — a bitmask covering the bits used per item (
mask). - High byte — the number of bits allocated per item (
bits).
org.viktor44.jtvision.dialogs.JtvMultiCheckBoxes
Summary
Constructors
| Visibility | Signature |
|---|---|
| public | JtvMultiCheckBoxes(JtvRect bounds, String[] items, int aSelRange, int aFlags, String aStates) |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| private static final | multiCheckIcon | String |
| private | selRange | int |
| private | flags | int |
| private | states | String |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | draw() | void |
| public | multiMark(int item) | int |
| public | press(int item) | void |
Constructors
JtvMultiCheckBoxes(JtvRect bounds, String[] items, int aSelRange, int aFlags, String aStates)
Creates a multi-state check-box cluster.
Parameters
bounds- the bounding rectangleitems- the label strings for each itemaSelRange- the number of states each item cycles throughaFlags- bit layout: low byte = mask, high byte = bits per itemaStates- characters for each state (index 0 = first state, etc.); defaults to" X"ifnull
Fields
String multiCheckIcon
Icon template drawn for each item: " [ ] ".
int selRange
Number of distinct states each item can cycle through.
int flags
Bit layout descriptor: low byte is the per-item bit mask, high byte is the number of bits per item.
String states
Characters used to render each state index inside the check-box icon.
Methods
draw()
Draws all multi-state check boxes using the [ ] icon with per-state characters.
multiMark(int item)
Overrides:
multiMark(int item) in org.viktor44.jtvision.dialogs.JtvCluster
Returns the current state index for item item by extracting the relevant
bits from JtvCluster.value.
Parameters
item- the zero-based item index
Returns
the state index (0 to selRange - 1)
press(int item)
Overrides:
press(int item) in org.viktor44.jtvision.dialogs.JtvCluster
Advances item item to its next state by incrementing its field in
JtvCluster.value modulo selRange.
Parameters
item- the zero-based item index