# CheckBox (Javadocs: controlP5)
Date: 2014-04-27

controlP5

## Class CheckBox

- java.lang.Object
- - controlP5.ControllerGroup<T>
  - - controlP5.ControlGroup<CheckBox>
    - - controlP5.CheckBox

All Implemented Interfaces:
  ControllerInterface<CheckBox>, ControlListener, ControlP5Constants

    public class CheckBox
    extends ControlGroup<CheckBox>

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.

See Also:
  `Toggle`

+Example
  `

      /**
       * 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>

  `

### Field Summary

### Fields inherited from interface controlP5.ControlP5Constants

`acceptClassList, ACTION_BROADCAST, ACTION_CLICK, ACTION_DRAG, ACTION_ENTER, ACTION_EXIT, ACTION_LEAVE, ACTION_MOVE, ACTION_PRESS, ACTION_PRESSED, ACTION_RELEASE, ACTION_RELEASED, ACTION_RELEASEDOUTSIDE, 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, 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, KEYCONTROL, LEFT, LEFT_OUTSIDE, LIME, LINE, LIST, LOAD, MAROON, MENU, METHOD, MOVE, MULTI, MULTIPLES, NAVY, OLIVE, ORANGE, OVER, P2D, P3D, PI, PRESSED, PRINT, PURPLE, RED, RELEASE, RESET, RIGHT, RIGHT_OUTSIDE, SAVE, 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_RED, THEME_RETRO, THEME_WHITE, TOP, TOP_OUTSIDE, TRANSITION_WAIT_FADEIN, TREE, TWO_PI, UP, VALUELABEL, VERBOSE, VERTICAL, WAIT, WHITE, YELLOW`

### Constructor Summary

Constructors
Constructor and Description
`CheckBox(ControlP5 theControlP5, ControllerGroup<?> theParent, java.lang.String theName, int theX, int theY)` A CheckBox should only be added to controlP5 by using controlP5.addCheckBox()
`CheckBox(ControlP5 theControlP5, java.lang.String theName)` Convenience constructor to extend CheckBox.

### Method Summary

Methods
`CheckBox` `activate(int theIndex)` Activates a single checkbox item by index
`CheckBox` `activate(java.lang.String theName)` Activates a single checkbox item by name
`CheckBox` `activateAll()`
`CheckBox` `addItem(java.lang.String theName, float theValue)`
`CheckBox` `addItem(Toggle theToggle, float theValue)`
`void` `controlEvent(ControlEvent theEvent)` controlEvent is called by controlP5's ControlBroadcaster to inform available listeners about value changes.
`CheckBox` `deactivate(int theIndex)` deactivate a single checkbox item by index
`CheckBox` `deactivate(java.lang.String theName)` Deactivates a single checkbox item by name
`CheckBox` `deactivateAll()`
`java.lang.String` `getInfo()`
`Toggle` `getItem(int theIndex)` Gets a radio button item by index.
`java.util.List<Toggle>` `getItems()`
`boolean` `getState(int theIndex)` Gets the state of an item - this can be true (for on) or false (for off) - by index.
`boolean` `getState(java.lang.String theName)` Gets the state of an item - this can be true (for on) or false (for off) - by name.
`CheckBox` `hideLabels()`
`CheckBox` `plugTo(java.lang.Object theObject)`
`CheckBox` `plugTo(java.lang.Object theObject, java.lang.String thePlugName)`
`CheckBox` `removeItem(java.lang.String theName)`
`CheckBox` `setArrayValue(float[] theArray)` Sets the value for all CheckBox items according to the values of the array passed on.
`CheckBox` `setColorLabels(int theColor)`
`CheckBox` `setImage(processing.core.PImage theImage)`
`CheckBox` `setImage(processing.core.PImage theImage, int theState)`
`CheckBox` `setImages(processing.core.PImage theDefaultImage, processing.core.PImage theOverImage, processing.core.PImage theActiveImage)`
`CheckBox` `setItemHeight(int theItemHeight)` set the height of a radioButton/checkBox item.
`CheckBox` `setItemsPerRow(int theValue)` Items of a radioButton or a checkBox are organized in columns and rows.
`CheckBox` `setItemWidth(int theItemWidth)` set the width of a radioButton/checkBox item.
`CheckBox` `setNoneSelectedAllowed(boolean theValue)` In order to always have 1 item selected, use setNoneSelectedAllowed(false), by default this is true.
`CheckBox` `setSize(int theWidth, int theHeight)`
`CheckBox` `setSize(processing.core.PImage theImage)`
`CheckBox` `setSpacingColumn(int theSpacing)` Sets the spacing in pixels between columns.
`CheckBox` `setSpacingRow(int theSpacing)` Sets the spacing in pixels between rows.
`CheckBox` `showLabels()`
`CheckBox` `toggle(int theIndex)` toggle a single checkbox item by index
`void` `toggle(java.lang.String theName)` deactivate a single checkbox item by name
`java.lang.String` `toString()`
`CheckBox` `toUpperCase(boolean theValue)`
`void` `updateLayout()`

### Methods inherited from class controlP5.ControlGroup

`activateEvent, addListener, getBackgroundHeight, getBarHeight, listenerSize, mousePressed, removeListener, setBackgroundColor, setBackgroundHeight, setBarHeight, stringValue, updateInternalEvents`

### Methods inherited from class controlP5.ControllerGroup

`absolutePosition, add, addCanvas, addCloseButton, addDrawable, arrayValue, bringToFront, bringToFront, close, color, continuousUpdateEvents, controller, disableCollapse, draw, enableCollapse, getAbsolutePosition, getAddress, getArrayValue, getArrayValue, getCaptionLabel, getColor, getController, getHeight, getId, getName, getParent, getPickingColor, getPosition, getProperty, getProperty, getStringValue, getTab, getValue, getValueLabel, getWidth, getWindow, hide, hideArrow, hideBar, id, init, isBarVisible, isCollapse, isMouseOver, isMoveable, isOpen, isUpdate, isVisible, keyEvent, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, name, open, parent, position, registerProperty, registerProperty, remove, remove, remove, removeCanvas, removeCloseButton, removeProperty, removeProperty, setAbsolutePosition, setAddress, setArrayValue, setCaptionLabel, setColor, setColorActive, setColorBackground, setColorForeground, setColorLabel, setColorValue, setGroup, setGroup, setHeight, setId, setLabel, setMouseOver, setMousePressed, setMoveable, setOpen, setPosition, setPosition, setStringValue, setTab, setTab, setTab, setTitle, setUpdate, setValue, setVisible, setWidth, show, showArrow, showBar, update, updateAbsolutePosition, updateEvents, value`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### CheckBox

    public CheckBox(ControlP5 theControlP5,
            ControllerGroup<?> theParent,
            java.lang.String theName,
            int theX,
            int theY)

A CheckBox should only be added to controlP5 by using controlP5.addCheckBox()

Parameters:
  `theControlP5` -
  `theParent` -
  `theName` -
  `theX` -
  `theY` -

#### CheckBox

    public CheckBox(ControlP5 theControlP5,
            java.lang.String theName)

Convenience constructor to extend CheckBox.

Parameters:
  `theControlP5` -
  `theName` -

+Example
  `

      /**
       * 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;
        }
      }

  `

### Method Detail

#### activate

    public final CheckBox activate(int theIndex)

Activates a single checkbox item by index

#### activate

    public final CheckBox activate(java.lang.String theName)

Activates a single checkbox item by name

#### activateAll

    public final CheckBox activateAll()

#### addItem

    public CheckBox addItem(java.lang.String theName,
                   float theValue)

Parameters:
  `theName` -
  `theValue` -
Returns:

#### addItem

    public CheckBox addItem(Toggle theToggle,
                   float theValue)

Parameters:
  `theToggle` -
  `theValue` -
Returns:

#### controlEvent

    public void controlEvent(ControlEvent theEvent)

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.

Specified by:
  `controlEvent` in interface `ControlListener`
Overrides:
  `controlEvent` in class `ControlGroup<CheckBox>`
Parameters:
  `theEvent` - ControlEvent
See Also:
  `CallbackListener`, `CallbackEvent`

#### deactivate

    public final CheckBox deactivate(int theIndex)

deactivate a single checkbox item by index

#### deactivate

    public final CheckBox deactivate(java.lang.String theName)

Deactivates a single checkbox item by name

#### deactivateAll

    public CheckBox deactivateAll()

#### getInfo

    public java.lang.String getInfo()

Description copied from class: `ControlGroup`

Overrides:
  `getInfo` in class `ControlGroup<CheckBox>`

#### getItem

    public Toggle getItem(int theIndex)

Gets a radio button item by index.

Parameters:
  `theIndex` -
Returns:
  Toggle

#### getItems

    public java.util.List<Toggle> getItems()

#### getState

    public boolean getState(int theIndex)

Gets the state of an item - this can be true (for on) or false (for off) - by index.

Parameters:
  `theIndex` -
Returns:
  boolean

#### getState

    public boolean getState(java.lang.String theName)

Gets the state of an item - this can be true (for on) or false (for off) - by name.

Parameters:
  `theName` -
Returns:

#### hideLabels

    public CheckBox hideLabels()

#### plugTo

    public CheckBox plugTo(java.lang.Object theObject)

#### plugTo

    public CheckBox plugTo(java.lang.Object theObject,
                  java.lang.String thePlugName)

#### removeItem

    public CheckBox removeItem(java.lang.String theName)

Parameters:
  `theName` -

#### setArrayValue

    public CheckBox setArrayValue(float[] theArray)

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.

Specified by:
  `setArrayValue` in interface `ControllerInterface<CheckBox>`
Overrides:
  `setArrayValue` in class `ControllerGroup<CheckBox>`
Returns:
  ControllerGroup

#### setColorLabels

    public CheckBox setColorLabels(int theColor)

#### setImage

    public CheckBox setImage(processing.core.PImage theImage)

Parameters:
  `theImage` -

#### setImage

    public CheckBox setImage(processing.core.PImage theImage,
                    int theState)

Parameters:
  `theImage` -
  `theState` - use Controller.DEFAULT (background), or Controller.OVER (foreground), or Controller.ACTIVE (active)
Returns:

#### setImages

    public CheckBox setImages(processing.core.PImage theDefaultImage,
                     processing.core.PImage theOverImage,
                     processing.core.PImage theActiveImage)

Parameters:
  `theDefaultImage` -
  `theOverImage` -
  `theActiveImage` -
Returns:
  CheckBox

#### setItemHeight

    public CheckBox setItemHeight(int theItemHeight)

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.

Parameters:
  `theItemHeight` -

#### setItemsPerRow

    public CheckBox setItemsPerRow(int theValue)

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.

Parameters:
  `theValue` -

#### setItemWidth

    public CheckBox setItemWidth(int theItemWidth)

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.

Parameters:
  `theItemWidth` -

#### setNoneSelectedAllowed

    public CheckBox setNoneSelectedAllowed(boolean theValue)

In order to always have 1 item selected, use setNoneSelectedAllowed(false), by default this is true. setNoneSelectedAllowed does not apply when in multipleChoice mode.

Parameters:
  `theValue` -

#### setSize

    public CheckBox setSize(int theWidth,
                   int theHeight)

Overrides:
  `setSize` in class `ControlGroup<CheckBox>`

#### setSize

    public CheckBox setSize(processing.core.PImage theImage)

#### setSpacingColumn

    public CheckBox setSpacingColumn(int theSpacing)

Sets the spacing in pixels between columns.

Parameters:
  `theSpacing` -

#### setSpacingRow

    public CheckBox setSpacingRow(int theSpacing)

Sets the spacing in pixels between rows.

Parameters:
  `theSpacing` -

#### showLabels

    public CheckBox showLabels()

#### toggle

    public final CheckBox toggle(int theIndex)

toggle a single checkbox item by index

#### toggle

    public final void toggle(java.lang.String theName)

deactivate a single checkbox item by name

#### toString

    public java.lang.String toString()

Description copied from class: `ControlGroup`

Overrides:
  `toString` in class `ControlGroup<CheckBox>`

#### toUpperCase

    public CheckBox toUpperCase(boolean theValue)

#### updateLayout

    public void updateLayout()