public class Style extends Object
Each Component contains a Style Object and allows Style modification in Runtime
by Using cmp.getStyle()
The style is also used in Themeing, when a Theme is Changed the Styles Objects are been
updated automatically.
When changing a theme the elements changed manually in a style will not be updated by the theme change by default. There are two ways to change that behavior:
The Margin and Padding is inspired by W3 Box Model
************************** * Margin * * ******************** * * * Padding * * * * *********** * * * * * Content * * * * * *********** * * * * Padding * * * ******************** * * Margin * **************************
Styles fire a change event for each style change that occurs. Component
listens to all changes events
of its styles, and adjusts some of its properties accordingly. Currently (as of 6.0) each style change will trigger
a Container.revalidate()
call on the Style's Component's parent container, which is expensive. You can disable this
Container.revalidate()
call by calling CN.setProperty("Component.revalidateOnStyleChange", "false"). This will
likely be the default behavior in a future version, so we recommend you disable this explicitly for both performance reasons, and
to avoid regressions when the default is changed.
Modifier and Type | Field and Description |
---|---|
static String |
ALIGNMENT
Alignment attribute for the style event
|
static String |
BACKGROUND_ALIGNMENT
Background attribute name for the theme hashtable
|
static String |
BACKGROUND_GRADIENT
Background attribute name for the theme hashtable
|
static byte |
BACKGROUND_GRADIENT_LINEAR_HORIZONTAL
Indicates the background for the style would use a linear gradient
|
static byte |
BACKGROUND_GRADIENT_LINEAR_VERTICAL
Indicates the background for the style would use a linear gradient
|
static byte |
BACKGROUND_GRADIENT_RADIAL
Indicates the background for the style would use a radial gradient
|
static byte |
BACKGROUND_IMAGE_ALIGNED_BOTTOM
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_ALIGNED_BOTTOM_LEFT
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_ALIGNED_BOTTOM_RIGHT
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_ALIGNED_CENTER
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_ALIGNED_LEFT
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_ALIGNED_RIGHT
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_ALIGNED_TOP
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_ALIGNED_TOP_LEFT
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_ALIGNED_TOP_RIGHT
Indicates the background for the style would use an unscaled image with an alignment
|
static byte |
BACKGROUND_IMAGE_SCALED
Indicates the background for the style would use a scaled image
|
static byte |
BACKGROUND_IMAGE_SCALED_FILL
Indicates the background for the style would use a scaled image that fills all available space while
maintaining aspect ratio
|
static byte |
BACKGROUND_IMAGE_SCALED_FIT
Indicates the background for the style would use a scaled image that fits to available space while
maintaining aspect ratio
|
static byte |
BACKGROUND_IMAGE_TILE_BOTH
Indicates the background for the style would use a tiled image on both axis
|
static byte |
BACKGROUND_IMAGE_TILE_HORIZONTAL
Indicates the background for the style would use a horizontal tiled image
|
static byte |
BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_BOTTOM
Indicates the background for the style would use a horizontal tiled image
|
static byte |
BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_CENTER
Indicates the background for the style would use a horizontal tiled image
|
static byte |
BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_TOP
Indicates the background for the style would use a horizontal tiled image
|
static byte |
BACKGROUND_IMAGE_TILE_VERTICAL
Indicates the background for the style would use a vertical tiled image
|
static byte |
BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_CENTER
Indicates the background for the style would use a horizontal tiled image
|
static byte |
BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_LEFT
Indicates the background for the style would use a horizontal tiled image
|
static byte |
BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_RIGHT
Indicates the background for the style would use a horizontal tiled image
|
static byte |
BACKGROUND_NONE
Indicates the background for the style would use a scaled image
|
static String |
BACKGROUND_TYPE
Background attribute name for the theme hashtable
|
static String |
BG_COLOR
Background color attribute name for the theme hashtable
|
static String |
BG_IMAGE
Background image attribute name for the theme hashtable
|
static String |
BORDER
Border attribute name for the theme hashtable
|
static String |
ELEVATION
Elevation attribute name for the theme hashtable.
|
static String |
FG_ALPHA
Foreground alpha attribute name for the theme hashtable
|
static String |
FG_COLOR
Foreground color attribute name for the theme hashtable
|
static String |
FONT
Font attribute name for the theme hashtable
|
static String |
ICON_GAP
Icon gap attribute name for the theme hashtable.
|
static String |
ICON_GAP_UNIT
Icon gap unit attribute.
|
static String |
MARGIN
Margin attribute name for the theme hashtable
|
static String |
MARGIN_UNIT
The units of the margin
|
static String |
OPACITY
Opacity attribute name for the theme hashtable
|
static String |
PADDING
Padding attribute name for the theme hashtable
|
static String |
PADDING_UNIT
The units of the padding
|
static String |
PAINTER
Painter attribute name for the style event
|
static String |
SURFACE
Surface attribute name for the theme hashtable.
|
static String |
TEXT_DECORATION
Text decoration attribute for the style event
|
static byte |
TEXT_DECORATION_3D
3D text effect using a font shadow
|
static byte |
TEXT_DECORATION_3D_LOWERED
3D sunken text effect using a light font shadow
|
static byte |
TEXT_DECORATION_3D_SHADOW_NORTH
3D text effect using a font shadow
|
static byte |
TEXT_DECORATION_NONE
Indicates no text decoration
|
static byte |
TEXT_DECORATION_OVERLINE
Indicates overline
|
static byte |
TEXT_DECORATION_STRIKETHRU
Indicates a strike-through line (usually used to denote deleted text)
|
static byte |
TEXT_DECORATION_UNDERLINE
Indicates underline
|
static String |
TRANSPARENCY
Transparency attribute name for the theme hashtable
|
static byte |
UNIT_TYPE_DIPS
Indicates the unit type for padding/margin in device independent pixels.
|
static byte |
UNIT_TYPE_PIXELS
Indicates the unit type for padding/margin, the default is in device specific pixels
|
static byte |
UNIT_TYPE_REM
Indicates the unit type for padding/margin relative to the font size of the default font.
|
static byte |
UNIT_TYPE_SCREEN_PERCENTAGE
Indicates the unit type for padding/margin in percentage of the size of the screen
|
static byte |
UNIT_TYPE_VH
Indicates the unit type for padding/margin as a percentage of the screen height.
|
static byte |
UNIT_TYPE_VMAX
Indicates the unit type for padding/margin as a percentage the maximum of screen width and height.
|
static byte |
UNIT_TYPE_VMIN
Indicates the unit type for padding/margin as a percentage the minimum of screen width and height.
|
static byte |
UNIT_TYPE_VW
Indicates the unit type for padding/margin as a percentage of the screen width.
|
Constructor and Description |
---|
Style()
Each component when it draw itself uses this Object
to determine in what colors it should use.
|
Style(int fgColor,
int bgColor,
Font f,
byte transparency)
Creates a new style with the given attributes
|
Style(int fgColor,
int bgColor,
Font f,
byte transparency,
Image im,
byte backgroundType)
Creates a new style with the given attributes
|
Style(Style style)
Creates a full copy of the given style.
|
Modifier and Type | Method and Description |
---|---|
void |
addStyleListener(StyleListener l)
Adds a Style Listener to the Style Object.
|
void |
cacheMargins(boolean override)
Store current margin values into a cache that could be restored with restoreCachedMargins()
|
static Style |
createProxyStyle(Style... styles)
Creates a "proxy" style whose setter methods map to the methods in the given styles passed and whose
getter methods are meaningless
|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void |
flushMarginsCache()
Flush the margins cache if one exists
|
int |
getAlignment()
Returns the alignment of the Label
|
int |
getBackgroundGradientEndColor()
End color for the radial/linear gradient
|
float |
getBackgroundGradientRelativeSize()
Background radial gradient relative size
|
float |
getBackgroundGradientRelativeX()
Background radial gradient relative center position X
|
float |
getBackgroundGradientRelativeY()
Background radial gradient relative center position Y
|
int |
getBackgroundGradientStartColor()
Start color for the radial/linear gradient
|
byte |
getBackgroundType()
The type of the background defaults to BACKGROUND_IMAGE_SCALED
|
int |
getBgColor()
Background color for the component
|
Image |
getBgImage()
Background image for the component
|
Painter |
getBgPainter()
Return the background painter for this style, normally this would be
the internal image/color painter but can be user defined
|
byte |
getBgTransparency()
Returns the transparency (opacity) level of the Component, zero indicates fully
transparent and FF indicates fully opaque.
|
Border |
getBorder()
Returns the border for the style
|
int |
getElevation()
Gets the elevation value of this style.
|
int |
getFgAlpha()
Foreground alpha for the component
|
int |
getFgColor()
Foreground color for the component
|
Font |
getFont()
Font for the component
|
int |
getHorizontalMargins()
The equivalent of getMarginLeft + getMarginRight
|
int |
getHorizontalPadding()
The equivalent of getPaddingLeft + getPaddingRight
|
int |
getIconGap()
Returns the icon gap in pixels.
|
int |
getIconGapUnit()
Returns the icon gap unit.
|
int |
getMargin(boolean rtl,
int orientation)
Returns the Margin
|
int |
getMargin(int orientation)
Returns the Margin
|
int |
getMarginBottom()
Returns the bottom margin in pixel
|
float |
getMarginFloatValue(boolean rtl,
int orientation)
Returns the Margin
|
int |
getMarginLeft(boolean rtl)
Returns the left margin in pixel or right margin in an RTL situation
|
int |
getMarginLeftNoRTL()
Returns the left margin in pixels ignoring RTL
|
int |
getMarginRight(boolean rtl)
Returns the right margin in pixel or left margin in an RTL situation
|
int |
getMarginRightNoRTL()
Returns the right margin in pixels ignoring RTL
|
int |
getMarginTop()
Returns the top margin in pixel
|
byte[] |
getMarginUnit()
Indicates the units used for margin elements, if null pixels are used if not this is a 4 element array containing values
of of
UNIT_TYPE_PIXELS , UNIT_TYPE_DIPS , UNIT_TYPE_SCREEN_PERCENTAGE , UNIT_TYPE_VW , UNIT_TYPE_VH ,
* UNIT_TYPE_VMIN , UNIT_TYPE_VMAX , UNIT_TYPE_REM . |
int |
getMarginValue(boolean rtl,
int orientation)
Deprecated.
|
int |
getOpacity()
Returns the opacity value for the component
|
int |
getPadding(boolean rtl,
int orientation)
Returns the Padding in using the current unit
|
int |
getPadding(int orientation)
Returns the Padding
|
int |
getPaddingBottom()
Returns the bottom padding in pixel
|
float |
getPaddingFloatValue(boolean rtl,
int orientation)
Returns the Padding in the internal value regardless of the unit
|
int |
getPaddingLeft(boolean rtl)
Returns the left padding in pixel or right padding in an RTL situation
|
int |
getPaddingLeftNoRTL()
Returns the left padding in pixels ignoring RTL
|
int |
getPaddingRight(boolean rtl)
Returns the right padding in pixel or left padding in an RTL situation
|
int |
getPaddingRightNoRTL()
Returns the right padding in pixels ignoring RTL
|
int |
getPaddingTop()
Returns the top padding in pixel
|
byte[] |
getPaddingUnit()
Indicates the units used for padding elements, if null pixels are used if not this is a 4 element array containing values
of of
UNIT_TYPE_PIXELS , UNIT_TYPE_DIPS , UNIT_TYPE_SCREEN_PERCENTAGE , UNIT_TYPE_VW , UNIT_TYPE_VH ,
* UNIT_TYPE_VMIN , UNIT_TYPE_VMAX , UNIT_TYPE_REM . |
int |
getPaddingValue(boolean rtl,
int orientation)
Deprecated.
|
int |
getTextDecoration()
Returns the text decoration of this style
|
int |
getVerticalMargins()
The equivalent of getMarginTop + getMarginBottom
|
int |
getVerticalPadding()
The equivalent of getPaddingTop + getPaddingBottom
|
boolean |
is3DTextNorth()
Returns the text decoration state for the north
|
boolean |
isLowered3DText()
Returns true if the 3D text decoration is on, false otherwise
|
boolean |
isModified()
Returns true if the style was modified manually after it was created by the
look and feel.
|
boolean |
isOverline()
Returns true if the overline text decoration is on, false otherwise
|
boolean |
isRaised3DText()
Returns true if the 3D text decoration is on, false otherwise
|
boolean |
isStrikeThru()
Returns true if the strike through text decoration is on, false otherwise
|
boolean |
isSuppressChangeEvents()
Checks to see if change events are currently suppressed.
|
boolean |
isSurface()
Checks whether the component is a surface.
|
boolean |
isUnderline()
Returns true if the underline text decoration is on, false otherwise
|
void |
markAsRendererStyle()
Disables native OS optimizations that might collide with cell renderers which do things like sharing style
objects
|
void |
merge(Style style)
Merges the new style with the current style without changing the elements that
were modified.
|
void |
removeListeners()
This method removes all Listeners from the Style
|
void |
removeStyleListener(StyleListener l)
Removes a Style Listener from the Style Object.
|
void |
restoreCachedMargins()
Restore cached margins and flush the margins cache
Warning: this method is used internally when unhidding a component with the Component.setHidden(false) method
Do not use it on an hidden component or it would result into unexpected results when unhidding this component
|
void |
set3DText(boolean t,
boolean raised)
Sets the 3D text decoration for this style
|
void |
set3DTextNorth(boolean north)
Sets the text decoration to 3D text
|
void |
setAlignment(int align)
Sets the Alignment of the Label to one of: CENTER, LEFT, RIGHT
|
void |
setAlignment(int align,
boolean override)
Sets the Alignment of the Label to one of: CENTER, LEFT, RIGHT
|
void |
setBackgroundGradientEndColor(int backgroundGradientEndColor)
Sets the background color for the component
|
void |
setBackgroundGradientEndColor(int backgroundGradientEndColor,
boolean override)
Sets the background color for the component
|
void |
setBackgroundGradientRelativeSize(float backgroundGradientRelativeSize)
Background radial gradient relative size
|
void |
setBackgroundGradientRelativeSize(float backgroundGradientRelativeSize,
boolean override)
Background radial gradient relative size
|
void |
setBackgroundGradientRelativeX(float backgroundGradientRelativeX)
Background radial gradient relative center position X
|
void |
setBackgroundGradientRelativeX(float backgroundGradientRelativeX,
boolean override)
Background radial gradient relative center position X
|
void |
setBackgroundGradientRelativeY(float backgroundGradientRelativeY)
Background radial gradient relative center position Y
|
void |
setBackgroundGradientRelativeY(float backgroundGradientRelativeY,
boolean override)
Background radial gradient relative center position Y
|
void |
setBackgroundGradientStartColor(int backgroundGradientStartColor)
Sets the background color for the component
|
void |
setBackgroundGradientStartColor(int backgroundGradientStartColor,
boolean override)
Sets the background color for the component
|
void |
setBackgroundType(byte backgroundType)
Sets the background type for the component
|
void |
setBackgroundType(byte backgroundType,
boolean override)
Sets the background type for the component
|
void |
setBgColor(int bgColor)
Sets the background color for the component
|
void |
setBgColor(int bgColor,
boolean override)
Sets the background color for the component
|
void |
setBgImage(Image bgImage)
Sets the background image for the component
|
void |
setBgImage(Image bgImage,
boolean override)
Sets the background image for the component
|
void |
setBgPainter(Painter bgPainter)
Defines the background painter for this style, normally this would be
the internal image/color painter but can be user defined
|
void |
setBgTransparency(byte transparency)
Sets the Component transparency (opacity) level of the Component, zero indicates fully
transparent and FF indicates fully opaque.
|
void |
setBgTransparency(int transparency)
Sets the Component transparency level.
|
void |
setBgTransparency(int transparency,
boolean override)
Sets the Component transparency level.
|
void |
setBorder(Border border)
Sets the border for the style
|
void |
setBorder(Border border,
boolean override)
Sets the border for the style
|
void |
setElevation(int elevation)
Sets the elevation value.
|
void |
setElevation(int elevation,
boolean override)
Sets the elevation value.
|
void |
setFgAlpha(int fgAlpha)
Sets the foreground alpha for the component
|
void |
setFgAlpha(int fgAlpha,
boolean override)
Sets the foreground alpha for the component
|
void |
setFgColor(int fgColor)
Sets the foreground color for the component
|
void |
setFgColor(int fgColor,
boolean override)
Sets the foreground color for the component
|
void |
setFont(Font font)
Sets the font for the component
|
void |
setFont(Font font,
boolean override)
Sets the font for the component
|
void |
setIconGap(float gap)
Sets the icon gap in the current units.
|
void |
setIconGap(float gap,
boolean override)
Sets the icon gap.
|
void |
setIconGap(float gap,
byte unit)
Sets the icon gap.
|
void |
setIconGap(float gap,
byte units,
boolean override)
Sets the icon gap.
|
void |
setIconGapUnit(byte unit)
Sets the icon gap unit.
|
void |
setIconGapUnit(byte unit,
boolean override)
Sets the icon gap unit.
|
void |
setMargin(float top,
float bottom,
float left,
float right)
Sets the Style Margin
|
void |
setMargin(int orientation,
float gap)
Sets the Style Margin
|
void |
setMargin(int orientation,
float gap,
boolean override)
Sets the Style Margin
|
void |
setMargin(int orientation,
int gap)
Sets the Style Margin
|
void |
setMargin(int orientation,
int gap,
boolean override)
Sets the Style Margin
|
void |
setMargin(int top,
int bottom,
int left,
int right)
Sets the Style Margin
|
void |
setMarginBottom(float gap)
Sets the Style Margin on the bottom, this is equivalent to calling
setMargin(Component.BOTTOM, gap, false); |
void |
setMarginBottom(int gap)
Sets the Style Margin on the bottom, this is equivalent to calling
setMargin(Component.BOTTOM, gap, false); |
void |
setMarginLeft(float gap)
Sets the Style Margin on the left, this is equivalent to calling
setMargin(Component.LEFT, gap, false); |
void |
setMarginLeft(int gap)
Sets the Style Margin on the left, this is equivalent to calling
setMargin(Component.LEFT, gap, false); |
void |
setMarginRight(float gap)
Sets the Style Margin on the right, this is equivalent to calling
setMargin(Component.RIGHT, gap, false); |
void |
setMarginRight(int gap)
Sets the Style Margin on the right, this is equivalent to calling
setMargin(Component.RIGHT, gap, false); |
void |
setMarginTop(float gap)
Sets the Style margin on the top, this is equivalent to calling
setMargin(Component.TOP, gap, false); |
void |
setMarginTop(int gap)
Sets the Style margin on the top, this is equivalent to calling
setMargin(Component.TOP, gap, false); |
void |
setMarginUnit(byte... marginUnit)
Indicates the units used for margin elements, if null pixels are used if not this is a 4 element array containing values
of of
UNIT_TYPE_PIXELS , UNIT_TYPE_DIPS , UNIT_TYPE_SCREEN_PERCENTAGE , UNIT_TYPE_VW , UNIT_TYPE_VH ,
* UNIT_TYPE_VMIN , UNIT_TYPE_VMAX , UNIT_TYPE_REM . |
void |
setMarginUnitBottom(byte unit)
Sets bottom margin unit.
|
void |
setMarginUnitLeft(byte unit)
Sets left margin unit.
|
void |
setMarginUnitRight(byte unit)
Sets right margin unit.
|
void |
setMarginUnitTop(byte unit)
Sets top margin unit.
|
void |
setOpacity(int opacity)
Set the opacity value
|
void |
setOpacity(int opacity,
boolean override)
Sets the Component transparency level.
|
void |
setOverline(boolean overline)
Sets the overline text decoration for this style
|
void |
setPadding(float top,
float bottom,
float left,
float right)
Sets the Style Padding.
|
void |
setPadding(int orientation,
float gap)
Sets the Style Padding.
|
void |
setPadding(int orientation,
float gap,
boolean override)
Sets the Style Padding
|
void |
setPadding(int orientation,
int gap)
Sets the Style Padding.
|
void |
setPadding(int orientation,
int gap,
boolean override)
Sets the Style Padding
|
void |
setPadding(int top,
int bottom,
int left,
int right)
Sets the Style Padding.
|
void |
setPaddingBottom(float gap)
Sets the Style Padding on the bottom, this is equivalent to calling
setPadding(Component.BOTTOM, gap, false); |
void |
setPaddingBottom(int gap)
Sets the Style Padding on the bottom, this is equivalent to calling
setPadding(Component.BOTTOM, gap, false); |
void |
setPaddingLeft(float gap)
Sets the Style Padding on the left, this is equivalent to calling
setPadding(Component.LEFT, gap, false); |
void |
setPaddingLeft(int gap)
Sets the Style Padding on the left, this is equivalent to calling
setPadding(Component.LEFT, gap, false); |
void |
setPaddingRight(float gap)
Sets the Style Padding on the right, this is equivalent to calling
setPadding(Component.RIGHT, gap, false); |
void |
setPaddingRight(int gap)
Sets the Style Padding on the right, this is equivalent to calling
setPadding(Component.RIGHT, gap, false); |
void |
setPaddingTop(float gap)
Sets the Style Padding on the top, this is equivalent to calling
setPadding(Component.TOP, gap, false); |
void |
setPaddingTop(int gap)
Sets the Style Padding on the top, this is equivalent to calling
setPadding(Component.TOP, gap, false); |
void |
setPaddingUnit(byte... paddingUnit)
Indicates the units used for padding elements, if null pixels are used if not this is a 4 element array containing values
of
UNIT_TYPE_PIXELS , UNIT_TYPE_DIPS , UNIT_TYPE_SCREEN_PERCENTAGE , UNIT_TYPE_VW , UNIT_TYPE_VH ,
UNIT_TYPE_VMIN , UNIT_TYPE_VMAX , UNIT_TYPE_REM . |
void |
setPaddingUnitBottom(byte unit)
Sets bottom padding unit.
|
void |
setPaddingUnitLeft(byte unit)
Sets left padding unit.
|
void |
setPaddingUnitRight(byte unit)
Sets right padding unit.
|
void |
setPaddingUnitTop(byte unit)
Sets top padding unit.
|
void |
setStrikeThru(boolean strikethru)
Sets the strike through text decoration for this style
|
void |
setSuppressChangeEvents(boolean suppress)
Enables or disables events.
|
void |
setSurface(boolean surface)
Enables or disables surface rendering mode for component.
|
void |
setSurface(boolean surface,
boolean override)
Enables or disables surface rendering mode for component.
|
void |
setTextDecoration(int textDecoration)
Sets the text decoration of this style
|
void |
setTextDecoration(int textDecoration,
boolean override)
Sets the text decoration of this style
|
void |
setUnderline(boolean underline)
Sets the underline text decoration for this style
|
void |
stripMarginAndPadding()
Strips all margin and padding from this style.
|
public static final String BG_COLOR
public static final String FG_COLOR
public static final String FG_ALPHA
public static final String BG_IMAGE
public static final String BACKGROUND_TYPE
public static final String BACKGROUND_ALIGNMENT
public static final String BACKGROUND_GRADIENT
public static final String FONT
public static final String TRANSPARENCY
public static final String OPACITY
public static final String ELEVATION
public static final String ICON_GAP
public static final String ICON_GAP_UNIT
public static final String SURFACE
public static final String MARGIN
public static final String BORDER
public static final String PADDING
public static final String PAINTER
public static final String ALIGNMENT
public static final String TEXT_DECORATION
public static final String PADDING_UNIT
public static final String MARGIN_UNIT
public static final byte BACKGROUND_NONE
public static final byte BACKGROUND_IMAGE_SCALED
public static final byte BACKGROUND_IMAGE_TILE_BOTH
public static final byte BACKGROUND_IMAGE_TILE_VERTICAL
public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL
public static final byte BACKGROUND_IMAGE_ALIGNED_TOP
public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM
public static final byte BACKGROUND_IMAGE_ALIGNED_LEFT
public static final byte BACKGROUND_IMAGE_ALIGNED_RIGHT
public static final byte BACKGROUND_IMAGE_ALIGNED_CENTER
public static final byte BACKGROUND_IMAGE_ALIGNED_TOP_LEFT
public static final byte BACKGROUND_IMAGE_ALIGNED_TOP_RIGHT
public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM_LEFT
public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM_RIGHT
public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_TOP
public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_CENTER
public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_BOTTOM
public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_LEFT
public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_CENTER
public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_RIGHT
public static final byte BACKGROUND_IMAGE_SCALED_FILL
public static final byte BACKGROUND_IMAGE_SCALED_FIT
public static final byte BACKGROUND_GRADIENT_LINEAR_VERTICAL
public static final byte BACKGROUND_GRADIENT_LINEAR_HORIZONTAL
public static final byte BACKGROUND_GRADIENT_RADIAL
public static final byte TEXT_DECORATION_NONE
public static final byte TEXT_DECORATION_UNDERLINE
public static final byte TEXT_DECORATION_STRIKETHRU
public static final byte TEXT_DECORATION_OVERLINE
public static final byte TEXT_DECORATION_3D
public static final byte TEXT_DECORATION_3D_LOWERED
public static final byte TEXT_DECORATION_3D_SHADOW_NORTH
public static final byte UNIT_TYPE_PIXELS
public static final byte UNIT_TYPE_SCREEN_PERCENTAGE
public static final byte UNIT_TYPE_DIPS
public static final byte UNIT_TYPE_VW
public static final byte UNIT_TYPE_VH
public static final byte UNIT_TYPE_VMIN
public static final byte UNIT_TYPE_VMAX
public static final byte UNIT_TYPE_REM
public Style()
public Style(Style style)
style
- the style to copypublic Style(int fgColor, int bgColor, Font f, byte transparency)
fgColor
- foreground colorbgColor
- background colorf
- fonttransparency
- transparency valuepublic Style(int fgColor, int bgColor, Font f, byte transparency, Image im, byte backgroundType)
fgColor
- foreground colorbgColor
- background colorf
- fonttransparency
- transparency valueim
- background imagebackgroundType
- one of:
BACKGROUND_IMAGE_SCALED, BACKGROUND_IMAGE_TILE_BOTH,
BACKGROUND_IMAGE_TILE_VERTICAL, BACKGROUND_IMAGE_TILE_HORIZONTAL,
BACKGROUND_IMAGE_ALIGNED, BACKGROUND_GRADIENT_LINEAR_HORIZONTAL,
BACKGROUND_GRADIENT_LINEAR_VERTICAL, BACKGROUND_GRADIENT_RADIALpublic void markAsRendererStyle()
public static Style createProxyStyle(Style... styles)
styles
- the styles to which we will proxypublic void merge(Style style)
style
- new values of styles from the current themepublic int getElevation()
public int getIconGap()
public int getIconGapUnit()
UNIT_TYPE_REM
, UNIT_TYPE_VMAX
, UNIT_TYPE_VMIN
,
UNIT_TYPE_VH
, UNIT_TYPE_VW
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_DIPS
,
UNIT_TYPE_PIXELS
public boolean isSurface()
public boolean isModified()
public int getBgColor()
public Image getBgImage()
public byte getBackgroundType()
public int getBackgroundGradientStartColor()
public int getBackgroundGradientEndColor()
public float getBackgroundGradientRelativeX()
public float getBackgroundGradientRelativeY()
public float getBackgroundGradientRelativeSize()
public int getFgColor()
public int getFgAlpha()
public Font getFont()
public void setElevation(int elevation, boolean override)
elevation
- The elevation value.override
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setElevation(int elevation)
elevation
- The elevation value.public void setIconGap(float gap, byte units, boolean override)
gap
- The gap.units
- The units of the gap.override
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelsetIconGapUnit(byte, boolean)
public void setIconGap(float gap, boolean override)
gap
- the icon gap.override
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelsetIconGapUnit(byte, boolean)
public void setIconGap(float gap, byte unit)
gap
- The icon gap.unit
- The unit. One of the standard style units of measurement.public void setIconGap(float gap)
gap
- The icon gap.getIconGapUnit()
public void setIconGapUnit(byte unit, boolean override)
unit
- The icon gap unit. One of the standard style units of measurement.override
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setIconGapUnit(byte unit)
unit
- The icon gap unit. One of the standard style units of measurement.public void setSurface(boolean surface, boolean override)
surface
- True to enable surface rendering mode.override
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setSurface(boolean surface)
surface
- True to enable surface rendering mode.public void setBgColor(int bgColor)
bgColor
- RRGGBB color that ignors the alpha componentpublic void setAlignment(int align)
align
- alignment valueComponent.CENTER
,
Component.LEFT
,
Component.RIGHT
public void setAlignment(int align, boolean override)
align
- alignment valueoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelComponent.CENTER
,
Component.LEFT
,
Component.RIGHT
public int getAlignment()
Component.CENTER
,
Component.LEFT
,
Component.RIGHT
public void setBgImage(Image bgImage)
bgImage
- background imagepublic void setBackgroundType(byte backgroundType)
backgroundType
- one of BACKGROUND_IMAGE_SCALED, BACKGROUND_IMAGE_TILE_BOTH,
BACKGROUND_IMAGE_TILE_VERTICAL, BACKGROUND_IMAGE_TILE_HORIZONTAL,
BACKGROUND_IMAGE_ALIGNED, BACKGROUND_GRADIENT_LINEAR_HORIZONTAL,
BACKGROUND_GRADIENT_LINEAR_VERTICAL, BACKGROUND_GRADIENT_RADIALpublic void setBackgroundGradientStartColor(int backgroundGradientStartColor)
backgroundGradientStartColor
- start color for the linear/radial gradientpublic void setBackgroundGradientEndColor(int backgroundGradientEndColor)
backgroundGradientEndColor
- end color for the linear/radial gradientpublic void setBackgroundGradientRelativeX(float backgroundGradientRelativeX)
backgroundGradientRelativeX
- x position of the radial gradient centerpublic void setBackgroundGradientRelativeY(float backgroundGradientRelativeY)
backgroundGradientRelativeY
- y position of the radial gradient centerpublic void setBackgroundGradientRelativeSize(float backgroundGradientRelativeSize)
backgroundGradientRelativeSize
- the size of the radial gradientpublic void setFgColor(int fgColor)
fgColor
- foreground colorpublic void setFgAlpha(int fgAlpha)
fgAlpha
- foreground alphapublic void setFont(Font font)
font
- the fontpublic void setUnderline(boolean underline)
underline
- true to turn underline on, false to turn it offpublic boolean isUnderline()
public void set3DText(boolean t, boolean raised)
t
- true to turn 3d shadow effect on, false to turn it offraised
- indicates a raised or lowered effectpublic void set3DTextNorth(boolean north)
north
- true to enable 3d text with the shadow on top false otherwisepublic boolean is3DTextNorth()
public boolean isRaised3DText()
public boolean isLowered3DText()
public void setOverline(boolean overline)
overline
- true to turn overline on, false to turn it offpublic boolean isOverline()
public void setStrikeThru(boolean strikethru)
strikethru
- true to turn strike through on, false to turn it offpublic boolean isStrikeThru()
public int getTextDecoration()
public void setTextDecoration(int textDecoration)
textDecoration
- the textDecoration to set (bitmask of the TEXT_DECORATION_* constants)public void setTextDecoration(int textDecoration, boolean override)
textDecoration
- the textDecoration to set (bitmask of the TEXT_DECORATION_* constants)override
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic byte getBgTransparency()
public void setBgTransparency(byte transparency)
transparency
- transparency level as bytepublic int getOpacity()
public void setOpacity(int opacity)
opacity
- the opacity valuepublic void setOpacity(int opacity, boolean override)
opacity
- int value between 0-255override
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBgTransparency(int transparency)
transparency
- int value between 0-255public void stripMarginAndPadding()
public void setPadding(int top, int bottom, int left, int right)
setPaddingUnit(byte...)
top
- number of units to pad the topbottom
- number of units to pad the bottomleft
- number of units to pad the leftright
- number of units to pad the rightsetPaddingUnit(byte...)
public void setPadding(float top, float bottom, float left, float right)
setPaddingUnit(byte...)
top
- number of units to pad the topbottom
- number of units to pad the bottomleft
- number of units to pad the leftright
- number of units to pad the rightsetPaddingUnit(byte...)
public void setPadding(int orientation, int gap)
setPaddingUnit(byte...)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of units to pad the orientationpublic void setPadding(int orientation, float gap)
setPaddingUnit(byte...)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of units to pad the orientationpublic void setMargin(int top, int bottom, int left, int right)
top
- number of margin using the current unitbottom
- number of margin using the current unitleft
- number of margin using the current unitright
- number of margin using the current unitpublic void setMargin(float top, float bottom, float left, float right)
top
- number of margin using the current unitbottom
- number of margin using the current unitleft
- number of margin using the current unitright
- number of margin using the current unitpublic void cacheMargins(boolean override)
public void restoreCachedMargins()
public void flushMarginsCache()
public void setMargin(int orientation, int gap)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of margin using the current unitpublic void setMargin(int orientation, float gap)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of margin using the current unitpublic int getPaddingValue(boolean rtl, int orientation)
getPaddingFloatValue(boolean, int)
rtl
- flag indicating whether the padding is for an RTL bidi componentorientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgetPaddingUnit()
public float getPaddingFloatValue(boolean rtl, int orientation)
rtl
- flag indicating whether the padding is for an RTL bidi componentorientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgetPaddingUnit()
public int getPaddingLeft(boolean rtl)
rtl
- indicates a right to left languagepublic void setPaddingUnitLeft(byte unit)
unit
- One of of UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public void setPaddingUnitRight(byte unit)
unit
- One of UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public void setPaddingUnitTop(byte unit)
unit
- One of UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public void setPaddingUnitBottom(byte unit)
unit
- One of UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public int getPaddingRight(boolean rtl)
rtl
- indicates a right to left languagepublic int getPaddingTop()
public void setPaddingTop(int gap)
setPadding(Component.TOP, gap, false);
gap
- amount to pad the top in current units.getPaddingUnit()
public void setPaddingTop(float gap)
setPadding(Component.TOP, gap, false);
gap
- Amount to pad the top in current units.getPaddingUnit()
,
setPaddingUnit(byte...)
public void setPaddingBottom(int gap)
setPadding(Component.BOTTOM, gap, false);
gap
- Amount to pad the bottom in current units.getPaddingUnit()
,
setPaddingUnit(byte...)
public void setPaddingBottom(float gap)
setPadding(Component.BOTTOM, gap, false);
gap
- Amount to pad the bottom in current units.getPaddingUnit()
,
setPaddingUnit(byte...)
public void setPaddingLeft(int gap)
setPadding(Component.LEFT, gap, false);
gap
- Amount to pad the left in current units.getPaddingUnit()
,
setPaddingUnit(byte...)
public void setPaddingLeft(float gap)
setPadding(Component.LEFT, gap, false);
gap
- Amount to pad the left in current units.getPaddingUnit()
,
setPaddingUnit(byte...)
public void setPaddingRight(int gap)
setPadding(Component.RIGHT, gap, false);
gap
- Amount to pad the right in current units.getPaddingUnit()
,
setPaddingUnit(byte...)
public void setPaddingRight(float gap)
setPadding(Component.RIGHT, gap, false);
gap
- Amount to pad the right in current units.getPaddingUnit()
,
setPaddingUnit(byte...)
public void setMarginTop(int gap)
setMargin(Component.TOP, gap, false);
gap
- number of top margin using the current unitpublic void setMarginTop(float gap)
setMargin(Component.TOP, gap, false);
gap
- number of top margin using the current unitpublic void setMarginBottom(int gap)
setMargin(Component.BOTTOM, gap, false);
gap
- number of bottom margin using the current unitpublic void setMarginBottom(float gap)
setMargin(Component.BOTTOM, gap, false);
gap
- number of bottom margin using the current unitpublic void setMarginLeft(int gap)
setMargin(Component.LEFT, gap, false);
gap
- number of left margin using the current unitpublic void setMarginLeft(float gap)
setMargin(Component.LEFT, gap, false);
gap
- number of left margin using the current unitpublic void setMarginRight(int gap)
setMargin(Component.RIGHT, gap, false);
gap
- number of right margin using the current unitpublic void setMarginRight(float gap)
setMargin(Component.RIGHT, gap, false);
gap
- number of right margin using the current unitpublic int getPaddingBottom()
public int getHorizontalMargins()
public int getVerticalMargins()
public int getHorizontalPadding()
public int getVerticalPadding()
public int getMarginRightNoRTL()
public int getMarginLeftNoRTL()
public int getPaddingRightNoRTL()
public int getPaddingLeftNoRTL()
public int getMarginRight(boolean rtl)
rtl
- indicates a right to left languagepublic int getMarginLeft(boolean rtl)
rtl
- indicates a right to left languagepublic int getMarginTop()
public int getMarginBottom()
public int getPadding(boolean rtl, int orientation)
rtl
- flag indicating whether the padding is for an RTL bidi componentorientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTpublic int getPadding(int orientation)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTpublic int getMargin(int orientation)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTpublic int getMargin(boolean rtl, int orientation)
rtl
- flag indicating whether the padding is for an RTL bidi componentorientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTpublic int getMarginValue(boolean rtl, int orientation)
getMarginFloatValue(boolean, int)
rtl
- flag indicating whether the padding is for an RTL bidi componentorientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTpublic float getMarginFloatValue(boolean rtl, int orientation)
rtl
- flag indicating whether the padding is for an RTL bidi componentorientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTpublic void setBgColor(int bgColor, boolean override)
bgColor
- RRGGBB color that ignores the alpha componentoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBgImage(Image bgImage, boolean override)
bgImage
- background imageoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBackgroundType(byte backgroundType, boolean override)
backgroundType
- one of BACKGROUND_IMAGE_SCALED, BACKGROUND_IMAGE_TILE_BOTH,
BACKGROUND_IMAGE_TILE_VERTICAL, BACKGROUND_IMAGE_TILE_HORIZONTAL,
BACKGROUND_IMAGE_ALIGNED, BACKGROUND_GRADIENT_LINEAR_HORIZONTAL,
BACKGROUND_GRADIENT_LINEAR_VERTICAL, BACKGROUND_GRADIENT_RADIALoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBackgroundGradientStartColor(int backgroundGradientStartColor, boolean override)
backgroundGradientStartColor
- start color for the linear/radial gradientoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBackgroundGradientEndColor(int backgroundGradientEndColor, boolean override)
backgroundGradientEndColor
- end color for the linear/radial gradientoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBackgroundGradientRelativeX(float backgroundGradientRelativeX, boolean override)
backgroundGradientRelativeX
- x position of the radial gradient centeroverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBackgroundGradientRelativeY(float backgroundGradientRelativeY, boolean override)
backgroundGradientRelativeY
- y position of the radial gradient centeroverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBackgroundGradientRelativeSize(float backgroundGradientRelativeSize, boolean override)
backgroundGradientRelativeSize
- the size of the radial gradient relative to the screens
larger dimensionoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setFgColor(int fgColor, boolean override)
fgColor
- foreground coloroverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setFgAlpha(int fgAlpha, boolean override)
fgAlpha
- foreground alphaoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setFont(Font font, boolean override)
font
- the fontoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setBgTransparency(int transparency, boolean override)
transparency
- int value between 0-255override
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setPadding(int orientation, int gap, boolean override)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of pixels to pad the orientationoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setPadding(int orientation, float gap, boolean override)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of pixels to pad the orientationoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setMargin(int orientation, int gap, boolean override)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of margin using the current unitoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic void setMargin(int orientation, float gap, boolean override)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of margin using the current unitoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic boolean isSuppressChangeEvents()
public void setSuppressChangeEvents(boolean suppress)
suppress
- True to suppress change events.public void addStyleListener(StyleListener l)
l
- a style listenerpublic void removeStyleListener(StyleListener l)
l
- a style listenerpublic void removeListeners()
public void setBorder(Border border)
border
- new border object for the componentpublic void setBorder(Border border, boolean override)
border
- new border object for the componentoverride
- If set to true allows the look and feel/theme to override
the value in this attribute when changing a theme/look and feelpublic Border getBorder()
public Painter getBgPainter()
public void setBgPainter(Painter bgPainter)
bgPainter
- new painter to install into the stylepublic byte[] getPaddingUnit()
UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
* UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public void setPaddingUnit(byte... paddingUnit)
UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.paddingUnit
- the paddingUnit to setpublic byte[] getMarginUnit()
UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
* UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public void setMarginUnit(byte... marginUnit)
UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
* UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.marginUnit
- the marginUnit to setpublic void setMarginUnitLeft(byte unit)
unit
- One of UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public void setMarginUnitRight(byte unit)
unit
- One of UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public void setMarginUnitTop(byte unit)
unit
- One of UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public void setMarginUnitBottom(byte unit)
unit
- One of UNIT_TYPE_PIXELS
, UNIT_TYPE_DIPS
, UNIT_TYPE_SCREEN_PERCENTAGE
, UNIT_TYPE_VW
, UNIT_TYPE_VH
,
UNIT_TYPE_VMIN
, UNIT_TYPE_VMAX
, UNIT_TYPE_REM
.public boolean equals(Object obj)
Object