public class Style
extends java.lang.Object
The foreground color is used to render the text (or any drawing in the content).
The background & the background color are used to render the background of the element.
The font profile contains the different properties to select the font used to render the text (or to define the size of a drawn element).
The text manager is able to render the text.
The alignment defines the position of the content (text or image or other) inside the element bounds.
The outlines implement the CSS box model. An outline is a box that wraps another box. An element is wrapped in a
sequence of outlines: the padding, the border then the margin:
The dimension allows to control the size of an element.
Modifier and Type | Field and Description |
---|---|
protected int |
alignment
Alignment.
|
protected static int |
ALIGNMENT_SHIFT
Alignment field position in bit map.
|
protected Background |
background
Background.
|
protected static int |
BACKGROUND_COLOR_SHIFT
Background color field position in bit map.
|
protected static int |
BACKGROUND_SHIFT
Background field position in bit map.
|
protected int |
backgroundColor
Background color.
|
protected Border |
border
Border.
|
protected static int |
BORDER_COLOR_SHIFT
Border color field position in bit map.
|
protected static int |
BORDER_SHIFT
Border field position in bit map.
|
protected int |
borderColor
Border color.
|
protected static int |
COMPLETE_MAP
Map value when all fields are set.
|
protected Dimension |
dimension
Dimension.
|
protected static int |
DIMENSION_SHIFT
Dimension field position in bit map.
|
protected static int |
FONT_PROFILE_SHIFT
Font profile field position in bit map.
|
protected FontProfile |
fontProfile
Font profile.
|
protected static int |
FOREGROUND_COLOR_SHIFT
Foreground color field position in bit map.
|
protected int |
foregroundColor
Foreground color.
|
protected int |
map
Bit map for set fields.
|
protected Outline |
margin
Margin.
|
protected static int |
MARGIN_SHIFT
Margin field position in bit map.
|
protected Outline |
padding
Padding.
|
protected static int |
PADDING_SHIFT
Padding field position in bit map.
|
protected static int |
TEXT_MANAGER_SHIFT
Text manager field position in bit map.
|
protected TextManager |
textManager
Text manager.
|
Constructor and Description |
---|
Style()
Creates a style.
|
Style(Style style)
Creates a style from another one.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getAlignment()
Gets the content alignment.
|
Background |
getBackground()
Gets the background.
|
int |
getBackgroundColor()
Gets the background color.
|
Border |
getBorder()
Gets the border.
|
int |
getBorderColor()
Gets the border color.
|
Dimension |
getDimension()
Gets the dimension.
|
FontProfile |
getFontProfile()
Gets the font profile.
|
int |
getForegroundColor()
Gets the foreground color.
|
Outline |
getMargin()
Gets the margin.
|
Outline |
getPadding()
Gets the padding.
|
TextManager |
getTextManager()
Gets the text manager.
|
int |
hashCode() |
boolean |
isComplete()
Checks whether or not the style is complete.
|
boolean |
isSetAlignment()
Checks whether or not the alignment of the style is set.
|
boolean |
isSetBackground()
Checks whether or not the background of the style is set.
|
boolean |
isSetBackgroundColor()
Checks whether or not the background color of the style is set.
|
boolean |
isSetBorder()
Checks whether or not the border of the style is set.
|
boolean |
isSetBorderColor()
Checks whether or not the border color of the style is set.
|
boolean |
isSetDimension()
Checks whether or not the dimension of the style is set.
|
boolean |
isSetFontProfile()
Checks whether or not the font profile of the style is set.
|
boolean |
isSetForegroundColor()
Checks whether or not the foreground color of the style is set.
|
boolean |
isSetMargin()
Checks whether or not the margin of the style is set.
|
boolean |
isSetPadding()
Checks whether or not the padding of the style is set.
|
boolean |
isSetTextManager()
Checks whether or not the text manager of the style is set.
|
void |
override(Style style)
Fills all defined attributes of the given style in this style.
|
protected static final int FOREGROUND_COLOR_SHIFT
protected static final int BACKGROUND_COLOR_SHIFT
protected static final int BORDER_COLOR_SHIFT
protected static final int BORDER_SHIFT
protected static final int FONT_PROFILE_SHIFT
protected static final int ALIGNMENT_SHIFT
protected static final int TEXT_MANAGER_SHIFT
protected static final int DIMENSION_SHIFT
protected static final int PADDING_SHIFT
protected static final int MARGIN_SHIFT
protected static final int BACKGROUND_SHIFT
protected static final int COMPLETE_MAP
protected int map
protected int foregroundColor
protected int backgroundColor
protected int borderColor
protected Border border
protected FontProfile fontProfile
protected int alignment
protected TextManager textManager
protected Dimension dimension
protected Outline padding
protected Outline margin
protected Background background
public Style()
0
0
0
0
.null
.public Style(@NonNull Style style)
style
- the style to copy from.public int getForegroundColor()
public int getBackgroundColor()
public int getBorderColor()
public Border getBorder()
public FontProfile getFontProfile()
public int getAlignment()
public TextManager getTextManager()
public Dimension getDimension()
public Outline getPadding()
public Outline getMargin()
public Background getBackground()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isComplete()
true
if the style is complete, false
otherwise.public boolean isSetForegroundColor()
true
if the foreground color is set, false
otherwise.public boolean isSetBackgroundColor()
true
if the background color is set, false
otherwise.public boolean isSetBorderColor()
true
if the border color is set, false
otherwise.public boolean isSetBorder()
true
if the border is set, false
otherwise.public boolean isSetFontProfile()
true
if the font profile is set, false
otherwise.public boolean isSetAlignment()
true
if the alignment is set, false
otherwise.public boolean isSetTextManager()
true
if the text manager is set, false
otherwise.public boolean isSetDimension()
true
if the dimension is set, false
otherwise.public boolean isSetPadding()
true
if the padding is set, false
otherwise.public boolean isSetMargin()
true
if the margin is set, false
otherwise.public boolean isSetBackground()
true
if the background is set, false
otherwise.public void override(@NonNull Style style)
style
- the style to get the attributes from.