
A slider provides control over a floating point value bounded by a range (defined by a minimum and a maximum). The relation between the current value, and the minimum and maximum range values is always as follow: minimum ≤ value ≤ maximum.
It is possible to display a parametrable number of tick marks (visible by default), and have the slider snap to these tick marks (disabled by default).
Method Summary for class XSlider
XComponentGroup |
getGroup()returns the group that includes the slider. |
* |
int |
getIndex()returns the index of the slider in its group (based on a left-to-right or top-to-bottom order). |
* |
float |
getValue()returns the slider's value. |
|
boolean |
getValueIsAdjusting()returns true if the slider is being adjusted. |
|
void |
setLegend(String text)sets the legend text for the slider. |
* |
void |
setMaximum(float max)sets the maximum value for the slider's range. |
|
void |
setMinimum(float min)sets the minimum value for the slider's range. |
|
void |
setPaintTicks(boolean b)determines whether tick marks are visible on the slider. |
|
void |
setTickNumber(int n)sets the number of tick marks. |
|
void |
setSnapToTicks(boolean b)determines whether the slider is snapping to tick marks. |
|
void |
setValue(float n)sets the slider's current value. |
XComponent.Default state
| range minimum | range maximum | value | # of ticks | ticks painted | snap to ticks | legend |
| 0 | 1 | 0 | 10 | true | false | none |
Events
| Message | Fires when... |
| ADJUSTED | the slider stops to be adjusted. |
| ADJUSTING | the slider starts to be adjusted. |
| MIN | the range minimum value changes. |
| MAX | the range maximum value changes. |
| VALUE | the slider's value changes. |
Arcball is a virtual trackball that provides an easy and intuitive way to control rotation in 3d space. The value produced by arcballs is an array of 4 floats, representing an angle and an axis (made of 3 components). The value of the angle is varying from 0 to 2π and the values of each axis component is varying from -1 to 1. Theses 4 floats can be plugged into Processing's rotate method to affect the matrix and produce the desired rotation.
While interacting with an arcball, it's possible to press the x, y or z keys to contrain the rotation to a specific axis.
Method Summary for class XArcBall
float[] |
getValue()returns the arcball's axis-angle values. |
|
boolean |
getValueIsAdjusting()returns true if the arcball is being adjusted. |
|
void |
setLegend(String text)sets the legend text for the arcball. |
* |
void |
setValue(float angle, float x, float y, float z)sets the arcball's current axis-angle values. |
XComponent.Default state
| value | legend |
| {0°, 0, 0, 0} | none |
Events
| Message | Fires when... |
| ADJUSTED | the arcball stops to be adjusted. |
| ADJUSTING | the arcball starts to be adjusted. |
| VALUE | the arcball's value changes. |
A spinner provides control over a floating point value bounded by a range (defined by a minimum and a maximum). The relation between the current value, and the minimum and maximum range values is always as follow: minimum ≤ value ≤ maximum.
Method Summary for class XSpinner
XComponentGroup |
getGroup()returns the group that includes the spinner. |
* |
int |
getIndex()returns the index of the spinner in its group (based on a top-to-bottom order). |
* |
float |
getValue()returns the spinner's value. |
|
boolean |
getValueIsAdjusting()returns true if the spinner is being adjusted. |
|
void |
setLegend(String text)sets the legend text for the spinner. |
* |
void |
setMaximum(float max)sets the maximum value for the spinner's range. |
|
void |
setMinimum(float min)sets the minimum value for the spinner's range. |
|
void |
setValue(float n)sets the spinner's current value. |
XComponent.Default state
| range minimum | range maximum | value | legend |
| 0 | 2π | 0 | none |
Events
| Message | Fires when... |
| ADJUSTED | the spinner stops to be adjusted. |
| ADJUSTING | the spinner starts to be adjusted. |
| MIN | the range minimum value changes. |
| MAX | the range maximum value changes. |
| VALUE | the spinner's value changes. |
Toggle buttons are two-state buttons that can be either selected or not.
By default, the behavior of a group of toggle buttons is to enable any button in the group to be in one of two states. There is also an option to give a group of toggle buttons a "radio" behavior, where only one of the buttons can be selected at a time: example.
Method Summary for class XToggleButton
XComponentGroup |
getGroup()returns the group that includes the button. |
* |
int |
getIndex()returns the index of the button in its group (based on a top-to-bottom order). |
* |
boolean |
isSelected()returns the state of the button. |
|
void |
setLegend(String text)sets the legend text for the button. |
* |
void |
setSelected(boolean b)sets the state of the button. |
XComponent.Default state
| selected | legend |
| false | none |
Events
| Message | Fires when... |
| DESELECTED | the button is deselected. |
| SELECTED | the button is selected. |
| TOGGLED | the button changes its state. |
** some of the components are borrowing method names and method descriptions from the javax.swing.JSlider and javax.swing.AbstractButton classes.