public class Style

  1. Object
  2. 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:

  • Use the set method that accepts a second boolean argument and set it to true.

  • Create a new style object and pass all the options in the constructor (without invoking setters manually).

The Margin and Padding is inspired by W3 Box Model

      **************************
      *         Margin         *
      *  ********************  *
      *  *      Padding     *  *
      *  *    ***********   *  *
      *  *    * Content *   *  *
      *  *    ***********   *  *
      *  *      Padding     *  *
      *  ********************  *
      *         Margin         *
      **************************

Change Events

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.

Fields

public static final String BG_COLOR = "bgColor"Background color attribute name for the theme hashtable
public static final String FG_COLOR = "fgColor"Foreground color attribute name for the theme hashtable
public static final String FG_ALPHA = "fgAlpha"Foreground alpha attribute name for the theme hashtable
public static final String BG_IMAGE = "bgImage"Background image attribute name for the theme hashtable
public static final String BACKGROUND_TYPE = "bgType"Background attribute name for the theme hashtable
public static final String BACKGROUND_ALIGNMENT = "bgAlign"Background attribute name for the theme hashtable
public static final String BACKGROUND_GRADIENT = "bgGradient"Background attribute name for the theme hashtable
public static final String GRADIENT = "bgGradientEx"Extended gradient attribute (multi-stop, angled, conic, repeating).
public static final String FILTER_BLUR = "filterBlur"CSS filter:blur() radius in pixels.
public static final String BACKDROP_FILTER_BLUR = "backdropFilterBlur"CSS backdrop-filter:blur() radius in pixels.
public static final String FILTER_COLOR_MATRIX = "filterColorMatrix"CSS filter: 4x5 color matrix (composed from brightness, contrast, grayscale, hue-rotate, invert, opacity, saturate, sepia).
public static final String BACKDROP_FILTER_COLOR_MATRIX = "backdropFilterColorMatrix"CSS backdrop-filter color matrix (same layout as FILTER_COLOR_MATRIX).
public static final String FONT = "font"Font attribute name for the theme hashtable
public static final String TRANSPARENCY = "transparency"Transparency attribute name for the theme hashtable
public static final String OPACITY = "opacity"Opacity attribute name for the theme hashtable
public static final String ELEVATION = "elevation"Elevation attribute name for the theme hashtable.
public static final String LETTER_SPACING = "letterSpacing"Letter spacing attribute name for the theme hashtable.
public static final String ICON_GAP = "iconGap"Icon gap attribute name for the theme hashtable.
public static final String ICON_GAP_UNIT = "iconGapUnit"Icon gap unit attribute.
public static final String SURFACE = "surface"Surface attribute name for the theme hashtable.
public static final String MARGIN = "margin"Margin attribute name for the theme hashtable
public static final String BORDER = "border"Border attribute name for the theme hashtable
public static final String PADDING = "padding"Padding attribute name for the theme hashtable
public static final String PAINTER = "painter"Painter attribute name for the style event
public static final String ALIGNMENT = "align"Alignment attribute for the style event
public static final String TEXT_DECORATION = "textDecoration"Text decoration attribute for the style event
public static final String PADDING_UNIT = "padUnit"The units of the padding
public static final String MARGIN_UNIT = "marUnit"The units of the margin
public static final byte BACKGROUND_NONE = 0Indicates the background for the style would use a scaled image
public static final byte BACKGROUND_IMAGE_SCALED = 1Indicates the background for the style would use a scaled image
public static final byte BACKGROUND_IMAGE_TILE_BOTH = 2Indicates the background for the style would use a tiled image on both axis
public static final byte BACKGROUND_IMAGE_TILE_VERTICAL = 3Indicates the background for the style would use a vertical tiled image
public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL = 4Indicates the background for the style would use a horizontal tiled image
public static final byte BACKGROUND_IMAGE_ALIGNED_TOP = 20Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM = 21Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_ALIGNED_LEFT = 22Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_ALIGNED_RIGHT = 23Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_ALIGNED_CENTER = 24Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_ALIGNED_TOP_LEFT = 25Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_ALIGNED_TOP_RIGHT = 26Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM_LEFT = 27Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM_RIGHT = 28Indicates the background for the style would use an unscaled image with an alignment
public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_TOP = 4Indicates the background for the style would use a horizontal tiled image
public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_CENTER = 29Indicates the background for the style would use a horizontal tiled image
public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_BOTTOM = 30Indicates the background for the style would use a horizontal tiled image
public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_LEFT = 3Indicates the background for the style would use a horizontal tiled image
public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_CENTER = 31Indicates the background for the style would use a horizontal tiled image
public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_RIGHT = 32Indicates the background for the style would use a horizontal tiled image
public static final byte BACKGROUND_IMAGE_SCALED_FILL = 33Indicates the background for the style would use a scaled image that fills all available space while maintaining aspect ratio
public static final byte BACKGROUND_IMAGE_SCALED_FIT = 34Indicates the background for the style would use a scaled image that fits to available space while maintaining aspect ratio
public static final byte BACKGROUND_GRADIENT_LINEAR_VERTICAL = 6Indicates the background for the style would use a linear gradient
public static final byte BACKGROUND_GRADIENT_LINEAR_HORIZONTAL = 7Indicates the background for the style would use a linear gradient
public static final byte BACKGROUND_GRADIENT_RADIAL = 8Indicates the background for the style would use a radial gradient
public static final byte BACKGROUND_GRADIENT_LINEAR = 35Multi-stop linear gradient at an arbitrary angle.
public static final byte BACKGROUND_GRADIENT_RADIAL_FULL = 36Multi-stop radial gradient with full CSS shape/extent control.
public static final byte BACKGROUND_GRADIENT_CONIC = 37Conic / sweep gradient.
public static final byte BACKGROUND_GRADIENT_REPEATING_LINEAR = 38Repeating multi-stop linear gradient (CSS repeating-linear-gradient).
public static final byte BACKGROUND_GRADIENT_REPEATING_RADIAL = 39Repeating multi-stop radial gradient (CSS repeating-radial-gradient).
public static final byte TEXT_DECORATION_NONE = 0Indicates no text decoration
public static final byte TEXT_DECORATION_UNDERLINE = 1Indicates underline
public static final byte TEXT_DECORATION_STRIKETHRU = 2Indicates a strike-through line (usually used to denote deleted text)
public static final byte TEXT_DECORATION_OVERLINE = 4Indicates overline
public static final byte TEXT_DECORATION_3D = 83D text effect using a font shadow
public static final byte TEXT_DECORATION_3D_LOWERED = 163D sunken text effect using a light font shadow
public static final byte TEXT_DECORATION_3D_SHADOW_NORTH = 323D text effect using a font shadow
public static final byte UNIT_TYPE_PIXELS = 0Indicates the unit type for padding/margin, the default is in device specific pixels
public static final byte UNIT_TYPE_SCREEN_PERCENTAGE = 1Indicates the unit type for padding/margin in percentage of the size of the screen
public static final byte UNIT_TYPE_DIPS = 2Indicates the unit type for padding/margin in device independent pixels.
public static final byte UNIT_TYPE_VW = 3Indicates the unit type for padding/margin as a percentage of the screen width.
public static final byte UNIT_TYPE_VH = 4Indicates the unit type for padding/margin as a percentage of the screen height.
public static final byte UNIT_TYPE_VMIN = 5Indicates the unit type for padding/margin as a percentage the minimum of screen width and height.
public static final byte UNIT_TYPE_VMAX = 6Indicates the unit type for padding/margin as a percentage the maximum of screen width and height.
public static final byte UNIT_TYPE_REM = 7Indicates the unit type for padding/margin relative to the font size of the default font.

Constructors

public Style()Each component when it draw itself uses this Object to determine in what colors it should use.
public Style(Style style)Creates a full copy of the given style.
public Style(int fgColor, int bgColor, Font f, byte transparency)Creates a new style with the given attributes
public Style(int fgColor, int bgColor, Font f, byte transparency, Image im, byte backgroundType)Creates a new style with the given attributes

