UIElement¶
-
php\swing\UIElement
abstract class
Children
- abstract class php\swing\UIContainer
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
¶
- property
border
¶
- property
background
¶
- property
foreground
¶
- property
tooltipText
¶string
- property
doubleBuffered
¶bool
- property
opaque
¶bool
- property
ignoreRepaint
¶bool
- property
autoscrolls
¶bool
- property
uiClassId
¶string
read-only
- property
popupMenu
¶
- property
cursor
¶string
- property
padding
¶php\swing\array [int, int, int, int]
- property
owner
¶
- property
parent
¶
- property
firstParent
¶
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
- $callback – callable
- $group – string
off
($name, $group = NULL)¶Remove all event callbacks (if group == null), or only group
Parameters:
- $name –
- $group – null, string
Returns: bool
trigger
($name)¶Trigger callback by event name
Parameters:
- $name –
addAllowedEventType
($name)¶protected
Parameters:
- $name – string
setAction
($name, $callback = null)¶
Parameters:
- $name – string
- $callback – callable
setInputKey
($keyString, $actionName)¶
Parameters:
- $keyString – string
- $actionName – string
hasFocus
()¶
Returns: bool
add
($component, $index = null)¶Add child component
Parameters:
- $component – php\swing\UIElement
- $index – null, int
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:
printOne
($canvas)¶Prints this component.
Parameters:
- $canvas – php\swing\Graphics
printAll
($canvas)¶Prints this component and all of its subcomponents.
Parameters:
- $canvas – php\swing\Graphics
paintOne
($canvas)¶Paints this component.
Parameters:
- $canvas – php\swing\Graphics
paintAll
($canvas)¶Paints this component and all of its subcomponents.
Parameters:
- $canvas – php\swing\Graphics
updateUI
()¶
invalidate
()¶
repaint
()¶
revalidate
()¶
repaintRegion
($x, $y, $w, $h)¶
Parameters:
- $x – int
- $y – int
- $w – int
- $h – int
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:
- $uid – string
Returns: