controlP5
Class Bang

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

public class Bang
extends Controller

a bang controller triggers an event when pressed. It can only be applied to a method assigned to it and not to fields. for a full documentation of this controller see the controller class.


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
 
Method Summary
 void addToXMLElement(ControlP5XMLElement theElement)
           
 void draw(processing.core.PApplet theApplet)
           
 void setTriggerEvent(int theEventID)
          by default a bang is triggered when the mouse is pressed.
 void setValue(float theValue)
          set the value of the bang controller.
 void update()
          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, getSprite, getTab, getWidth, getWindow, hide, id, init, isBroadcast, isInside, isMousePressed, isUpdate, isVisible, isXMLsavable, keyEvent, label, listenerSize, max, min, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, name, parent, position, remove, remove, removeBehavior, removeListener, setArrayValue, setBehavior, setBroadcast, setCaptionLabel, setColorActive, setColorBackground, setColorForeground, setColorLabel, setColorValue, setDecimalPrecision, setDefaultValue, setGroup, setGroup, setHeight, setId, setLabel, setLabelVisible, setMax, setMin, setMousePressed, setMoveable, setParent, setPosition, setSprite, setTab, setTab, setUpdate, setValueLabel, setVisible, setWidth, setWindow, setWindow, show, stringValue, trigger, updateAbsolutePosition, updateEvents, updateInternalEvents, value, valueLabel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

draw

public void draw(processing.core.PApplet theApplet)
Specified by:
draw in interface CDrawable
Specified by:
draw in interface ControllerInterface
Overrides:
draw in class Controller
Parameters:
theApplet - PApplet

setTriggerEvent

public void setTriggerEvent(int theEventID)
by default a bang is triggered when the mouse is pressed. use setTriggerEvent(Bang.PRESSED) or setTriggerEvent(Bang.RELEASE) to define the action for triggering a bang. currently only Bang.PRESSED and Bang.RELEASE are supported.

Parameters:
theEventID -

setValue

public void setValue(float theValue)
set the value of the bang controller. since bang can be true or false, false=0 and true=1

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

update

public void update()
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().

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

addToXMLElement

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


processing library controlP5 by Andreas Schlegel. (c) 2010