controlp5/reference/controlP5/CheckBox.html

1322 lines
72 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Sun Apr 27 21:39:46 SGT 2014 -->
<title>CheckBox (Javadocs: controlP5)</title>
<meta name="date" content="2014-04-27">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="CheckBox (Javadocs: controlP5)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../controlP5/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../index-all.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../controlP5/ChartDataSet.html" title="class in controlP5"><span class="strong">Prev Class</span></a></li>
<li><a href="../controlP5/ColorPicker.html" title="class in controlP5"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?controlP5/CheckBox.html" target="_top">Frames</a></li>
<li><a href="CheckBox.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">controlP5</div>
<h2 title="Class CheckBox" class="title">Class CheckBox</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../controlP5/ControllerGroup.html" title="class in controlP5">controlP5.ControllerGroup</a>&lt;T&gt;</li>
<li>
<ul class="inheritance">
<li><a href="../controlP5/ControlGroup.html" title="class in controlP5">controlP5.ControlGroup</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;</li>
<li>
<ul class="inheritance">
<li>controlP5.CheckBox</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../controlP5/ControllerInterface.html" title="interface in controlP5">ControllerInterface</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;, <a href="../controlP5/ControlListener.html" title="interface in controlP5">ControlListener</a>, <a href="../controlP5/ControlP5Constants.html" title="interface in controlP5">ControlP5Constants</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">CheckBox</span>
extends <a href="../controlP5/ControlGroup.html" title="class in controlP5">ControlGroup</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;</pre>
<div class="block">A multiple-choice radioButton. items are added to a checkBox and can be organized in rows and
columns. items of a checkBox are of type Toggle.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../controlP5/Toggle.html" title="class in controlP5"><code>Toggle</code></a></dd><script type="text/javascript">
<!--
document.getElementsByTagName('html')[0].className = 'isjs';function toggle(dt) { var display, dd=dt; do{ dd = dd.nextSibling } while(dd.tagName!='DD'); toOpen =!dd.style.display;dd.style.display = toOpen? 'block':''; dt.getElementsByTagName('span')[0].innerHTML = toOpen? '-':'+' ; }
-->
</script>
<div id="test" class="toggleList"><dl><dt onclick="toggle(this);"><span>+</span>Example</dt><dd><code><pre>/**
* ControlP5 Checkbox
* an example demonstrating the use of a checkbox in controlP5.
* CheckBox extends the RadioButton class.
* to control a checkbox use:
* activate(), deactivate(), activateAll(), deactivateAll(), toggle(), getState()
*
* find a list of public methods available for the Checkbox Controller
* at the bottom of this sketch's source code
*
* by Andreas Schlegel, 2012
* www.sojamo.de/libraries/controlP5
*
*/
import controlP5.*;
ControlP5 cp5;
CheckBox checkbox;
int myColorBackground;
void setup() {
size(700, 400);
smooth();
cp5 = new ControlP5(this);
checkbox = cp5.addCheckBox("checkBox")
.setPosition(100, 200)
.setSize(40, 40)
.setItemsPerRow(3)
.setSpacingColumn(30)
.setSpacingRow(20)
.addItem("0", 0)
.addItem("50", 50)
.addItem("100", 100)
.addItem("150", 150)
.addItem("200", 200)
.addItem("255", 255)
;
}
void keyPressed() {
if (key==' ') {
checkbox.deactivateAll();
}
else {
for (int i=0;i<6;i++) {
// check if key 0-5 have been pressed and toggle
// the checkbox item accordingly.
if (keyCode==(48 + i)) {
// the index of checkbox items start at 0
checkbox.toggle(i);
println("toggle "+checkbox.getItem(i).name());
// also see
// checkbox.activate(index);
// checkbox.deactivate(index);
}
}
}
}
void draw() {
background(170);
pushMatrix();
translate(width/2 + 200, height/2);
stroke(255);
strokeWeight(2);
fill(myColorBackground);
ellipse(0,0,200,200);
popMatrix();
}
void controlEvent(ControlEvent theEvent) {
if (theEvent.isFrom(checkbox)) {
myColorBackground = 0;
print("got an event from "+checkbox.getName()+"\t\n");
// checkbox uses arrayValue to store the state of
// individual checkbox-items. usage:
println(checkbox.getArrayValue());
int col = 0;
for (int i=0;i<checkbox.getArrayValue().length;i++) {
int n = (int)checkbox.getArrayValue()[i];
print(n);
if(n==1) {
myColorBackground += checkbox.getItem(i).internalValue();
}
}
println();
}
}
void checkBox(float[] a) {
println(a);
}
/*
a list of all methods available for the CheckBox Controller
use ControlP5.printPublicMethodsFor(CheckBox.class);
to print the following list into the console.
You can find further details about class CheckBox in the javadoc.
Format:
ClassName : returnType methodName(parameter type)
controlP5.CheckBox : CheckBox addItem(String, float)
controlP5.CheckBox : CheckBox addItem(Toggle, float)
controlP5.CheckBox : CheckBox deactivateAll()
controlP5.CheckBox : CheckBox hideLabels()
controlP5.CheckBox : CheckBox removeItem(String)
controlP5.CheckBox : CheckBox setArrayValue(float[])
controlP5.CheckBox : CheckBox setColorLabels(int)
controlP5.CheckBox : CheckBox setImage(PImage)
controlP5.CheckBox : CheckBox setImage(PImage, int)
controlP5.CheckBox : CheckBox setImages(PImage, PImage, PImage)
controlP5.CheckBox : CheckBox setItemHeight(int)
controlP5.CheckBox : CheckBox setItemWidth(int)
controlP5.CheckBox : CheckBox setItemsPerRow(int)
controlP5.CheckBox : CheckBox setNoneSelectedAllowed(boolean)
controlP5.CheckBox : CheckBox setSize(PImage)
controlP5.CheckBox : CheckBox setSize(int, int)
controlP5.CheckBox : CheckBox setSpacingColumn(int)
controlP5.CheckBox : CheckBox setSpacingRow(int)
controlP5.CheckBox : CheckBox showLabels()
controlP5.CheckBox : String getInfo()
controlP5.CheckBox : String toString()
controlP5.CheckBox : Toggle getItem(int)
controlP5.CheckBox : List getItems()
controlP5.CheckBox : boolean getState(String)
controlP5.CheckBox : boolean getState(int)
controlP5.CheckBox : void updateLayout()
controlP5.ControlGroup : CheckBox activateEvent(boolean)
controlP5.ControlGroup : CheckBox addListener(ControlListener)
controlP5.ControlGroup : CheckBox hideBar()
controlP5.ControlGroup : CheckBox removeListener(ControlListener)
controlP5.ControlGroup : CheckBox setBackgroundColor(int)
controlP5.ControlGroup : CheckBox setBackgroundHeight(int)
controlP5.ControlGroup : CheckBox setBarHeight(int)
controlP5.ControlGroup : CheckBox showBar()
controlP5.ControlGroup : CheckBox updateInternalEvents(PApplet)
controlP5.ControlGroup : String getInfo()
controlP5.ControlGroup : String toString()
controlP5.ControlGroup : boolean isBarVisible()
controlP5.ControlGroup : int getBackgroundHeight()
controlP5.ControlGroup : int getBarHeight()
controlP5.ControlGroup : int listenerSize()
controlP5.ControllerGroup : CColor getColor()
controlP5.ControllerGroup : CheckBox add(ControllerInterface)
controlP5.ControllerGroup : CheckBox bringToFront()
controlP5.ControllerGroup : CheckBox bringToFront(ControllerInterface)
controlP5.ControllerGroup : CheckBox close()
controlP5.ControllerGroup : CheckBox disableCollapse()
controlP5.ControllerGroup : CheckBox enableCollapse()
controlP5.ControllerGroup : CheckBox hide()
controlP5.ControllerGroup : CheckBox moveTo(ControlWindow)
controlP5.ControllerGroup : CheckBox moveTo(PApplet)
controlP5.ControllerGroup : CheckBox open()
controlP5.ControllerGroup : CheckBox registerProperty(String)
controlP5.ControllerGroup : CheckBox registerProperty(String, String)
controlP5.ControllerGroup : CheckBox remove(CDrawable)
controlP5.ControllerGroup : CheckBox remove(ControllerInterface)
controlP5.ControllerGroup : CheckBox removeCanvas(ControlWindowCanvas)
controlP5.ControllerGroup : CheckBox removeProperty(String)
controlP5.ControllerGroup : CheckBox removeProperty(String, String)
controlP5.ControllerGroup : CheckBox setAddress(String)
controlP5.ControllerGroup : CheckBox setArrayValue(float[])
controlP5.ControllerGroup : CheckBox setColor(CColor)
controlP5.ControllerGroup : CheckBox setColorActive(int)
controlP5.ControllerGroup : CheckBox setColorBackground(int)
controlP5.ControllerGroup : CheckBox setColorForeground(int)
controlP5.ControllerGroup : CheckBox setColorLabel(int)
controlP5.ControllerGroup : CheckBox setColorValue(int)
controlP5.ControllerGroup : CheckBox setHeight(int)
controlP5.ControllerGroup : CheckBox setId(int)
controlP5.ControllerGroup : CheckBox setLabel(String)
controlP5.ControllerGroup : CheckBox setMouseOver(boolean)
controlP5.ControllerGroup : CheckBox setMoveable(boolean)
controlP5.ControllerGroup : CheckBox setOpen(boolean)
controlP5.ControllerGroup : CheckBox setPosition(PVector)
controlP5.ControllerGroup : CheckBox setPosition(float, float)
controlP5.ControllerGroup : CheckBox setStringValue(String)
controlP5.ControllerGroup : CheckBox setUpdate(boolean)
controlP5.ControllerGroup : CheckBox setValue(float)
controlP5.ControllerGroup : CheckBox setVisible(boolean)
controlP5.ControllerGroup : CheckBox setWidth(int)
controlP5.ControllerGroup : CheckBox show()
controlP5.ControllerGroup : CheckBox update()
controlP5.ControllerGroup : CheckBox updateAbsolutePosition()
controlP5.ControllerGroup : ControlWindow getWindow()
controlP5.ControllerGroup : ControlWindowCanvas addCanvas(ControlWindowCanvas)
controlP5.ControllerGroup : Controller getController(String)
controlP5.ControllerGroup : ControllerProperty getProperty(String)
controlP5.ControllerGroup : ControllerProperty getProperty(String, String)
controlP5.ControllerGroup : Label getCaptionLabel()
controlP5.ControllerGroup : Label getValueLabel()
controlP5.ControllerGroup : PVector getPosition()
controlP5.ControllerGroup : String getAddress()
controlP5.ControllerGroup : String getInfo()
controlP5.ControllerGroup : String getName()
controlP5.ControllerGroup : String getStringValue()
controlP5.ControllerGroup : String toString()
controlP5.ControllerGroup : Tab getTab()
controlP5.ControllerGroup : boolean isCollapse()
controlP5.ControllerGroup : boolean isMouseOver()
controlP5.ControllerGroup : boolean isMoveable()
controlP5.ControllerGroup : boolean isOpen()
controlP5.ControllerGroup : boolean isUpdate()
controlP5.ControllerGroup : boolean isVisible()
controlP5.ControllerGroup : boolean setMousePressed(boolean)
controlP5.ControllerGroup : float getValue()
controlP5.ControllerGroup : float[] getArrayValue()
controlP5.ControllerGroup : int getHeight()
controlP5.ControllerGroup : int getId()
controlP5.ControllerGroup : int getWidth()
controlP5.ControllerGroup : void remove()
java.lang.Object : String toString()
java.lang.Object : boolean equals(Object)
*/
</pre></code></dd></dl></div></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_controlP5.ControlP5Constants">
<!-- -->
</a>
<h3>Fields inherited from interface&nbsp;controlP5.<a href="../controlP5/ControlP5Constants.html" title="interface in controlP5">ControlP5Constants</a></h3>
<code><a href="../controlP5/ControlP5Constants.html#acceptClassList">acceptClassList</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_BROADCAST">ACTION_BROADCAST</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_CLICK">ACTION_CLICK</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_DRAG">ACTION_DRAG</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_ENTER">ACTION_ENTER</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_EXIT">ACTION_EXIT</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_LEAVE">ACTION_LEAVE</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_MOVE">ACTION_MOVE</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_PRESS">ACTION_PRESS</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_PRESSED">ACTION_PRESSED</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_RELEASE">ACTION_RELEASE</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_RELEASED">ACTION_RELEASED</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_RELEASEDOUTSIDE">ACTION_RELEASEDOUTSIDE</a>, <a href="../controlP5/ControlP5Constants.html#ACTION_WHEEL">ACTION_WHEEL</a>, <a href="../controlP5/ControlP5Constants.html#ACTIVE">ACTIVE</a>, <a href="../controlP5/ControlP5Constants.html#ALL">ALL</a>, <a href="../controlP5/ControlP5Constants.html#ALT">ALT</a>, <a href="../controlP5/ControlP5Constants.html#AQUA">AQUA</a>, <a href="../controlP5/ControlP5Constants.html#ARC">ARC</a>, <a href="../controlP5/ControlP5Constants.html#ARRAY">ARRAY</a>, <a href="../controlP5/ControlP5Constants.html#BACKSPACE">BACKSPACE</a>, <a href="../controlP5/ControlP5Constants.html#BASELINE">BASELINE</a>, <a href="../controlP5/ControlP5Constants.html#BITFONT">BITFONT</a>, <a href="../controlP5/ControlP5Constants.html#BLACK">BLACK</a>, <a href="../controlP5/ControlP5Constants.html#BLUE">BLUE</a>, <a href="../controlP5/ControlP5Constants.html#BOOLEAN">BOOLEAN</a>, <a href="../controlP5/ControlP5Constants.html#BOTTOM">BOTTOM</a>, <a href="../controlP5/ControlP5Constants.html#BOTTOM_OUTSIDE">BOTTOM_OUTSIDE</a>, <a href="../controlP5/ControlP5Constants.html#CAPTIONLABEL">CAPTIONLABEL</a>, <a href="../controlP5/ControlP5Constants.html#CENTER">CENTER</a>, <a href="../controlP5/ControlP5Constants.html#CHECKBOX">CHECKBOX</a>, <a href="../controlP5/ControlP5Constants.html#COMMANDKEY">COMMANDKEY</a>, <a href="../controlP5/ControlP5Constants.html#CONTROL">CONTROL</a>, <a href="../controlP5/ControlP5Constants.html#controlEventClass">controlEventClass</a>, <a href="../controlP5/ControlP5Constants.html#CUSTOM">CUSTOM</a>, <a href="../controlP5/ControlP5Constants.html#DECREASE">DECREASE</a>, <a href="../controlP5/ControlP5Constants.html#DEFAULT">DEFAULT</a>, <a href="../controlP5/ControlP5Constants.html#DELETE">DELETE</a>, <a href="../controlP5/ControlP5Constants.html#DONE">DONE</a>, <a href="../controlP5/ControlP5Constants.html#DOWN">DOWN</a>, <a href="../controlP5/ControlP5Constants.html#DROPDOWN">DROPDOWN</a>, <a href="../controlP5/ControlP5Constants.html#ELLIPSE">ELLIPSE</a>, <a href="../controlP5/ControlP5Constants.html#ENTER">ENTER</a>, <a href="../controlP5/ControlP5Constants.html#ESCAPE">ESCAPE</a>, <a href="../controlP5/ControlP5Constants.html#EVENT">EVENT</a>, <a href="../controlP5/ControlP5Constants.html#eventMethod">eventMethod</a>, <a href="../controlP5/ControlP5Constants.html#FADEIN">FADEIN</a>, <a href="../controlP5/ControlP5Constants.html#FADEOUT">FADEOUT</a>, <a href="../controlP5/ControlP5Constants.html#FIELD">FIELD</a>, <a href="../controlP5/ControlP5Constants.html#FLOAT">FLOAT</a>, <a href="../controlP5/ControlP5Constants.html#FUCHSIA">FUCHSIA</a>, <a href="../controlP5/ControlP5Constants.html#GRAY">GRAY</a>, <a href="../controlP5/ControlP5Constants.html#GREEN">GREEN</a>, <a href="../controlP5/ControlP5Constants.html#grixel">grixel</a>, <a href="../controlP5/ControlP5Constants.html#HALF_PI">HALF_PI</a>, <a href="../controlP5/ControlP5Constants.html#HIDE">HIDE</a>, <a href="../controlP5/ControlP5Constants.html#HIGHLIGHT">HIGHLIGHT</a>, <a href="../controlP5/ControlP5Constants.html#HORIZONTAL">HOR
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../controlP5/CheckBox.html#CheckBox(controlP5.ControlP5, controlP5.ControllerGroup, java.lang.String, int, int)">CheckBox</a></strong>(<a href="../controlP5/ControlP5.html" title="class in controlP5">ControlP5</a>&nbsp;theControlP5,
<a href="../controlP5/ControllerGroup.html" title="class in controlP5">ControllerGroup</a>&lt;?&gt;&nbsp;theParent,
java.lang.String&nbsp;theName,
int&nbsp;theX,
int&nbsp;theY)</code>
<div class="block">A CheckBox should only be added to controlP5 by using controlP5.addCheckBox()</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../controlP5/CheckBox.html#CheckBox(controlP5.ControlP5, java.lang.String)">CheckBox</a></strong>(<a href="../controlP5/ControlP5.html" title="class in controlP5">ControlP5</a>&nbsp;theControlP5,
java.lang.String&nbsp;theName)</code>
<div class="block">Convenience constructor to extend CheckBox.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#activate(int)">activate</a></strong>(int&nbsp;theIndex)</code>
<div class="block">Activates a single checkbox item by index</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#activate(java.lang.String)">activate</a></strong>(java.lang.String&nbsp;theName)</code>
<div class="block">Activates a single checkbox item by name</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#activateAll()">activateAll</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#addItem(java.lang.String, float)">addItem</a></strong>(java.lang.String&nbsp;theName,
float&nbsp;theValue)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#addItem(controlP5.Toggle, float)">addItem</a></strong>(<a href="../controlP5/Toggle.html" title="class in controlP5">Toggle</a>&nbsp;theToggle,
float&nbsp;theValue)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#controlEvent(controlP5.ControlEvent)">controlEvent</a></strong>(<a href="../controlP5/ControlEvent.html" title="class in controlP5">ControlEvent</a>&nbsp;theEvent)</code>
<div class="block">controlEvent is called by controlP5's ControlBroadcaster to inform available listeners about
value changes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#deactivate(int)">deactivate</a></strong>(int&nbsp;theIndex)</code>
<div class="block">deactivate a single checkbox item by index</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#deactivate(java.lang.String)">deactivate</a></strong>(java.lang.String&nbsp;theName)</code>
<div class="block">Deactivates a single checkbox item by name</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#deactivateAll()">deactivateAll</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#getInfo()">getInfo</a></strong>()</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/Toggle.html" title="class in controlP5">Toggle</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#getItem(int)">getItem</a></strong>(int&nbsp;theIndex)</code>
<div class="block">Gets a radio button item by index.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.util.List&lt;<a href="../controlP5/Toggle.html" title="class in controlP5">Toggle</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#getItems()">getItems</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#getState(int)">getState</a></strong>(int&nbsp;theIndex)</code>
<div class="block">Gets the state of an item - this can be true (for on) or false (for off) - by index.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#getState(java.lang.String)">getState</a></strong>(java.lang.String&nbsp;theName)</code>
<div class="block">Gets the state of an item - this can be true (for on) or false (for off) - by name.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#hideLabels()">hideLabels</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#plugTo(java.lang.Object)">plugTo</a></strong>(java.lang.Object&nbsp;theObject)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#plugTo(java.lang.Object, java.lang.String)">plugTo</a></strong>(java.lang.Object&nbsp;theObject,
java.lang.String&nbsp;thePlugName)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#removeItem(java.lang.String)">removeItem</a></strong>(java.lang.String&nbsp;theName)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setArrayValue(float[])">setArrayValue</a></strong>(float[]&nbsp;theArray)</code>
<div class="block">Sets the value for all CheckBox items according to the values of the array passed on.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setColorLabels(int)">setColorLabels</a></strong>(int&nbsp;theColor)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setImage(processing.core.PImage)">setImage</a></strong>(processing.core.PImage&nbsp;theImage)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setImage(processing.core.PImage, int)">setImage</a></strong>(processing.core.PImage&nbsp;theImage,
int&nbsp;theState)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setImages(processing.core.PImage, processing.core.PImage, processing.core.PImage)">setImages</a></strong>(processing.core.PImage&nbsp;theDefaultImage,
processing.core.PImage&nbsp;theOverImage,
processing.core.PImage&nbsp;theActiveImage)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setItemHeight(int)">setItemHeight</a></strong>(int&nbsp;theItemHeight)</code>
<div class="block">set the height of a radioButton/checkBox item.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setItemsPerRow(int)">setItemsPerRow</a></strong>(int&nbsp;theValue)</code>
<div class="block">Items of a radioButton or a checkBox are organized in columns and rows.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setItemWidth(int)">setItemWidth</a></strong>(int&nbsp;theItemWidth)</code>
<div class="block">set the width of a radioButton/checkBox item.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setNoneSelectedAllowed(boolean)">setNoneSelectedAllowed</a></strong>(boolean&nbsp;theValue)</code>
<div class="block">In order to always have 1 item selected, use setNoneSelectedAllowed(false), by default this
is true.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setSize(int, int)">setSize</a></strong>(int&nbsp;theWidth,
int&nbsp;theHeight)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setSize(processing.core.PImage)">setSize</a></strong>(processing.core.PImage&nbsp;theImage)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setSpacingColumn(int)">setSpacingColumn</a></strong>(int&nbsp;theSpacing)</code>
<div class="block">Sets the spacing in pixels between columns.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#setSpacingRow(int)">setSpacingRow</a></strong>(int&nbsp;theSpacing)</code>
<div class="block">Sets the spacing in pixels between rows.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#showLabels()">showLabels</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#toggle(int)">toggle</a></strong>(int&nbsp;theIndex)</code>
<div class="block">toggle a single checkbox item by index</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#toggle(java.lang.String)">toggle</a></strong>(java.lang.String&nbsp;theName)</code>
<div class="block">deactivate a single checkbox item by name</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#toString()">toString</a></strong>()</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a></code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#toUpperCase(boolean)">toUpperCase</a></strong>(boolean&nbsp;theValue)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../controlP5/CheckBox.html#updateLayout()">updateLayout</a></strong>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_controlP5.ControlGroup">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;controlP5.<a href="../controlP5/ControlGroup.html" title="class in controlP5">ControlGroup</a></h3>
<code><a href="../controlP5/ControlGroup.html#activateEvent(boolean)">activateEvent</a>, <a href="../controlP5/ControlGroup.html#addListener(controlP5.ControlListener)">addListener</a>, <a href="../controlP5/ControlGroup.html#getBackgroundHeight()">getBackgroundHeight</a>, <a href="../controlP5/ControlGroup.html#getBarHeight()">getBarHeight</a>, <a href="../controlP5/ControlGroup.html#listenerSize()">listenerSize</a>, <a href="../controlP5/ControlGroup.html#mousePressed()">mousePressed</a>, <a href="../controlP5/ControlGroup.html#removeListener(controlP5.ControlListener)">removeListener</a>, <a href="../controlP5/ControlGroup.html#setBackgroundColor(int)">setBackgroundColor</a>, <a href="../controlP5/ControlGroup.html#setBackgroundHeight(int)">setBackgroundHeight</a>, <a href="../controlP5/ControlGroup.html#setBarHeight(int)">setBarHeight</a>, <a href="../controlP5/ControlGroup.html#stringValue()">stringValue</a>, <a href="../controlP5/ControlGroup.html#updateInternalEvents(processing.core.PApplet)">updateInternalEvents</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_controlP5.ControllerGroup">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;controlP5.<a href="../controlP5/ControllerGroup.html" title="class in controlP5">ControllerGroup</a></h3>
<code><a href="../controlP5/ControllerGroup.html#absolutePosition()">absolutePosition</a>, <a href="../controlP5/ControllerGroup.html#add(controlP5.ControllerInterface)">add</a>, <a href="../controlP5/ControllerGroup.html#addCanvas(controlP5.Canvas)">addCanvas</a>, <a href="../controlP5/ControllerGroup.html#addCloseButton()">addCloseButton</a>, <a href="../controlP5/ControllerGroup.html#addDrawable(controlP5.CDrawable)">addDrawable</a>, <a href="../controlP5/ControllerGroup.html#arrayValue()">arrayValue</a>, <a href="../controlP5/ControllerGroup.html#bringToFront()">bringToFront</a>, <a href="../controlP5/ControllerGroup.html#bringToFront(controlP5.ControllerInterface)">bringToFront</a>, <a href="../controlP5/ControllerGroup.html#close()">close</a>, <a href="../controlP5/ControllerGroup.html#color()">color</a>, <a href="../controlP5/ControllerGroup.html#continuousUpdateEvents()">continuousUpdateEvents</a>, <a href="../controlP5/ControllerGroup.html#controller(java.lang.String)">controller</a>, <a href="../controlP5/ControllerGroup.html#disableCollapse()">disableCollapse</a>, <a href="../controlP5/ControllerGroup.html#draw(processing.core.PGraphics)">draw</a>, <a href="../controlP5/ControllerGroup.html#enableCollapse()">enableCollapse</a>, <a href="../controlP5/ControllerGroup.html#getAbsolutePosition()">getAbsolutePosition</a>, <a href="../controlP5/ControllerGroup.html#getAddress()">getAddress</a>, <a href="../controlP5/ControllerGroup.html#getArrayValue()">getArrayValue</a>, <a href="../controlP5/ControllerGroup.html#getArrayValue(int)">getArrayValue</a>, <a href="../controlP5/ControllerGroup.html#getCaptionLabel()">getCaptionLabel</a>, <a href="../controlP5/ControllerGroup.html#getColor()">getColor</a>, <a href="../controlP5/ControllerGroup.html#getController(java.lang.String)">getController</a>, <a href="../controlP5/ControllerGroup.html#getHeight()">getHeight</a>, <a href="../controlP5/ControllerGroup.html#getId()">getId</a>, <a href="../controlP5/ControllerGroup.html#getName()">getName</a>, <a href="../controlP5/ControllerGroup.html#getParent()">getParent</a>, <a href="../controlP5/ControllerGroup.html#getPickingColor()">getPickingColor</a>, <a href="../controlP5/ControllerGroup.html#getPosition()">getPosition</a>, <a href="../controlP5/ControllerGroup.html#getProperty(java.lang.String)">getProperty</a>, <a href="../controlP5/ControllerGroup.html#getProperty(java.lang.String, java.lang.String)">getProperty</a>, <a href="../controlP5/ControllerGroup.html#getStringValue()">getStringValue</a>, <a href="../controlP5/ControllerGroup.html#getTab()">getTab</a>, <a href="../controlP5/ControllerGroup.html#getValue()">getValue</a>, <a href="../controlP5/ControllerGroup.html#getValueLabel()">getValueLabel</a>, <a href="../controlP5/ControllerGroup.html#getWidth()">getWidth</a>, <a href="../controlP5/ControllerGroup.html#getWindow()">getWindow</a>, <a href="../controlP5/ControllerGroup.html#hide()">hide</a>, <a href="../controlP5/ControllerGroup.html#hideArrow()">hideArrow</a>, <a href="../controlP5/ControllerGroup.html#hideBar()">hideBar</a>, <a href="../controlP5/ControllerGroup.html#id()">id</a>, <a href="../controlP5/ControllerGroup.html#init()">init</a>, <a href="../controlP5/ControllerGroup.html#isBarVisible()">isBarVisible</a>, <a href="../controlP5/ControllerGroup.html#isCollapse()">isCollapse</a>, <a href="../controlP5/ControllerGroup.html#isMouseOver()">isMouseOver</a>, <a href="../controlP5/ControllerGroup.html#isMoveable()">isMoveable</a>, <a href="../controlP5/ControllerGroup.html#isOpen()">isOpen</a>, <a href="../controlP5/ControllerGroup.html#isUpdate()">isUpdate</a>, <a href="../controlP5/ControllerGroup.html#isVisible()">isVisible</a>, <a href="../controlP5/ControllerGroup.html#keyEvent(processing.event.KeyEvent)">keyEvent</a>, <a href="../controlP5/ControllerGroup.html#moveTo(controlP5.ControllerGroup)">moveTo</a>, <a href="../controlP5/ControllerGroup.html#moveTo(controlP5.ControllerGroup, controlP5.Tab, controlP5.ControlWindow)">moveTo</a>, <a href="../controlP5/ControllerGroup.html#moveTo(controlP5.Contro
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="CheckBox(controlP5.ControlP5, controlP5.ControllerGroup, java.lang.String, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CheckBox</h4>
<pre>public&nbsp;CheckBox(<a href="../controlP5/ControlP5.html" title="class in controlP5">ControlP5</a>&nbsp;theControlP5,
<a href="../controlP5/ControllerGroup.html" title="class in controlP5">ControllerGroup</a>&lt;?&gt;&nbsp;theParent,
java.lang.String&nbsp;theName,
int&nbsp;theX,
int&nbsp;theY)</pre>
<div class="block">A CheckBox should only be added to controlP5 by using controlP5.addCheckBox()</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theControlP5</code> - </dd><dd><code>theParent</code> - </dd><dd><code>theName</code> - </dd><dd><code>theX</code> - </dd><dd><code>theY</code> - </dd></dl>
</li>
</ul>
<a name="CheckBox(controlP5.ControlP5, java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CheckBox</h4>
<pre>public&nbsp;CheckBox(<a href="../controlP5/ControlP5.html" title="class in controlP5">ControlP5</a>&nbsp;theControlP5,
java.lang.String&nbsp;theName)</pre>
<div class="block">Convenience constructor to extend CheckBox.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theControlP5</code> - </dd><dd><code>theName</code> - </dd><script type="text/javascript">
<!--
document.getElementsByTagName('html')[0].className = 'isjs';function toggle(dt) { var display, dd=dt; do{ dd = dd.nextSibling } while(dd.tagName!='DD'); toOpen =!dd.style.display;dd.style.display = toOpen? 'block':''; dt.getElementsByTagName('span')[0].innerHTML = toOpen? '-':'+' ; }
-->
</script>
<div id="test" class="toggleList"><dl><dt onclick="toggle(this);"><span>+</span>Example</dt><dd><code><pre>/**
* 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<MyButton>, <MyButton>
// is an indicator for the super class about the type of
// custom controller to be created.
class MyButton extends Controller<MyButton> {
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(PApplet 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;
}
}
</pre></code></dd></dl></div></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="activate(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>activate</h4>
<pre>public final&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;activate(int&nbsp;theIndex)</pre>
<div class="block">Activates a single checkbox item by index</div>
</li>
</ul>
<a name="activate(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>activate</h4>
<pre>public final&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;activate(java.lang.String&nbsp;theName)</pre>
<div class="block">Activates a single checkbox item by name</div>
</li>
</ul>
<a name="activateAll()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>activateAll</h4>
<pre>public final&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;activateAll()</pre>
</li>
</ul>
<a name="addItem(java.lang.String, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addItem</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;addItem(java.lang.String&nbsp;theName,
float&nbsp;theValue)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theName</code> - </dd><dd><code>theValue</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="addItem(controlP5.Toggle, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addItem</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;addItem(<a href="../controlP5/Toggle.html" title="class in controlP5">Toggle</a>&nbsp;theToggle,
float&nbsp;theValue)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theToggle</code> - </dd><dd><code>theValue</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="controlEvent(controlP5.ControlEvent)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>controlEvent</h4>
<pre>public&nbsp;void&nbsp;controlEvent(<a href="../controlP5/ControlEvent.html" title="class in controlP5">ControlEvent</a>&nbsp;theEvent)</pre>
<div class="block">controlEvent is called by controlP5's ControlBroadcaster to inform available listeners about
value changes. Use the CallbackListener to get informed when actions such as pressed,
release, drag, etc are performed.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../controlP5/ControlListener.html#controlEvent(controlP5.ControlEvent)">controlEvent</a></code>&nbsp;in interface&nbsp;<code><a href="../controlP5/ControlListener.html" title="interface in controlP5">ControlListener</a></code></dd>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../controlP5/ControlGroup.html#controlEvent(controlP5.ControlEvent)">controlEvent</a></code>&nbsp;in class&nbsp;<code><a href="../controlP5/ControlGroup.html" title="class in controlP5">ControlGroup</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;</code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>theEvent</code> - ControlEvent</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../controlP5/CallbackListener.html" title="interface in controlP5"><code>CallbackListener</code></a>,
<a href="../controlP5/CallbackEvent.html" title="class in controlP5"><code>CallbackEvent</code></a></dd></dl>
</li>
</ul>
<a name="deactivate(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deactivate</h4>
<pre>public final&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;deactivate(int&nbsp;theIndex)</pre>
<div class="block">deactivate a single checkbox item by index</div>
</li>
</ul>
<a name="deactivate(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deactivate</h4>
<pre>public final&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;deactivate(java.lang.String&nbsp;theName)</pre>
<div class="block">Deactivates a single checkbox item by name</div>
</li>
</ul>
<a name="deactivateAll()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deactivateAll</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;deactivateAll()</pre>
</li>
</ul>
<a name="getInfo()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInfo</h4>
<pre>public&nbsp;java.lang.String&nbsp;getInfo()</pre>
<div class="block"><strong>Description copied from class:&nbsp;<code><a href="../controlP5/ControlGroup.html#getInfo()">ControlGroup</a></code></strong></div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../controlP5/ControlGroup.html#getInfo()">getInfo</a></code>&nbsp;in class&nbsp;<code><a href="../controlP5/ControlGroup.html" title="class in controlP5">ControlGroup</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="getItem(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getItem</h4>
<pre>public&nbsp;<a href="../controlP5/Toggle.html" title="class in controlP5">Toggle</a>&nbsp;getItem(int&nbsp;theIndex)</pre>
<div class="block">Gets a radio button item by index.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theIndex</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>Toggle</dd></dl>
</li>
</ul>
<a name="getItems()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getItems</h4>
<pre>public&nbsp;java.util.List&lt;<a href="../controlP5/Toggle.html" title="class in controlP5">Toggle</a>&gt;&nbsp;getItems()</pre>
</li>
</ul>
<a name="getState(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getState</h4>
<pre>public&nbsp;boolean&nbsp;getState(int&nbsp;theIndex)</pre>
<div class="block">Gets the state of an item - this can be true (for on) or false (for off) - by index.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theIndex</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>boolean</dd></dl>
</li>
</ul>
<a name="getState(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getState</h4>
<pre>public&nbsp;boolean&nbsp;getState(java.lang.String&nbsp;theName)</pre>
<div class="block">Gets the state of an item - this can be true (for on) or false (for off) - by name.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theName</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="hideLabels()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hideLabels</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;hideLabels()</pre>
</li>
</ul>
<a name="plugTo(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>plugTo</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;plugTo(java.lang.Object&nbsp;theObject)</pre>
</li>
</ul>
<a name="plugTo(java.lang.Object, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>plugTo</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;plugTo(java.lang.Object&nbsp;theObject,
java.lang.String&nbsp;thePlugName)</pre>
</li>
</ul>
<a name="removeItem(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeItem</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;removeItem(java.lang.String&nbsp;theName)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theName</code> - </dd></dl>
</li>
</ul>
<a name="setArrayValue(float[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setArrayValue</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setArrayValue(float[]&nbsp;theArray)</pre>
<div class="block">Sets the value for all CheckBox items according to the values of the array passed on. 0 will
turn off an item, any other value will turn it on.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../controlP5/ControllerInterface.html#setArrayValue(float[])">setArrayValue</a></code>&nbsp;in interface&nbsp;<code><a href="../controlP5/ControllerInterface.html" title="interface in controlP5">ControllerInterface</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;</code></dd>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../controlP5/ControllerGroup.html#setArrayValue(float[])">setArrayValue</a></code>&nbsp;in class&nbsp;<code><a href="../controlP5/ControllerGroup.html" title="class in controlP5">ControllerGroup</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>ControllerGroup</dd></dl>
</li>
</ul>
<a name="setColorLabels(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setColorLabels</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setColorLabels(int&nbsp;theColor)</pre>
</li>
</ul>
<a name="setImage(processing.core.PImage)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setImage</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setImage(processing.core.PImage&nbsp;theImage)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theImage</code> - </dd></dl>
</li>
</ul>
<a name="setImage(processing.core.PImage, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setImage</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setImage(processing.core.PImage&nbsp;theImage,
int&nbsp;theState)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theImage</code> - </dd><dd><code>theState</code> - use Controller.DEFAULT (background), or Controller.OVER (foreground), or
Controller.ACTIVE (active)</dd>
<dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="setImages(processing.core.PImage, processing.core.PImage, processing.core.PImage)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setImages</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setImages(processing.core.PImage&nbsp;theDefaultImage,
processing.core.PImage&nbsp;theOverImage,
processing.core.PImage&nbsp;theActiveImage)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theDefaultImage</code> - </dd><dd><code>theOverImage</code> - </dd><dd><code>theActiveImage</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>CheckBox</dd></dl>
</li>
</ul>
<a name="setItemHeight(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setItemHeight</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setItemHeight(int&nbsp;theItemHeight)</pre>
<div class="block">set the height of a radioButton/checkBox item. by default the height is 11px. in order to
recognize a custom height, the itemHeight has to be set before adding items to a
radioButton/checkBox.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theItemHeight</code> - </dd></dl>
</li>
</ul>
<a name="setItemsPerRow(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setItemsPerRow</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setItemsPerRow(int&nbsp;theValue)</pre>
<div class="block">Items of a radioButton or a checkBox are organized in columns and rows. SetItemsPerRow sets
the limit of items per row. items exceeding the limit will be pushed to the next row.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theValue</code> - </dd></dl>
</li>
</ul>
<a name="setItemWidth(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setItemWidth</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setItemWidth(int&nbsp;theItemWidth)</pre>
<div class="block">set the width of a radioButton/checkBox item. by default the width is 11px. in order to
recognize a custom width, the itemWidth has to be set before adding items to a
radioButton/checkBox.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theItemWidth</code> - </dd></dl>
</li>
</ul>
<a name="setNoneSelectedAllowed(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setNoneSelectedAllowed</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setNoneSelectedAllowed(boolean&nbsp;theValue)</pre>
<div class="block">In order to always have 1 item selected, use setNoneSelectedAllowed(false), by default this
is true. setNoneSelectedAllowed does not apply when in multipleChoice mode.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theValue</code> - </dd></dl>
</li>
</ul>
<a name="setSize(int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSize</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setSize(int&nbsp;theWidth,
int&nbsp;theHeight)</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../controlP5/ControlGroup.html#setSize(int, int)">setSize</a></code>&nbsp;in class&nbsp;<code><a href="../controlP5/ControlGroup.html" title="class in controlP5">ControlGroup</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="setSize(processing.core.PImage)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSize</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setSize(processing.core.PImage&nbsp;theImage)</pre>
</li>
</ul>
<a name="setSpacingColumn(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSpacingColumn</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setSpacingColumn(int&nbsp;theSpacing)</pre>
<div class="block">Sets the spacing in pixels between columns.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theSpacing</code> - </dd></dl>
</li>
</ul>
<a name="setSpacingRow(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSpacingRow</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;setSpacingRow(int&nbsp;theSpacing)</pre>
<div class="block">Sets the spacing in pixels between rows.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>theSpacing</code> - </dd></dl>
</li>
</ul>
<a name="showLabels()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>showLabels</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;showLabels()</pre>
</li>
</ul>
<a name="toggle(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toggle</h4>
<pre>public final&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;toggle(int&nbsp;theIndex)</pre>
<div class="block">toggle a single checkbox item by index</div>
</li>
</ul>
<a name="toggle(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toggle</h4>
<pre>public final&nbsp;void&nbsp;toggle(java.lang.String&nbsp;theName)</pre>
<div class="block">deactivate a single checkbox item by name</div>
</li>
</ul>
<a name="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;java.lang.String&nbsp;toString()</pre>
<div class="block"><strong>Description copied from class:&nbsp;<code><a href="../controlP5/ControlGroup.html#toString()">ControlGroup</a></code></strong></div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../controlP5/ControlGroup.html#toString()">toString</a></code>&nbsp;in class&nbsp;<code><a href="../controlP5/ControlGroup.html" title="class in controlP5">ControlGroup</a>&lt;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="toUpperCase(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toUpperCase</h4>
<pre>public&nbsp;<a href="../controlP5/CheckBox.html" title="class in controlP5">CheckBox</a>&nbsp;toUpperCase(boolean&nbsp;theValue)</pre>
</li>
</ul>
<a name="updateLayout()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>updateLayout</h4>
<pre>public&nbsp;void&nbsp;updateLayout()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../controlP5/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../index-all.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../controlP5/ChartDataSet.html" title="class in controlP5"><span class="strong">Prev Class</span></a></li>
<li><a href="../controlP5/ColorPicker.html" title="class in controlP5"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?controlP5/CheckBox.html" target="_top">Frames</a></li>
<li><a href="CheckBox.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>processing library controlP5 by Andreas Schlegel. (c) 2006-2014</small></p>
</body>
</html>