Modifier and Type | Field and Description |
---|---|
static int |
MAX_EXTRA_FIELDS
The maximum number of extra fields.
|
Constructor and Description |
---|
EditableStyle()
Creates an editable style from the default style.
|
EditableStyle(EditableStyle style)
Creates an editable style from an other one.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
Background |
getBackground()
Gets the background.
|
Outline |
getBorder()
Gets the border.
|
int |
getColor()
Gets the color.
|
Dimension |
getDimension()
Gets the dimension.
|
float |
getExtraFloat(int fieldId,
float defaultValue)
Gets an extra field as a float.
|
int |
getExtraInt(int fieldId,
int defaultValue)
Gets an extra field as an int.
|
<T> T |
getExtraObject(int fieldId,
java.lang.Class<T> clazz,
T defaultValue)
Gets an extra field as an object of the given type.
|
ej.microui.display.Font |
getFont()
Gets the font.
|
int |
getHorizontalAlignment()
Gets the horizontal alignment.
|
Outline |
getMargin()
Gets the margin.
|
Outline |
getPadding()
Gets the padding.
|
int |
getVerticalAlignment()
Gets the vertical alignment.
|
int |
hashCode() |
void |
setBackground(Background background)
Sets the background.
|
void |
setBorder(Outline border)
Sets the border.
|
void |
setColor(int color)
Sets the color.
|
void |
setDimension(Dimension dimension)
Sets the dimension.
|
void |
setExtraFloat(int fieldId,
float fieldValue)
Sets an extra field to the given float value.
|
void |
setExtraInt(int fieldId,
int fieldValue)
Sets an extra field to the given int value.
|
void |
setExtraObject(int fieldId,
java.lang.Object fieldValue)
Sets an extra field to the given object value.
|
void |
setFont(ej.microui.display.Font font)
Sets the font.
|
void |
setHorizontalAlignment(int horizontalAlignment)
Sets the horizontal alignment.
|
void |
setMargin(Outline margin)
Sets the margin.
|
void |
setPadding(Outline padding)
Sets the padding.
|
void |
setVerticalAlignment(int verticalAlignment)
Sets the vertical alignment.
|
protected static void |
validateExtraFieldId(int fieldId)
Validates that the extra field ID is correct.
|
public static final int MAX_EXTRA_FIELDS
public EditableStyle()
public EditableStyle(EditableStyle style)
style
- the editable style to copy.public Dimension getDimension()
Style
getDimension
in interface Style
public int getHorizontalAlignment()
Style
getHorizontalAlignment
in interface Style
public int getVerticalAlignment()
Style
getVerticalAlignment
in interface Style
public Outline getPadding()
Style
getPadding
in interface Style
public Background getBackground()
Style
getBackground
in interface Style
public int getColor()
Style
public ej.microui.display.Font getFont()
Style
public <T> T getExtraObject(int fieldId, java.lang.Class<T> clazz, T defaultValue)
Style
getExtraObject
in interface Style
T
- the type of the extra field.fieldId
- the ID of the extra field.clazz
- the type of the extra field.defaultValue
- the value to return if the extra field is not set or if it does not match the given type.public int getExtraInt(int fieldId, int defaultValue)
Style
getExtraInt
in interface Style
fieldId
- the ID of the extra field.defaultValue
- the value to return if the extra field is not set or if it is not an integer.public float getExtraFloat(int fieldId, float defaultValue)
Style
getExtraFloat
in interface Style
fieldId
- the ID of the extra field.defaultValue
- the value to return if the extra field is not set or if it is not a float.public void setDimension(Dimension dimension)
dimension
- the dimension.public void setHorizontalAlignment(int horizontalAlignment)
Alignment.LEFT
,
Alignment.HCENTER
or Alignment.RIGHT
).horizontalAlignment
- the horizontal alignment.java.lang.IllegalArgumentException
- if the horizontal alignment is not valid.Alignment.validateHorizontalAlignment(int)
public void setVerticalAlignment(int verticalAlignment)
Alignment.TOP
,
Alignment.VCENTER
or Alignment.BOTTOM
).verticalAlignment
- the vertical alignment.java.lang.IllegalArgumentException
- if the vertical alignment is not valid.Alignment.validateVerticalAlignment(int)
public void setMargin(Outline margin)
margin
- the margin.public void setBorder(Outline border)
border
- the border.public void setPadding(Outline padding)
padding
- the padding.public void setBackground(Background background)
background
- the background.public void setColor(int color)
color
- the color.public void setFont(ej.microui.display.Font font)
font
- the font.public void setExtraObject(int fieldId, java.lang.Object fieldValue)
fieldId
- the ID of the extra field.fieldValue
- the value of the extra field.java.lang.IllegalArgumentException
- if the given ID is not within the [0, 6] interval.public void setExtraInt(int fieldId, int fieldValue)
fieldId
- the ID of the extra field.fieldValue
- the value of the extra field.java.lang.IllegalArgumentException
- if the given ID is not within the [0, 6] interval.public void setExtraFloat(int fieldId, float fieldValue)
fieldId
- the ID of the extra field.fieldValue
- the value of the extra field.java.lang.IllegalArgumentException
- if the given ID is not within the [0, 6] interval.protected static void validateExtraFieldId(int fieldId)
fieldId
- the ID to validate.java.lang.IllegalArgumentException
- if the given ID is not within the [0, 6] interval.public boolean equals(@Nullable java.lang.Object obj)