Methods

public 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
public void markAsRendererStyle()Disables native OS optimizations that might collide with cell renderers which do things like sharing style objects
public boolean isRendererStyle()Indicates whether this style has been marked for use with renderers.
public void merge(Style style)Merges the new style with the current style without changing the elements that were modified.
public int getElevation()Gets the elevation value of this style.
public void setElevation(int elevation)Sets the elevation value.
public int getIconGap()Returns the icon gap in pixels.
public float getLetterSpacing()Returns the letter spacing (in EM units, font-size relative) applied to text drawn with this style.
public void setLetterSpacing(float letterSpacing)Sets the letter spacing in EM units (font-size relative).
public void setLetterSpacing(float spacing, boolean override)Sets the letter spacing in EM units.
public void setIconGap(float gap)Sets the icon gap in the current units.
public int getIconGapUnit()Returns the icon gap unit.
public void setIconGapUnit(byte unit)Sets the icon gap unit.
public boolean isSurface()Checks whether the component is a surface.
public void setSurface(boolean surface)Enables or disables surface rendering mode for component.
public boolean isModified()Returns true if the style was modified manually after it was created by the look and feel.
public int getBgColor()Background color for the component
public void setBgColor(int bgColor)Sets the background color for the component
public Image getBgImage()Background image for the component
public void setBgImage(Image bgImage)Sets the background image for the component
public byte getBackgroundType()The type of the background defaults to BACKGROUND_IMAGE_SCALED
public void setBackgroundType(byte backgroundType)Sets the background type for the component
public int getBackgroundGradientStartColor()Start color for the radial/linear gradient
public void setBackgroundGradientStartColor(int backgroundGradientStartColor)Sets the background color for the component
public int getBackgroundGradientEndColor()End color for the radial/linear gradient
public void setBackgroundGradientEndColor(int backgroundGradientEndColor)Sets the background color for the component
public float getBackgroundGradientRelativeX()Background radial gradient relative center position X
public void setBackgroundGradientRelativeX(float backgroundGradientRelativeX)Background radial gradient relative center position X
public float getBackgroundGradientRelativeY()Background radial gradient relative center position Y
public void setBackgroundGradientRelativeY(float backgroundGradientRelativeY)Background radial gradient relative center position Y
public float getBackgroundGradientRelativeSize()Background radial gradient relative size
public void setBackgroundGradientRelativeSize(float backgroundGradientRelativeSize)Background radial gradient relative size
public int getFgColor()Foreground color for the component
public final void setFgColor(int fgColor)Sets the foreground color for the component
public int getFgAlpha()Foreground alpha for the component
public void setFgAlpha(int fgAlpha)Sets the foreground alpha for the component
public Font getFont()Font for the component
public void setFont(Font font)Sets the font for the component
public void setElevation(int elevation, boolean override)Sets the elevation value.
public void setIconGap(float gap, byte units, boolean override)Sets the icon gap.
public void setIconGap(float gap, boolean override)Sets the icon gap.
public void setIconGap(float gap, byte unit)Sets the icon gap.
public void setIconGapUnit(byte unit, boolean override)Sets the icon gap unit.
public void setSurface(boolean surface, boolean override)Enables or disables surface rendering mode for component.
public void setAlignment(int align, boolean override)Sets the Alignment of the Label to one of: CENTER, LEFT, RIGHT
public int getAlignment()Returns the alignment of the Label
public void setAlignment(int align)Sets the Alignment of the Label to one of: CENTER, LEFT, RIGHT
public boolean isUnderline()Returns true if the underline text decoration is on, false otherwise
public void setUnderline(boolean underline)Sets the underline text decoration for this style
public void set3DText(boolean t, boolean raised)Sets the 3D text decoration for this style
public boolean is3DTextNorth()Returns the text decoration state for the north
public void set3DTextNorth(boolean north)Sets the text decoration to 3D text
public boolean isRaised3DText()Returns true if the 3D text decoration is on, false otherwise
public boolean isLowered3DText()Returns true if the 3D text decoration is on, false otherwise
public boolean isOverline()Returns true if the overline text decoration is on, false otherwise
public void setOverline(boolean overline)Sets the overline text decoration for this style
public boolean isStrikeThru()Returns true if the strike through text decoration is on, false otherwise
public void setStrikeThru(boolean strikethru)Sets the strike through text decoration for this style
public int getTextDecoration()Returns the text decoration of this style
public void setTextDecoration(int textDecoration)Sets the text decoration of this style
public void setTextDecoration(int textDecoration, boolean override)Sets the text decoration of this style
public byte getBgTransparency()Returns the transparency (opacity) level of the Component, zero indicates fully transparent and FF indicates fully opaque.
public void setBgTransparency(byte transparency)Sets the Component transparency (opacity) level of the Component, zero indicates fully transparent and FF indicates fully opaque.
public void setBgTransparency(int transparency)Sets the Component transparency level.
public int getOpacity()Returns the opacity value for the component
public final void setOpacity(int opacity)Set the opacity value
public final void setOpacity(int opacity, boolean override)Sets the Component transparency level.
public void stripMarginAndPadding()Strips all margin and padding from this style.
public void setPadding(int top, int bottom, int left, int right)Sets the Style Padding.
public void setPadding(float top, float bottom, float left, float right)Sets the Style Padding.
public void setPadding(int orientation, int gap)Sets the Style Padding.
public void setPadding(int orientation, float gap)Sets the Style Padding.
public void setMargin(int top, int bottom, int left, int right)Sets the Style Margin
public void setMargin(float top, float bottom, float left, float right)Sets the Style Margin
public void cacheMargins(boolean override)Store current margin values into a cache that could be restored with restoreCachedMargins()
public 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…
public void flushMarginsCache()Flush the margins cache if one exists
public void setMargin(int orientation, int gap)Sets the Style Margin
public void setMargin(int orientation, float gap)Sets the Style Margin
public int getPaddingValue(boolean rtl, int orientation)Deprecated Returns the Padding in the internal value regardless of the unit
public float getPaddingFloatValue(boolean rtl, int orientation)Returns the Padding in the internal value regardless of the unit
public int getPaddingLeft(boolean rtl)Returns the left padding in pixel or right padding in an RTL situation
public void setPaddingUnitLeft(byte unit)Sets left padding unit.
public void setPaddingUnitRight(byte unit)Sets right padding unit.
public void setPaddingUnitTop(byte unit)Sets top padding unit.
public void setPaddingUnitBottom(byte unit)Sets bottom padding unit.
public int getPaddingRight(boolean rtl)Returns the right padding in pixel or left padding in an RTL situation
public int getPaddingTop()Returns the top padding in pixel
public void setPaddingTop(int gap)Sets the Style Padding on the top, this is equivalent to calling setPadding(Component.TOP, gap, false);
public void setPaddingTop(float gap)Sets the Style Padding on the top, this is equivalent to calling setPadding(Component.TOP, gap, false);
public void setPaddingLeft(int gap)Sets the Style Padding on the left, this is equivalent to calling setPadding(Component.LEFT, gap, false);
public void setPaddingLeft(float gap)Sets the Style Padding on the left, this is equivalent to calling setPadding(Component.LEFT, gap, false);
public void setPaddingRight(int gap)Sets the Style Padding on the right, this is equivalent to calling setPadding(Component.RIGHT, gap, false);
public void setPaddingRight(float gap)Sets the Style Padding on the right, this is equivalent to calling setPadding(Component.RIGHT, gap, false);
public void setMarginLeft(int gap)Sets the Style Margin on the left, this is equivalent to calling setMargin(Component.LEFT, gap, false);
public void setMarginLeft(float gap)Sets the Style Margin on the left, this is equivalent to calling setMargin(Component.LEFT, gap, false);
public void setMarginRight(int gap)Sets the Style Margin on the right, this is equivalent to calling setMargin(Component.RIGHT, gap, false);
public void setMarginRight(float gap)Sets the Style Margin on the right, this is equivalent to calling setMargin(Component.RIGHT, gap, false);
public int getPaddingBottom()Returns the bottom padding in pixel
public void setPaddingBottom(int gap)Sets the Style Padding on the bottom, this is equivalent to calling setPadding(Component.BOTTOM, gap, false);
public void setPaddingBottom(float gap)Sets the Style Padding on the bottom, this is equivalent to calling setPadding(Component.BOTTOM, gap, false);
public int getHorizontalMargins()The equivalent of getMarginLeft + getMarginRight
public int getVerticalMargins()The equivalent of getMarginTop + getMarginBottom
public int getHorizontalPadding()The equivalent of getPaddingLeft + getPaddingRight
public int getVerticalPadding()The equivalent of getPaddingTop + getPaddingBottom
public int getMarginRightNoRTL()Returns the right margin in pixels ignoring RTL
public int getMarginLeftNoRTL()Returns the left margin in pixels ignoring RTL
public int getPaddingRightNoRTL()Returns the right padding in pixels ignoring RTL
public int getPaddingLeftNoRTL()Returns the left padding in pixels ignoring RTL
public int getMarginRight(boolean rtl)Returns the right margin in pixel or left margin in an RTL situation
public int getMarginLeft(boolean rtl)Returns the left margin in pixel or right margin in an RTL situation
public int getMarginTop()Returns the top margin in pixel
public void setMarginTop(int gap)Sets the Style margin on the top, this is equivalent to calling setMargin(Component.TOP, gap, false);
public void setMarginTop(float gap)Sets the Style margin on the top, this is equivalent to calling setMargin(Component.TOP, gap, false);
public int getMarginBottom()Returns the bottom margin in pixel
public void setMarginBottom(int gap)Sets the Style Margin on the bottom, this is equivalent to calling setMargin(Component.BOTTOM, gap, false);
public void setMarginBottom(float gap)Sets the Style Margin on the bottom, this is equivalent to calling setMargin(Component.BOTTOM, gap, false);
public int getPadding(boolean rtl, int orientation)Returns the Padding in using the current unit
public int getPadding(int orientation)Returns the Padding
public int getMargin(int orientation)Returns the Margin
public int getMargin(boolean rtl, int orientation)Returns the Margin
public int getMarginValue(boolean rtl, int orientation)Deprecated Returns the Margin
public float getMarginFloatValue(boolean rtl, int orientation)Returns the Margin
public void setBgColor(int bgColor, boolean override)Sets the background color for the component
public void setBgImage(Image bgImage, boolean override)Sets the background image for the component
public void setBackgroundType(byte backgroundType, boolean override)Sets the background type for the component
public void setBackgroundGradientStartColor(int backgroundGradientStartColor, boolean override)Sets the background color for the component
public void setBackgroundGradientEndColor(int backgroundGradientEndColor, boolean override)Sets the background color for the component
public void setBackgroundGradientRelativeX(float backgroundGradientRelativeX, boolean override)Background radial gradient relative center position X
public void setBackgroundGradientRelativeY(float backgroundGradientRelativeY, boolean override)Background radial gradient relative center position Y
public void setBackgroundGradientRelativeSize(float backgroundGradientRelativeSize, boolean override)Background radial gradient relative size
public Gradient getGradient()Extended (multi-stop / angled / conic / repeating) gradient backing BACKGROUND_GRADIENT_LINEAR / BACKGROUND_GRADIENT_RADIAL_FULL / BACKGROUND_GRADIENT_CONIC / BACKGROUND_GRADIENT_REPEATING_*.
public void setGradient(Gradient gradient)Sets the extended gradient.
public void setGradient(Gradient gradient, boolean override)Internal setter variant honoring the override flag.
public float getFilterBlurRadius()CSS filter:blur() radius applied to the component’s foreground (the component itself, after it has been painted).
public void setFilterBlurRadius(float radius)
public void setFilterBlurRadius(float radius, boolean override)
public float getBackdropFilterBlurRadius()CSS backdrop-filter:blur() radius applied to whatever is painted behind the component before this component is drawn.
public void setBackdropFilterBlurRadius(float radius)
public void setBackdropFilterBlurRadius(float radius, boolean override)
public float[] getFilterColorMatrix()CSS filter color-matrix: 4x5 row-major float[20] composed from brightness / contrast / grayscale / hue-rotate / invert / opacity / saturate / sepia.
public void setFilterColorMatrix(float[] matrix)
public void setFilterColorMatrix(float[] matrix, boolean override)
public float[] getBackdropFilterColorMatrix()CSS backdrop-filter color-matrix; same layout as filterColorMatrix but applied to whatever is painted behind the component.
public void setBackdropFilterColorMatrix(float[] matrix)
public void setBackdropFilterColorMatrix(float[] matrix, boolean override)
public boolean isExtendedGradientBackground()Returns true when the backgroundType requires the extended gradient descriptor (i.e. legacy 2-color start/end accessors are not sufficient).
public final void setFgColor(int fgColor, boolean override)Sets the foreground color for the component
public void setFgAlpha(int fgAlpha, boolean override)Sets the foreground alpha for the component
public void setFont(Font font, boolean override)Sets the font for the component
public void setBgTransparency(int transparency, boolean override)Sets the Component transparency level.
public void setPadding(int orientation, int gap, boolean override)Sets the Style Padding
public void setPadding(int orientation, float gap, boolean override)Sets the Style Padding
public void setMargin(int orientation, int gap, boolean override)Sets the Style Margin
public void setMargin(int orientation, float gap, boolean override)Sets the Style Margin
public boolean isSuppressChangeEvents()Checks to see if change events are currently suppressed.
public void setSuppressChangeEvents(boolean suppress)Enables or disables events.
public void addStyleListener(StyleListener l)Adds a Style Listener to the Style Object.
public void removeStyleListener(StyleListener l)Removes a Style Listener from the Style Object.
public void removeListeners()This method removes all Listeners from the Style
public void setBorder(Border border, boolean override)Sets the border for the style
public Border getBorder()Returns the border for the style
public void setBorder(Border border)Sets the border for the style
public Painter getBgPainter()Return the background painter for this style, normally this would be the internal image/color painter but can be user defined
public 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
public 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.
public 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.
public 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.
public 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.
public void setMarginUnitLeft(byte unit)Sets left margin unit.
public void setMarginUnitRight(byte unit)Sets right margin unit.
public void setMarginUnitTop(byte unit)Sets top margin unit.
public void setMarginUnitBottom(byte unit)Sets bottom margin unit.
public boolean equals(Object obj)Indicates whether some other object is “equal to” this one.
public int hashCode()Returns a hash code value for the object.

Inherited methods

Field details

BG_COLOR

public static final String BG_COLOR = "bgColor"
Background color attribute name for the theme hashtable

FG_COLOR

public static final String FG_COLOR = "fgColor"
Foreground color attribute name for the theme hashtable

FG_ALPHA

public static final String FG_ALPHA = "fgAlpha"
Foreground alpha attribute name for the theme hashtable

BG_IMAGE

public static final String BG_IMAGE = "bgImage"
Background image attribute name for the theme hashtable

BACKGROUND_TYPE

public static final String BACKGROUND_TYPE = "bgType"
Background attribute name for the theme hashtable

BACKGROUND_ALIGNMENT

public static final String BACKGROUND_ALIGNMENT = "bgAlign"
Background attribute name for the theme hashtable

BACKGROUND_GRADIENT

public static final String BACKGROUND_GRADIENT = "bgGradient"
Background attribute name for the theme hashtable

GRADIENT

public static final String GRADIENT = "bgGradientEx"
Extended gradient attribute (multi-stop, angled, conic, repeating).

FILTER_BLUR

public static final String FILTER_BLUR = "filterBlur"
CSS filter:blur() radius in pixels.

BACKDROP_FILTER_BLUR

public static final String BACKDROP_FILTER_BLUR = "backdropFilterBlur"
CSS backdrop-filter:blur() radius in pixels.

