|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.plaf.Style
public class Style
Represents the look of a given component: colors, fonts, transparency, margin and padding & images.
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 * **************************
Field Summary | |
---|---|
static java.lang.String |
ALIGNMENT
Alignment attribute for the style event |
static java.lang.String |
BACKGROUND_ALIGNMENT
Background attribute name for the theme hashtable |
static java.lang.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_ALIGN_BOTTOM
Indicates the background alignment for use in tiling or aligned images |
static byte |
BACKGROUND_IMAGE_ALIGN_CENTER
Indicates the background alignment for use in tiling or aligned images |
static byte |
BACKGROUND_IMAGE_ALIGN_LEFT
Indicates the background alignment for use in tiling or aligned images |
static byte |
BACKGROUND_IMAGE_ALIGN_RIGHT
Indicates the background alignment for use in tiling or aligned images |
static byte |
BACKGROUND_IMAGE_ALIGN_TOP
Indicates the background alignment for use in tiling or aligned images |
static byte |
BACKGROUND_IMAGE_ALIGNED
Indicates the background for the style would use an unscaled image with an alignment |
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_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 java.lang.String |
BACKGROUND_TYPE
Background attribute name for the theme hashtable |
static java.lang.String |
BG_COLOR
Background color attribute name for the theme hashtable |
static java.lang.String |
BG_IMAGE
Background image attribute name for the theme hashtable |
static java.lang.String |
BORDER
Border attribute name for the theme hashtable |
static java.lang.String |
FG_COLOR
Foreground color attribute name for the theme hashtable |
static java.lang.String |
FONT
Font attribute name for the theme hashtable |
static java.lang.String |
MARGIN
Margin attribute name for the theme hashtable |
static java.lang.String |
MARGIN_UNIT
The units of the margin |
static java.lang.String |
PADDING
Padding attribute name for the theme hashtable |
static java.lang.String |
PADDING_UNIT
The units of the padding |
static java.lang.String |
PAINTER
Painter attribute name for the style event |
static java.lang.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_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 java.lang.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_SCREEN_PERCENTAGE
Indicates the unit type for padding/margin in percentage of the size of the screen |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
addStyleListener(StyleListener l)
Adds a Style Listener to the Style Object. |
int |
getAlignment()
Returns the alignment of the Label |
byte |
getBackgroundAlignment()
Deprecated. the functionality of this method is now covered by background type |
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 |
getFgColor()
Foreground color for the component |
Font |
getFont()
Font for the component |
int |
getMargin(boolean rtl,
int orientation)
Returns the Margin |
int |
getMargin(int orientation)
Returns the Margin |
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 UNIT_TYPE_PIXELS, UNIT_TYPE_DIPS or UNIT_TYPE_SCREEN_PERCENTAGE |
int |
getMarginValue(boolean rtl,
int orientation)
Returns the Margin |
int |
getPadding(boolean rtl,
int orientation)
Returns the Padding in pixels |
int |
getPadding(int orientation)
Returns the Padding |
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 UNIT_TYPE_PIXELS, UNIT_TYPE_DIPS or UNIT_TYPE_SCREEN_PERCENTAGE |
int |
getPaddingValue(boolean rtl,
int orientation)
Returns the Padding in the internal value regardless of the unit |
int |
getTextDecoration()
Returns the text decoration of this style |
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 |
isUnderline()
Returns true if the underline text decoration is on, false otherwise |
void |
merge(Style style)
Merges the new style with the current style without changing the elements that were modified. |
void |
removeStyleListener(StyleListener l)
Removes a Style Listener from the Style Object. |
void |
set3DText(boolean t,
boolean raised)
Sets the 3D text decoration for this style |
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 |
setBackgroundAlignment(byte backgroundAlignment)
Deprecated. the functionality of this method is now covered by background type |
void |
setBackgroundAlignment(byte backgroundAlignment,
boolean override)
Deprecated. the functionality of this method is now covered by background type |
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 |
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 |
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 |
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 UNIT_TYPE_PIXELS, UNIT_TYPE_DIPS or UNIT_TYPE_SCREEN_PERCENTAGE |
void |
setOverline(boolean overline)
Sets the overline text decoration for this style |
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 |
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 or UNIT_TYPE_SCREEN_PERCENTAGE |
void |
setStrikeThru(boolean strikethru)
Sets the strike through text decoration for this style |
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 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BG_COLOR
public static final java.lang.String FG_COLOR
public static final java.lang.String BG_IMAGE
public static final java.lang.String BACKGROUND_TYPE
public static final java.lang.String BACKGROUND_ALIGNMENT
public static final java.lang.String BACKGROUND_GRADIENT
public static final java.lang.String FONT
public static final java.lang.String TRANSPARENCY
public static final java.lang.String MARGIN
public static final java.lang.String BORDER
public static final java.lang.String PADDING
public static final java.lang.String PAINTER
public static final java.lang.String ALIGNMENT
public static final java.lang.String TEXT_DECORATION
public static final java.lang.String PADDING_UNIT
public static final java.lang.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
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_GRADIENT_LINEAR_VERTICAL
public static final byte BACKGROUND_GRADIENT_LINEAR_HORIZONTAL
public static final byte BACKGROUND_GRADIENT_RADIAL
public static final byte BACKGROUND_IMAGE_ALIGN_TOP
public static final byte BACKGROUND_IMAGE_ALIGN_BOTTOM
public static final byte BACKGROUND_IMAGE_ALIGN_LEFT
public static final byte BACKGROUND_IMAGE_ALIGN_RIGHT
public static final byte BACKGROUND_IMAGE_ALIGN_CENTER
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 UNIT_TYPE_PIXELS
public static final byte UNIT_TYPE_SCREEN_PERCENTAGE
public static final byte UNIT_TYPE_DIPS
Constructor Detail |
---|
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_RADIALMethod Detail |
---|
public void merge(Style style)
style
- new values of styles from the current themepublic boolean isModified()
public int getBgColor()
public Image getBgImage()
public byte getBackgroundType()
public byte getBackgroundAlignment()
public int getBackgroundGradientStartColor()
public int getBackgroundGradientEndColor()
public float getBackgroundGradientRelativeX()
public float getBackgroundGradientRelativeY()
public float getBackgroundGradientRelativeSize()
public int getFgColor()
public Font getFont()
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 setBackgroundAlignment(byte backgroundAlignment)
backgroundAlignment
- one of:
BACKGROUND_IMAGE_ALIGN_TOP, BACKGROUND_IMAGE_ALIGN_BOTTOM,
BACKGROUND_IMAGE_ALIGN_LEFT, BACKGROUND_IMAGE_ALIGN_RIGHT,
BACKGROUND_IMAGE_ALIGN_CENTERpublic 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 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 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 void setBgTransparency(int transparency)
transparency
- int value between 0-255public void setPadding(int top, int bottom, int left, int right)
top
- number of pixels to paddbottom
- number of pixels to paddleft
- number of pixels to paddright
- number of pixels to paddpublic void setPadding(int orientation, int gap)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of pixels to paddpublic void setMargin(int top, int bottom, int left, int right)
top
- number of margin pixelsbottom
- number of margin pixelsleft
- number of margin pixelsright
- number of margin pixelspublic void setMargin(int orientation, int gap)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHTgap
- number of margin pixelspublic int getPaddingValue(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.RIGHT
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.RIGHT
public int getPadding(int orientation)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
public int getMargin(int orientation)
orientation
- one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
public 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.RIGHT
public int getMarginValue(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.RIGHT
public void setBgColor(int bgColor, boolean override)
bgColor
- RRGGBB color that ignors 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 setBackgroundAlignment(byte backgroundAlignment, boolean override)
backgroundAlignment
- one of:
BACKGROUND_IMAGE_ALIGN_TOP, BACKGROUND_IMAGE_ALIGN_BOTTOM,
BACKGROUND_IMAGE_ALIGN_LEFT, BACKGROUND_IMAGE_ALIGN_RIGHT,
BACKGROUND_IMAGE_ALIGN_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 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 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 paddoverride
- 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 pixelsoverride
- 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 addStyleListener(StyleListener l)
l
- a style listenerpublic void removeStyleListener(StyleListener l)
l
- a style listenerpublic 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()
public void setPaddingUnit(byte[] paddingUnit)
paddingUnit
- the paddingUnit to setpublic byte[] getMarginUnit()
public void setMarginUnit(byte[] marginUnit)
marginUnit
- the marginUnit to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |