public abstract class nUIDisplayObject extends nUIObject
Modifier and Type | Field and Description |
---|---|
static int |
COLOR_BACKGROUND_NORMAL |
static int |
COLOR_BLACK |
static int |
COLOR_FOREGROUND_DARK |
static int |
COLOR_FOREGROUND_LIGHT |
static int |
COLOR_FOREGROUND_NORMAL |
static int |
COLOR_TRANSPARENT |
static int |
COLOR_WHITE |
static int |
DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
If the width is set to this, an object will be as wide/high as its parent inner
|
event_listener, event_listener_exclusive, first_child, last_child, next_sibling, nuiid, parent, prev_sibling, unlink_children_on_removal_from_parent
Constructor and Description |
---|
nUIDisplayObject(int nuiid) |
Modifier and Type | Method and Description |
---|---|
IBackgroundDrawable |
getBackgroundDrawable()
Gets the
IBackgroundDrawable responsible for defining how this element is drawn. |
int |
getBgcolor()
Deprecated.
Use
getBackgroundDrawable() instead. |
int |
getBottom()
Gets the bottom of this object relative to the parent's y position.
|
boolean |
getFocus()
Deprecated.
|
boolean |
getFocusable()
Gets whether or not this object is focusable.
|
int |
getGesturable() |
int |
getHeight()
Gets the height of this object.
|
int |
getInnerHeight() |
int |
getInnerWidth() |
int |
getInnerX()
Gets the x-position of the internal bounding box, relative to getX().
|
int |
getInnerY()
Gets the y-position of the internal bounding box, relative to getY().
|
int |
getLeft()
Equivalent to
getX() |
int |
getMaxChildX()
Returns the rightmost .Right() value from all children objects
|
int |
getMaxChildY()
Returns the bottommost .Bottom() value from all children objects
|
int |
getRight()
Gets the position of the right-hand edge of this object, relative to the parent object's x position.
|
int |
getScreenInnerX() |
int |
getScreenInnerY() |
int |
getScreenX()
Gets the literal on-screen x-position of this object.
|
int |
getScreenY()
Gets the literal on-screen y-position of this object.
|
int |
getTop()
Equivalent to
getY() |
nUIViewDisplay |
getTopLevelParentView()
Returns the top level view that contains this object
|
nUIWindowDisplay |
getTopLevelParentWindow()
Returns the top level window that contains this object
|
boolean |
getTriggerable()
Determines if this object can be triggered.
|
int |
getWidth()
Gets the width of this object in pixels.
|
int |
getX()
Gets the current x position of this object relative to its parent's internal bounding box.
|
int |
getY()
Gets the current y-position of this object relative to its parent's internal bounding box.
|
boolean |
insertAtInternal(int index,
nUIObject to_add)
The first focusable (non-nUINavView) nUIDisplayObject added should become the focused child
|
boolean |
isEnabled() |
void |
onRemoved()
The method will be called immediately after this object has has been
removed from its parent.
|
boolean |
remove(nUIObject to_remove)
Remove a child nUIObject from this one.
|
void |
setBackgroundDrawable(IBackgroundDrawable background)
Set the
IBackgroundDrawable responsible for
handling how the background of this element is drawn. |
void |
setBgcolor(int bgcolor)
Deprecated.
Use
setBackgroundDrawable() instead. |
void |
setBottom(int bottom)
Sets the bottom of this object relative to the parent's y position.
|
void |
setChildFocus(nUIDisplayObject object)
Deprecated.
|
void |
setEnabled(boolean enabled) |
void |
setFocus(boolean focus)
Deprecated.
|
void |
setFocusable(boolean focusable) |
void |
setGesturable(int enabled_gestures) |
void |
setHeight(int height)
Sets the pixel height of this object.
|
void |
setInnerHeight(int inner_height) |
void |
setInnerWidth(int inner_width) |
void |
setInnerX(int inner_x)
Delta from the getX position to our internal bounding box
|
void |
setInnerY(int inner_y)
Delta from the getY position to our internal bounding box
|
void |
setLeft(int left)
Equivalent to
setX(left) . |
void |
setRight(int right)
Sets the right hand edge of this object, relative to the parent object's x position.
|
void |
setTop(int top)
Equivalent to
setY(top) |
void |
setTriggerable(boolean triggerable)
Sets an object as triggerable.
|
void |
setWidth(int width)
Sets the pixel width of this object.
|
void |
setX(int x)
Sets the current x-position of this object relative to its parent's internal bounding box.
|
void |
setY(int y)
Sets the current y-position of this object relative to its parent's internal bounding box.
|
add, addEventListener, childElementAt, childIndexOf, getTag, insertAfter, insertAt, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setTag
public static final int COLOR_TRANSPARENT
public static final int COLOR_BLACK
public static final int COLOR_WHITE
public static final int COLOR_FOREGROUND_NORMAL
public static final int COLOR_FOREGROUND_LIGHT
public static final int COLOR_FOREGROUND_DARK
public static final int COLOR_BACKGROUND_NORMAL
public static final int DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
public nUIDisplayObject(int nuiid)
nuiid
- Unique Native UI ID (or -1 if unidentified)public void onRemoved()
nUIObject
unlink_children_on_removal_from_parent
is set to
false
, references to children will be retained.public void setBgcolor(int bgcolor)
setBackgroundDrawable()
instead.bgcolor
- This is an AARRGGBB value.public int getBgcolor()
getBackgroundDrawable()
instead.public void setBackgroundDrawable(IBackgroundDrawable background)
IBackgroundDrawable
responsible for
handling how the background of this element is drawn.background
- The IBackgroundDrawable
that is used to
define the background of this element.public IBackgroundDrawable getBackgroundDrawable()
IBackgroundDrawable
responsible for defining how this element is drawn.IBackgroundDrawable
that is responsible for drawing this background.public void setEnabled(boolean enabled)
public boolean isEnabled()
public void setX(int x)
x
- public int getX()
public void setLeft(int left)
setX(left)
.public int getLeft()
getX()
public void setY(int y)
public int getY()
public void setTop(int top)
setY(top)
public int getTop()
getY()
public void setWidth(int width)
width
- Width in pixelsjava.lang.IllegalArgumentException
- if width is less than or equal to 0 and not equal to DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONSpublic int getWidth()
public void setRight(int right)
public int getRight()
public void setHeight(int height)
height
- height in pixelsjava.lang.IllegalArgumentException
- if height is less than or equal to 0 and not equal to DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONSpublic int getHeight()
public void setBottom(int bottom)
public int getBottom()
public void setInnerX(int inner_x)
public int getInnerX()
public void setInnerY(int inner_y)
public int getInnerY()
public void setInnerWidth(int inner_width)
public int getInnerWidth()
public void setInnerHeight(int inner_height)
public int getInnerHeight()
public int getScreenX()
public int getScreenY()
public int getScreenInnerX()
public int getScreenInnerY()
public void setGesturable(int enabled_gestures)
enabled_gestures
- bitflag representing which gestures should be enabled for this object, using the gesture values in nUIConstantspublic int getGesturable()
public void setFocusable(boolean focusable)
public boolean getFocusable()
public void setFocus(boolean focus)
focus
- true
if this object should have focus.public boolean getFocus()
public void setTriggerable(boolean triggerable)
nUIConstants.EVT_TRIGGER
when touched or otherwise activated.triggerable
- public boolean getTriggerable()
public boolean insertAtInternal(int index, nUIObject to_add)
public void setChildFocus(nUIDisplayObject object)
object
- The new focus objectpublic boolean remove(nUIObject to_remove)
nUIObject
public nUIWindowDisplay getTopLevelParentWindow()
public nUIViewDisplay getTopLevelParentView()
public int getMaxChildX()
public int getMaxChildY()