FILTER_COLOR_MATRIX

public static final String FILTER_COLOR_MATRIX = "filterColorMatrix"
CSS filter: 4x5 color matrix (composed from brightness, contrast, grayscale, hue-rotate, invert, opacity, saturate, sepia). Stored as row-major float[20] - [R,G,B,A] x [R,G,B,A,offset]. Offset column is in 0-255 RGB space.

BACKDROP_FILTER_COLOR_MATRIX

public static final String BACKDROP_FILTER_COLOR_MATRIX = "backdropFilterColorMatrix"
CSS backdrop-filter color matrix (same layout as FILTER_COLOR_MATRIX).

FONT

public static final String FONT = "font"
Font attribute name for the theme hashtable

TRANSPARENCY

public static final String TRANSPARENCY = "transparency"
Transparency attribute name for the theme hashtable

OPACITY

public static final String OPACITY = "opacity"
Opacity attribute name for the theme hashtable

ELEVATION

public static final String ELEVATION = "elevation"
Elevation attribute name for the theme hashtable.

LETTER_SPACING

public static final String LETTER_SPACING = "letterSpacing"
Letter spacing attribute name for the theme hashtable.

ICON_GAP

public static final String ICON_GAP = "iconGap"
Icon gap attribute name for the theme hashtable.

ICON_GAP_UNIT

public static final String ICON_GAP_UNIT = "iconGapUnit"
Icon gap unit attribute.

SURFACE

public static final String SURFACE = "surface"
Surface attribute name for the theme hashtable.

MARGIN

public static final String MARGIN = "margin"
Margin attribute name for the theme hashtable

BORDER

public static final String BORDER = "border"
Border attribute name for the theme hashtable

PADDING

public static final String PADDING = "padding"
Padding attribute name for the theme hashtable

PAINTER

public static final String PAINTER = "painter"
Painter attribute name for the style event

ALIGNMENT

public static final String ALIGNMENT = "align"
Alignment attribute for the style event

TEXT_DECORATION

public static final String TEXT_DECORATION = "textDecoration"
Text decoration attribute for the style event

PADDING_UNIT

public static final String PADDING_UNIT = "padUnit"
The units of the padding

MARGIN_UNIT

public static final String MARGIN_UNIT = "marUnit"
The units of the margin

BACKGROUND_NONE

public static final byte BACKGROUND_NONE = 0
Indicates the background for the style would use a scaled image

BACKGROUND_IMAGE_SCALED

public static final byte BACKGROUND_IMAGE_SCALED = 1
Indicates the background for the style would use a scaled image

BACKGROUND_IMAGE_TILE_BOTH

public static final byte BACKGROUND_IMAGE_TILE_BOTH = 2
Indicates the background for the style would use a tiled image on both axis

BACKGROUND_IMAGE_TILE_VERTICAL

public static final byte BACKGROUND_IMAGE_TILE_VERTICAL = 3
Indicates the background for the style would use a vertical tiled image

BACKGROUND_IMAGE_TILE_HORIZONTAL

public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL = 4
Indicates the background for the style would use a horizontal tiled image

BACKGROUND_IMAGE_ALIGNED_TOP

public static final byte BACKGROUND_IMAGE_ALIGNED_TOP = 20
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_ALIGNED_BOTTOM

public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM = 21
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_ALIGNED_LEFT

public static final byte BACKGROUND_IMAGE_ALIGNED_LEFT = 22
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_ALIGNED_RIGHT

public static final byte BACKGROUND_IMAGE_ALIGNED_RIGHT = 23
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_ALIGNED_CENTER

public static final byte BACKGROUND_IMAGE_ALIGNED_CENTER = 24
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_ALIGNED_TOP_LEFT

public static final byte BACKGROUND_IMAGE_ALIGNED_TOP_LEFT = 25
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_ALIGNED_TOP_RIGHT

public static final byte BACKGROUND_IMAGE_ALIGNED_TOP_RIGHT = 26
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_ALIGNED_BOTTOM_LEFT

public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM_LEFT = 27
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_ALIGNED_BOTTOM_RIGHT

public static final byte BACKGROUND_IMAGE_ALIGNED_BOTTOM_RIGHT = 28
Indicates the background for the style would use an unscaled image with an alignment

BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_TOP

public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_TOP = 4
Indicates the background for the style would use a horizontal tiled image

BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_CENTER

public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_CENTER = 29
Indicates the background for the style would use a horizontal tiled image

BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_BOTTOM

public static final byte BACKGROUND_IMAGE_TILE_HORIZONTAL_ALIGN_BOTTOM = 30
Indicates the background for the style would use a horizontal tiled image

BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_LEFT

public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_LEFT = 3
Indicates the background for the style would use a horizontal tiled image

BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_CENTER

public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_CENTER = 31
Indicates the background for the style would use a horizontal tiled image

BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_RIGHT

public static final byte BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_RIGHT = 32
Indicates the background for the style would use a horizontal tiled image

BACKGROUND_IMAGE_SCALED_FILL

public static final byte BACKGROUND_IMAGE_SCALED_FILL = 33
Indicates the background for the style would use a scaled image that fills all available space while maintaining aspect ratio

BACKGROUND_IMAGE_SCALED_FIT

public static final byte BACKGROUND_IMAGE_SCALED_FIT = 34
Indicates the background for the style would use a scaled image that fits to available space while maintaining aspect ratio

BACKGROUND_GRADIENT_LINEAR_VERTICAL

public static final byte BACKGROUND_GRADIENT_LINEAR_VERTICAL = 6
Indicates the background for the style would use a linear gradient

BACKGROUND_GRADIENT_LINEAR_HORIZONTAL

public static final byte BACKGROUND_GRADIENT_LINEAR_HORIZONTAL = 7
Indicates the background for the style would use a linear gradient

BACKGROUND_GRADIENT_RADIAL

public static final byte BACKGROUND_GRADIENT_RADIAL = 8
Indicates the background for the style would use a radial gradient

BACKGROUND_GRADIENT_LINEAR

public static final byte BACKGROUND_GRADIENT_LINEAR = 35
Multi-stop linear gradient at an arbitrary angle. Driven by the gradient gradient attached via setGradient(); legacy setBackgroundGradientStartColor/EndColor are ignored for this type.

BACKGROUND_GRADIENT_RADIAL_FULL

public static final byte BACKGROUND_GRADIENT_RADIAL_FULL = 36
Multi-stop radial gradient with full CSS shape/extent control. Driven by the gradient descriptor.

BACKGROUND_GRADIENT_CONIC

public static final byte BACKGROUND_GRADIENT_CONIC = 37
Conic / sweep gradient. Driven by the gradient descriptor.

BACKGROUND_GRADIENT_REPEATING_LINEAR

public static final byte BACKGROUND_GRADIENT_REPEATING_LINEAR = 38
Repeating multi-stop linear gradient (CSS repeating-linear-gradient).

BACKGROUND_GRADIENT_REPEATING_RADIAL

public static final byte BACKGROUND_GRADIENT_REPEATING_RADIAL = 39
Repeating multi-stop radial gradient (CSS repeating-radial-gradient).

TEXT_DECORATION_NONE

public static final byte TEXT_DECORATION_NONE = 0
Indicates no text decoration

TEXT_DECORATION_UNDERLINE

public static final byte TEXT_DECORATION_UNDERLINE = 1
Indicates underline

TEXT_DECORATION_STRIKETHRU

public static final byte TEXT_DECORATION_STRIKETHRU = 2
Indicates a strike-through line (usually used to denote deleted text)

TEXT_DECORATION_OVERLINE

public static final byte TEXT_DECORATION_OVERLINE = 4
Indicates overline

TEXT_DECORATION_3D

public static final byte TEXT_DECORATION_3D = 8
3D text effect using a font shadow

TEXT_DECORATION_3D_LOWERED

public static final byte TEXT_DECORATION_3D_LOWERED = 16
3D sunken text effect using a light font shadow

TEXT_DECORATION_3D_SHADOW_NORTH

