controlP5
Class ControllerGroup

java.lang.Object
  extended by controlP5.ControllerGroup
All Implemented Interfaces:
ControllerInterface, ControlP5Constants
Direct Known Subclasses:
ControlGroup, Tab, Textarea

public abstract class ControllerGroup
extends java.lang.Object
implements ControllerInterface, ControlP5Constants

ControllerGroup is an abstract class and is extended by e.g. ControlGroup, Tab, or ScrollList ControlGroup ScrollList Tab Textarea


Field Summary
 
Fields inherited from interface controlP5.ControlP5Constants
acceptClassList, ACTIVE, ALT, ARC, ARRAY, BACKSPACE, BOOLEAN, BOTTOM, CENTER, CONTROL, controlEventClass, CUSTOM, DECREASE, DEFAULT, DELETE, DOWN, ELLIPSE, ENTER, ESCAPE, EVENT, eventMethod, FIELD, FLOAT, HALF_PI, HIDE, HIGHLIGHT, HORIZONTAL, IMAGE, INCREASE, INTEGER, INVALID, KEYCONTROL, LEFT, LINE, LOAD, MENU, METHOD, MOVE, OVER, PI, PRESSED, PRINT, RELEASE, RESET, RIGHT, SAVE, SHIFT, SPRITE, STRING, SWITCH, SWITCH_BACK, SWITCH_FORE, TAB, TOP, TWO_PI, UP, VERBOSE, VERTICAL
 
Constructor Summary
ControllerGroup(ControlP5 theControlP5, ControllerGroup theParent, java.lang.String theName, float theX, float theY)
           
 
Method Summary
 CVector3f absolutePosition()
           
 void add(ControllerInterface theElement)
          add a controller to the group, but use Controller.setGroup() instead.
 ControlCanvas addCanvas(ControlCanvas theCanvas)
          add a canvas to a controllerGroup such as a tab or group.
 void addDrawable(CDrawable theElement)
           
 float[] arrayValue()
           
 Label captionLabel()
           
 void close()
          set the status of the group to closed.
 CColor color()
           
 void continuousUpdateEvents()
           
 Controller controller(java.lang.String theController)
          get a controller of the group.
 void disableCollapse()
           
 void draw(processing.core.PApplet theApplet)
           
 void enableCollapse()
           
 ControlP5XMLElement getAsXML()
           
 CColor getColor()
           
 int getHeight()
           
 int getPickingColor()
           
 Tab getTab()
          get the instance of the tab this controller belongs to.
 int getWidth()
           
 ControlWindow getWindow()
           
 void hide()
          hide the group.
 int id()
           
 void init()
           
 boolean isCollapse()
           
 boolean isMoveable()
          check if the group is moveable.
 boolean isOpen()
           
 boolean isUpdate()
          check the update status of a controller.
 boolean isVisible()
          check if the group is visible.
 boolean isXMLsavable()
           
 void keyEvent(java.awt.event.KeyEvent theEvent)
           
 void moveTo(ControlGroup theGroup)
           
 void moveTo(ControlGroup theGroup, Tab theTab, ControlWindow theControlWindow)
          move the group.
 void moveTo(ControlWindow theControlWindow)
           
 void moveTo(ControlWindow theControlWindow, java.lang.String theTabName)
           
 void moveTo(java.lang.String theTabName)
           
 void moveTo(java.lang.String theTabName, ControlWindow theControlWindow)
           
 void moveTo(Tab theTab)
           
 void moveTo(Tab theTab, ControlWindow theControlWindow)
           
 java.lang.String name()
          get the name of the group.
 void open()
          set the status of the group to open.
 ControllerInterface parent()
           
 CVector3f position()
           
 void remove()
          remove the controller from controlP5.
 void remove(CDrawable theElement)
           
 void remove(ControllerInterface theElement)
          remove a controller from the group, but use Controller.setGroup() instead.
 void removeCanvas(ControlCanvas theCanvas)
          remove a canvas from a controller group.
 void setColorActive(int theColor)
          set the color for the group when active.
 void setColorBackground(int theColor)
          set the background color of the group.
 void setColorForeground(int theColor)
          set the foreground color of the group.
 void setColorLabel(int theColor)
          set the color of the text label of the group.
 void setColorValue(int theColor)
          set the color of the value label.
 void setGroup(ControllerGroup theGroup)
          set the group of the controller.
 void setGroup(java.lang.String theName)
           
 ControllerGroup setHeight(int theHeight)
           
 void setId(int theId)
           
 void setLabel(java.lang.String theLabel)
          set the label of the group.
 boolean setMousePressed(boolean theStatus)
           
 void setMoveable(boolean theFlag)
          set the moveable status of the group.
 void setOpen(boolean theFlag)
           
 void setPosition(float theX, float theY)
          set the position of this controller.
 void setTab(ControlWindow theWindow, java.lang.String theName)
           
 void setTab(java.lang.String theName)
          set the tab of the controller.
 void setTab(Tab theTab)
          set the tab of the controller.
 void setUpdate(boolean theFlag)
          enable or disable the update function of a controller.
 void setVisible(boolean theFlag)
          set the group's visibility.
 ControllerGroup setWidth(int theWidth)
           
 void show()
          show the group.
 java.lang.String stringValue()
           
 java.lang.String toString()
           
 void update()
          call update if you want to update the value of or function call of a controller.
 void updateAbsolutePosition()
           
 void updateEvents()
           
 void updateInternalEvents(processing.core.PApplet theApplet)
          a method for putting input events like e.g.
 float value()
          !!! experimental, have to check if this spoils anything.
 Label valueLabel()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface controlP5.ControllerInterface
addToXMLElement
 

Constructor Detail

ControllerGroup

public ControllerGroup(ControlP5 theControlP5,
                       ControllerGroup theParent,
                       java.lang.String theName,
                       float theX,
                       float theY)
Parameters:
theControlP5 - ControlP5
theParent - ControllerGroup
theName - String
theX - float
theY - float
Method Detail

init

public void init()
Specified by:
init in interface ControllerInterface

parent

public ControllerInterface parent()
Specified by:
parent in interface ControllerInterface

setGroup

public void setGroup(ControllerGroup theGroup)
set the group of the controller.

Parameters:
theGroup - ControllerGroup

setGroup

public void setGroup(java.lang.String theName)
Parameters:
theName - String

moveTo

public void moveTo(ControlGroup theGroup,
                   Tab theTab,
                   ControlWindow theControlWindow)
move the group.

Specified by:
moveTo in interface ControllerInterface
Parameters:
theGroup - ControlGroup
theTab - Tab
theControlWindow - ControlWindow

moveTo

public void moveTo(ControlGroup theGroup)

moveTo

public void moveTo(Tab theTab)

moveTo

public void moveTo(ControlWindow theControlWindow)

moveTo

public void moveTo(java.lang.String theTabName)

moveTo

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

moveTo

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

moveTo

public void moveTo(Tab theTab,
                   ControlWindow theControlWindow)

setTab

public void setTab(java.lang.String theName)
set the tab of the controller.

Parameters:
theName - String

setTab

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

setTab

public void setTab(Tab theTab)
set the tab of the controller.

Parameters:
theTab - Tab

getTab

public Tab getTab()
get the instance of the tab this controller belongs to.

Specified by:
getTab in interface ControllerInterface
Returns:
Tab

position

public CVector3f position()
Specified by:
position in interface ControllerInterface
Returns:
CVector3f

absolutePosition

public CVector3f absolutePosition()
Specified by:
absolutePosition in interface ControllerInterface
Returns:
CVector3f

setPosition

public void setPosition(float theX,
                        float theY)
set the position of this controller.

Specified by:
setPosition in interface ControllerInterface
Parameters:
theX - float
theY - float

updateAbsolutePosition

public void updateAbsolutePosition()
Specified by:
updateAbsolutePosition in interface ControllerInterface

continuousUpdateEvents

public void continuousUpdateEvents()
Specified by:
continuousUpdateEvents in interface ControllerInterface

update

public void update()
call update if you want to update the value of or function call of a controller.

Specified by:
update in interface ControllerInterface

setUpdate

public void setUpdate(boolean theFlag)
enable or disable the update function of a controller.

Specified by:
setUpdate in interface ControllerInterface
Parameters:
theFlag - boolean

isUpdate

public boolean isUpdate()
check the update status of a controller.

Specified by:
isUpdate in interface ControllerInterface
Returns:
boolean

updateEvents

public void updateEvents()
Specified by:
updateEvents in interface ControllerInterface

updateInternalEvents

public void 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
See Also:
ControllerInterface.updateInternalEvents

draw

public final void draw(processing.core.PApplet theApplet)
Specified by:
draw in interface ControllerInterface
Parameters:
theApplet - PApplet

addCanvas

public ControlCanvas addCanvas(ControlCanvas theCanvas)
add a canvas to a controllerGroup such as a tab or group. use regular processing draw methods to add visual content.

Parameters:
theCanvas -

removeCanvas

public void removeCanvas(ControlCanvas theCanvas)
remove a canvas from a controller group.

Parameters:
theCanvas -

add

public void add(ControllerInterface theElement)
add a controller to the group, but use Controller.setGroup() instead.

Specified by:
add in interface ControllerInterface
Parameters:
theElement - ControllerInterface

