|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectcontrolP5.Controller
controlP5.Toggle
public class Toggle
a toggle can have two states, true and false, where true has the value 1 and false is 0.
Field Summary |
---|
Fields inherited from class controlP5.Controller |
---|
MOVE, PRESSED, RELEASE |
Fields inherited from interface controlP5.ControlP5Constants |
---|
acceptClassList, ALT, ARRAY, BACKSPACE, BOOLEAN, CONTROL, DECREASE, DELETE, DOWN, ENTER, ESCAPE, eventMethod, FIELD, FLOAT, HALF_PI, HIDE, INCREASE, INTEGER, INVALID, KEYCONTROL, LEFT, LOAD, MENU, METHOD, PI, PRINT, RESET, RIGHT, SAVE, SHIFT, STRING, SWITCH_BACK, SWITCH_FORE, TAB, TWO_PI, UP, VERBOSE |
Constructor Summary | |
---|---|
Toggle(ControlP5 theControlP5,
Tab theParent,
java.lang.String theName,
float theValue,
float theX,
float theY,
int theWidth,
int theHeight)
|
Method Summary | |
---|---|
void |
addToXMLElement(ControlP5XMLElement theElement)
|
void |
draw(processing.core.PApplet theApplet)
|
boolean |
getState()
|
float |
internalValue()
|
void |
mousePressed()
|
void |
setInternalValue(float theInternalValue)
by default a toggle returns 0 (for off) and 1 (for on). |
void |
setState(boolean theFlag)
set the state of the toggle, which can be true or false. |
void |
setValue(float theValue)
set the value of the controller. |
void |
toggle()
switch the state of a toggle. |
void |
update()
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, toString, wait, wait, wait |
Constructor Detail |
---|
public Toggle(ControlP5 theControlP5, Tab theParent, java.lang.String theName, float theValue, float theX, float theY, int theWidth, int theHeight)
theControlP5
- ControlP5theParent
- TabtheName
- StringtheValue
- floattheX
- floattheY
- floattheWidth
- inttheHeight
- intMethod Detail |
---|
public void draw(processing.core.PApplet theApplet)
draw
in interface CDrawable
draw
in interface ControllerInterface
draw
in class Controller
theApplet
- PAppletpublic void mousePressed()
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 setState(boolean theFlag)
theFlag
- booleanpublic boolean getState()
public void toggle()
public void addToXMLElement(ControlP5XMLElement theElement)
theElement
- ControlP5XMLElementpublic void setInternalValue(float theInternalValue)
theInternalValue
- public float internalValue()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |