UIElement¶
-
php\swing\UIElement abstract class
Children
- abstract class php\swing\UIContainer
Properties
- property
uid¶
stringread-only
- property
group¶
string
- property
x¶
intPosition X
- property
y¶
intPosition Y
- property
w¶
intWidth
- property
h¶
intHeight
- property
size¶
arraySize (width and height), [int, int]
- property
preferredSize¶
php\swing\array [int, int]
- property
minSize¶
arrayMin Size (width and height) [int, int]
- property
autosize¶
bool
- property
position¶
arrayPosition (x and y), [int, int]
- property
screenPosition¶
arrayScreen Position (x and y), [int, int]
- property
absolutePosition¶
arrayread-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¶
stringread-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
Результат: 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
- $callback –
callable- $group –
string
off($name, $group = NULL)¶Remove all event callbacks (if group == null), or only group
Параметры:
- $name –
- $group –
null,stringРезультат:
bool
trigger($name)¶Trigger callback by event name
Параметры:
- $name –
addAllowedEventType($name)¶protected
Параметры:
- $name –
string
setAction($name, $callback = null)¶
Параметры:
- $name –
string- $callback –
callable
setInputKey($keyString, $actionName)¶
Параметры:
- $keyString –
string- $actionName –
string
hasFocus()¶
Результат: bool
add($component, $index = null)¶Add child component
Параметры:
- $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.
Параметры:
- $x –
- $y –
Результат:
printOne($canvas)¶Prints this component.
Параметры:
- $canvas – php\swing\Graphics
printAll($canvas)¶Prints this component and all of its subcomponents.
Параметры:
- $canvas – php\swing\Graphics
paintOne($canvas)¶Paints this component.
Параметры:
- $canvas – php\swing\Graphics
paintAll($canvas)¶Paints this component and all of its subcomponents.
Параметры:
- $canvas – php\swing\Graphics
updateUI()¶
invalidate()¶
repaint()¶
revalidate()¶
repaintRegion($x, $y, $w, $h)¶
Параметры:
- $x –
int- $y –
int- $w –
int- $h –
int
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
Параметры:
- $uid –
stringРезультат: