ControllerGroup (Javadocs: controlP5)

controlP5

## Class ControllerGroup<T>

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

- All Implemented Interfaces:
    ControllerInterface<T>, ControlListener, ControlP5Constants
  Direct Known Subclasses:
    ControlGroup, Tab, Textarea

      public abstract class ControllerGroup<T>
      extends java.lang.Object
      implements ControllerInterface<T>, ControlP5Constants, ControlListener

  ControllerGroup is an abstract class and is extended by class ControlGroup, Tab, or the ListBox.

- - ### Field Summary

    - ### Fields inherited from interface controlP5.ControlP5Constants

      `acceptClassList, ACTION_BROADCAST, ACTION_CLICK, ACTION_DOUBLE_PRESS, ACTION_DRAG, ACTION_END_DRAG, ACTION_ENTER, ACTION_EXIT, ACTION_LEAVE, ACTION_MOVE, ACTION_PRESS, ACTION_PRESSED, ACTION_RELEASE, ACTION_RELEASE_OUTSIDE, ACTION_RELEASED, ACTION_RELEASEDOUTSIDE, ACTION_START_DRAG, ACTION_WHEEL, ACTIVE, ALL, ALT, AQUA, ARC, ARRAY, BACKSPACE, BASELINE, BITFONT, BLACK, BLUE, BOOLEAN, BOTTOM, BOTTOM_OUTSIDE, CAPTIONLABEL, CENTER, CHECKBOX, COMMANDKEY, CONTROL, controlEventClass, CUSTOM, DECREASE, DEFAULT, DELETE, delimiter, DONE, DOWN, DROPDOWN, ELLIPSE, ENTER, ESCAPE, EVENT, eventMethod, FADEIN, FADEOUT, FIELD, FLOAT, FUCHSIA, GRAY, GREEN, grixel, HALF_PI, HIDE, HIGHLIGHT, HORIZONTAL, IDLE, IMAGE, INACTIVE, INCREASE, INTEGER, INVALID, J2D, JSON, KEYCONTROL, LEFT, LEFT_OUTSIDE, LIME, LINE, LIST, LOAD, MAROON, MENU, METHOD, MOVE, MULTI, MULTIPLES, NAVY, OLIVE, ORANGE, OVER, P2D, P3D, pathdelimiter, PI, PRESS, PRESSED, PRINT, PURPLE, RED, RELEASE, RELEASED, RESET, RIGHT, RIGHT_OUTSIDE, SAVE, SERIALIZED, SHIFT, SILVER, SINGLE, SINGLE_COLUMN, SINGLE_ROW, SPRITE, standard56, standard58, STRING, SWITCH, SWITCH_BACK, SWITCH_FORE, synt24, TAB, TEAL, THEME_A, THEME_CP52014, THEME_CP5BLUE, THEME_GREY, THEME_RED, THEME_RETRO, TOP, TOP_OUTSIDE, TRANSITION_WAIT_FADEIN, TREE, TWO_PI, UP, VALUELABEL, VERBOSE, VERTICAL, WAIT, WHITE, YELLOW`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ControllerGroup(ControlP5 theControlP5, ControllerGroup<?> theParent, java.lang.String theName, float theX, float theY)`
    `ControllerGroup(ControlP5 theControlP5, java.lang.String theName)` Convenience constructor to extend ControllerGroup.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `add(ControllerInterface<?> theElement)` Adds a controller to the group, but use Controller.setGroup() instead.
    `Canvas` | `addCanvas(Canvas theCanvas)` Adds a canvas to a controllerGroup such as a tab or group.
    `T` | `addCloseButton()` TODO redesign or deprecate add a close button to the controlbar of this controlGroup.
    `T` | `addDrawable(CDrawable theElement)`
    `T` | `addListener(ControlListener theListener)`
    `T` | `bringToFront()`
    `T` | `bringToFront(ControllerInterface<?> theController)`
    `T` | `close()`
    `void` | `continuousUpdateEvents()`
    `void` | `controlEvent(ControlEvent theEvent)` controlEvent is called by controlP5's ControlBroadcaster to inform available listeners about value changes.
    `T` | `disableCollapse()`
    `void` | `draw(processing.core.PGraphics theGraphics)`
    `T` | `enableCollapse()`
    `float[]` | `getAbsolutePosition()`
    `java.lang.String` | `getAddress()`
    `float[]` | `getArrayValue()`
    `float` | `getArrayValue(int theIndex)`
    `Label` | `getCaptionLabel()`
    `CColor` | `getColor()`
    `Controller<?>` | `getController(java.lang.String theController)`
    `int` | `getHeight()`
    `int` | `getId()`
    `java.lang.String` | `getInfo()`
    `java.lang.String` | `getName()`
    `ControllerInterface<?>` | `getParent()`
    `int` | `getPickingColor()`
    `float[]` | `getPosition()`
    `ControllerProperty` | `getProperty(java.lang.String thePropertyName)`
    `ControllerProperty` | `getProperty(java.lang.String theSetter, java.lang.String theGetter)`
    `java.lang.String` | `getStringValue()`
    `Tab` | `getTab()`
    `float` | `getValue()`
    `Label` | `getValueLabel()`
    `int` | `getWidth()`
    `ControlWindow` | `getWindow()`
    `T` | `hide()`
    `T` | `hideArrow()`
    `T` | `hideBar()`
    `void` | `init()`
    `boolean` | `isBarVisible()`
    `boolean` | `isCollapse()`
    `boolean` | `isMouseOver()`
    `boolean` | `isMoveable()`
    `boolean` | `isOpen()`
    `boolean` | `isUpdate()` checks the update status of a controller.
    `boolean` | `isVisible()`
    `void` | `keyEvent(processing.event.KeyEvent theEvent)`
    `int` | `listenerSize()`
    `T` | `moveTo(ControllerGroup<?> theGroup)`
    `T` | `moveTo(ControllerGroup<?> theGroup, Tab theTab, ControlWindow theControlWindow)`
    `T` | `moveTo(ControlWindow theControlWindow)`
    `T` | `moveTo(ControlWindow theControlWindow, java.lang.String theTabName)`
    `T` | `moveTo(processing.core.PApplet thePApplet)`
    `T` | `moveTo(java.lang.String theTabName)`
    `T` | `moveTo(java.lang.String theTabName, ControlWindow theControlWindow)`
    `T` | `moveTo(Tab theTab)`
    `T` | `moveTo(Tab theTab, ControlWindow theControlWindow)`
    `T` | `open()`
    `T` | `registerProperty(java.lang.String thePropertyName)`
    `T` | `registerProperty(java.lang.String theSetter, java.lang.String theGetter)`
    `void` | `remove()` removes the group from controlP5.
    `T` | `remove(CDrawable theElement)`
    `T` | `remove(ControllerInterface<?> theElement)` Removes a controller from the group, but use Controller.setGroup() instead.
    `T` | `removeCanvas(Canvas theCanvas)` Removes a canvas from a controller group.
    `T` | `removeCloseButton()` TODO redesign or deprecate remove the close button.
    `T` | `removeListener(ControlListener theListener)`
    `T` | `removeProperty(java.lang.String thePropertyName)`
    `T` | `removeProperty(java.lang.String theSetter, java.lang.String theGetter)`
    `static float[]` | `set(float[] theArray, float... theValues)` convenience method to fill a float array in favor of theArray[0] = 1.2; etc.
    `T` | `setAbsolutePosition(float[] thePos)`
    `T` | `setAddress(java.lang.String theAddress)`
    `T` | `setArrayValue(float[] theArray)`
    `T` | `setArrayValue(int theIndex, float theValue)`
    `T` | `setCaptionLabel(java.lang.String theValue)`
    `T` | `setColor(CColor theColor)`
    `T` | `setColorActive(int theColor)`
    `T` | `setColorBackground(int theColor)`
    `T` | `setColorForeground(int theColor)`
    `T` | `setColorLabel(int theColor)`
    `T` | `setColorValue(int theColor)`
    `T` | `setGroup(ControllerGroup<?> theGroup)`
    `T` | `setGroup(java.lang.String theName)`
    `T` | `setHeight(int theHeight)`
    `T` | `setId(int theId)`
    `T` | `setLabel(java.lang.String theLabel)`
    `T` | `setMouseOver(boolean theFlag)`
    `boolean` | `setMousePressed(boolean theStatus)`
    `T` | `setMoveable(boolean theFlag)` set the moveable status of the group, when false, the group can't be moved.
    `T` | `setOpen(boolean theFlag)`
    `T` | `setPosition(float[] thePVector)`
    `T` | `setPosition(float theX, float theY)`
    `T` | `setSize(int theWidth, int theHeight)`
    `T` | `setStringValue(java.lang.String theValue)`
    `T` | `setTab(ControlWindow theWindow, java.lang.String theName)`
    `T` | `setTab(java.lang.String theName)`
    `T` | `setTab(Tab theTab)`
    `T` | `setTitle(java.lang.String theTitle)`
    `T` | `setUpdate(boolean theFlag)` enables or disables the update function of a controller.
    `T` | `setValue(float theValue)`
    `T` | `setVisible(boolean theFlag)`
    `T` | `setWidth(int theWidth)`
    `T` | `show()`
    `T` | `showArrow()`
    `T` | `showBar()`
    `java.lang.String` | `toString()`
    `T` | `update()`
    `T` | `updateAbsolutePosition()`
    `T` | `updateEvents()`
    `T` | `updateInternalEvents(processing.core.PApplet theApplet)` a method for putting input events like e.g.
    `static float` | `x(float[] theArray)` returns the first element of the float array.
    `static float` | `y(float[] theArray)` returns the second element of the float array.

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

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

- - ### Constructor Detail

    - #### ControllerGroup

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

    - #### ControllerGroup

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

      Convenience constructor to extend ControllerGroup.

  - ### Method Detail

    - #### add

          public T add(ControllerInterface<?> theElement)

      Adds a controller to the group, but use Controller.setGroup() instead.
      Specified by:
        `add` in interface `ControllerInterface<T>`

    - #### addCanvas

          public Canvas addCanvas(Canvas theCanvas)

      Adds a canvas to a controllerGroup such as a tab or group. Use processing's draw methods to add visual content.

    - #### addCloseButton

          public T addCloseButton()

      TODO redesign or deprecate add a close button to the controlbar of this controlGroup.

    - #### addDrawable

          public T addDrawable(CDrawable theElement)

    - #### addListener

          public T addListener(ControlListener theListener)

      Specified by:
        `addListener` in interface `ControllerInterface<T>`

    - #### bringToFront

          public T bringToFront()

      Specified by:
        `bringToFront` in interface `ControllerInterface<T>`

    - #### bringToFront

          public T bringToFront(ControllerInterface<?> theController)

      Specified by:
        `bringToFront` in interface `ControllerInterface<T>`

    - #### close

          public T close()

    - #### continuousUpdateEvents

          public void continuousUpdateEvents()

      Specified by:
        `continuousUpdateEvents` in interface `ControllerInterface<T>`

    - #### controlEvent

          public void controlEvent(ControlEvent theEvent)

      Description copied from interface: `ControlListener`
      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`
      Parameters:
        `theEvent` - ControlEvent
      See Also:
        `CallbackListener`, `CallbackEvent`

    - #### disableCollapse

          public T disableCollapse()

    - #### draw

          public final void draw(processing.core.PGraphics theGraphics)

      Specified by:
        `draw` in interface `ControllerInterface<T>`

    - #### enableCollapse

          public T enableCollapse()

    - #### getAbsolutePosition

          public float[] getAbsolutePosition()

      Specified by:
        `getAbsolutePosition` in interface `ControllerInterface<T>`

    - #### getAddress

          public java.lang.String getAddress()

      Specified by:
        `getAddress` in interface `ControllerInterface<T>`

    - #### getArrayValue

          public float[] getArrayValue()

      Specified by:
        `getArrayValue` in interface `ControllerInterface<T>`

    - #### getArrayValue

          public float getArrayValue(int theIndex)

      Specified by:
        `getArrayValue` in interface `ControllerInterface<T>`

    - #### getCaptionLabel

          public Label getCaptionLabel()

    - #### getColor

          public CColor getColor()

      Specified by:
        `getColor` in interface `ControllerInterface<T>`

    - #### getController

          public Controller<?> getController(java.lang.String theController)

    - #### getHeight

          public int getHeight()

      Specified by:
        `getHeight` in interface `ControllerInterface<T>`

    - #### getId

          public int getId()

      Specified by:
        `getId` in interface `ControllerInterface<T>`

    - #### getInfo

          public java.lang.String getInfo()

    - #### getName

          public java.lang.String getName()

      Specified by:
        `getName` in interface `ControllerInterface<T>`

    - #### getParent

          public ControllerInterface<?> getParent()

      Specified by:
        `getParent` in interface `ControllerInterface<T>`

    - #### getPickingColor

          public int getPickingColor()

      Specified by:
        `getPickingColor` in interface `ControllerInterface<T>`

    - #### getPosition

          public float[] getPosition()

      Specified by:
        `getPosition` in interface `ControllerInterface<T>`

    - #### getProperty

          public ControllerProperty getProperty(java.lang.String thePropertyName)

      Specified by:
        `getProperty` in interface `ControllerInterface<T>`

    - #### getProperty

          public ControllerProperty getProperty(java.lang.String theSetter,
                                                java.lang.String theGetter)

      Specified by:
        `getProperty` in interface `ControllerInterface<T>`

    - #### getStringValue

          public java.lang.String getStringValue()

      Specified by:
        `getStringValue` in interface `ControllerInterface<T>`

    - #### getTab

          public Tab getTab()

      Specified by:
        `getTab` in interface `ControllerInterface<T>`

    - #### getValue

          public float getValue()

      Specified by:
        `getValue` in interface `ControllerInterface<T>`

    - #### getValueLabel

          public Label getValueLabel()

    - #### getWidth

          public int getWidth()

      Specified by:
        `getWidth` in interface `ControllerInterface<T>`

    - #### getWindow

          public ControlWindow getWindow()

      Specified by:
        `getWindow` in interface `ControllerInterface<T>`

    - #### hide

          public T hide()

      Specified by:
        `hide` in interface `ControllerInterface<T>`

    - #### hideArrow

          public T hideArrow()

    - #### hideBar

          public T hideBar()

    - #### init

          public void init()

      Specified by:
        `init` in interface `ControllerInterface<T>`

    - #### isBarVisible

          public boolean isBarVisible()

    - #### isCollapse

          public boolean isCollapse()

    - #### isMouseOver

          public boolean isMouseOver()

      Specified by:
        `isMouseOver` in interface `ControllerInterface<T>`

    - #### isMoveable

          public boolean isMoveable()

    - #### isOpen

          public boolean isOpen()

    - #### isUpdate

          public boolean isUpdate()

      checks the update status of a controller.
      Specified by:
        `isUpdate` in interface `ControllerInterface<T>`

    - #### isVisible

          public boolean isVisible()

      Specified by:
        `isVisible` in interface `ControllerInterface<T>`

    - #### keyEvent

          public void keyEvent(processing.event.KeyEvent theEvent)

      Specified by:
        `keyEvent` in interface `ControllerInterface<T>`

    - #### listenerSize

          public int listenerSize()

    - #### moveTo

          public final T moveTo(ControllerGroup<?> theGroup)

      Specified by:
        `moveTo` in interface `ControllerInterface<T>`

    - #### moveTo

          public final T moveTo(ControllerGroup<?> theGroup,
                                Tab theTab,
                                ControlWindow theControlWindow)

      Specified by:
        `moveTo` in interface `ControllerInterface<T>`

    - #### moveTo

          public T moveTo(ControlWindow theControlWindow)

    - #### moveTo

          public final T moveTo(ControlWindow theControlWindow,
                                java.lang.String theTabName)

    - #### moveTo

          public T moveTo(processing.core.PApplet thePApplet)

    - #### moveTo

          public final T moveTo(java.lang.String theTabName)

    - #### moveTo

          public final T moveTo(java.lang.String theTabName,
                                ControlWindow theControlWindow)

    - #### moveTo

          public final T moveTo(Tab theTab)

    - #### moveTo

          public final T moveTo(Tab theTab,
                                ControlWindow theControlWindow)

    - #### open

          public T open()

    - #### registerProperty

          public T registerProperty(java.lang.String thePropertyName)

      Specified by:
        `registerProperty` in interface `ControllerInterface<T>`

    - #### registerProperty

          public T registerProperty(java.lang.String theSetter,
                                    java.lang.String theGetter)

      Specified by:
        `registerProperty` in interface `ControllerInterface<T>`

    - #### remove

          public void remove()

      removes the group from controlP5.
      Specified by:
        `remove` in interface `ControllerInterface<T>`

    - #### remove

          public T remove(CDrawable theElement)

    - #### remove

          public T remove(ControllerInterface<?> theElement)

      Removes a controller from the group, but use Controller.setGroup() instead.
      Specified by:
        `remove` in interface `ControllerInterface<T>`

    - #### removeCanvas

          public T removeCanvas(Canvas theCanvas)

      Removes a canvas from a controller group.

    - #### removeCloseButton

          public T removeCloseButton()

      TODO redesign or deprecate remove the close button.

    - #### removeListener

          public T removeListener(ControlListener theListener)

    - #### removeProperty

          public T removeProperty(java.lang.String thePropertyName)

      Specified by:
        `removeProperty` in interface `ControllerInterface<T>`

    - #### removeProperty

          public T removeProperty(java.lang.String theSetter,
                                  java.lang.String theGetter)

      Specified by:
        `removeProperty` in interface `ControllerInterface<T>`

    - #### set

          public static float[] set(float[] theArray,
                                    float... theValues)

      convenience method to fill a float array in favor of theArray[0] = 1.2; etc. takes a float array and fills it (starting from index 0) with arguments starting from index 1.

    - #### setAbsolutePosition

          public T setAbsolutePosition(float[] thePos)

      Specified by:
        `setAbsolutePosition` in interface `ControllerInterface<T>`

    - #### setAddress

          public T setAddress(java.lang.String theAddress)

      Specified by:
        `setAddress` in interface `ControllerInterface<T>`

    - #### setArrayValue

          public T setArrayValue(float[] theArray)

      Specified by:
        `setArrayValue` in interface `ControllerInterface<T>`

    - #### setArrayValue

          public T setArrayValue(int theIndex,
                                 float theValue)

      Specified by:
        `setArrayValue` in interface `ControllerInterface<T>`

    - #### setCaptionLabel

          public T setCaptionLabel(java.lang.String theValue)

      Specified by:
        `setCaptionLabel` in interface `ControllerInterface<T>`

    - #### setColor

          public T setColor(CColor theColor)

      Specified by:
        `setColor` in interface `ControllerInterface<T>`

    - #### setColorActive

          public T setColorActive(int theColor)

      Specified by:
        `setColorActive` in interface `ControllerInterface<T>`

    - #### setColorBackground

          public T setColorBackground(int theColor)

      Specified by:
        `setColorBackground` in interface `ControllerInterface<T>`

    - #### setColorForeground

          public T setColorForeground(int theColor)

      Specified by:
        `setColorForeground` in interface `ControllerInterface<T>`

    - #### setColorLabel

          public T setColorLabel(int theColor)

      Specified by:
        `setColorLabel` in interface `ControllerInterface<T>`

    - #### setColorValue

          public T setColorValue(int theColor)

      Specified by:
        `setColorValue` in interface `ControllerInterface<T>`

    - #### setGroup

          public final T setGroup(ControllerGroup<?> theGroup)

    - #### setGroup

          public final T setGroup(java.lang.String theName)

    - #### setHeight

          public T setHeight(int theHeight)

    - #### setId

          public T setId(int theId)

      Specified by:
        `setId` in interface `ControllerInterface<T>`

    - #### setLabel

          public T setLabel(java.lang.String theLabel)

      Specified by:
        `setLabel` in interface `ControllerInterface<T>`

    - #### setMouseOver

          public T setMouseOver(boolean theFlag)

      Specified by:
        `setMouseOver` in interface `ControllerInterface<T>`

    - #### setMousePressed

          public boolean setMousePressed(boolean theStatus)

      Specified by:
        `setMousePressed` in interface `ControllerInterface<T>`

    - #### setMoveable

          public T setMoveable(boolean theFlag)

      set the moveable status of the group, when false, the group can't be moved.

    - #### setOpen

          public T setOpen(boolean theFlag)

    - #### setPosition

          public T setPosition(float[] thePVector)

      Specified by:
        `setPosition` in interface `ControllerInterface<T>`

    - #### setPosition

          public T setPosition(float theX,
                               float theY)

      Specified by:
        `setPosition` in interface `ControllerInterface<T>`

    - #### setSize

          public T setSize(int theWidth,
                           int theHeight)

    - #### setStringValue

          public T setStringValue(java.lang.String theValue)

      Specified by:
        `setStringValue` in interface `ControllerInterface<T>`

    - #### setTab

          public final T setTab(ControlWindow theWindow,
                                java.lang.String theName)

    - #### setTab

          public final T setTab(java.lang.String theName)

    - #### setTab

          public final T setTab(Tab theTab)

    - #### setTitle

          public T setTitle(java.lang.String theTitle)

    - #### setUpdate

          public T setUpdate(boolean theFlag)

      enables or disables the update function of a controller.
      Specified by:
        `setUpdate` in interface `ControllerInterface<T>`

    - #### setValue

          public T setValue(float theValue)

      Specified by:
        `setValue` in interface `ControllerInterface<T>`

    - #### setVisible

          public T setVisible(boolean theFlag)

    - #### setWidth

          public T setWidth(int theWidth)

    - #### show

          public T show()

      Specified by:
        `show` in interface `ControllerInterface<T>`

    - #### showArrow

          public T showArrow()

    - #### showBar

          public T showBar()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### update

          public T update()

      Specified by:
        `update` in interface `ControllerInterface<T>`

    - #### updateAbsolutePosition

          public T updateAbsolutePosition()

      Specified by:
        `updateAbsolutePosition` in interface `ControllerInterface<T>`

    - #### updateEvents

          public T updateEvents()

      Specified by:
        `updateEvents` in interface `ControllerInterface<T>`

    - #### updateInternalEvents

          public T updateInternalEvents(processing.core.PApplet theApplet)

      Description copied from interface: `ControllerInterface`
      a method for putting input events like e.g. mouse or keyboard events and queries. this has been taken out of the draw method for better overwriting capability.
      Specified by:
        `updateInternalEvents` in interface `ControllerInterface<T>`

    - #### x

          public static float x(float[] theArray)

      returns the first element of the float array.

    - #### y

          public static float y(float[] theArray)

      returns the second element of the float array.

processing library controlP5 by Andreas Schlegel. (c) 2006-2015