|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectcontrolP5.Controller
controlP5.Radio
public class Radio
/** * ControlP5 Radio * Radio is deprecated, use RadioButton or CheckBox * by andreas schlegel, 2009 */ import controlP5.*; ControlP5 controlP5; int myColorBackground = color(0,0,0); void setup() { size(400,400); smooth(); controlP5 = new ControlP5(this); Radio r = controlP5.addRadio("radio",100,160); r.deactivateAll(); // use deactiveAll to not make the first radio button active. r.add("black",0); r.add("red",1); r.add("green",2); r.add("blue",3); r.add("grey",4); } void draw() { background(myColorBackground); } void radio(int theID) { switch(theID) { case(0): myColorBackground = color(0); break; case(1): myColorBackground = color(255,0,0); break; case(2): myColorBackground = color(0,255,0); break; case(3): myColorBackground = color(0,0,255); break; case(4): myColorBackground = color(128); break; } println("a radio event."); }
Field Summary | |
---|---|
int |
defaultValue
Deprecated. |
Fields inherited from interface controlP5.ControlP5Constants |
---|
acceptClassList, ACTIVE, ALT, ARC, ARRAY, BACKSPACE, BOOLEAN, BOTTOM, CENTER, CONTROL, controlEventClass, CUSTOM, DECREASE, DEFAULT, DELETE, DOWN, ELLIPSE, ENTER, ESCAPE, EVENT, eventMethod, FIELD, FLOAT, HALF_PI, HIDE, HIGHLIGHT, HORIZONTAL, IMAGE, INCREASE, INTEGER, INVALID, KEYCONTROL, LEFT, LINE, LOAD, MENU, METHOD, MOVE, OVER, PI, PRESSED, PRINT, RELEASE, RESET, RIGHT, SAVE, SHIFT, SPRITE, STRING, SWITCH, SWITCH_BACK, SWITCH_FORE, TAB, TOP, TWO_PI, UP, VERBOSE, VERTICAL |
Constructor Summary | |
---|---|
Radio(ControlP5 theControlP5,
ControllerGroup theParent,
java.lang.String theName,
float theX,
float theY)
Deprecated. |
|
Radio(ControlP5 theControlP5,
ControllerGroup theParent,
java.lang.String theName,
float theX,
float theY,
int theWidth,
int theHeight,
int theLineSpacing)
Deprecated. |
Method Summary | |
---|---|
void |
activate(java.lang.String theRadioButtonName)
Deprecated. activate a radio button by name. |
controlP5.Radio.RadioToggle |
add(java.lang.String theLabel,
int theValue)
Deprecated. |
controlP5.Radio.RadioToggle |
addItem(java.lang.String theLabel,
int theValue)
Deprecated. add a new radio button item. |
void |
addToXMLElement(ControlP5XMLElement theElement)
Deprecated. |
controlP5.Radio.RadioToggle |
current()
Deprecated. get current radio button. |
void |
current(controlP5.Radio.RadioToggle theRadioButton)
Deprecated. set current radio button. |
void |
deactivate(java.lang.String theRadioButtonName)
Deprecated. deactivate a RadioButton and set the value of the radio controller to the default value. |
void |
deactivateAll()
Deprecated. |
void |
draw(processing.core.PApplet theApplet)
Deprecated. the default draw function for each controller extending superclass Controller. |
void |
removeItem(java.lang.String theName)
Deprecated. |
void |
setColorActive(int theColor)
Deprecated. set the color for the controller while active. |
void |
setColorBackground(int theColor)
Deprecated. set the background color of the controller. |
void |
setColorForeground(int theColor)
Deprecated. set the foreground color of the controller. |
void |
setColorLabel(int theColor)
Deprecated. |
void |
setDefaultValue(int theValue)
Deprecated. set the default value of a Radio controller, in case no radio button is selected. |
void |
setValue(float theValue)
Deprecated. set the value of the controller. |
void |
update()
Deprecated. updates the value of the controller without having to set the value explicitly. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int defaultValue
Constructor Detail |
---|
public Radio(ControlP5 theControlP5, ControllerGroup theParent, java.lang.String theName, float theX, float theY)
theControlP5
- ControlP5theParent
- ControllerGrouptheName
- StringtheX
- floattheY
- floatpublic Radio(ControlP5 theControlP5, ControllerGroup theParent, java.lang.String theName, float theX, float theY, int theWidth, int theHeight, int theLineSpacing)
Method Detail |
---|
public controlP5.Radio.RadioToggle add(java.lang.String theLabel, int theValue)
theLabel
- StringtheValue
- int
public controlP5.Radio.RadioToggle addItem(java.lang.String theLabel, int theValue)
theLabel
- StringtheValue
- intpublic void removeItem(java.lang.String theName)
public void draw(processing.core.PApplet theApplet)
Controller
draw
in interface CDrawable
draw
in interface ControllerInterface
draw
in class Controller
theApplet
- PAppletControllerDisplay
public void setDefaultValue(int theValue)
theValue
- public void setValue(float theValue)
Controller
setValue
in class Controller
theValue
- floatpublic void update()
Controller
update
in interface ControllerInterface
update
in class Controller
public void current(controlP5.Radio.RadioToggle theRadioButton)
theRadioButton
- RadioButtonpublic controlP5.Radio.RadioToggle current()
public void activate(java.lang.String theRadioButtonName)
theRadioButtonLabel
- Stringpublic void deactivate(java.lang.String theRadioButtonName)
theRadioButtonName
- public void deactivateAll()
public void setColorBackground(int theColor)
Controller
setColorBackground
in interface ControllerInterface
setColorBackground
in class Controller
theColor
- intpublic void setColorForeground(int theColor)
Controller
setColorForeground
in interface ControllerInterface
setColorForeground
in class Controller
theColor
- intpublic void setColorLabel(int theColor)
setColorLabel
in interface ControllerInterface
setColorLabel
in class Controller
theColor
- intpublic void setColorActive(int theColor)
Controller
setColorActive
in interface ControllerInterface
setColorActive
in class Controller
theColor
- intpublic void addToXMLElement(ControlP5XMLElement theElement)
theElement
- ControlP5XMLElement
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |