Module technology.sola.engine
Class GuiTheme
java.lang.Object
technology.sola.engine.graphics.gui.style.theme.GuiTheme
GuiTheme instances contain
GuiElement
to BaseStyles
mappings that can be applied to a specific
element or an element and all its children.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<Style extends BaseStyles>
GuiThemeaddStyle
(Class<? extends GuiElement<Style, ?>> elementClass, List<ConditionalStyle<Style>> styles) <Style extends BaseStyles>
voidapplyToElement
(GuiElement<Style, ?> guiElement) Applies this theme to aGuiElement
.<Style extends BaseStyles>
voidapplyToTree
(GuiElement<Style, ?> guiElement) Applies this theme to aGuiElement
and all its children.<Style extends BaseStyles>
List<ConditionalStyle<Style>>getForElement
(GuiElement<Style, ?> guiElement)
-
Constructor Details
-
GuiTheme
public GuiTheme()
-
-
Method Details
-
applyToTree
Applies this theme to aGuiElement
and all its children. Theme styles are prepended to element's existing styles.- Type Parameters:
Style
- theBaseStyles
type the element uses- Parameters:
guiElement
- the parent element of the tree to apply the theme to
-
applyToElement
Applies this theme to aGuiElement
. Theme styles are prepended to element's existing styles.- Type Parameters:
Style
- theBaseStyles
type the element uses- Parameters:
guiElement
- the element to apply the theme to
-
getForElement
public <Style extends BaseStyles> List<ConditionalStyle<Style>> getForElement(GuiElement<Style, ?> guiElement) - Type Parameters:
Style
- theBaseStyles
type the element uses- Parameters:
guiElement
- the element to get theme styles for- Returns:
- the styles for the element
-
addStyle
public <Style extends BaseStyles> GuiTheme addStyle(Class<? extends GuiElement<Style, ?>> elementClass, List<ConditionalStyle<Style>> styles) - Type Parameters:
Style
- theBaseStyles
type the element uses- Parameters:
elementClass
- the class of the element to add style definitions forstyles
- the styles to add- Returns:
- this
-