UIElement

php\swing\UIElement

abstract class

Children


Properties


property uid

string

read-only

property group

string

property x

int

Position X

property y

int

Position Y

property w

int

Width

property h

int

Height

property size

array

Size (width and height), [int, int]

property preferredSize

php\swing\array [int, int]

property minSize

array

Min Size (width and height) [int, int]

property autosize

bool

property position

array

Position (x and y), [int, int]

property screenPosition

array

Screen Position (x and y), [int, int]

property absolutePosition

array

read-only

Absolute Position (x and y), [int, int]

property visible

bool

property enabled

bool

property focusable

bool

property align

php\swing\string - NONE, LEFT, RIGHT, TOP, BOTTOM, CLIENT

property anchors

array

[LEFT, TOP, RIGHT, BOTTOM]

property font

php\swing\Font

property border

php\swing\Border

property background

php\swing\Color

property foreground

php\swing\Color

property tooltipText

string

property doubleBuffered

bool

property opaque

bool

property ignoreRepaint

bool

property autoscrolls

bool

property uiClassId

string

read-only

property popupMenu

php\swing\UIPopupMenu

property cursor

string

property padding

php\swing\array [int, int, int, int]

property owner

php\swing\UIContainer

property parent

php\swing\UIContainer

property firstParent

php\swing\UIContainer

Methods


__construct()
getGraphics()

Get graphic canvas object

Returns:php\swing\Graphics
on($name, $callback, $group = 'general')

Events - Mouse: click mousePress mouseRelease mouseEnter mouseExit mouseMove mouseDrag

Keyboard: keyDown keyUp keyPress

Focus: focus blur

Add callback for event

Parameters:
  • $name
      • name of event
  • $callbackcallable
  • $groupstring
off($name, $group = NULL)

Remove all event callbacks (if group == null), or only group

Parameters:
  • $name
  • $groupnull, string
Returns:

bool

trigger($name)

Trigger callback by event name

Parameters:
  • $name
addAllowedEventType($name)

protected

Parameters:
  • $namestring
setAction($name, $callback = null)
Parameters:
  • $namestring
  • $callbackcallable
setInputKey($keyString, $actionName)
Parameters:
  • $keyStringstring
  • $actionNamestring
hasFocus()
Returns:bool
add($component, $index = null)

Add child component

Parameters:
getComponentAt($x, $y)

Determines if this component or one of its immediate subcomponents contains the (x, y) location, and if so, returns the containing component. This method only looks one level deep.

Parameters:
  • $x
  • $y
Returns:

php\swing\UIElement

printOne($canvas)

Prints this component.

Parameters:
printAll($canvas)

Prints this component and all of its subcomponents.

Parameters:
paintOne($canvas)

Paints this component.

Parameters:
paintAll($canvas)

Paints this component and all of its subcomponents.

Parameters:
updateUI()
invalidate()
repaint()
revalidate()
repaintRegion($x, $y, $w, $h)
Parameters:
  • $xint
  • $yint
  • $wint
  • $hint
grabFocus()
getTextWidth($str)

Return width of str for drawText + current font

Parameters:
  • $str
Returns:

int

getTextHeight()

Return height of one line text with current font

Returns:int
show()
hide()
toggle()
removeSelf()
static getByUid($uid)

Get component by unique id

Parameters:
  • $uidstring
Returns:

php\swing\UIElement