public static final byte TEXT_DECORATION_3D_SHADOW_NORTH = 32
3D text effect using a font shadow

UNIT_TYPE_PIXELS

public static final byte UNIT_TYPE_PIXELS = 0
Indicates the unit type for padding/margin, the default is in device specific pixels

UNIT_TYPE_SCREEN_PERCENTAGE

public static final byte UNIT_TYPE_SCREEN_PERCENTAGE = 1
Indicates the unit type for padding/margin in percentage of the size of the screen

UNIT_TYPE_DIPS

public static final byte UNIT_TYPE_DIPS = 2
Indicates the unit type for padding/margin in device independent pixels. Device independent pixels try to aim at roughly 1 millimeter of the screen per DIP but make no guarantee for accuracy.

UNIT_TYPE_VW

public static final byte UNIT_TYPE_VW = 3
Indicates the unit type for padding/margin as a percentage of the screen width.

UNIT_TYPE_VH

public static final byte UNIT_TYPE_VH = 4
Indicates the unit type for padding/margin as a percentage of the screen height.

UNIT_TYPE_VMIN

public static final byte UNIT_TYPE_VMIN = 5
Indicates the unit type for padding/margin as a percentage the minimum of screen width and height.

UNIT_TYPE_VMAX

public static final byte UNIT_TYPE_VMAX = 6
Indicates the unit type for padding/margin as a percentage the maximum of screen width and height.

UNIT_TYPE_REM

public static final byte UNIT_TYPE_REM = 7
Indicates the unit type for padding/margin relative to the font size of the default font. 1rem == Font.getDefaultFont().getHeight()

Constructor details

Style

public Style()
Each component when it draw itself uses this Object to determine in what colors it should use. When a Component is generated it construct a default Style Object. The Default values for each Component can be changed by using the UIManager class

Style

public Style(Style style)
Creates a full copy of the given style. Notice that if the original style was modified manually (by invoking setters on it) it would not chnage when changing a theme/look and feel, however this newly created style would change in such a case.

Parameters

style Style
the style to copy

Style

public Style(int fgColor, int bgColor, Font f, byte transparency)
Creates a new style with the given attributes

Parameters

fgColor int
foreground color
bgColor int
background color
f Font
font
transparency byte
transparency value

Style

public Style(int fgColor, int bgColor, Font f, byte transparency, Image im, byte backgroundType)
Creates a new style with the given attributes

Parameters

fgColor int
foreground color
bgColor int
background color
f Font
font
transparency byte
transparency value
im Image
background image
backgroundType byte
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_RADIAL

Method details

createProxyStyle

public 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

Parameters

styles Style...
the styles to which we will proxy

Returns

a proxy style object

markAsRendererStyle

public void markAsRendererStyle()
Disables native OS optimizations that might collide with cell renderers which do things like sharing style objects

isRendererStyle

public boolean isRendererStyle()
Indicates whether this style has been marked for use with renderers.

Returns

true if #markAsRendererStyle() was invoked.

merge

public void merge(Style style)
Merges the new style with the current style without changing the elements that were modified.

Parameters

style Style
new values of styles from the current theme

getElevation

public int getElevation()
Gets the elevation value of this style. Valid values include 0, 1, 2, 3, 4, 6, 8, 9, 12, 16, and 24.

Returns

The elevation value. Default is 0.

setElevation

public void setElevation(int elevation)
Sets the elevation value. Valid values include 0, 1, 2, 3, 4, 6, 8, 9, 12, 16, and 24.

Parameters

elevation int
The elevation value.

getIconGap

public int getIconGap()
Returns the icon gap in pixels.

getLetterSpacing

public float getLetterSpacing()
Returns the letter spacing (in EM units, font-size relative) applied to text drawn with this style. 0 means the platform default (no extra spacing).

setLetterSpacing

public void setLetterSpacing(float letterSpacing)
Sets the letter spacing in EM units (font-size relative). A native theme uses this to match a Material/iOS text appearance’s tracking per component. The spacing is carried by the style’s font so it affects both layout measurement and rendering.

setLetterSpacing

public void setLetterSpacing(float spacing, boolean override)
Sets the letter spacing in EM units. See setLetterSpacing(float).

setIconGap

public void setIconGap(float gap)
Sets the icon gap in the current units.

Parameters

gap float
The icon gap.

getIconGapUnit

public int getIconGapUnit()
Returns the icon gap unit. One of #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

Returns

The icon gap unit

setIconGapUnit

public void setIconGapUnit(byte unit)
Sets the icon gap unit.

Parameters

unit byte
The icon gap unit. One of the standard style units of measurement.

isSurface

public boolean isSurface()
Checks whether the component is a surface. Surface containers support a sort of z-index of descendants via the elevation attribute. Surfaces will render the shadows of elevated descendants to convey depth.

Returns

True if container should be rendered as a surface.

setSurface

public void setSurface(boolean surface)
Enables or disables surface rendering mode for component. Surfaces can support a sort of z-indexing of its descendants via their elevation properties. The surface will render the shadows of elevated descendants to convey depth.

Parameters

surface boolean
True to enable surface rendering mode.

isModified

public boolean isModified()
Returns true if the style was modified manually after it was created by the look and feel. If the style was modified manually (by one of the set methods) then it should be merged rather than overwritten.

Returns

true if the style was modified

getBgColor

public int getBgColor()
Background color for the component

Returns

the background color for the component

setBgColor

public void setBgColor(int bgColor)
Sets the background color for the component

Parameters

bgColor int
RRGGBB color that ignors the alpha component

getBgImage

public Image getBgImage()
Background image for the component

Returns

the background image for the component

setBgImage

public void setBgImage(Image bgImage)
Sets the background image for the component

Parameters

bgImage Image
background image

getBackgroundType

public byte getBackgroundType()
The type of the background defaults to BACKGROUND_IMAGE_SCALED

Returns

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_RADIAL

setBackgroundType

public void setBackgroundType(byte backgroundType)
Sets the background type for the component

Parameters

backgroundType byte
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_RADIAL

getBackgroundGradientStartColor

public int getBackgroundGradientStartColor()
Start color for the radial/linear gradient

Returns

the start color for the radial/linear gradient

setBackgroundGradientStartColor

public void setBackgroundGradientStartColor(int backgroundGradientStartColor)
Sets the background color for the component

Parameters

backgroundGradientStartColor int
start color for the linear/radial gradient

getBackgroundGradientEndColor

public int getBackgroundGradientEndColor()
End color for the radial/linear gradient

Returns

the end color for the radial/linear gradient

setBackgroundGradientEndColor

public void setBackgroundGradientEndColor(int backgroundGradientEndColor)
Sets the background color for the component

Parameters

backgroundGradientEndColor int
end color for the linear/radial gradient

getBackgroundGradientRelativeX

public float getBackgroundGradientRelativeX()
Background radial gradient relative center position X

Returns

value between 0 and 1 with 0.5 representing the center of the component

setBackgroundGradientRelativeX

public void setBackgroundGradientRelativeX(float backgroundGradientRelativeX)
Background radial gradient relative center position X

Parameters

backgroundGradientRelativeX float
x position of the radial gradient center

getBackgroundGradientRelativeY

public float getBackgroundGradientRelativeY()
Background radial gradient relative center position Y

Returns

value between 0 and 1 with 0.5 representing the center of the component

setBackgroundGradientRelativeY

public void setBackgroundGradientRelativeY(float backgroundGradientRelativeY)
Background radial gradient relative center position Y

Parameters

backgroundGradientRelativeY float
y position of the radial gradient center

getBackgroundGradientRelativeSize

public float getBackgroundGradientRelativeSize()
Background radial gradient relative size

Returns

value representing the relative size of the gradient

setBackgroundGradientRelativeSize

public void setBackgroundGradientRelativeSize(float backgroundGradientRelativeSize)
Background radial gradient relative size

Parameters

backgroundGradientRelativeSize float
the size of the radial gradient

getFgColor

