public class EditableStyle extends Style
An editable style is used to create rules in a stylesheet.
A stylesheet does not keep a reference to the style of a rule. It means that:
clear()
method between
each one for example).alignment, ALIGNMENT_SHIFT, background, BACKGROUND_COLOR_SHIFT, BACKGROUND_SHIFT, backgroundColor, border, BORDER_COLOR_SHIFT, BORDER_SHIFT, borderColor, COMPLETE_MAP, dimension, DIMENSION_SHIFT, FONT_PROFILE_SHIFT, fontProfile, FOREGROUND_COLOR_SHIFT, foregroundColor, map, margin, MARGIN_SHIFT, padding, PADDING_SHIFT, TEXT_MANAGER_SHIFT, textManager
Constructor and Description |
---|
EditableStyle()
Creates an editable style.
|
EditableStyle(Style style)
Creates an editable style from another one.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all the attributes of the style.
|
void |
setAlignment(int alignment)
Sets the content alignment.
|
void |
setBackground(Background background)
Sets the background.
|
void |
setBackgroundColor(int backgroundColor)
Sets the background color.
|
void |
setBorder(Border border)
Sets the border.
|
void |
setBorderColor(int borderColor)
Sets the border color.
|
void |
setDimension(Dimension dimension)
Sets the dimension.
|
void |
setFontProfile(FontProfile fontProfile)
Sets the font profile.
|
void |
setForegroundColor(int foregroundColor)
Sets the foreground color.
|
void |
setMargin(Outline margin)
Sets the margin.
|
void |
setPadding(Outline padding)
Sets the padding.
|
void |
setTextManager(TextManager textManager)
Sets the text manager.
|
equals, getAlignment, getBackground, getBackgroundColor, getBorder, getBorderColor, getDimension, getFontProfile, getForegroundColor, getMargin, getPadding, getTextManager, hashCode, isComplete, isSetAlignment, isSetBackground, isSetBackgroundColor, isSetBorder, isSetBorderColor, isSetDimension, isSetFontProfile, isSetForegroundColor, isSetMargin, isSetPadding, isSetTextManager, override
public EditableStyle()
Style.Style()
public void clear()
public void setForegroundColor(int foregroundColor)
foregroundColor
- the foreground color to set.public void setBackgroundColor(int backgroundColor)
backgroundColor
- the background color to set.public void setBorderColor(int borderColor)
borderColor
- the border color to set.public void setBorder(@NonNull Border border)
border
- the border to set.public void setFontProfile(@NonNull FontProfile fontProfile)
fontProfile
- the font profile to set.public void setAlignment(int alignment)
GraphicsContext#LEFT
, GraphicsContext#HCENTER
, GraphicsContext#RIGHT
} ) and exactly
one vertical constant (taken from { GraphicsContext#TOP
, GraphicsContext#VCENTER
,
GraphicsContext#BOTTOM
} ). Default alignment matches the (GraphicsContext#TOP
|
GraphicsContext#LEFT
) constant combination.alignment
- the alignment to set.java.lang.IllegalArgumentException
- if the alignment is not valid.AlignmentHelper.validateAlignment(int)
public void setTextManager(@NonNull TextManager textManager)
textManager
- the text manager to set.public void setDimension(@NonNull Dimension dimension)
dimension
- the dimension to set.public void setPadding(@NonNull Outline padding)
padding
- the padding to set.public void setMargin(@NonNull Outline margin)
margin
- the margin to set.public void setBackground(@NonNull Background background)
background
- the background to set.