public abstract class nUIObject
extends java.lang.Object
Constructor and Description |
---|
nUIObject() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(nUIObject to_add)
Add a nUIObject as a child of this one.
|
void |
addEventListener(nUIEventListener listener,
boolean exclusive)
Adds a new event-listener, replacing any previously defined listener
|
nUIObject |
childElementAt(int index)
Gets the child nUIObject at a given index (starting from 0).
|
int |
childIndexOf(nUIObject object)
Find the index of this nUIObject inside its parent.
|
nUIObject |
getFirstChild() |
int |
getId()
Returns an ID for the particular element.
|
nUIObject |
getLastChild() |
nUIObject |
getNextSibling() |
nUIObject |
getParent() |
nUIObject |
getPrevSibling() |
java.lang.Object |
getTag()
Gets user-defined data
|
boolean |
insertAfter(nUIObject object,
nUIObject to_add)
Insert a nUIObject as a child of this one, and place it after an existing child.
|
boolean |
insertAt(int index,
nUIObject to_add)
Insert a nUIObject as a child of this one, at the given index.
|
boolean |
insertBefore(nUIObject object,
nUIObject to_add)
Insert a nUIObject as a child of this one, and place it before an existing child.
|
void |
onRemoved()
The method will be called immediately after this object has has been
removed from its parent.
|
void |
outputChildHierarchy(java.lang.String prefix,
boolean dimensions)
Debugs to the console the hierarchy of this object and all its children
|
boolean |
remove(int index)
Remove a child nUIObject from this one.
|
boolean |
remove(nUIObject to_remove)
Remove a child nUIObject from this one.
|
void |
removeEventListener(nUIEventListener listener)
Removes an existing event-listener
|
boolean |
replace(int index,
nUIObject to_add)
Replace the child nUIObject at a given index.
|
boolean |
replace(nUIObject object,
nUIObject to_add)
Replace a current child of this nUIObject with another nUIObject.
|
void |
setId(int id)
Sets an ID for the particular element.
|
void |
setTag(java.lang.Object tag)
Sets user-defined data
|
void |
setUnlinkChildrenOnRemoval(boolean unlinkChildren) |
public nUIObject getFirstChild()
public nUIObject getLastChild()
public nUIObject getParent()
public nUIObject getPrevSibling()
public nUIObject getNextSibling()
public void setUnlinkChildrenOnRemoval(boolean unlinkChildren)
public void setId(int id)
public int getId()
public java.lang.Object getTag()
public void setTag(java.lang.Object tag)
tag
- public nUIObject childElementAt(int index)
null
will be returned.index
- the index of the child element to get.public int childIndexOf(nUIObject object)
object
- the nUIObject to find.public boolean add(nUIObject to_add)
to_add
- the child nUIObject to add.public boolean insertAt(int index, nUIObject to_add)
index
- The index to add a new objectto_add
- The new object to addpublic void onRemoved()
unlink_children_on_removal_from_parent
is set to
false
, references to children will be retained.public boolean remove(nUIObject to_remove)
to_remove
- the nUIObject to remove.public boolean remove(int index)
index
- the index of the nUIObjectpublic boolean insertBefore(nUIObject object, nUIObject to_add)
object
- the object to insert beforeto_add
- the object to addpublic boolean insertAfter(nUIObject object, nUIObject to_add)
object
- the nUIObject to insert afterto_add
- the new nUIObject to add.public boolean replace(nUIObject object, nUIObject to_add)
object
- the child nUIObject to replaceto_add
- the new nUIObejct to insertpublic boolean replace(int index, nUIObject to_add)
index
- the index of the child to replace.to_add
- the new nUIObject to insert.public void addEventListener(nUIEventListener listener, boolean exclusive)
listener
- The new listenerexclusive
- If only this listener should be called (not the generic listener)public void removeEventListener(nUIEventListener listener)
listener
- The listener to removepublic void outputChildHierarchy(java.lang.String prefix, boolean dimensions)
prefix
- String prefix to prepend to output - will be appended with ">" for each depthdimensions
- Should x/y/w/h dimensions by output