public int getFgColor()
Foreground color for the component

Returns

the foreground color for the component

setFgColor

public final void setFgColor(int fgColor)
Sets the foreground color for the component

Parameters

fgColor int
foreground color

getFgAlpha

public int getFgAlpha()
Foreground alpha for the component

Returns

the foreground alpha for the component

setFgAlpha

public void setFgAlpha(int fgAlpha)
Sets the foreground alpha for the component

Parameters

fgAlpha int
foreground alpha

getFont

public Font getFont()
Font for the component

Returns

the font for the component

setFont

public void setFont(Font font)
Sets the font for the component

Parameters

font Font
the font

setElevation

public void setElevation(int elevation, boolean override)
Sets the elevation value. Valid values include 0, 1, 2, 3, 4, 6, 8, 9, 12, 16, and 24.

Parameters

elevation int
The elevation value.
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setIconGap

public void setIconGap(float gap, byte units, boolean override)
Sets the icon gap.

Parameters

gap float
The gap.
units byte
The units of the gap.
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setIconGap

public void setIconGap(float gap, boolean override)
Sets the icon gap.

Parameters

gap float
the icon gap.
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setIconGap

public void setIconGap(float gap, byte unit)
Sets the icon gap.

Parameters

gap float
The icon gap.
unit byte
The unit. One of the standard style units of measurement.

setIconGapUnit

public void setIconGapUnit(byte unit, boolean override)
Sets the icon gap unit.

Parameters

unit byte
The icon gap unit. One of the standard style units of measurement.
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setSurface

public void setSurface(boolean surface, boolean override)
Enables or disables surface rendering mode for component. Surfaces can support a sort of z-indexing of its descendants via their elevation properties. The surface will render the shadows of elevated descendants to convey depth.

Parameters

surface boolean
True to enable surface rendering mode.
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setAlignment

public void setAlignment(int align, boolean override)
Sets the Alignment of the Label to one of: CENTER, LEFT, RIGHT

Parameters

align int
alignment value
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

getAlignment

public int getAlignment()
Returns the alignment of the Label

Returns

the alignment of the Label one of: CENTER, LEFT, RIGHT

setAlignment

public void setAlignment(int align)
Sets the Alignment of the Label to one of: CENTER, LEFT, RIGHT

Parameters

align int
alignment value

isUnderline

public boolean isUnderline()
Returns true if the underline text decoration is on, false otherwise

Returns

true if the underline text decoration is on, false otherwise

setUnderline

public void setUnderline(boolean underline)
Sets the underline text decoration for this style

Parameters

underline boolean
true to turn underline on, false to turn it off

set3DText

public void set3DText(boolean t, boolean raised)
Sets the 3D text decoration for this style

Parameters

t boolean
true to turn 3d shadow effect on, false to turn it off
raised boolean
indicates a raised or lowered effect

is3DTextNorth

public boolean is3DTextNorth()
Returns the text decoration state for the north

Returns

true if that is used

set3DTextNorth

public void set3DTextNorth(boolean north)
Sets the text decoration to 3D text

Parameters

north boolean
true to enable 3d text with the shadow on top false otherwise

isRaised3DText

public boolean isRaised3DText()
Returns true if the 3D text decoration is on, false otherwise

Returns

true if the 3D text decoration is on, false otherwise

isLowered3DText

public boolean isLowered3DText()
Returns true if the 3D text decoration is on, false otherwise

Returns

true if the 3D text decoration is on, false otherwise

isOverline

public boolean isOverline()
Returns true if the overline text decoration is on, false otherwise

Returns

true if the overline text decoration is on, false otherwise

setOverline

public void setOverline(boolean overline)
Sets the overline text decoration for this style

Parameters

overline boolean
true to turn overline on, false to turn it off

isStrikeThru

public boolean isStrikeThru()
Returns true if the strike through text decoration is on, false otherwise

Returns

true if the strike through text decoration is on, false otherwise

setStrikeThru

public void setStrikeThru(boolean strikethru)
Sets the strike through text decoration for this style

Parameters

strikethru boolean
true to turn strike through on, false to turn it off

getTextDecoration

public int getTextDecoration()
Returns the text decoration of this style

Returns

the text decoration of this style (bitmask of the TEXT_DECORATION_* constants)

setTextDecoration

public void setTextDecoration(int textDecoration)
Sets the text decoration of this style

Parameters

textDecoration int
the textDecoration to set (bitmask of the TEXT_DECORATION_* constants)

setTextDecoration

public void setTextDecoration(int textDecoration, boolean override)
Sets the text decoration of this style

Parameters

textDecoration int
the textDecoration to set (bitmask of the TEXT_DECORATION_* constants)
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

getBgTransparency

public byte getBgTransparency()
Returns the transparency (opacity) level of the Component, zero indicates fully transparent and FF indicates fully opaque.

Returns

the transparency level of the Component

setBgTransparency

public void setBgTransparency(byte transparency)
Sets the Component transparency (opacity) level of the Component, zero indicates fully transparent and FF indicates fully opaque.

Parameters

transparency byte
transparency level as byte

setBgTransparency

public void setBgTransparency(int transparency)
Sets the Component transparency level. Valid values should be a number between 0-255

Parameters

transparency int
int value between 0-255

getOpacity

public int getOpacity()
Returns the opacity value for the component

Returns

the opacity value

setOpacity

public final void setOpacity(int opacity)
Set the opacity value

Parameters

opacity int
the opacity value

setOpacity

public final void setOpacity(int opacity, boolean override)
Sets the Component transparency level. Valid values should be a number between 0-255

Parameters

opacity int
int value between 0-255
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

stripMarginAndPadding

public void stripMarginAndPadding()
Strips all margin and padding from this style.

setPadding

public void setPadding(int top, int bottom, int left, int right)
Sets the Style Padding. Units are specified by #setPaddingUnit(byte...)

Parameters

top int
number of units to pad the top
bottom int
number of units to pad the bottom
left int
number of units to pad the left
right int
number of units to pad the right

setPadding

public void setPadding(float top, float bottom, float left, float right)
Sets the Style Padding. Units are specified by #setPaddingUnit(byte...)

Parameters

top float
number of units to pad the top
bottom float
number of units to pad the bottom
left float
number of units to pad the left
right float
number of units to pad the right

setPadding

public void setPadding(int orientation, int gap)
Sets the Style Padding. Units are specified by #setPaddingUnit(byte...)

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
gap int
number of units to pad the orientation

setPadding

public void setPadding(int orientation, float gap)
Sets the Style Padding. Units are specified by #setPaddingUnit(byte...)

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
gap float
number of units to pad the orientation

setMargin

public void setMargin(int top, int bottom, int left, int right)
Sets the Style Margin

Parameters

top int
number of margin using the current unit
bottom int
number of margin using the current unit
left int
number of margin using the current unit
right int
number of margin using the current unit

setMargin

public void setMargin(float top, float bottom, float left, float right)
Sets the Style Margin

Parameters

top float
number of margin using the current unit
bottom float
number of margin using the current unit
left float
number of margin using the current unit
right float
number of margin using the current unit

cacheMargins

public void cacheMargins(boolean override)
Store current margin values into a cache that could be restored with restoreCachedMargins()

Parameters

override boolean
if true, margins are cached even if a previous cache already exists. If false, margins are cached only if no cache already exists. Warning: This method is used internally when hidding a component with the Component.setHidden(true) method and expect a component with no previous margins cache. So do not use this method on a component that would be hidden or flush its margins cache by calling flushMarginsCache() before hidding the component. And do not use on an hidden component either or unhidding this component might result in unexpected results

restoreCachedMargins

public 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

flushMarginsCache

public void flushMarginsCache()
Flush the margins cache if one exists

setMargin

public void setMargin(int orientation, int gap)
Sets the Style Margin

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
gap int
number of margin using the current unit

setMargin

public void setMargin(int orientation, float gap)
Sets the Style Margin

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
gap float
number of margin using the current unit

getPaddingValue

public int getPaddingValue(boolean rtl, int orientation)
Deprecated. Use int)
Returns the Padding in the internal value regardless of the unit

Parameters

rtl boolean
flag indicating whether the padding is for an RTL bidi component
orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT

Returns

amount of padding in the given orientation using current units.

getPaddingFloatValue

public float getPaddingFloatValue(boolean rtl, int orientation)
Returns the Padding in the internal value regardless of the unit

Parameters

rtl boolean
flag indicating whether the padding is for an RTL bidi component
orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT

Returns

amount of padding in the given orientation using current units.

getPaddingLeft

public int getPaddingLeft(boolean rtl)
Returns the left padding in pixel or right padding in an RTL situation

Parameters

rtl boolean
indicates a right to left language

Returns

the padding in pixels

setPaddingUnitLeft

public void setPaddingUnitLeft(byte unit)
Sets left padding unit.

Parameters

unit byte
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.

setPaddingUnitRight

public void setPaddingUnitRight(byte unit)
Sets right padding unit.

Parameters

unit byte
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.

setPaddingUnitTop

public void setPaddingUnitTop(byte unit)
Sets top padding unit.

Parameters

unit byte
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.

setPaddingUnitBottom

public void setPaddingUnitBottom(byte unit)
Sets bottom padding unit.

Parameters

unit byte
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.

getPaddingRight

public int getPaddingRight(boolean rtl)
Returns the right padding in pixel or left padding in an RTL situation

Parameters

rtl boolean
indicates a right to left language

Returns

the padding in pixels

getPaddingTop

public int getPaddingTop()
Returns the top padding in pixel

Returns

the padding in pixels

setPaddingTop

public void setPaddingTop(int gap)
Sets the Style Padding on the top, this is equivalent to calling setPadding(Component.TOP, gap, false);

Parameters

gap int
amount to pad the top in current units.

setPaddingTop

public void setPaddingTop(float gap)
Sets the Style Padding on the top, this is equivalent to calling setPadding(Component.TOP, gap, false);

Parameters

gap float
Amount to pad the top in current units.

setPaddingLeft

public void setPaddingLeft(int gap)
Sets the Style Padding on the left, this is equivalent to calling setPadding(Component.LEFT, gap, false);

Parameters

gap int
Amount to pad the left in current units.

setPaddingLeft

public void setPaddingLeft(float gap)
Sets the Style Padding on the left, this is equivalent to calling setPadding(Component.LEFT, gap, false);

Parameters

gap float
Amount to pad the left in current units.

setPaddingRight

public void setPaddingRight(int gap)
Sets the Style Padding on the right, this is equivalent to calling setPadding(Component.RIGHT, gap, false);

Parameters

gap int
Amount to pad the right in current units.

setPaddingRight

public void setPaddingRight(float gap)
Sets the Style Padding on the right, this is equivalent to calling setPadding(Component.RIGHT, gap, false);

Parameters

gap float
Amount to pad the right in current units.

setMarginLeft

public void setMarginLeft(int gap)
Sets the Style Margin on the left, this is equivalent to calling setMargin(Component.LEFT, gap, false);

Parameters

gap int
number of left margin using the current unit

setMarginLeft

public void setMarginLeft(float gap)
Sets the Style Margin on the left, this is equivalent to calling setMargin(Component.LEFT, gap, false);

Parameters

gap float
number of left margin using the current unit

setMarginRight

public void setMarginRight(int gap)
Sets the Style Margin on the right, this is equivalent to calling setMargin(Component.RIGHT, gap, false);

Parameters

gap int
number of right margin using the current unit

setMarginRight

public void setMarginRight(float gap)
Sets the Style Margin on the right, this is equivalent to calling setMargin(Component.RIGHT, gap, false);

Parameters

gap float
number of right margin using the current unit

getPaddingBottom

public int getPaddingBottom()
Returns the bottom padding in pixel

Returns

the padding in pixels

setPaddingBottom

public void setPaddingBottom(int gap)
Sets the Style Padding on the bottom, this is equivalent to calling setPadding(Component.BOTTOM, gap, false);

Parameters

gap int
Amount to pad the bottom in current units.

setPaddingBottom

public void setPaddingBottom(float gap)
Sets the Style Padding on the bottom, this is equivalent to calling setPadding(Component.BOTTOM, gap, false);

Parameters

gap float
Amount to pad the bottom in current units.

getHorizontalMargins

public int getHorizontalMargins()
The equivalent of getMarginLeft + getMarginRight

Returns

the side margin

getVerticalMargins

public int getVerticalMargins()
The equivalent of getMarginTop + getMarginBottom

Returns

the vertical margin

getHorizontalPadding

public int getHorizontalPadding()
The equivalent of getPaddingLeft + getPaddingRight

Returns

the side padding

getVerticalPadding

public int getVerticalPadding()
The equivalent of getPaddingTop + getPaddingBottom

Returns

the vertical padding

getMarginRightNoRTL

public int getMarginRightNoRTL()
Returns the right margin in pixels ignoring RTL

Returns

the margin in pixels

getMarginLeftNoRTL

public int getMarginLeftNoRTL()
Returns the left margin in pixels ignoring RTL

Returns

the margin in pixels

getPaddingRightNoRTL

public int getPaddingRightNoRTL()
Returns the right padding in pixels ignoring RTL

Returns

the padding in pixels

getPaddingLeftNoRTL

public int getPaddingLeftNoRTL()
Returns the left padding in pixels ignoring RTL

Returns

the padding in pixels

getMarginRight

public int getMarginRight(boolean rtl)
Returns the right margin in pixel or left margin in an RTL situation

Parameters

rtl boolean
indicates a right to left language

Returns

the margin in pixels

getMarginLeft

public int getMarginLeft(boolean rtl)
Returns the left margin in pixel or right margin in an RTL situation

Parameters

rtl boolean
indicates a right to left language

Returns

the margin in pixels

getMarginTop

public int getMarginTop()
Returns the top margin in pixel

Returns

the margin in pixels

setMarginTop

public void setMarginTop(int gap)
Sets the Style margin on the top, this is equivalent to calling setMargin(Component.TOP, gap, false);

Parameters

gap int
number of top margin using the current unit

setMarginTop

public void setMarginTop(float gap)
Sets the Style margin on the top, this is equivalent to calling setMargin(Component.TOP, gap, false);

Parameters

gap float
number of top margin using the current unit

getMarginBottom

public int getMarginBottom()
Returns the bottom margin in pixel

Returns

the margin in pixels

setMarginBottom

public void setMarginBottom(int gap)
Sets the Style Margin on the bottom, this is equivalent to calling setMargin(Component.BOTTOM, gap, false);

Parameters

gap int
number of bottom margin using the current unit

setMarginBottom

public void setMarginBottom(float gap)
Sets the Style Margin on the bottom, this is equivalent to calling setMargin(Component.BOTTOM, gap, false);

Parameters

gap float
number of bottom margin using the current unit

getPadding

public int getPadding(boolean rtl, int orientation)
Returns the Padding in using the current unit

Parameters

rtl boolean
flag indicating whether the padding is for an RTL bidi component
orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT

Returns

number of padding pixels in the given orientation

getPadding

public int getPadding(int orientation)
Returns the Padding

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT

Returns

number of padding pixels in the given orientation

getMargin

public int getMargin(int orientation)
Returns the Margin

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT

Returns

number of margin using the current unit in the given orientation

getMargin

public int getMargin(boolean rtl, int orientation)
Returns the Margin

Parameters

rtl boolean
flag indicating whether the padding is for an RTL bidi component
orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT

Returns

number of margin using the current unit in the given orientation

getMarginValue

public int getMarginValue(boolean rtl, int orientation)
Deprecated. Use int)
Returns the Margin

Parameters

rtl boolean
flag indicating whether the padding is for an RTL bidi component
orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT

Returns

number of margin using the current unit in the given orientation

getMarginFloatValue

public float getMarginFloatValue(boolean rtl, int orientation)
Returns the Margin

Parameters

rtl boolean
flag indicating whether the padding is for an RTL bidi component
orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT

Returns

number of margin using the current unit in the given orientation

setBgColor

public void setBgColor(int bgColor, boolean override)
Sets the background color for the component

Parameters

bgColor int
RRGGBB color that ignores the alpha component
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setBgImage

public void setBgImage(Image bgImage, boolean override)
Sets the background image for the component

Parameters

bgImage Image
background image
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setBackgroundType

public void setBackgroundType(byte backgroundType, boolean override)
Sets the background type for the component

Parameters

backgroundType byte
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_RADIAL
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setBackgroundGradientStartColor

public void setBackgroundGradientStartColor(int backgroundGradientStartColor, boolean override)
Sets the background color for the component

Parameters

backgroundGradientStartColor int
start color for the linear/radial gradient
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setBackgroundGradientEndColor

public void setBackgroundGradientEndColor(int backgroundGradientEndColor, boolean override)
Sets the background color for the component

Parameters

backgroundGradientEndColor int
end color for the linear/radial gradient
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setBackgroundGradientRelativeX

public void setBackgroundGradientRelativeX(float backgroundGradientRelativeX, boolean override)
Background radial gradient relative center position X

Parameters

backgroundGradientRelativeX float
x position of the radial gradient center
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setBackgroundGradientRelativeY

public void setBackgroundGradientRelativeY(float backgroundGradientRelativeY, boolean override)
Background radial gradient relative center position Y

Parameters

backgroundGradientRelativeY float
y position of the radial gradient center
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setBackgroundGradientRelativeSize

public void setBackgroundGradientRelativeSize(float backgroundGradientRelativeSize, boolean override)
Background radial gradient relative size

Parameters

backgroundGradientRelativeSize float
the size of the radial gradient relative to the screens larger dimension
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

getGradient

public Gradient getGradient()
Extended (multi-stop / angled / conic / repeating) gradient backing BACKGROUND_GRADIENT_LINEAR / BACKGROUND_GRADIENT_RADIAL_FULL / BACKGROUND_GRADIENT_CONIC / BACKGROUND_GRADIENT_REPEATING_*. May be null if this Style uses no extended gradient.

setGradient

public void setGradient(Gradient gradient)
Sets the extended gradient. Pass null to clear it.

setGradient

public void setGradient(Gradient gradient, boolean override)
Internal setter variant honoring the override flag.

getFilterBlurRadius

public float getFilterBlurRadius()
CSS filter:blur() radius applied to the component’s foreground (the component itself, after it has been painted). 0 disables the filter.

setFilterBlurRadius

public void setFilterBlurRadius(float radius)

setFilterBlurRadius

public void setFilterBlurRadius(float radius, boolean override)

getBackdropFilterBlurRadius

public float getBackdropFilterBlurRadius()
CSS backdrop-filter:blur() radius applied to whatever is painted behind the component before this component is drawn. 0 disables the filter.

setBackdropFilterBlurRadius

public void setBackdropFilterBlurRadius(float radius)

setBackdropFilterBlurRadius

public void setBackdropFilterBlurRadius(float radius, boolean override)

getFilterColorMatrix

public float[] getFilterColorMatrix()
CSS filter color-matrix: 4x5 row-major float[20] composed from brightness / contrast / grayscale / hue-rotate / invert / opacity / saturate / sepia. Returns null when no color filter is active (treat as identity).

setFilterColorMatrix

public void setFilterColorMatrix(float[] matrix)

setFilterColorMatrix

public void setFilterColorMatrix(float[] matrix, boolean override)

getBackdropFilterColorMatrix

public float[] getBackdropFilterColorMatrix()
CSS backdrop-filter color-matrix; same layout as filterColorMatrix but applied to whatever is painted behind the component.

setBackdropFilterColorMatrix

public void setBackdropFilterColorMatrix(float[] matrix)

setBackdropFilterColorMatrix

public void setBackdropFilterColorMatrix(float[] matrix, boolean override)

isExtendedGradientBackground

public boolean isExtendedGradientBackground()
Returns true when the backgroundType requires the extended gradient descriptor (i.e. legacy 2-color start/end accessors are not sufficient).

setFgColor

public final void setFgColor(int fgColor, boolean override)
Sets the foreground color for the component

Parameters

fgColor int
foreground color
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setFgAlpha

public void setFgAlpha(int fgAlpha, boolean override)
Sets the foreground alpha for the component

Parameters

fgAlpha int
foreground alpha
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setFont

public void setFont(Font font, boolean override)
Sets the font for the component

Parameters

font Font
the font
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setBgTransparency

public void setBgTransparency(int transparency, boolean override)
Sets the Component transparency level. Valid values should be a number between 0-255

Parameters

transparency int
int value between 0-255
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setPadding

public void setPadding(int orientation, int gap, boolean override)
Sets the Style Padding

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
gap int
number of pixels to pad the orientation
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setPadding

public void setPadding(int orientation, float gap, boolean override)
Sets the Style Padding

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
gap float
number of pixels to pad the orientation
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setMargin

public void setMargin(int orientation, int gap, boolean override)
Sets the Style Margin

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
gap int
number of margin using the current unit
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

setMargin

public void setMargin(int orientation, float gap, boolean override)
Sets the Style Margin

Parameters

orientation int
one of: Component.TOP, Component.BOTTOM, Component.LEFT, Component.RIGHT
gap float
number of margin using the current unit
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

isSuppressChangeEvents

public boolean isSuppressChangeEvents()
Checks to see if change events are currently suppressed.

Returns

True if change events are suppressed.

setSuppressChangeEvents

public void setSuppressChangeEvents(boolean suppress)
Enables or disables events. Use this to temporarily suppress change events.

Parameters

suppress boolean
True to suppress change events.

addStyleListener

public void addStyleListener(StyleListener l)
Adds a Style Listener to the Style Object.

Parameters

l StyleListener
a style listener

removeStyleListener

public void removeStyleListener(StyleListener l)
Removes a Style Listener from the Style Object.

Parameters

l StyleListener
a style listener

removeListeners

public void removeListeners()
This method removes all Listeners from the Style

setBorder

public void setBorder(Border border, boolean override)
Sets the border for the style

Parameters

border Border
new border object for the component
override boolean
If set to true allows the look and feel/theme to override the value in this attribute when changing a theme/look and feel

getBorder

public Border getBorder()
Returns the border for the style

Returns

the border

setBorder

public void setBorder(Border border)
Sets the border for the style

Parameters

border Border
new border object for the component

getBgPainter

public Painter getBgPainter()
Return the background painter for this style, normally this would be the internal image/color painter but can be user defined

Returns

the background painter

setBgPainter

public 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

Parameters

bgPainter Painter
new painter to install into the style

getPaddingUnit

public 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.

Returns

the paddingUnit

setPaddingUnit

public 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.

Parameters

paddingUnit byte...
the paddingUnit to set

getMarginUnit

public 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.

Returns

the marginUnit

setMarginUnit

public 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.

Parameters

marginUnit byte...
the marginUnit to set

setMarginUnitLeft

public void setMarginUnitLeft(byte unit)
Sets left margin unit.

Parameters

unit byte
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.

setMarginUnitRight

public void setMarginUnitRight(byte unit)
Sets right margin unit.

Parameters

unit byte
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.

setMarginUnitTop

public void setMarginUnitTop(byte unit)
Sets top margin unit.

Parameters

unit byte
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.

setMarginUnitBottom

public void setMarginUnitBottom(byte unit)
Sets bottom margin unit.

Parameters

unit byte
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.

equals

public boolean equals(Object obj)
Indicates whether some other object is “equal to” this one. The equals method implements an equivalence relation: It is reflexive: for any reference value x, x.equals(x) should return true. It is symmetric: for any reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true. It is transitive: for any reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true. It is consistent: for any reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the object is modified. For any non-null reference value x, x.equals(null) should return false. The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable. The general contract of hashCode is: Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables. As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)