remove

public void remove(ControllerInterface theElement)
remove a controller from the group, but use Controller.setGroup() instead.

Specified by:
remove in interface ControllerInterface
Parameters:
theElement - ControllerInterface

addDrawable

public void addDrawable(CDrawable theElement)
Parameters:
theElement - CDrawable

remove

public void remove(CDrawable theElement)
Parameters:
theElement - CDrawable

remove

public void remove()
remove the controller from controlP5.

Specified by:
remove in interface ControllerInterface

name

public java.lang.String name()
get the name of the group.

Specified by:
name in interface ControllerInterface
Returns:
String

getWindow

public ControlWindow getWindow()
Specified by:
getWindow in interface ControllerInterface
Returns:
ControlWindow

keyEvent

public void keyEvent(java.awt.event.KeyEvent theEvent)
Specified by:
keyEvent in interface ControllerInterface
Parameters:
theEvent - KeyEvent

setMousePressed

public boolean setMousePressed(boolean theStatus)
Specified by:
setMousePressed in interface ControllerInterface
Parameters:
theStatus - boolean
Returns:
boolean

setId

public void setId(int theId)
Specified by:
setId in interface ControllerInterface
Parameters:
theId - int

id

public int id()
Specified by:
id in interface ControllerInterface
Returns:
int

setColorActive

public void setColorActive(int theColor)
set the color for the group when active.

Specified by:
setColorActive in interface ControllerInterface
Parameters:
theColor - int

setColorForeground

public void setColorForeground(int theColor)
set the foreground color of the group.

Specified by:
setColorForeground in interface ControllerInterface
Parameters:
theColor - int

setColorBackground

public void setColorBackground(int theColor)
set the background color of the group.

Specified by:
setColorBackground in interface ControllerInterface
Parameters:
theColor - int

setColorLabel

public void setColorLabel(int theColor)
set the color of the text label of the group.

Specified by:
setColorLabel in interface ControllerInterface
Parameters:
theColor - int

setColorValue

public void setColorValue(int theColor)
set the color of the value label.

Specified by:
setColorValue in interface ControllerInterface
Parameters:
theColor - int

setLabel

public void setLabel(java.lang.String theLabel)
set the label of the group.

Specified by:
setLabel in interface ControllerInterface
Parameters:
theLabel - String

isVisible

public boolean isVisible()
check if the group is visible.

Specified by:
isVisible in interface ControllerInterface
Returns:
boolean

setVisible

public void setVisible(boolean theFlag)
set the group's visibility.

Parameters:
theFlag - boolean

hide

public void hide()
hide the group.

Specified by:
hide in interface ControllerInterface

show

public void show()
show the group.

Specified by:
show in interface ControllerInterface

setMoveable

public void setMoveable(boolean theFlag)
set the moveable status of the group.

Parameters:
theFlag - boolean

isMoveable

public boolean isMoveable()
check if the group is moveable.

Returns:
boolean

setOpen

public void setOpen(boolean theFlag)
Parameters:
theFlag - boolean

isOpen

public boolean isOpen()
Returns:
boolean

open

public void open()
set the status of the group to open.


close

public void close()
set the status of the group to closed.


getPickingColor

public int getPickingColor()
Specified by:
getPickingColor in interface ControllerInterface

color

public CColor color()
Specified by:
color in interface ControllerInterface
Returns:
CColor

getColor

public CColor getColor()

value

public float value()
!!! experimental, have to check if this spoils anything. implemented for ScrollList and MultiList to forward values to a dedicated method

Specified by:
value in interface ControllerInterface

stringValue

public java.lang.String stringValue()
Specified by:
stringValue in interface ControllerInterface

arrayValue

public float[] arrayValue()

controller

public Controller controller(java.lang.String theController)
get a controller of the group.

Parameters:
theController - String
Returns:
Controller

captionLabel

public Label captionLabel()

valueLabel

public Label valueLabel()

enableCollapse

public void enableCollapse()

disableCollapse

public void disableCollapse()

isCollapse

public boolean isCollapse()

getWidth

public int getWidth()
Specified by:
getWidth in interface ControllerInterface

getHeight

public int getHeight()
Specified by:
getHeight in interface ControllerInterface

setWidth

public ControllerGroup setWidth(int theWidth)

setHeight

public ControllerGroup setHeight(int theHeight)

isXMLsavable

public boolean isXMLsavable()
Specified by:
isXMLsavable in interface ControllerInterface
Returns:
boolean

getAsXML

public ControlP5XMLElement getAsXML()
Specified by:
getAsXML in interface ControllerInterface
Returns:
ControlP5XMLElement

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


processing library controlP5 by Andreas Schlegel. (c) 2010