DelegatingThemeDefinition
, SimpleTheme.Definition
public interface ThemeDefinition
Modifier and Type | Method | Description |
---|---|---|
ThemeStyle |
getActive() |
The "active" style of this definition, which can be used when a component is being directly interacted with
|
boolean |
getBooleanProperty(String name,
boolean defaultValue) |
Retrieves a custom boolean property, if one is available by this name.
|
char |
getCharacter(String name,
char fallback) |
Retrieves a character from this theme definition by the specified name.
|
ThemeStyle |
getCustom(String name) |
Retrieves a custom ThemeStyle, if one is available by this name.
|
ThemeStyle |
getCustom(String name,
ThemeStyle defaultValue) |
Retrieves a custom
ThemeStyle , if one is available by this name. |
ThemeStyle |
getInsensitive() |
The insensitive style of this definition, which can be used when a component has been disabled or in some other
way isn't able to be interacted with.
|
ThemeStyle |
getNormal() |
The normal style of the definition, which can be considered the default to be used.
|
ThemeStyle |
getPreLight() |
The pre-light style of this definition, which can be used when a component has input focus but isn't active or
selected, similar to mouse-hoovering in modern GUIs
|
<T extends Component> |
getRenderer(Class<T> type) |
Returns a
ComponentRenderer attached to this definition for the specified type. |
ThemeStyle |
getSelected() |
The "selected" style of this definition, which can used when a component has been actively selected in some way.
|
boolean |
isCursorVisible() |
Asks the theme definition for this component if the theme thinks that the text cursor should be visible or not.
|
ThemeStyle getNormal()
ThemeStyle getPreLight()
ThemeStyle getSelected()
ThemeStyle getActive()
ThemeStyle getInsensitive()
ThemeStyle getCustom(String name)
name
- Name of the style to look upThemeStyle getCustom(String name, ThemeStyle defaultValue)
ThemeStyle
, if one is available by this name. Will return a supplied default value if
no such style could be found within this ThemeDefinition
. You can use this if you need more categories
than the ones available above.name
- Name of the style to look updefaultValue
- What to return if the there is no custom style by the given nameThemeStyle
associated with the name, or defaultValue
if there was no such styleboolean getBooleanProperty(String name, boolean defaultValue)
ThemeDefinition
.name
- Name of the boolean property to look updefaultValue
- What to return if the there is no property with this nameboolean isCursorVisible()
getBooleanProperty(String, boolean)
to allow themes more fine-grained control
over when cursor should be visible or not.true
) or
not (returns false
)char getCharacter(String name, char fallback)
null
so
you need to give a fallback in case the definition didn't have any character by this name.name
- Name of the character to look upfallback
- Character to return if there was no character by the name supplied in this definitionfallback
if the definition didn't have
any character defined with this name<T extends Component> ComponentRenderer<T> getRenderer(Class<T> type)
ComponentRenderer
attached to this definition for the specified type. Generally one theme
definition is linked to only one component type so it wouldn't need the type parameter to figure out what to
return. unlike the other methods of this interface, it will not traverse up in the theme hierarchy if this field
is not defined, instead the component will use its default component renderer.T
- Type of componenttype
- Component class to get the theme's renderer fortype
component or null
to use the defaultCopyright © 2020. All rights reserved.