Notice: This is a static archive of the Mobile Processing website, as the project is no longer significantly active. All forms and the Discourse boards are no longer functional, and the mobile website at http://wapmp.at/ is no longer available. Please visit the Mobile Processing Google Group for any remaining discussions and the Processing website for the latest news about Processing.
Index
Name

PComponent

Description The PComponent class defines the fields and methods common to all the UI components.
Fields
DEFAULT_BG_COLOR   Constant value representing the default background color

DEFAULT_FG_FOCUSED_COLOR   Constant value representing the default focused foreground color

DEFAULT_FG_UNFOCUSED_COLOR   Constant value representing the default unfocused foreground color

DEFAULT_FG_PRESSED_COLOR   Constant value representing the default pressed foreground color

DEFAULT_BORDER_FOCUSED_COLOR   Constant value representing the default focused border color

DEFAULT_BORDER_UNFOCUSED_COLOR   Constant value representing the default unfocused border color

DEFAULT_HIGHLIGHT_FOCUSED_COLOR   Constant value representing the default focused highlight color

DEFAULT_HIGHLIGHT_UNFOCUSED_COLOR   Constant value representing the default unfocused highlight color

x   Top left x-coordinate value of the component

y   Top left y-coordinate value of the component

width   Total width of the component

height   Total height of the component

contentX   Top left x-coordinate value of the content area of the component

contentY   Top left y-coordinate value of the content area of the component

contentWidth   Width of the content area of the component

contentHeight   Height of the content area of the component

margin   Size of margin around the outside of the component

padding   Size of padding inside the component around the content area

acceptsFocus   True if the component can accept input focus

focused   True if the component currently has input focus

pressed   True if the component has been activated/pressed

visible   True if the component is rendered visible

bgColor   Background color of the entire component

pressedFgColor   Foreground color of the component when pressed

focusedFgColor   Foreground color of the component when it has input focus

unfocusedFgColor   Foreground color of the component when it does not have input focus

highlightWidth   Width of the highlight border around the component

focusedHighlightColor   Color of the highlight border when the component has input focus

unfocusedHighlightColor   Color of the highlight focus when the component doesn't have input focus

borderWidth   Width of the border around the component content area

focusedBorderColor   Color of the border when the component has input focus

unfocusedBorderColor   Color of the border when the component doesn't have input focus

Methods
setBounds()   Sets the location and dimensions of the component.

calculateBounds()   Lets the component automatically place and size itself within the specified location and dimensions.

intersects()   Returns true if the component intersects the specified bounds.

initialize()   Initializes the component, should be called after bounds have changed.

draw()   Draws the component onto the screen.

keyPressed()   Called to let the component handle a keypress event.

keyReleased()   Called to let the component handle a keyrelease event.