public abstract class UIObject extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ALIGN_BOTTOM
bottom align
|
static int |
ALIGN_CENTER
center align (used in both horizontal and vertical direction)
|
static int |
ALIGN_DEFAULT
default align
|
static int |
ALIGN_LEFT
left align
|
static int |
ALIGN_RIGHT
right align
|
static int |
ALIGN_TOP
top align
|
protected com.joshvm.ui.UIObjectImpl |
objImpl |
static int |
SIDE_BOTTOM
bottom side
|
static int |
SIDE_FULL
all sides
|
static int |
SIDE_LEFT
left side
|
static int |
SIDE_RIGHT
right side
|
static int |
SIDE_TOP
top side
|
static int |
SIZE_CONTENT
Special value for the width or height of ui object.
|
static int |
TEXT_DECOR_NONE
no decoration for text
|
static int |
TEXT_DECOR_STRIKETHROUGH
draw strikethrough for text
|
static int |
TEXT_DECOR_UNDERLINE
draw underline for text
|
Modifier | Constructor and Description |
---|---|
protected |
UIObject(com.joshvm.ui.UIObjectImpl obj) |
Modifier and Type | Method and Description |
---|---|
void |
enableClipCorner(boolean enabled)
Enables to clip the overflowed content on the rounded corner.
|
void |
forceNewTrack(boolean force)
Sets flex new track property of the object.
|
Color |
getBackgroundColor()
Gets background color of the object
|
Color |
getBorderColor()
Gets border color of the object
|
int |
getBorderWidth()
Gets border width of the object.
|
int |
getColumnPadding()
Gets the padding between the columns
|
Area |
getCoordinates()
Gets the coordinates of the object
|
int |
getFlexGrow()
Gets flex grow value of the object.
|
int |
getHeight()
Gets the height of the object.
|
int |
getMaxHeight()
Gets the maximal height of the object.
|
int |
getMaxWidth()
Gets the maximal width of the object.
|
int |
getMinHeight()
Gets the minimal height of the object.
|
int |
getMinWidth()
Gets the minimal width of the object.
|
String |
getName()
Gets the name of the object
|
int |
getPadding(int side)
Gets the padding on specified side.
|
protected UIObject |
getParent() |
protected boolean |
getPropertyBooleanValue(int prop) |
protected int |
getPropertyIntValue(int prop) |
int |
getRadius()
Gets the radius on every corner.
|
int |
getRowPadding()
Gets the padding between the rows
|
Color |
getShadowColor()
Gets shadow color of the object
|
int |
getShadowOffsetX()
Gets the offset on the shadow in X direction.
|
int |
getShadowOffsetY()
Gets the offset on the shadow in X direction.
|
int |
getShadowWidth()
Gets shadow width of the object.
|
Color |
getTextColor()
Gets the color of text of the object.
|
int |
getTextLetterSpace()
Gets the letter space of text of the object
|
int |
getTextLineSpace()
Gets the line space of text of the object
|
int |
getTranslateX()
Returns translate value in X direction
|
int |
getTranslateY()
Returns translate value in Y direction
|
Object |
getUserData()
Gets user data
|
int |
getWidth()
Gets the width of the object.
|
int |
getX()
Gets the X coordinate of the object.
|
int |
getY()
Gets the Y coordinate of the object.
|
boolean |
isClipCornerEnabled()
Returns if enable to clip the overflowed content on the rounded corner.
|
void |
setAlign(int hAlign,
int vAlign)
Changes the alignment of the object to its parent.
|
void |
setBackgroundColor(Color color)
Sets background color of the object
|
void |
setBorderColor(Color color)
Sets border color of the object
|
void |
setBorderWidth(int width)
Sets border width of the object.
|
void |
setColumnPadding(int padding)
Sets the padding between the columns
|
void |
setFlexGrow(int value)
Sets flex grow value of the object.
|
void |
setHeight(int h)
Sets the height of the object.
|
void |
setMaxHeight(int h)
Sets a maximal height of the object.
|
void |
setMaxWidth(int w)
Sets a maximal width of the object.
|
void |
setMinHeight(int h)
Sets a minimal height of the object.
|
void |
setMinWidth(int w)
Sets a minimal width of the object.
|
void |
setName(String name)
Sets the name of the object.
|
void |
setPadding(int padding)
Sets the padding on all sides.
|
void |
setPadding(int side,
int padding)
Sets the padding on specified sides.
|
protected void |
setParent(UIObject parent) |
void |
setPos(int x,
int y)
Sets the X coordinate and Y coordinate of the object considering the set
align.
|
protected void |
setPropertyValue(int prop,
boolean value) |
protected void |
setPropertyValue(int prop,
int value) |
protected void |
setPropertyValue(int prop,
int value1,
int value2) |
protected void |
setPropertyValue(int prop,
Object value) |
void |
setRadius(int radius)
Sets the radius on every corner.
|
void |
setRecolor(Color color)
Sets the color to mix to image of the object.
|
void |
setRowPadding(int padding)
Sets the padding between the rows
|
void |
setShadowColor(Color color)
Sets shadow color of the object
|
void |
setShadowOffsetX(int offsetX)
Sets an offset on the shadow in X direction.
|
void |
setShadowOffsetY(int offsetY)
Sets an offset on the shadow in Y direction.
|
void |
setShadowWidth(int width)
Sets shadow width of the object.
|
void |
setSize(int width,
int height)
Sets the width and height of the object.
|
void |
setTextAlign(int align)
Sets how to align the lines of the text of the object.
|
void |
setTextColor(Color color)
Sets the color of text of the object.
|
void |
setTextDecor(int decor)
Set decoration for the text of the object.
|
void |
setTextFont(Font font)
Sets the font of the text of the object.
|
void |
setTextLetterSpace(int space)
Sets the letter space of text of the object
|
void |
setTextLineSpace(int space)
Sets the line space of text of the object
|
void |
setTranslateX(int translateX)
Move the object with this value in X direction.
|
void |
setTranslateY(int translateY)
Move the object with this value in Y direction.
|
void |
setUserData(Object data)
Sets user data of the object
|
void |
setWidth(int w)
Sets the width of the object.
|
void |
setX(int x)
Sets the X coordinate of the object considering the set align.
|
void |
setY(int y)
Sets the Y coordinate of the object considering the set align.
|
public static final int SIDE_LEFT
public static final int SIDE_RIGHT
public static final int SIDE_TOP
public static final int SIDE_BOTTOM
public static final int SIDE_FULL
public static final int SIZE_CONTENT
Special value for the width or height of ui object.
SIZE_CONTENT means that the object will auto change its width or height to fit its own internal content.public static final int ALIGN_DEFAULT
public static final int ALIGN_LEFT
public static final int ALIGN_TOP
public static final int ALIGN_CENTER
public static final int ALIGN_RIGHT
public static final int ALIGN_BOTTOM
public static final int TEXT_DECOR_NONE
public static final int TEXT_DECOR_UNDERLINE
public static final int TEXT_DECOR_STRIKETHROUGH
protected com.joshvm.ui.UIObjectImpl objImpl
protected void setParent(UIObject parent)
protected UIObject getParent()
public void setName(String name)
name
- the new name of the objectpublic String getName()
setName(java.lang.String)
public void setUserData(Object data)
data
- additional info that user may setpublic Object getUserData()
setUserData(java.lang.Object)
protected void setPropertyValue(int prop, int value)
protected void setPropertyValue(int prop, boolean value)
protected void setPropertyValue(int prop, int value1, int value2)
protected void setPropertyValue(int prop, Object value)
protected int getPropertyIntValue(int prop)
protected boolean getPropertyBooleanValue(int prop)
public void setBackgroundColor(Color color)
color
- Color instanceColor
public Color getBackgroundColor()
setBackgroundColor
. Color values
may be resampled to reflect the display capabilities of the device.public void setBorderWidth(int width)
width
- in pixels.public int getBorderWidth()
public void setBorderColor(Color color)
color
- Color instancepublic Color getBorderColor()
public void setShadowWidth(int width)
width
- in pixels. should >= 0public int getShadowWidth()
public void setShadowColor(Color color)
color
- Color instancepublic Color getShadowColor()
public void setShadowOffsetX(int offsetX)
offsetX
- in pixels.public int getShadowOffsetX()
public void setShadowOffsetY(int offsetY)
offsetY
- in pixels.public int getShadowOffsetY()
public void setRadius(int radius)
radius
- in pixels.public int getRadius()
public void enableClipCorner(boolean enabled)
enabled
- true or falsepublic boolean isClipCornerEnabled()
public void setWidth(int w)
w
- width in pixels or SIZE_CONTENT.SIZE_CONTENT
public int getWidth()
Gets the width of the object.
Returns actual width in pixels in default state.public void setHeight(int h)
h
- height in pixels or SIZE_CONTENT.SIZE_CONTENT
public int getHeight()
Gets the height of the object.
Returns actual height in pixels in default state.public void setMinWidth(int w)
w
- width in pixelspublic int getMinWidth()
public void setMaxWidth(int w)
w
- width in pixelspublic int getMaxWidth()
public void setMinHeight(int h)
h
- height in pixelspublic int getMinHeight()
public void setMaxHeight(int h)
h
- height in pixelspublic int getMaxHeight()
public void setPadding(int padding)
Padding is the spacing between the parent's sides and the children and among the children.
padding
- in pixels.public void setPadding(int side, int padding)
side
- a combination of SIDE_LEFT
, SIDE_RIGHT
,
SIDE_TOP
and SIDE_BOTTOM
padding
- in pixels.public int getPadding(int side)
side
- SIDE_LEFT
or SIDE_RIGHT
or SIDE_TOP
or SIDE_BOTTOM
public void setX(int x)
x
- in pixels.public int getX()
public void setY(int y)
y
- in pixels.public int getY()
public void setSize(int width, int height)
width
- width in pixels or SIZE_CONTENT.height
- height in pixels or SIZE_CONTENT.SIZE_CONTENT
public void setPos(int x, int y)
x
- X coordinate in pixels.y
- Y coordinate in pixels.public Area getCoordinates()
public void setAlign(int hAlign, int vAlign)
hAlign
- alignment in horizontal direction.ALIGN_DEFAULT
or ALIGN_LEFT
or
ALIGN_CENTER
or ALIGN_RIGHT
vAlign
- alignment in vertical direction.ALIGN_DEFAULT
or ALIGN_TOP
or
ALIGN_CENTER
or ALIGN_BOTTOM
public void setTranslateX(int translateX)
translateX
- in pixels.public int getTranslateX()
public void setTranslateY(int translateY)
translateY
- in pixels.public int getTranslateY()
public void setRecolor(Color color)
color
- Color instancepublic void setTextColor(Color color)
color
- Color instancepublic Color getTextColor()
public void setTextLetterSpace(int space)
space
- in pixels.public int getTextLetterSpace()
public void setTextLineSpace(int space)
space
- in pixels.public int getTextLineSpace()
public void setTextAlign(int align)
align
- ALIGN_DEFAULT
or ALIGN_LEFT
or
ALIGN_CENTER
or ALIGN_RIGHT
public void setTextFont(Font font)
font
- Font instanceFont
public void setTextDecor(int decor)
decor
- a combination of TEXT_DECOR_NONE
,
TEXT_DECOR_UNDERLINE
and
TEXT_DECOR_STRIKETHROUGH
public void setFlexGrow(int value)
value
- >= 0Flex
public int getFlexGrow()
public void forceNewTrack(boolean force)
force
- true to enable, false to disablepublic void setRowPadding(int padding)
padding
- >= 0public int getRowPadding()
public void setColumnPadding(int padding)
padding
- >= 0public int getColumnPadding()