java.lang.Object
atlantafx.base.theme.Styles
A set of constants and utility methods that simplifies adding CSS
classes programmatically.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final javafx.css.PseudoClass
static final javafx.css.PseudoClass
static final javafx.css.PseudoClass
static final javafx.css.PseudoClass
static final javafx.css.PseudoClass
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
activatePseudoClass
(javafx.scene.Node node, javafx.css.PseudoClass pseudoClass, javafx.css.PseudoClass... excludes) Activates given pseudo-class to the node and deactivates the excluded pseudo-classes.static void
addStyleClass
(javafx.scene.Node node, String styleClass, String... excludes) Adds the given style class to the node and removes the excluded classes.static void
appendStyle
(javafx.scene.Node node, String prop, String value) Appends CSS style declaration to the specified node.static void
removeStyle
(javafx.scene.Node node, String prop) Removes the specified CSS style declaration from the specified node.static String
Converts a CSS string to the Base64-encoded data URI.static void
toggleStyleClass
(javafx.scene.Node node, String styleClass) Adds the given style class to the node if it's not present, otherwise removes it.
-
Field Details
-
DATA_URI_PREFIX
- See Also:
-
ACCENT
- See Also:
-
SUCCESS
- See Also:
-
WARNING
- See Also:
-
DANGER
- See Also:
-
TEXT
- See Also:
-
FONT_ICON
- See Also:
-
BUTTON_CIRCLE
- See Also:
-
BUTTON_ICON
- See Also:
-
BUTTON_OUTLINED
- See Also:
-
LEFT_PILL
- See Also:
-
CENTER_PILL
- See Also:
-
RIGHT_PILL
- See Also:
-
SMALL
- See Also:
-
MEDIUM
- See Also:
-
LARGE
- See Also:
-
TOP
- See Also:
-
RIGHT
- See Also:
-
BOTTOM
- See Also:
-
LEFT
- See Also:
-
CENTER
- See Also:
-
FLAT
- See Also:
-
BORDERED
- See Also:
-
DENSE
- See Also:
-
ELEVATED_1
- See Also:
-
ELEVATED_2
- See Also:
-
ELEVATED_3
- See Also:
-
ELEVATED_4
- See Also:
-
INTERACTIVE
- See Also:
-
ROUNDED
- See Also:
-
STRIPED
- See Also:
-
TABS_BORDER_TOP
- See Also:
-
TABS_CLASSIC
- See Also:
-
TABS_FLOATING
- See Also:
-
TITLE_1
- See Also:
-
TITLE_2
- See Also:
-
TITLE_3
- See Also:
-
TITLE_4
- See Also:
-
TEXT_CAPTION
- See Also:
-
TEXT_SMALL
- See Also:
-
TEXT_BOLD
- See Also:
-
TEXT_BOLDER
- See Also:
-
TEXT_NORMAL
- See Also:
-
TEXT_LIGHTER
- See Also:
-
TEXT_ITALIC
- See Also:
-
TEXT_OBLIQUE
- See Also:
-
TEXT_STRIKETHROUGH
- See Also:
-
TEXT_UNDERLINED
- See Also:
-
TEXT_MUTED
- See Also:
-
TEXT_SUBTLE
- See Also:
-
TEXT_ON_EMPHASIS
- See Also:
-
STATE_ACCENT
public static final javafx.css.PseudoClass STATE_ACCENT -
STATE_SUCCESS
public static final javafx.css.PseudoClass STATE_SUCCESS -
STATE_WARNING
public static final javafx.css.PseudoClass STATE_WARNING -
STATE_DANGER
public static final javafx.css.PseudoClass STATE_DANGER -
STATE_INTERACTIVE
public static final javafx.css.PseudoClass STATE_INTERACTIVE -
BG_DEFAULT
- See Also:
-
BG_INSET
- See Also:
-
BG_SUBTLE
- See Also:
-
BG_NEUTRAL_EMPHASIS_PLUS
- See Also:
-
BG_NEUTRAL_EMPHASIS
- See Also:
-
BG_NEUTRAL_MUTED
- See Also:
-
BG_NEUTRAL_SUBTLE
- See Also:
-
BG_ACCENT_EMPHASIS
- See Also:
-
BG_ACCENT_MUTED
- See Also:
-
BG_ACCENT_SUBTLE
- See Also:
-
BG_WARNING_EMPHASIS
- See Also:
-
BG_WARNING_MUTED
- See Also:
-
BG_WARNING_SUBTLE
- See Also:
-
BG_SUCCESS_EMPHASIS
- See Also:
-
BG_SUCCESS_MUTED
- See Also:
-
BG_SUCCESS_SUBTLE
- See Also:
-
BG_DANGER_EMPHASIS
- See Also:
-
BG_DANGER_MUTED
- See Also:
-
BG_DANGER_SUBTLE
- See Also:
-
BORDER_DEFAULT
- See Also:
-
BORDER_MUTED
- See Also:
-
BORDER_SUBTLE
- See Also:
-
-
Method Details
-
toggleStyleClass
Adds the given style class to the node if it's not present, otherwise removes it.- Parameters:
node
- The target node.styleClass
- The style class to be toggled.- Throws:
NullPointerException
- if node or style class is null
-
addStyleClass
Adds the given style class to the node and removes the excluded classes. This method is supposed to be used when only one from a set of classes have to be present at once.- Parameters:
node
- The target node.styleClass
- The style class to be toggled.excludes
- The style classes to be excluded.- Throws:
NullPointerException
- if node or styleClass is null
-
activatePseudoClass
public static void activatePseudoClass(javafx.scene.Node node, javafx.css.PseudoClass pseudoClass, javafx.css.PseudoClass... excludes) Activates given pseudo-class to the node and deactivates the excluded pseudo-classes. This method is supposed to be used when only one from a set of pseudo-classes have to be present at once.- Parameters:
node
- The node to activate the pseudo-class on.pseudoClass
- The pseudo-class to be activated.excludes
- The pseudo-classes to be deactivated.- Throws:
NullPointerException
- if node or pseudo-class is null
-
appendStyle
Appends CSS style declaration to the specified node. There's no check for duplicates, so the CSS declarations with the same property name can be appended multiple times.- Parameters:
node
- The node to append the new style declaration.prop
- The CSS property name.value
- The CSS property value.- Throws:
NullPointerException
- if node is null
-
removeStyle
Removes the specified CSS style declaration from the specified node.- Parameters:
node
- The node to remove the style from.prop
- The name of the style property to remove.- Throws:
NullPointerException
- if node is null
-
toDataURI
Converts a CSS string to the Base64-encoded data URI. The resulting string is an inline data URI that can be applied to any node in the following manner:var dataUri = Styles.toDataURI(); node.getStylesheets().add(dataUri); node.getStylesheets().contains(dataUri); node.getStylesheets().remove(dataUri);
- Parameters:
css
- The CSS string to encode.- Returns:
- The resulting data URI string.
-