Controller 001 alpha : Component reference

Slider (horizontal & vertical)

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).

Example

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.
* method inherited from class XComponent.

Default state

range minimumrange maximumvalue# of ticksticks paintedsnap to tickslegend
01010truefalsenone

Events

MessageFires when...
ADJUSTEDthe slider stops to be adjusted.
ADJUSTINGthe slider starts to be adjusted.
MINthe range minimum value changes.
MAXthe range maximum value changes.
VALUEthe slider's value changes.

Arcball

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.

Example

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.
* method inherited from class XComponent.

Default state

valuelegend
{0°, 0, 0, 0}none

Events

MessageFires when...
ADJUSTEDthe arcball stops to be adjusted.
ADJUSTINGthe arcball starts to be adjusted.
VALUEthe arcball's value changes.

Spinner

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.

Example

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.
* method inherited from class XComponent.

Default state

range minimumrange maximumvaluelegend
00none

Events

MessageFires when...
ADJUSTEDthe spinner stops to be adjusted.
ADJUSTINGthe spinner starts to be adjusted.
MINthe range minimum value changes.
MAXthe range maximum value changes.
VALUEthe spinner's value changes.

Toggle Button

Toggle buttons are two-state buttons that can be either selected or not.

Example

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.
* method inherited from class XComponent.

Default state

selectedlegend
falsenone

Events

MessageFires when...
DESELECTEDthe button is deselected.
SELECTEDthe button is selected.
TOGGLEDthe 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.

top  |  home  |  bagel papa poule : tookit