Class jls.gui.Element

This class represents a graphical element.
Defined in: Element.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
jls.gui.Element(parameters, parent)
Creates an element.
Method Summary
Method Attributes Method Name and Description
 
addChild(child)
Adds a child.
 
addChildren(children)
Adds children.
 
Destroys this element.
 
Returns an attribute.
 
getChild(index)
Gets a child.
 
Returns all children.
 
Returns the layout associated with this element.
 
Returns the element style.
<static>  
jls.gui.Element.invokeAndWait(fn)
Calls a function synchronously in the GUI message thread.
<static>  
jls.gui.Element.invokeLater(fn)
Calls a function asynchronously in the GUI message thread.
 
observe(type, handler)
Register an event handler.
 
removeChild(child)
Removes a child.
 
Removes all children.
 
setAttribute(key, value)
Sets an attribute.
 
setAttributes(attributes)
Sets some attributes.
 
setLayout(layout)
Sets the layout for this element.
 
unobserve(type, handler)
Unregister an event handler.
Class Detail
jls.gui.Element(parameters, parent)
Creates an element.
Parameters:
{Object} parameters Optional
The element parameter.
{Object} parameters.attributes Optional
The element attributes.
{Object} parameters.style Optional
The element style.
{Array} parameters.children Optional
The element children.
{jls.gui.Element} parent Optional
The parent.
Method Detail
addChild(child)
Adds a child.
Parameters:
{Object} child
The child to add.

addChildren(children)
Adds children.
Parameters:
{Object} children
The children to add.

destroy()
Destroys this element.

{String} getAttribute(key)
Returns an attribute.
Parameters:
{String} key
The attribute key.
Returns:
{String} The attribute value.

{Object} getChild(index)
Gets a child.
Parameters:
{Number} index
The child index.
Returns:
{Object} The child.

getChildren()
Returns all children.

{jls.gui.Layout} getLayout()
Returns the layout associated with this element.
Returns:
{jls.gui.Layout} The element layout or null if there is no layout.

{jls.gui.Style} getStyle()
Returns the element style.
Returns:
{jls.gui.Style} The element style.

<static> {Object} jls.gui.Element.invokeAndWait(fn)
Calls a function synchronously in the GUI message thread.
Parameters:
{Function} fn
The function to call.
Returns:
{Object} The function result if any.

<static> jls.gui.Element.invokeLater(fn)
Calls a function asynchronously in the GUI message thread.
Parameters:
{Function} fn
The handler to unregister.

{Function} observe(type, handler)
Register an event handler.
Parameters:
{String} type
The event type to observe.
{Function} handler
The handler to register.
Returns:
{Function} The handler.

removeChild(child)
Removes a child.
Parameters:
{Object} child
The child to remove.

removeChildren()
Removes all children.

setAttribute(key, value)
Sets an attribute.
Parameters:
{String} key
The attribute key.
{String} value
The attribute value.

setAttributes(attributes)
Sets some attributes.
Parameters:
{Object} attributes
The attributes to set.

setLayout(layout)
Sets the layout for this element.
Parameters:
{jls.gui.Layout} layout
The layout to associate to this element.

{Array} unobserve(type, handler)
Unregister an event handler.
Parameters:
{String} type
The event type to unregister.
{Function} handler
The handler to unregister.
Returns:
{Array} The removed handlers.

Documentation generated by JsDoc Toolkit 2.3.2 on Sat Jan 08 2011 02:00:12 GMT+0100 (CET)