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

controlP5

## Class ControlP5Base

- java.lang.Object
- - controlP5.ControlP5Legacy
  - - controlP5.ControlP5Base

All Implemented Interfaces:
  ControlP5Constants

Direct Known Subclasses:
  ControlP5

    public class ControlP5Base
    extends ControlP5Legacy
    implements ControlP5Constants

The ControlP5Base supports the ControlP5 class and implements all adder methods to add controllers to controlP5.

### 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
`ControlP5Base()`

### Method Summary

Methods
`Accordion` `addAccordion(java.lang.Object theObject, java.lang.String theName)`
`Accordion` `addAccordion(java.lang.String theName)`
`Bang` `addBang(java.lang.Object theObject, java.lang.String theName)`
`Bang` `addBang(java.lang.String theName)` Triggers an event without passing a value.
`Button` `addButton(java.lang.Object theObject, java.lang.String theName)`
`Button` `addButton(java.lang.String theName)` Triggers an event and passing a value.
`Chart` `addChart(java.lang.String theName)` adds chart support to display float array based data.
`CheckBox` `addCheckBox(java.lang.Object theObject, java.lang.String theName)`
`CheckBox` `addCheckBox(java.lang.String theName)` Use a checkbox for single choice options.
`ColorPicker` `addColorPicker(java.lang.Object theObject, java.lang.String theName)`
`ColorPicker` `addColorPicker(java.lang.String theName)` adds a simple RGBA colorpicker.
`ColorWheel` `addColorWheel(java.lang.Object theObject, java.lang.String theName)`
`ColorWheel` `addColorWheel(java.lang.String theName)`
`Println` `addConsole(Textarea theTextarea)`
`ControlP5Base` `addControllersFor(processing.core.PApplet theApplet)`
`ControlP5Base` `addControllersFor(java.lang.String theAddressSpace, java.lang.Object t)` Adds controllers for a specific object using annotations.
`FrameRate` `addFrameRate()` returns the current framerate of the running sketch.
`Group` `addGroup(java.lang.Object theObject, java.lang.String theName)`
`Group` `addGroup(java.lang.String theName)` A controller group can be used to group controllers for a better organization of single controllers.
`Knob` `addKnob(java.lang.Object theObject, java.lang.String theName)`
`Knob` `addKnob(java.lang.String theName)` Knobs can use limited and endless revolutions, custom angles and starting points.
`Matrix` `addMatrix(java.lang.Object theObject, java.lang.String theName)`
`Matrix` `addMatrix(java.lang.String theName)` Matrix is a 2-D matrix controller using toggle controllers in a rows and a columns setup.
`MultiList` `addMultiList(java.lang.Object theObject, java.lang.String theName)`
`MultiList` `addMultiList(java.lang.String theName)` Multilist is a tree like menu.
`Numberbox` `addNumberbox(java.lang.Object theObject, java.lang.String theName)`
`Numberbox` `addNumberbox(java.lang.String theName)`
`RadioButton` `addRadioButton(java.lang.Object theObject, java.lang.String theName)`
`RadioButton` `addRadioButton(java.lang.String theName)` Use radio buttons for multiple choice options.
`Range` `addRange(java.lang.Object theObject, java.lang.String theName)`
`Range` `addRange(java.lang.String theName)` A range controller, a slider that allows control on both ends of the slider.
`ScrollableList` `addScrollableList(java.lang.Object theObject, java.lang.String theName)`
`ScrollableList` `addScrollableList(java.lang.String theName)` the ScrollableList replaces the DropwdownList and ListBox, the type for a ScrollableList can be set with setType(ControlP5.DROPDOWN | ControlP5.LIST).
`Slider` `addSlider(java.lang.Object theObject, java.lang.String theName)`
`Slider` `addSlider(java.lang.String theName)` Adds a default slider with a default width of 100 and height of 10.
`Slider2D` `addSlider2D(java.lang.Object theObject, java.lang.String theName)`
`Slider2D` `addSlider2D(java.lang.String theName)` Adds a 2D slider to controlP5.
`Tab` `addTab(java.lang.String theName)`
`Textarea` `addTextarea(java.lang.String theName)` A Textarea is a label without any controller functionality and can be used to leave notes, headlines, etc when extending the dedicated area of the Textrea, a scrollbar is added on the right.
`Textfield` `addTextfield(java.lang.Object theObject, java.lang.String theIndex)`
`Textfield` `addTextfield(java.lang.String theIndex)` A Textfield allows single line text input.
`Textlabel` `addTextlabel(java.lang.String theName)`
`Toggle` `addToggle(java.lang.Object theObject, java.lang.String theName)` Toggles a boolean field or passes a value when triggered.
`Toggle` `addToggle(java.lang.String theName)`
`Tab` `getDefaultTab()`
`char` `getKey()`
`int` `getKeyCode()`
`controlP5.ControllerLayout` `getLayout()`
`java.lang.Object` `getObjectForController(ControllerInterface theController)`
`ControllerProperties` `getProperties()`
`static java.util.Set<java.lang.String>` `getPublicMethodsFor(java.lang.Class<?> theClass)`
`static java.util.Set<java.lang.String>` `getPublicMethodsFor(java.lang.Class<?> theClass, boolean theFlag)`
`static java.util.Set<java.lang.String>` `getPublicMethodsFor(java.lang.Class<?> theClass, boolean isSuperclass, java.lang.String... thePattern)`
`static java.util.Set<java.lang.String>` `getPublicMethodsFor(java.lang.Class<?> theClass, java.lang.String... thePattern)`
`ControlP5Base` `hide(java.lang.Object theObject)`
`boolean` `isAltDown()`
`boolean` `isControlDown()`
`boolean` `isMetaDown()`
`boolean` `isShiftDown()`
`ControlP5Base` `listenTo(java.lang.String theFieldName, java.lang.Object theObject)`
`ControlP5` `mapKeyFor(ControlKey theKey, java.lang.Object... os)`
`ControlP5Base` `moveTo(ControllerGroup<?> theController, java.lang.Object theObject)`
`static void` `printPublicMethodsFor(java.lang.Class<?> theClass)`
`static void` `printPublicMethodsFor(java.lang.Class<?> theClass, java.lang.String... thePattern)` prints a list of public methods of requested class into the console.
`ControlP5Base` `remove(java.lang.Object theObject)` for internal use only.
`ControlP5` `removeKeyFor(ControlKey theKey, char... theChar)`
`ControlP5` `removeKeyFor(ControlKey theKey, int... theChar)`
`ControlP5` `removeKeysFor(char... theChar)`
`ControlP5` `removeKeysFor(int... theChar)`
`void` `removeProperty(ControllerInterface<?> theController)`
`void` `setAutoAddDirection(int theDirection)`
`void` `setAutoSpacing()`
`void` `setAutoSpacing(float theX)`
`void` `setAutoSpacing(float theX, float theY)`
`void` `setAutoSpacing(float theX, float theY, float theZ)`
`ControlP5Base` `setColor(CColor theColor, java.lang.Object theObject)`
`ControlP5Base` `setPosition(int theX, int theY, java.lang.Object o)`
`ControlP5Base` `show(java.lang.Object theObject)`
`ControlP5Base` `stopListeningTo(java.lang.String theFieldName, java.lang.Object theObject)`

### Methods inherited from class controlP5.ControlP5Legacy

`addAccordion, addAccordion, addBang, addBang, addBang, addBang, addBoundingBox, addBoundingBox, addButton, addButton, addButton, addButton, addButton, addChart, addCheckBox, addCheckBox, addColorPicker, addColorPicker, addColorWheel, addColorWheel, addController, addController, addControlWindow, addControlWindow, addControlWindow, addControlWindow, addControlWindow, addDropdownList, addDropdownList, addDropdownList, addGroup, addGroup, addGroup, addGroup, addGroup, addGroup, addKnob, addKnob, addKnob, addKnob, addKnob, addKnob, addKnob, addListBox, addListBox, addListBox, addMatrix, addMatrix, addMultiList, addMultiList, addNumberbox, addNumberbox, addNumberbox, addNumberbox, addNumberbox, addRadio, addRadio, addRadioButton, addRadioButton, addRange, addRange, addRange, addRange, addScrollableList, addScrollableList, addScrollableList, addSlider, addSlider, addSlider, addSlider, addSlider, addSlider, addSlider, addSlider2D, addSlider2D, addSlider2D, addSlider2D, addTab, addTab, addTextarea, addTextfield, addTextfield, addTextfield, addTextlabel, addTextlabel, addTextlabel, addTextlabel, addToggle, addToggle, addToggle, addToggle, addToggle, addToggle, addToggle, addTooltip, getController, getTextlabel, getTextlabel`

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

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

### Constructor Detail

#### ControlP5Base

    public ControlP5Base()

### Method Detail

#### addAccordion

    public Accordion addAccordion(java.lang.Object theObject,
                         java.lang.String theName)

#### addAccordion

    public Accordion addAccordion(java.lang.String theName)

#### addBang

    public Bang addBang(java.lang.Object theObject,
               java.lang.String theName)

#### addBang

    public Bang addBang(java.lang.String theName)

Triggers an event without passing a value.

#### addButton

    public Button addButton(java.lang.Object theObject,
                   java.lang.String theName)

#### addButton

    public Button addButton(java.lang.String theName)

Triggers an event and passing a value.

#### addChart

    public Chart addChart(java.lang.String theName)

adds chart support to display float array based data.

#### addCheckBox

    public CheckBox addCheckBox(java.lang.Object theObject,
                       java.lang.String theName)

#### addCheckBox

    public CheckBox addCheckBox(java.lang.String theName)

Use a checkbox for single choice options.

#### addColorPicker

    public ColorPicker addColorPicker(java.lang.Object theObject,
                             java.lang.String theName)

#### addColorPicker

    public ColorPicker addColorPicker(java.lang.String theName)

adds a simple RGBA colorpicker.

#### addColorWheel

    public ColorWheel addColorWheel(java.lang.Object theObject,
                           java.lang.String theName)

#### addColorWheel

    public ColorWheel addColorWheel(java.lang.String theName)

#### addConsole

    public Println addConsole(Textarea theTextarea)

#### addControllersFor

    public ControlP5Base addControllersFor(processing.core.PApplet theApplet)

#### addControllersFor

    public ControlP5Base addControllersFor(java.lang.String theAddressSpace,
                                  java.lang.Object t)

Adds controllers for a specific object using annotations.

Uses a forward slash delimited address, for example:

lets say the theAddressSpace parameter is set to "hello", and the Object (second parameter) contains an annotated field "x", addControllersFor("hello", o); will add a controller for field x with address /hello/x This address can be used with getController("/hello/x") to access the controller of that particular Object and field.

#### addFrameRate

    public FrameRate addFrameRate()

returns the current framerate of the running sketch.

#### addGroup

    public Group addGroup(java.lang.Object theObject,
                 java.lang.String theName)

#### addGroup

    public Group addGroup(java.lang.String theName)

A controller group can be used to group controllers for a better organization of single controllers.

#### addKnob

    public Knob addKnob(java.lang.Object theObject,
               java.lang.String theName)

#### addKnob

    public Knob addKnob(java.lang.String theName)

Knobs can use limited and endless revolutions, custom angles and starting points. There are 2 control areas for a knob, an area closer to the edge allows 'click-and-adjust' control, a click and drag action at the inside allows to gradually change the value of a know when dragged. A knob can be controller by mouse click, drag or mouse-wheel.

#### addMatrix

    public Matrix addMatrix(java.lang.Object theObject,
                   java.lang.String theName)

#### addMatrix

    public Matrix addMatrix(java.lang.String theName)

Matrix is a 2-D matrix controller using toggle controllers in a rows and a columns setup. useful for software drum machines.

#### addMultiList

    public MultiList addMultiList(java.lang.Object theObject,
                         java.lang.String theName)

#### addMultiList

    public MultiList addMultiList(java.lang.String theName)

Multilist is a tree like menu.

#### addNumberbox

    public Numberbox addNumberbox(java.lang.Object theObject,
                         java.lang.String theName)

#### addNumberbox

    public Numberbox addNumberbox(java.lang.String theName)

#### addRadioButton

    public RadioButton addRadioButton(java.lang.Object theObject,
                             java.lang.String theName)

#### addRadioButton

    public RadioButton addRadioButton(java.lang.String theName)

Use radio buttons for multiple choice options.

#### addRange

    public Range addRange(java.lang.Object theObject,
                 java.lang.String theName)

#### addRange

    public Range addRange(java.lang.String theName)

A range controller, a slider that allows control on both ends of the slider.

#### addScrollableList

    public ScrollableList addScrollableList(java.lang.Object theObject,
                                   java.lang.String theName)

#### addScrollableList

    public ScrollableList addScrollableList(java.lang.String theName)

the ScrollableList replaces the DropwdownList and ListBox, the type for a ScrollableList can be set with setType(ControlP5.DROPDOWN | ControlP5.LIST).

#### addSlider

    public Slider addSlider(java.lang.Object theObject,
                   java.lang.String theName)

#### addSlider

    public Slider addSlider(java.lang.String theName)

Adds a default slider with a default width of 100 and height of 10. the default value range is from 0-100. By default it will be added to the default tab of the main window. Sliders can be arranged vertically and horizontally depending on their width and height. The look of a sliders control can either be a bar or a handle. you can add tickmarks to a slider or use the default free-control setting. A slider can be controller by mouse click, drag or mouse-wheel.

#### addSlider2D

    public Slider2D addSlider2D(java.lang.Object theObject,
                       java.lang.String theName)

#### addSlider2D

    public Slider2D addSlider2D(java.lang.String theName)

Adds a 2D slider to controlP5. A 2D slider is a 2D area with 1 cursor returning its xy coordinates.

#### addTab

    public Tab addTab(java.lang.String theName)

#### addTextarea

    public Textarea addTextarea(java.lang.String theName)

A Textarea is a label without any controller functionality and can be used to leave notes, headlines, etc when extending the dedicated area of the Textrea, a scrollbar is added on the right.

#### addTextfield

    public Textfield addTextfield(java.lang.Object theObject,
                         java.lang.String theIndex)

#### addTextfield

    public Textfield addTextfield(java.lang.String theIndex)

A Textfield allows single line text input. If text goes beyond the edges of a Textfield box, the text will automatically scroll. Use Arrow keys to navigate back and forth.

#### addTextlabel

    public Textlabel addTextlabel(java.lang.String theName)

#### addToggle

    public Toggle addToggle(java.lang.Object theObject,
                   java.lang.String theName)

Toggles a boolean field or passes a value when triggered.

#### addToggle

    public Toggle addToggle(java.lang.String theName)

#### getDefaultTab

    public Tab getDefaultTab()

#### getKey

    public char getKey()

#### getKeyCode

    public int getKeyCode()

#### getLayout

    public controlP5.ControllerLayout getLayout()

#### getObjectForController

    public java.lang.Object getObjectForController(ControllerInterface theController)

#### getProperties

    public ControllerProperties getProperties()

#### getPublicMethodsFor

    public static java.util.Set<java.lang.String> getPublicMethodsFor(java.lang.Class<?> theClass)

#### getPublicMethodsFor

    public static java.util.Set<java.lang.String> getPublicMethodsFor(java.lang.Class<?> theClass,
                                                      boolean theFlag)

#### getPublicMethodsFor

    public static java.util.Set<java.lang.String> getPublicMethodsFor(java.lang.Class<?> theClass,
                                                      boolean isSuperclass,
                                                      java.lang.String... thePattern)

#### getPublicMethodsFor

    public static java.util.Set<java.lang.String> getPublicMethodsFor(java.lang.Class<?> theClass,
                                                      java.lang.String... thePattern)

#### hide

    public ControlP5Base hide(java.lang.Object theObject)

#### isAltDown

    public boolean isAltDown()

#### isControlDown

    public boolean isControlDown()

#### isMetaDown

    public boolean isMetaDown()

#### isShiftDown

    public boolean isShiftDown()

#### listenTo

    public ControlP5Base listenTo(java.lang.String theFieldName,
                         java.lang.Object theObject)

#### mapKeyFor

    public ControlP5 mapKeyFor(ControlKey theKey,
                      java.lang.Object... os)

#### moveTo

    public ControlP5Base moveTo(ControllerGroup<?> theController,
                       java.lang.Object theObject)

#### printPublicMethodsFor

    public static void printPublicMethodsFor(java.lang.Class<?> theClass)

#### printPublicMethodsFor

    public static void printPublicMethodsFor(java.lang.Class<?> theClass,
                             java.lang.String... thePattern)

prints a list of public methods of requested class into the console. You can specify patterns that will print methods found with only these particular patterns in their name.

printed Format: returnType methodName(parameter type)

#### remove

    public ControlP5Base remove(java.lang.Object theObject)

for internal use only. use Controller.remove() instead.

Parameters:
  `theObject` -
Returns:

#### removeKeyFor

    public ControlP5 removeKeyFor(ControlKey theKey,
                         char... theChar)

#### removeKeyFor

    public ControlP5 removeKeyFor(ControlKey theKey,
                         int... theChar)

#### removeKeysFor

    public ControlP5 removeKeysFor(char... theChar)

#### removeKeysFor

    public ControlP5 removeKeysFor(int... theChar)

#### removeProperty

    public void removeProperty(ControllerInterface<?> theController)

#### setAutoAddDirection

    public void setAutoAddDirection(int theDirection)

#### setAutoSpacing

    public void setAutoSpacing()

#### setAutoSpacing

    public void setAutoSpacing(float theX)

#### setAutoSpacing

    public void setAutoSpacing(float theX,
                      float theY)

#### setAutoSpacing

    public void setAutoSpacing(float theX,
                      float theY,
                      float theZ)

#### setColor

    public ControlP5Base setColor(CColor theColor,
                         java.lang.Object theObject)

#### setPosition

    public ControlP5Base setPosition(int theX,
                            int theY,
                            java.lang.Object o)

#### show

    public ControlP5Base show(java.lang.Object theObject)

#### stopListeningTo

    public ControlP5Base stopListeningTo(java.lang.String theFieldName,
                                java.lang.Object theObject)