public abstract class Controller<T> extends java.lang.Object implements ControllerInterface<T>, CDrawable, ControlP5Constants
Controller is an abstract class that is extended by any available controller within controlP5. this is the full documentation list for all methods available for a controller. An event triggered by a controller will be forwarded to the main program. If a void controlEvent(ControlEvent theEvent) {} method is available, this method will be called.
A Controller can notify the main program in 2 different ways:
setBroadcast(boolean)
Bang
,
Button
,
Knob
,
Matrix
,
MultiList
,
Numberbox
,
RadioButton
,
ListBox
,
Slider
,
Textarea
,
Textfield
,
Textlabel
,
Toggle
,
ControlGroup
,
ControlBehavior
,
ControlEvent
/**
* ControlP5 Basics
*
* The following example demonstrates the basic use of controlP5.
* After initializing controlP5 you can add controllers to controlP5.
* Here we use three numberboxes, one slider and one textfield.
* The numberbox with name numberboxC will trigger function numberboxC()
* in the example below. Whenever controlP5 detects a function in your
* sketch that corresponds to the name of a controller, it will forward
* an event to that function. Any event triggered by a controller
* will be forwarded to function controlEvent in your sketch.
* related examples ControlP5numberbox, ControlP5slider, ControlP5textfield
*
* by Andreas Schlegel, 2011
* www.sojamo.de/libraries/controlp5
*
*/
import controlP5.*;
ControlP5 cp5;
public int myColorRect = 200;
public int myColorBackground = 100;
void setup() {
size(400, 400);
noStroke();
cp5 = new ControlP5(this);
// create a slider
// parameters:
// name, minValue, maxValue, defaultValue, x, y, width, height
cp5.addSlider("sliderA", 100, 200, 100, 100, 260, 100, 14);
// create 3 numberboxes and assign an id for each
cp5.addNumberbox("numberboxA", myColorRect, 100, 140, 100, 14).setId(1);
cp5.addNumberbox("numberboxB", myColorBackground, 100, 180, 100, 14).setId(2);
cp5.addNumberbox("numberboxC", 0, 100, 220, 100, 14).setId(3);
// create a texfield
cp5.addTextfield("textA", 100, 290, 100, 20);
// change individual settings for a controller
cp5.getController("numberboxA").setMax(255);
cp5.getController("numberboxA").setMin(0);
}
void draw() {
background(myColorBackground);
fill(myColorRect);
rect(0, 0, width, 100);
}
// events from controller numberboxC are received here
public void numberboxC(int theValue) {
println("### got an event from numberboxC : "+theValue);
}
// an event from slider sliderA will change the value of textfield textA here
public void sliderA(int theValue) {
Textfield txt = ((Textfield)cp5.getController("textA"));
txt.setValue(""+theValue);
}
// for every change (a textfield event confirmed with a return) in textfield textA,
// function textA will be invoked
public void textA(String theValue) {
println("### got an event from textA : "+theValue);
}
// function controlEvent will be invoked with every value change
// in any registered controller
public void controlEvent(ControlEvent theEvent) {
println("got a control event from controller with id "+theEvent.getId());
switch(theEvent.getId()) {
case(1): // numberboxA is registered with id 1
myColorRect = (int)(theEvent.getController().getValue());
break;
case(2): // numberboxB is registered with id 2
myColorBackground = (int)(theEvent.getController().getValue());
break;
}
}
Modifier and Type | Field and Description |
---|---|
static int |
autoHeight |
static float[] |
autoSpacing |
static int |
autoWidth |
acceptClassList, ACTION_BROADCAST, ACTION_CLICK, ACTION_DOUBLE_PRESS, ACTION_DRAG, ACTION_END_DRAG, ACTION_ENTER, ACTION_EXIT, ACTION_LEAVE, ACTION_MOVE, ACTION_PRESS, ACTION_PRESSED, ACTION_RELEASE, ACTION_RELEASE_OUTSIDE, ACTION_RELEASED, ACTION_RELEASEDOUTSIDE, ACTION_START_DRAG, ACTION_WHEEL, ACTIVE, ALL, ALT, AQUA, ARC, ARRAY, BACKSPACE, BASELINE, BITFONT, BLACK, BLUE, BOOLEAN, BOTTOM, BOTTOM_OUTSIDE, CAPTIONLABEL, CENTER, CHECKBOX, COMMANDKEY, CONTROL, controlEventClass, CUSTOM, DECREASE, DEFAULT, DELETE, delimiter, DONE, DOWN, DROPDOWN, ELLIPSE, ENTER, ESCAPE, EVENT, eventMethod, FADEIN, FADEOUT, FIELD, FLOAT, FUCHSIA, GRAY, GREEN, grixel, HALF_PI, HIDE, HIGHLIGHT, HORIZONTAL, IDLE, IMAGE, INACTIVE, INCREASE, INTEGER, INVALID, J2D, JSON, KEYCONTROL, LEFT, LEFT_OUTSIDE, LIME, LINE, LIST, LOAD, MAROON, MENU, METHOD, MOVE, MULTI, MULTIPLES, NAVY, OLIVE, ORANGE, OVER, P2D, P3D, pathdelimiter, PI, PRESS, PRESSED, PRINT, PURPLE, RED, RELEASE, RELEASED, RESET, RIGHT, RIGHT_OUTSIDE, SAVE, SERIALIZED, SHIFT, SILVER, SINGLE, SINGLE_COLUMN, SINGLE_ROW, SPRITE, standard56, standard58, STRING, SWITCH, SWITCH_BACK, SWITCH_FORE, synt24, TAB, TEAL, THEME_A, THEME_CP52014, THEME_CP5BLUE, THEME_GREY, THEME_RED, THEME_RETRO, TOP, TOP_OUTSIDE, TRANSITION_WAIT_FADEIN, TREE, TWO_PI, UP, VALUELABEL, VERBOSE, VERTICAL, WAIT, WHITE, YELLOW
Constructor and Description |
---|
Controller(ControlP5 theControlP5,
java.lang.String theName)
Convenience constructor to extend Controller.
|
Modifier and Type | Method and Description |
---|---|
T |
add(ControllerInterface<?> theElement) |
T |
addCallback(CallbackListener theListener) |
T |
addListener(ControlListener theListener) |
T |
addListenerFor(int theAction,
CallbackListener theListener) |
T |
align(int theCaptionX,
int theCaptionY,
int theValueX,
int theValueY) |
T |
bringToFront() |
T |
bringToFront(ControllerInterface<?> theController) |
T |
changeValue(float theValue)
sets the value of the controller without sending the broadcast event.
|
void |
continuousUpdateEvents()
continuousUpdateEvents is used for internal updates of a controller.
|
void |
draw(processing.core.PGraphics theGraphics)
the default draw function for each controller extending superclass Controller.
|
float[] |
getAbsolutePosition() |
java.lang.String |
getAddress() |
float[] |
getArrayValue()
returns the current float array value of a controller.
|
float |
getArrayValue(int theIndex) |
ControlBehavior |
getBehavior() |
Label |
getCaptionLabel() |
CColor |
getColor() |
java.util.List<ControllerPlug> |
getControllerPlugList() |
ControlWindow |
getControlWindow() |
int |
getDecimalPrecision() |
float |
getDefaultValue() |
int |
getHeight() |
int |
getId()
returns the id of a controller, by default the id is -1.
|
java.lang.String |
getInfo() |
java.lang.String |
getLabel()
returns the controller's caption label text.
|
float |
getMax()
returns the maximum value of the controller.
|
float |
getMin()
returns the minimum value of the controller.
|
java.lang.String |
getName()
returns the index name of the controller.
|
ControllerInterface<?> |
getParent()
returns the parent of a controller.
|
int |
getPickingColor() |
Pointer |
getPointer() |
float[] |
getPosition()
get the position of a controller.
|
ControllerProperty |
getProperty(java.lang.String thePropertyName) |
ControllerProperty |
getProperty(java.lang.String theSetter,
java.lang.String theGetter) |
java.lang.String |
getStringValue() |
Tab |
getTab()
get the instance of the tab the controller belongs to.
|
float |
getValue() |
Label |
getValueLabel() |
ControllerView<T> |
getView() |
int |
getWidth() |
ControlWindow |
getWindow()
returns the control window of the controller
|
T |
hide() |
void |
init() |
boolean |
isActive()
checks if a controller is active.
|
boolean |
isBroadcast()
check if broadcasting is enabled or disabled for a controller.
|
boolean |
isInside()
returns true or false and indicates if the mouse is inside the area of a controller.
|
boolean |
isLabelVisible() |
boolean |
isListening()
returns true or false for the current listening status.
|
boolean |
isLock() |
boolean |
isMouseOver()
check if the mouse is within this particular controller.
|
boolean |
isMousePressed()
returns true or false if the mouse has is pressed.
|
boolean |
isMoveable()
checks if a controller is moveable.
|
boolean |
isUpdate()
enables the update function for a controller.
|
boolean |
isUserInteraction() |
boolean |
isVisible() |
void |
keyEvent(processing.event.KeyEvent theEvent) |
T |
linebreak() |
T |
listen(boolean theValue)
enables a controller to listen to changes made to the variable linked to the controller.
|
int |
listenerSize() |
T |
lock()
disables the controller to be moved, or changed or controlled by the user.
|
T |
moveTo(ControlGroup<?> theGroup) |
T |
moveTo(ControllerGroup<?> theGroup) |
T |
moveTo(ControllerGroup<?> theGroup,
Tab theTab,
ControlWindow theControlWindow) |
T |
moveTo(ControlWindow theControlWindow)
moves the controller to the default tab of a control window - other than the main window.
|
T |
moveTo(ControlWindow theControlWindow,
java.lang.String theTabName) |
T |
moveTo(processing.core.PApplet theApplet)
moves the controller to the default tab inside the main window.
|
T |
moveTo(processing.core.PApplet theApplet,
java.lang.String theTabName)
moves the controller to a tab inside the main window.
|
T |
moveTo(java.lang.String theTabName)
moves the controller to another tab.
|
T |
moveTo(Tab theTab)
moves the controller to another tab.
|
T |
onChange(CallbackListener theListener) |
T |
onClick(CallbackListener theListener) |
T |
onDoublePress(CallbackListener theListener) |
T |
onDrag(CallbackListener theListener) |
T |
onDraw(ControllerView<T> theView) |
T |
onEndDrag(CallbackListener theListener) |
T |
onEnter(CallbackListener theListener) |
T |
onLeave(CallbackListener theListener) |
T |
onMove(CallbackListener theListener) |
T |
onPress(CallbackListener theListener) |
T |
onRelease(CallbackListener theListener) |
T |
onReleaseOutside(CallbackListener theListener) |
T |
onStartDrag(CallbackListener theListener) |
T |
onWheel(CallbackListener theListener) |
T |
plugTo(java.lang.Object theObject) |
T |
plugTo(java.lang.Object[] theObjects)
plugs the controller to a list of objects
|
T |
plugTo(java.lang.Object[] theObjects,
java.lang.String theName) |
T |
plugTo(java.lang.Object theObject,
java.lang.String theName) |
T |
registerProperty(java.lang.String thePropertyName) |
T |
registerProperty(java.lang.String theSetter,
java.lang.String theGetter) |
T |
registerTooltip(java.lang.String theText)
adds a tooltip to a controller, by default the tooltip is disabled.
|
void |
remove()
removes a controller from controlP5.
|
T |
remove(ControllerInterface<?> theElement) |
T |
removeBehavior() |
T |
removeCallback() |
T |
removeCallback(CallbackListener theListener) |
T |
removeListener(ControlListener theListener) |
T |
removeListenerFor(int theAction,
CallbackListener theListener) |
T |
removeListenersFor(int theAction) |
T |
removeProperty(java.lang.String thePropertyName) |
T |
removeProperty(java.lang.String theSetter,
java.lang.String theGetter) |
static float[] |
set(float[] theArray,
float... theValues)
convenience method to fill a float array in favor of theArray[0] = 1.2; etc.
|
T |
setAbsolutePosition(float[] thePos) |
T |
setAddress(java.lang.String theAddress) |
T |
setArrayValue(float[] theArray) |
T |
setArrayValue(int theIndex,
float theValue) |
T |
setBehavior(ControlBehavior theBehavior)
with setBehavior you can add a ControlBehavior to a controller.
|
T |
setBroadcast(boolean theFlag)
Use setBroadcast to enable and disable the broadcasting of changes in a controller's value.
|
T |
setCaptionLabel(java.lang.String theLabel)
sets the content of the caption label of a controller.
|
T |
setColor(CColor theColor) |
T |
setColorActive(int theColor) |
T |
setColorBackground(int theColor) |
T |
setColorCaptionLabel(int theColor) |
T |
setColorForeground(int theColor) |
T |
setColorLabel(int theColor) |
T |
setColorValue(int theColor) |
T |
setColorValueLabel(int theColor) |
T |
setDecimalPrecision(int theValue)
sets the decimal precision of a controller's float value displayed.
|
T |
setDefaultValue(float theValue)
set the default value.
|
T |
setGroup(ControllerGroup<?> theGroup) |
T |
setGroup(java.lang.String theName)
sets the group of the controller.
|
T |
setHeight(int theHeight) |
T |
setId(int theId)
set the id of a controller.
|
T |
setImage(processing.core.PImage theImage) |
T |
setImage(processing.core.PImage theImage,
int theState) |
T |
setImages(processing.core.PImage... imgs) |
T |
setImages(processing.core.PImage theImageDefault,
processing.core.PImage theImageOver,
processing.core.PImage theImageActive)
by default controllers use simple shapes, to replace these shapes with images, use setImages().
|
T |
setImages(processing.core.PImage theImageDefault,
processing.core.PImage theImageOver,
processing.core.PImage theImageActive,
processing.core.PImage theImageHighlight) |
T |
setLabel(java.lang.String theString) |
T |
setLabelVisible(boolean theValue)
show or hide the labels of a controller.
|
T |
setLock(boolean theValue)
sets the lock status of the controller
|
T |
setMax(float theValue)
sets the maximum value of the Controller.
|
T |
setMin(float theValue)
sets the minimum value of the Controller.
|
T |
setMouseOver(boolean theFlag) |
boolean |
setMousePressed(boolean theStatus) |
T |
setMoveable(boolean theValue)
enable or prevent the controller to be moveable.
|
T |
setParent(ControllerInterface<?> theParent)
set the parent of a parent of a controller.
|
T |
setPosition(float[] thePos) |
T |
setPosition(float theX,
float theY)
set the position of a controller.
|
T |
setSize(int theWidth,
int theHeight) |
T |
setSize(processing.core.PImage theImage)
auto-updates the size of a controller according to the dimensions of the PImage.
|
T |
setStringValue(java.lang.String theValue) |
T |
setTab(ControlWindow theWindow,
java.lang.String theName) |
T |
setTab(java.lang.String theName)
sets the tab of the controller.
|
T |
setUpdate(boolean theFlag)
disables the update function for a controller.
|
T |
setUserInteraction(boolean theValue) |
T |
setValue(float theValue) |
T |
setValueLabel(java.lang.String theLabel)
set or change the value of the value label of a controller.
|
T |
setValueSelf(float theValue) |
T |
setView(ControllerView<T> theView)
use setDisplay to customize your controller look.
|
void |
setView(ControllerView<T> theView,
int theMode) |
T |
setVisible(boolean theFlag) |
T |
setWidth(int theWidth) |
T |
show() |
java.lang.String |
toString() |
T |
unlock()
enables the controller to be moved, changed and controlled by the user.
|
T |
unplugFrom(java.lang.Object theObject)
unplugs the Controller for a single object
|
T |
unplugFrom(java.lang.Object[] theObjects)
unplugs the controller from a list of objects
|
T |
unregisterTooltip() |
T |
update()
updates the value of the controller without having to set the value explicitly.
|
T |
updateAbsolutePosition() |
T |
updateEvents()
updateEvents is used for internal updates of a controller.
|
T |
updateInternalEvents(processing.core.PApplet theApplet)
a method for putting input events like e.g.
|
T |
updateSize() |
static float |
x(float[] theArray)
returns the first element of the float array.
|
static float |
y(float[] theArray)
returns the second element of the float array.
|
public static int autoHeight
public static float[] autoSpacing
public static int autoWidth
public Controller(ControlP5 theControlP5, java.lang.String theName)
theControlP5
- theName
- /**
* ControlP5 extending Controllers
*
* the following example shows how to extend the Controller class to
* create customizable Controllers. You can either extend the Controller class itself,
* or any class that extends Controller itself like the Slider, Button, DropdownList, etc.
*
* How to:
*
* 1) do a super call to the convenience constructor requiring
* 2 parameter (ControlP5 instance, name)
*
* 2) the Controller class has a set of empty methods that allow you to capture
* inputs from the mouse including
* onEnter(), onLeave(), onPress(), onRelease(), onClick(), onScroll(int), onDrag()
* These you can override and include functionality as needed.
*
* 3) use method getPointer() to return the local (relative)
* xy-coordinates of the controller
*
* 4) after instantiation custom controllers are treated the same
* as default controlP5 controllers.
*
* by Andreas Schlegel, 2012
* www.sojamo.de/libraries/controlp5
*
*/
import controlP5.*;
ControlP5 cp5;
PApplet p;
void setup() {
size(400, 400);
cp5 = new ControlP5(this);
// create 2 groups to show nesting of custom controllers and
//
Group g1 = cp5.addGroup("a").setPosition(0,100).setWidth(180);
Group g2 = cp5.addGroup("b").setPosition(0,10).setWidth(180);
g2.moveTo(g1);
// create 2 custom Controllers from class MyButton
// MyButton extends Controller and inherits all methods accordingly.
new MyButton(cp5, "b1").setPosition(0, 0).setSize(180, 200).moveTo(g2);
new MyButton(cp5, "b2").setPosition(205, 15).setSize(180, 200);
}
void draw() {
background(0);
}
// b1 will be called from Controller b1
public void b1(float theValue) {
println("yay button "+theValue);
}
public void controlEvent(ControlEvent theEvent) {
println("controlEvent : "+theEvent);
}
// Create a custom Controller, please not that
// MyButton extends Controller,
// is an indicator for the super class about the type of
// custom controller to be created.
class MyButton extends Controller {
int current = 0xffff0000;
float a = 128;
float na;
int y;
// use the convenience constructor of super class Controller
// MyButton will automatically registered and move to the
// default controlP5 tab.
MyButton(ControlP5 cp5, String theName) {
super(cp5, theName);
// replace the default view with a custom view.
setView(new ControllerView() {
public void display(PGraphics p, Object b) {
// draw button background
na += (a-na) * 0.1;
p.fill(current,na);
p.rect(0, 0, getWidth(), getHeight());
// draw horizontal line which can be moved on the x-axis
// using the scroll wheel.
p.fill(0,255,0);
p.rect(0,y,width,10);
// draw the custom label
p.fill(128);
translate(0,getHeight()+14);
p.text(getName(),0,0);
p.text(getName(),0,0);
}
}
);
}
// override various input methods for mouse input control
void onEnter() {
cursor(HAND);
println("enter");
a = 255;
}
void onScroll(int n) {
println("scrolling");
y -= n;
y = constrain(y,0,getHeight()-10);
}
void onPress() {
println("press");
current = 0xffffff00;
}
void onClick() {
Pointer p1 = getPointer();
println("clicked at "+p1.x()+", "+p1.y());
current = 0xffffff00;
setValue(y);
}
void onRelease() {
println("release");
current = 0xffffffff;
}
void onMove() {
println("moving "+this+" "+_myControlWindow.getMouseOverList());
}
void onDrag() {
current = 0xff0000ff;
Pointer p1 = getPointer();
float dif = dist(p1.px(),p1.py(),p1.x(),p1.y());
println("dragging at "+p1.x()+", "+p1.y()+" "+dif);
}
void onReleaseOutside() {
onLeave();
}
void onLeave() {
println("leave");
cursor(ARROW);
a = 128;
}
}
public T add(ControllerInterface<?> theElement)
add
in interface ControllerInterface<T>
theElement
- ControllerInterfacepublic T addCallback(CallbackListener theListener)
theListener
- CallbackListener
public T addListener(ControlListener theListener)
addListener
in interface ControllerInterface<T>
theListener
- ControlListenerControlListener
public T addListenerFor(int theAction, CallbackListener theListener)
public T align(int theCaptionX, int theCaptionY, int theValueX, int theValueY)
public T bringToFront()
bringToFront
in interface ControllerInterface<T>
public T bringToFront(ControllerInterface<?> theController)
bringToFront
in interface ControllerInterface<T>
public final T changeValue(float theValue)
theValue
- floatpublic final void continuousUpdateEvents()
continuousUpdateEvents
in interface ControllerInterface<T>
public void draw(processing.core.PGraphics theGraphics)
draw
in interface CDrawable
draw
in interface ControllerInterface<T>
theApplet
- PAppletControllerView
public float[] getAbsolutePosition()
getAbsolutePosition
in interface ControllerInterface<T>
PVector
public java.lang.String getAddress()
getAddress
in interface ControllerInterface<T>
public float[] getArrayValue()
getArrayValue
in interface ControllerInterface<T>
getValue()
,
getStringValue()
public float getArrayValue(int theIndex)
getArrayValue
in interface ControllerInterface<T>
theIndex
- public ControlBehavior getBehavior()
public CColor getColor()
getColor
in interface ControllerInterface<T>
public java.util.List<ControllerPlug> getControllerPlugList()
public ControlWindow getControlWindow()
public int getDecimalPrecision()
public float getDefaultValue()
public int getHeight()
getHeight
in interface ControllerInterface<T>
public int getId()
getId
in interface ControllerInterface<T>
public java.lang.String getInfo()
public java.lang.String getLabel()
public float getMax()
public float getMin()
public java.lang.String getName()
getName
in interface ControllerInterface<T>
public ControllerInterface<?> getParent()
getParent
in interface ControllerInterface<T>
public int getPickingColor()
getPickingColor
in interface ControllerInterface<T>
public Pointer getPointer()
public float[] getPosition()
getPosition
in interface ControllerInterface<T>
public ControllerProperty getProperty(java.lang.String thePropertyName)
getProperty
in interface ControllerInterface<T>
public ControllerProperty getProperty(java.lang.String theSetter, java.lang.String theGetter)
getProperty
in interface ControllerInterface<T>
public java.lang.String getStringValue()
getStringValue
in interface ControllerInterface<T>
getValue()
,
getArrayValue()
public Tab getTab()
getTab
in interface ControllerInterface<T>
public float getValue()
getValue
in interface ControllerInterface<T>
getStringValue()
,
getArrayValue()
public Label getValueLabel()
public ControllerView<T> getView()
public int getWidth()
getWidth
in interface ControllerInterface<T>
public ControlWindow getWindow()
getWindow
in interface ControllerInterface<T>
public T hide()
hide
in interface ControllerInterface<T>
public void init()
init
in interface ControllerInterface<T>
public boolean isActive()
public boolean isBroadcast()
public boolean isInside()
public boolean isLabelVisible()
public boolean isListening()
listen(boolean)
public boolean isLock()
public boolean isMouseOver()
isMouseOver
in interface ControllerInterface<T>
public boolean isMousePressed()
public boolean isMoveable()
public boolean isUpdate()
isUpdate
in interface ControllerInterface<T>
update()
,
setUpdate(boolean)
public boolean isUserInteraction()
public boolean isVisible()
isVisible
in interface ControllerInterface<T>
public void keyEvent(processing.event.KeyEvent theEvent)
keyEvent
in interface ControllerInterface<T>
KeyEvent
- theEventpublic T linebreak()
public T listen(boolean theValue)
theFlag
- public int listenerSize()
public T lock()
public final T moveTo(ControlGroup<?> theGroup)
theGroup
- public final T moveTo(ControllerGroup<?> theGroup)
moveTo
in interface ControllerInterface<T>
public final T moveTo(ControllerGroup<?> theGroup, Tab theTab, ControlWindow theControlWindow)
moveTo
in interface ControllerInterface<T>
public final T moveTo(ControlWindow theControlWindow)
theControlWindow
- public final T moveTo(ControlWindow theControlWindow, java.lang.String theTabName)
theControlWindow
- theTabName
- public final T moveTo(processing.core.PApplet theApplet)
theApplet
- public final T moveTo(processing.core.PApplet theApplet, java.lang.String theTabName)
theApplet
- theTabName
- public final T moveTo(java.lang.String theTabName)
theTabName
- Stringpublic final T moveTo(Tab theTab)
theTab
- public T onChange(CallbackListener theListener)
public T onClick(CallbackListener theListener)
public T onDoublePress(CallbackListener theListener)
public T onDrag(CallbackListener theListener)
public T onDraw(ControllerView<T> theView)
public T onEndDrag(CallbackListener theListener)
public T onEnter(CallbackListener theListener)
public T onLeave(CallbackListener theListener)
public T onMove(CallbackListener theListener)
public T onPress(CallbackListener theListener)
public T onRelease(CallbackListener theListener)
public T onReleaseOutside(CallbackListener theListener)
public T onStartDrag(CallbackListener theListener)
public T onWheel(CallbackListener theListener)
public T plugTo(java.lang.Object theObject)
theObject
- public T plugTo(java.lang.Object[] theObjects)
theObject
- public T plugTo(java.lang.Object[] theObjects, java.lang.String theName)
theObjects
- theName
- public T plugTo(java.lang.Object theObject, java.lang.String theName)
public T registerProperty(java.lang.String thePropertyName)
registerProperty
in interface ControllerInterface<T>
public T registerProperty(java.lang.String theSetter, java.lang.String theGetter)
registerProperty
in interface ControllerInterface<T>
public T registerTooltip(java.lang.String theText)
theText
- public void remove()
remove
in interface ControllerInterface<T>
public T remove(ControllerInterface<?> theElement)
remove
in interface ControllerInterface<T>
theElement
- ControllerInterfacepublic T removeBehavior()
public T removeCallback()
public T removeCallback(CallbackListener theListener)
theListener
- CallbackListener
public T removeListener(ControlListener theListener)
theListener
- ControlListenerControlListener
public T removeListenerFor(int theAction, CallbackListener theListener)
public T removeListenersFor(int theAction)
public T removeProperty(java.lang.String thePropertyName)
removeProperty
in interface ControllerInterface<T>
public T removeProperty(java.lang.String theSetter, java.lang.String theGetter)
removeProperty
in interface ControllerInterface<T>
public static float[] set(float[] theArray, float... theValues)
public T setAbsolutePosition(float[] thePos)
setAbsolutePosition
in interface ControllerInterface<T>
public T setAddress(java.lang.String theAddress)
setAddress
in interface ControllerInterface<T>
public T setArrayValue(float[] theArray)
setArrayValue
in interface ControllerInterface<T>
theArray
- public T setArrayValue(int theIndex, float theValue)
setArrayValue
in interface ControllerInterface<T>
theIndex
- theValue
- public T setBehavior(ControlBehavior theBehavior)
theBehavior
- ControlBehaviorpublic T setBroadcast(boolean theFlag)
theFlag
- booleanpublic T setCaptionLabel(java.lang.String theLabel)
setCaptionLabel
in interface ControllerInterface<T>
theLabel
- public T setColor(CColor theColor)
setColor
in interface ControllerInterface<T>
public T setColorActive(int theColor)
setColorActive
in interface ControllerInterface<T>
public T setColorBackground(int theColor)
setColorBackground
in interface ControllerInterface<T>
public T setColorCaptionLabel(int theColor)
theColor
- public T setColorForeground(int theColor)
setColorForeground
in interface ControllerInterface<T>
public T setColorLabel(int theColor)
setColorLabel
in interface ControllerInterface<T>
public T setColorValue(int theColor)
setColorValue
in interface ControllerInterface<T>
public T setColorValueLabel(int theColor)
theColor
- public T setDecimalPrecision(int theValue)
theValue
- public T setDefaultValue(float theValue)
theValue
- floatpublic final T setGroup(ControllerGroup<?> theGroup)
public final T setGroup(java.lang.String theName)
theName
- Stringpublic T setHeight(int theHeight)
theHeight
- public T setId(int theId)
setId
in interface ControllerInterface<T>
int
- theIdpublic T setImage(processing.core.PImage theImage)
public T setImage(processing.core.PImage theImage, int theState)
theImage
- theState
- use Controller.DEFAULT (background) Controller.OVER (foreground) Controller.ACTIVE (active)public T setImages(processing.core.PImage... imgs)
public T setImages(processing.core.PImage theImageDefault, processing.core.PImage theImageOver, processing.core.PImage theImageActive)
theImageDefault
- theImageOver
- theImageActive
- public T setImages(processing.core.PImage theImageDefault, processing.core.PImage theImageOver, processing.core.PImage theImageActive, processing.core.PImage theImageHighlight)
public T setLabel(java.lang.String theString)
setLabel
in interface ControllerInterface<T>
public T setLabelVisible(boolean theValue)
theValue
- booleanpublic T setLock(boolean theValue)
theValue
- public T setMax(float theValue)
theValue
- floatpublic T setMin(float theValue)
theValue
- floatpublic T setMouseOver(boolean theFlag)
setMouseOver
in interface ControllerInterface<T>
public final boolean setMousePressed(boolean theStatus)
setMousePressed
in interface ControllerInterface<T>
public T setMoveable(boolean theValue)
theValue
- booleanpublic final T setParent(ControllerInterface<?> theParent)
theParent
- ControllerInterfacepublic T setPosition(float[] thePos)
setPosition
in interface ControllerInterface<T>
public T setPosition(float theX, float theY)
setPosition
in interface ControllerInterface<T>
theX
- floattheY
- floatpublic T setSize(int theWidth, int theHeight)
theWidth
- theHeight
- public T setSize(processing.core.PImage theImage)
theImage
- public T setStringValue(java.lang.String theValue)
setStringValue
in interface ControllerInterface<T>
theValue
- public final T setTab(ControlWindow theWindow, java.lang.String theName)
public final T setTab(java.lang.String theName)
theName
- Stringpublic T setUpdate(boolean theFlag)
setUpdate
in interface ControllerInterface<T>
theFlag
- booleanupdate()
,
isUpdate()
public T setUserInteraction(boolean theValue)
public T setValue(float theValue)
setValue
in interface ControllerInterface<T>
theValue
- floatpublic T setValueLabel(java.lang.String theLabel)
theLabel
- public T setValueSelf(float theValue)
public T setView(ControllerView<T> theView)
theView
- ControllerView
public void setView(ControllerView<T> theView, int theMode)
public T setVisible(boolean theFlag)
theFlag
- booleanpublic T setWidth(int theWidth)
theWidth
- public T show()
show
in interface ControllerInterface<T>
public java.lang.String toString()
toString
in class java.lang.Object
public T unlock()
public T unplugFrom(java.lang.Object theObject)
theObject
- public T unplugFrom(java.lang.Object[] theObjects)
theObjects
- public T unregisterTooltip()
registerTooltip(String)
public T update()
update
in interface ControllerInterface<T>
setUpdate(boolean)
,
isUpdate()
public T updateAbsolutePosition()
updateAbsolutePosition
in interface ControllerInterface<T>
public final T updateEvents()
updateEvents
in interface ControllerInterface<T>
public T updateInternalEvents(processing.core.PApplet theApplet)
ControllerInterface
updateInternalEvents
in interface ControllerInterface<T>
ControllerInterface.updateInternalEvents
public T updateSize()
public static float x(float[] theArray)
public static float y(float[] theArray)
processing library controlP5 by Andreas Schlegel. (c) 2006-2015