public class StyleContext extends Object
getStyleContext()
method.Modifier and Type | Method and Description |
---|---|
void |
addClass(StyleClass value)
Adds a
StyleClass to StyleContext so render functions will make
use of this new class for styling. |
void |
addRegion(StyleRegion region,
RegionFlags flags)
Adds a
StyleRegion to StyleContext, so render functions will
make use of this new region for styling. |
TextDirection |
getDirection()
Returns the widget direction used for rendering.
|
JunctionSides |
getJunctionSides()
Return the sides where rendered elements connect visually with others.
|
Screen |
getScreen()
Returns the
Screen to which this StyleContext is attached. |
StateFlags |
getState()
Returns the
StateFlags used when rendering. |
boolean |
hasClass(StyleClass value)
Returns
true if StyleContext currently has defined the
given StyleClass . |
RegionFlags |
hasRegion(StyleRegion region)
Returns a non-
null value if StyleContext currently has
defined the given StyleRegion . |
String[] |
listClasses()
Returns a string array that list the classes used by this context.
|
String[] |
listRegions()
Returns a string array that list the regions used by this context.
|
void |
removeClass(StyleClass value)
Removes a
StyleClass from the StyleContext. |
void |
removeRegion(StyleRegion region)
Removes a
StyleRegion from the StyleContext. |
void |
restore()
Restores StyleContext state to a previous saved stage.
|
void |
save()
Saves the StyleContext state, so all modifications done through
addClass(StyleClass) , removeClass(StyleClass) ,
addRegion(StyleRegion, RegionFlags) , or
removeRegion(StyleRegion) can be reverted in one go through
restore() . |
void |
setDirection(TextDirection direction)
Sets the reading direction of a rendered widget.
|
void |
setJunctionSides(JunctionSides sides)
Sets the sides where rendered elements will visually connect with other
visual elements.
|
void |
setScreen(Screen screen)
Sets the
Screen to which this StyleContext has to be attached. |
void |
setState(StateFlags flags)
Sets the
StateFlags to be used when rendering. |
public void addClass(StyleClass value)
StyleClass
to StyleContext so render functions will make
use of this new class for styling.public void addRegion(StyleRegion region, RegionFlags flags)
StyleRegion
to StyleContext, so render functions will
make use of this new region for styling.public TextDirection getDirection()
public JunctionSides getJunctionSides()
public Screen getScreen()
Screen
to which this StyleContext is attached.public StateFlags getState()
StateFlags
used when rendering.public boolean hasClass(StyleClass value)
true
if StyleContext currently has defined the
given StyleClass
.public RegionFlags hasRegion(StyleRegion region)
null
value if StyleContext currently has
defined the given StyleRegion
. The returned value corresponds
to the RegionFlags
.public String[] listClasses()
public String[] listRegions()
public void removeClass(StyleClass value)
StyleClass
from the StyleContext.public void removeRegion(StyleRegion region)
StyleRegion
from the StyleContext.public void restore()
save()
.public void save()
addClass(StyleClass)
, removeClass(StyleClass)
,
addRegion(StyleRegion, RegionFlags)
, or
removeRegion(StyleRegion)
can be reverted in one go through
restore()
.public void setDirection(TextDirection direction)
public void setJunctionSides(JunctionSides sides)
public void setScreen(Screen screen)
Screen
to which this StyleContext has to be attached.public void setState(StateFlags flags)
StateFlags
to be used when rendering.