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

Результат: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

Параметры:
  • $name
      • name of event
  • $callbackcallable
  • $groupstring
off($name, $group = NULL)

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

Параметры:
  • $name
  • $groupnull, string
Результат:

bool

trigger($name)

Trigger callback by event name

Параметры:
  • $name
addAllowedEventType($name)

protected

Параметры:
  • $namestring
setAction($name, $callback = null)
Параметры:
  • $namestring
  • $callbackcallable
setInputKey($keyString, $actionName)
Параметры:
  • $keyStringstring
  • $actionNamestring
hasFocus()
Результат:bool
add($component, $index = null)

Add child component

Параметры:
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.

Параметры:
  • $x
  • $y
Результат:

php\swing\UIElement

printOne($canvas)

Prints this component.

Параметры:
printAll($canvas)

Prints this component and all of its subcomponents.

Параметры:
paintOne($canvas)

Paints this component.

Параметры:
paintAll($canvas)

Paints this component and all of its subcomponents.

Параметры:
updateUI()
invalidate()
repaint()
revalidate()
repaintRegion($x, $y, $w, $h)
Параметры:
  • $xint
  • $yint
  • $wint
  • $hint
grabFocus()
getTextWidth($str)

Return width of str for drawText + current font

Параметры:
  • $str
Результат:

int

getTextHeight()

Return height of one line text with current font

Результат:int
show()
hide()
toggle()
removeSelf()
static getByUid($uid)

Get component by unique id

Параметры:
  • $uidstring
Результат:

php\swing\UIElement