Maven module :un.engine : engine-ui :
Class : un.engine.ui.widget.AbstractWidget
Extends/Implements : un.api.layout.AbstractPositionableNode un.api.event.EventListener un.engine.ui.widget.Widget
Subclasses : -

Base widget class.
Extend Widget class to make a container widget.
Extend WLeaf class to make a leaf widget which won't have any children.
Widgets all share common properties which are :


Variables : mouseState
Functions : AbstractWidget, getPropertyValue, getPropertyValue, setPropertyValue, setPropertyValue, setEffectiveExtent, varId, varVisible, varExtents, varReserveSpace, varEffectiveExtent, varEnable, setId, getId, setEnable, isEnable, isStackEnable, isFocused, setFocused, requestFocus, setToolTip, getToolTip, setPopup, getPopup, setLanguage, getLanguage, setCursor, getCursor, getStackCursor, getExtentsInternal, updateExtents, getInnerExtent, getInnerExtent, setFrame, getFrame, getStyle, thisToChars, getFlags, setView, getView, setDirty, setDirty, getOnSreenPosition, getOnSreenPosition, showTooltip, showPopup, getEventClasses, receiveEvent, receiveEventParent, receiveEventChildren, sendPropertyEvent, isMouseOver, isMousePress, addChildren, getEventManager




protected int mouseState


public void AbstractWidget (boolean allowChildren)

protected Object getPropertyValue (Chars name)


Get property value, if value is null the default value is returned.
param  name
param  defaultValue
return
protected Object getPropertyValue (Chars name, Object defaultValue)


Set property value, sends property event if value has changed.
param  name property name
param  value, new value
return  true if value has changed
protected boolean setPropertyValue (Chars name, Object value)


Set property value, sends property event if value has changed.
if the new value is equal to the default value, then the value
will not be stored in the internal properties dictionary.
param  name property name
param  value, new value
param  defaultValue
return  true if value has changed
protected boolean setPropertyValue (Chars name, Object value, Object defaultValue)


{@inheritDoc }
public void setEffectiveExtent (Extent extent)

public Variable varId ()

public Variable varVisible ()

public Variable varExtents ()

public Variable varReserveSpace ()

public Variable varEffectiveExtent ()

public Variable varEnable ()


Set widget id.
param  id not null
public void setId (Chars id)


return  widget id, never null
public Chars getId ()


Set widget state, enable or disable.
param  enable
public void setEnable (boolean enable)


return  true if widget is active
public boolean isEnable ()


search throw parents to find if any of them is disable.
return  true if all parents in the stack are enable.
public boolean isStackEnable ()


Indicate if the widget is focused.
return  true if widget is focused
public boolean isFocused ()


WARNING : INTERNAL USE ONLY, DO NOT CALL IT YOURSELF.
USE method requestFocus.
param  focused
public void setFocused (boolean focused)


Request focus on this widget.
public void requestFocus ()


Set widget tooltip.
param  tooltip, can be null
public void setToolTip (Widget tooltip)


return  popup tooltip, can be null.
public Widget getToolTip ()


Set widget popup.
param  popup, can be null
public void setPopup (Widget popup)


return  popup widget, can be null.
public Widget getPopup ()


Set widget language.
param  language, can not be null
param  recursive, loop on childrens to set language
public void setLanguage (Language language, boolean recursive)


return  language, can not be null.
public Language getLanguage ()


Set widget cursor.
param  cursor, can be null
public void setCursor (Cursor cursor)


return  cursor can be null.
public Cursor getCursor ()


search throw parents to find the first cursor
return  Cursor, can be null
public Cursor getStackCursor ()

protected void getExtentsInternal (Extents buffer, Extent constraint)


WARNING : INTERNAL USE ONLY, DO NOT CALL IT YOURSELF.
Reaffect extents which are not overridden.
public boolean updateExtents ()


The widget effective inner bounding box, excluding margins and overlaps.
return  BoundingBox
public BBox getInnerExtent ()

public BBox getInnerExtent (Widget widget, Extent extent)


INTERNAL USE ONLY, DO NOT CALL THIS METHOD YOURSELF !
param  frame
public void setFrame (Frame frame)

public Frame getFrame ()


Style definition,
return
public WStyle getStyle ()

public Chars thisToChars ()


Flags are similar to CSS style classes.
It is a list of Chars mainly used to mark widgets.
return  Set, never null
public Set getFlags ()



public void setView (View view)

public View getView ()

public void setDirty ()


Set dirty.
param  dirtyArea
public void setDirty (BBox dirtyArea)



public Tuple getOnSreenPosition (Widget child)

public Tuple getOnSreenPosition ()


Force showing tooltip.
public void showTooltip ()


Force showing popup.
public void showPopup ()


All widgets provide at least events of type :
public Class[] getEventClasses ()


Catch event from children if rerendering is needed.
param  event
public void receiveEvent (Event event)

protected void receiveEventParent (Event event)

protected void receiveEventChildren (Event event)

protected void sendPropertyEvent (EventSource source, Chars name, Object oldValue, Object newValue)



public boolean isMouseOver ()

public boolean isMousePress ()



protected void addChildren (int index, Object[] array)


FOR INTERNAL USE ONLY.
return
public EventManager getEventManager ()