|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectcontrolP5.Controller
controlP5.Knob
public class Knob
a knob. description tbd.
/** * ControlP5 Knob * by andreas schlegel, 2009 */ import controlP5.*; ControlP5 controlP5; int myColorBackground = color(0,0,0); int knobValue = 100; Knob myKnobA; Knob myKnobB; void setup() { size(400,400); smooth(); controlP5 = new ControlP5(this); myKnobA = controlP5.addKnob("knob",0,360,0,100,160,40); myKnobB = controlP5.addKnob("knobValue",100,200,128,100,240,40); myKnobA.setOffsetAngle(-HALF_PI); } void draw() { background(myColorBackground); fill(knobValue); rect(0,0,width,100); } void knob(int theValue) { myColorBackground = color(theValue); println("a knob event. setting background to "+theValue); } void keyPressed() { myKnobA.setValue(180); }
Field Summary |
---|
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 | |
---|---|
Knob(ControlP5 theControlP5,
ControllerGroup theParent,
java.lang.String theName,
float theMin,
float theMax,
float theDefaultValue,
int theX,
int theY,
int theWidth)
|
Method Summary | |
---|---|
void |
addToXMLElement(ControlP5XMLElement theElement)
|
int |
getDragDirection()
get the drag direction which is either Controller.HORIZONTAL or Controller.VERTICAL. |
float |
getRange()
get the range value. |
float |
getResolution()
|
float |
getStartAngle()
get the start angle, 0 is at 3 o'clock. |
void |
mousePressed()
|
void |
mouseReleased()
|
void |
mouseReleasedOutside()
|
void |
setDisplayStyle(int theStyle)
set the display style of a know. |
void |
setDragDirection(int theValue)
set the drag direction, when controlling a knob, parameter is either Controller.HORIZONTAL or Controller.VERTICAL. |
void |
setMax(float theValue)
set the maximum value of the knob. |
void |
setMin(float theValue)
set the minimum value of the knob. |
void |
setNumberOfTickMarks(int theNumber)
|
void |
setOffsetAngle(float theValue)
Deprecated. |
void |
setRange(float theRange)
set the range in between which the know operates. |
void |
setResolution(float theValue)
resolution is a sensitivity value when dragging a knob. |
void |
setStartAngle(float theAngle)
The start angle is a value between 0 and TWO_PI. |
void |
setTickMarkLength(int theLength)
|
void |
setTickMarkWeight(float theWeight)
|
void |
setValue(float theValue)
set the value of the controller. |
void |
showTickMarks(boolean theFlag)
|
void |
snapToTickMarks(boolean theFlag)
|
void |
update()
updates the value of the controller without having to set the value explicitly. |
void |
updateDisplayMode(int theMode)
|
void |
updateInternalEvents(processing.core.PApplet theApplet)
TODO |
float |
value()
get the current value of the controller. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Knob(ControlP5 theControlP5, ControllerGroup theParent, java.lang.String theName, float theMin, float theMax, float theDefaultValue, int theX, int theY, int theWidth)
Method Detail |
---|
public void setStartAngle(float theAngle)
theAngle
- public float getStartAngle()
public void setRange(float theRange)
theRange
- public float getRange()
public void setDragDirection(int theValue)
theValue
- public int getDragDirection()
public void setResolution(float theValue)
theValue
- public float getResolution()
public void setNumberOfTickMarks(int theNumber)
public void showTickMarks(boolean theFlag)
public void snapToTickMarks(boolean theFlag)
public void setTickMarkLength(int theLength)
public void setTickMarkWeight(float theWeight)
public void updateInternalEvents(processing.core.PApplet theApplet)
Controller
updateInternalEvents
in interface ControllerInterface
updateInternalEvents
in class Controller
ControllerInterface.updateInternalEvents
public void mousePressed()
public void mouseReleased()
public void mouseReleasedOutside()
public void setMin(float theValue)
setMin
in class Controller
theValue
- floatpublic void setMax(float theValue)
setMax
in class Controller
theValue
- floatpublic void setValue(float theValue)
Controller
setValue
in class Controller
theValue
- floatpublic float value()
Controller
value
in interface ControllerInterface
value
in class Controller
public void update()
Controller
update
in interface ControllerInterface
update
in class Controller
public void setOffsetAngle(float theValue)
setStartAngle(float)
public void addToXMLElement(ControlP5XMLElement theElement)
theElement
- ControlP5XMLElementpublic void setDisplayStyle(int theStyle)
theStyle
- public void updateDisplayMode(int theMode)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |