controlP5
Class Radio

java.lang.Object
  extended by controlP5.Controller
      extended by controlP5.Radio
All Implemented Interfaces:
CDrawable, ControllerInterface, ControlP5Constants

Deprecated. use RadioButton or CheckBox instead ControlP5 Bang Button Knob Numberbox Radio Slider Tab Textfield Toggle

public class Radio
extends Controller

+Example
/**
 * 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 controlP5.Controller
absolutePosition, add, addListener, arrayValue, behavior, captionLabel, changeValue, color, continuousUpdateEvents, controlWindow, defaultValue, disableSprite, enableSprite, getAsXML, getColor, getHeight, getPickingColor, getSprite, getTab, getWidth, getWindow, hide, id, init, isBroadcast, isInside, isLock, isMousePressed, isMoveable, isUpdate, isUserInteraction, isVisible, isXMLsavable, keyEvent, label, linebreak, listenerSize, lock, max, min, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, name, parent, plugTo, plugTo, position, remove, remove, removeBehavior, removeListener, setArrayValue, setBehavior, setBroadcast, setCaptionLabel, setColor, setColorCaptionLabel, setColorValue, setColorValueLabel, setDecimalPrecision, setDefaultValue, setDisplay, setDisplay, setGroup, setGroup, setHeight, setId, setImage, setImage, setImages, setImages, setLabel, setLabelVisible, setLock, setMax, setMin, setMousePressed, setMoveable, setParent, setPosition, setSize, setSize, setSprite, setTab, setTab, setUpdate, setUserInteraction, setValueLabel, setVisible, setWidth, setWindow, setWindow, show, stringValue, toString, trigger, unlock, unplugFrom, unplugFrom, updateAbsolutePosition, updateEvents, updateInternalEvents, updateSize, value, valueLabel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultValue

public int defaultValue
Deprecated. 
Constructor Detail

Radio

public Radio(ControlP5 theControlP5,
             ControllerGroup theParent,
             java.lang.String theName,
             float theX,
             float theY)
Deprecated. 
Parameters:
theControlP5 - ControlP5
theParent - ControllerGroup
theName - String
theX - float
theY - float

Radio

public Radio(ControlP5 theControlP5,
             ControllerGroup theParent,
             java.lang.String theName,
             float theX,
             float theY,
             int theWidth,
             int theHeight,
             int theLineSpacing)
Deprecated. 
Method Detail

add

public controlP5.Radio.RadioToggle add(java.lang.String theLabel,
                                       int theValue)
Deprecated. 

Parameters:
theLabel - String
theValue - int
Returns:
RadioButton

addItem

public controlP5.Radio.RadioToggle addItem(java.lang.String theLabel,
                                           int theValue)
Deprecated. 
add a new radio button item.

Parameters:
theLabel - String
theValue - int

removeItem

public void removeItem(java.lang.String theName)
Deprecated. 

draw

public void draw(processing.core.PApplet theApplet)
Deprecated. 
Description copied from class: Controller
the default draw function for each controller extending superclass Controller. This draw function will take care of default matrix operations and will call the display function of the current ControllerDisplay object active for this particular controller.

Specified by:
draw in interface CDrawable
Specified by:
draw in interface ControllerInterface
Overrides:
draw in class Controller
Parameters:
theApplet - PApplet
See Also:
ControllerDisplay

setDefaultValue

public void setDefaultValue(int theValue)
Deprecated. 
set the default value of a Radio controller, in case no radio button is selected.

Parameters:
theValue -

setValue

public void setValue(float theValue)
Deprecated. 
Description copied from class: Controller
set the value of the controller.

Specified by:
setValue in class Controller
Parameters:
theValue - float

update

public void update()
Deprecated. 
Description copied from class: Controller
updates the value of the controller without having to set the value explicitly. update does not visually update the controller. the updating status can be set with setUpdate(true/false) and checked with isUpdate(). setUpdate ( )

Specified by:
update in interface ControllerInterface
Overrides:
update in class Controller

current

public void current(controlP5.Radio.RadioToggle theRadioButton)
Deprecated. 
set current radio button.

Parameters:
theRadioButton - RadioButton

current

public controlP5.Radio.RadioToggle current()
Deprecated. 
get current radio button.

Returns:
RadioButton

activate

public void activate(java.lang.String theRadioButtonName)
Deprecated. 
activate a radio button by name.

Parameters:
theRadioButtonLabel - String

deactivate

public void deactivate(java.lang.String theRadioButtonName)
Deprecated. 
deactivate a RadioButton and set the value of the radio controller to the default value.

Parameters:
theRadioButtonName -

deactivateAll

public void deactivateAll()
Deprecated. 

setColorBackground

public void setColorBackground(int theColor)
Deprecated. 
Description copied from class: Controller
set the background color of the controller.

Specified by:
setColorBackground in interface ControllerInterface
Overrides:
setColorBackground in class Controller
Parameters:
theColor - int

setColorForeground

public void setColorForeground(int theColor)
Deprecated. 
Description copied from class: Controller
set the foreground color of the controller.

Specified by:
setColorForeground in interface ControllerInterface
Overrides:
setColorForeground in class Controller
Parameters:
theColor - int

setColorLabel

public void setColorLabel(int theColor)
Deprecated. 
Specified by:
setColorLabel in interface ControllerInterface
Overrides:
setColorLabel in class Controller
Parameters:
theColor - int

setColorActive

public void setColorActive(int theColor)
Deprecated. 
Description copied from class: Controller
set the color for the controller while active.

Specified by:
setColorActive in interface ControllerInterface
Overrides:
setColorActive in class Controller
Parameters:
theColor - int

addToXMLElement

public void addToXMLElement(ControlP5XMLElement theElement)
Deprecated. 
Parameters:
theElement - ControlP5XMLElement


processing library controlP5 by Andreas Schlegel. (c) 2010