Module javafx.graphics
Package javafx.css
Provides API for making properties styleable via CSS and for supporting pseudo-class state.
The JavaFX Scene Graph provides the facility to style nodes using
CSS (Cascading Style Sheets).
The Node
class contains id
, styleClass
, and
style
variables which are used by CSS selectors to find nodes
to which styles should be applied. The Scene
class and
Parent
class contain a
the stylesheets
variable which is a list of URLs that
reference CSS style sheets that are to be applied to the nodes within
that scene or parent.
The primary classes in this package are:
CssMetaData
- Defines the CSS property and provides a link back to the
StyleableProperty
. By convention, classes that have CssMetaData implement apublic static List<CssMetaData<? extends Styleable>> getClassCssMetaData()
method that allows other classes to include CssMetaData from an inherited class. The methodgetCssMetaData()
should be overridden to returngetClassCssMetaData()
. The CSS implementation frequently callsgetCssMetaData()
. It is strongly recommended that the returned list be afinal static
. StyleableProperty
- Defines the interface that the CSS implementation uses to set values on a
property and provides a link back to the
CssMetaData
that corresponds to the property. TheStyleablePropertyFactory
greatly simplifies creating a StyleableProperty and its corresponding CssMetaData. PseudoClass
- Defines a pseudo-class which can be set or cleared via the method
pseudoClassStateChanged
.
For further information about CSS, how to apply CSS styles to nodes, and what properties are available for styling, see the CSS Reference Guide.
-
Interface Summary Interface Description Styleable Styleable comprises the minimal interface required for an object to be styled by CSS.StyleableProperty<T> StyleableProperty allows ajavafx.beans.property
to be styled from CSS. -
Class Summary Class Description CompoundSelector A compound selector which behaves according to the CSS standard.CssMetaData<S extends Styleable,V> A CssMetaData instance provides information about the CSS style and provides the hooks that allow CSS to set a property value.CssParser CssParser.ParseError Encapsulate information about the source and nature of errors encountered while parsing CSS or applying styles to Nodes.CssParser.ParseError.InlineStyleParsingError Encapsulate errors arising from parsing of Node's style propertyCssParser.ParseError.PropertySetError Encapsulates errors arising from applying a style to a Node.CssParser.ParseError.StringParsingError Encapsulate errors arising from parsing when the style is not an in-line style nor is the style from a stylesheet.CssParser.ParseError.StylesheetParsingError Encapsulate errors arising from parsing of stylesheet filesDeclaration FontCssMetaData<S extends Styleable> An partial implementation of CssMetaData for Font properties which includes the font sub-properties: weight, style, family and size.FontFace A FontFace is a @font-face definition from CSS fileMatch Used byRule
to determine whether or not the selector applies to a given object.ParsedValue<V,T> A representation of a parsed CSS value.PseudoClass PseudoClass represents one unique pseudo-class state.Rule Selector Used by CSSRule to determine whether or not the selector applies to a given object.SimpleSelector A simple selector which behaves according to the CSS standard.SimpleStyleableBooleanProperty This class extendsSimpleBooleanProperty
and provides a full implementation of aStyleableProperty
.SimpleStyleableDoubleProperty This class extendsSimpleDoubleProperty
and provides a full implementation of aStyleableProperty
.SimpleStyleableFloatProperty This class extendsSimpleFloatProperty
and provides a full implementation of aStyleableProperty
.SimpleStyleableIntegerProperty This class extendsSimpleIntegerProperty
and provides a full implementation of aStyleableProperty
.SimpleStyleableLongProperty This class extendsSimpleLongProperty
and provides a full implementation of aStyleableProperty
.SimpleStyleableObjectProperty<T> This class extendsSimpleObjectProperty
and provides a full implementation of aStyleableProperty
.SimpleStyleableStringProperty This class extendsSimpleStringProperty
and provides a full implementation of aStyleableProperty
.Size Represents a size specified in a particular unit, such as 14px or 0.2em.Style A Style is just the selector and declaration from a Rule.StyleableBooleanProperty This class extendsBooleanPropertyBase
and provides a partial implementation of aStyleableProperty
.StyleableDoubleProperty This class extendsDoublePropertyBase
and provides a partial implementation of aStyleableProperty
.StyleableFloatProperty This class extendsFloatPropertyBase
and provides a partial implementation of aStyleableProperty
.StyleableIntegerProperty This class extendsIntegerPropertyBase
and provides a partial implementation of aStyleableProperty
.StyleableLongProperty This class extendsLongPropertyBase
and provides a partial implementation of aStyleableProperty
.StyleableObjectProperty<T> This class extendsObjectPropertyBase
and provides a partial implementation of aStyleableProperty
.StyleablePropertyFactory<S extends Styleable> Methods for creating instances of StyleableProperty with corresponding CssMetaData created behind the scenes.StyleableStringProperty This class extendsStringPropertyBase
and provides a partial implementation of aStyleableProperty
.StyleClass StyleConverter<F,T> StyleConverter convertsParsedValue<F,T>
from typeF
to typeT
.StyleConverter.StringStore The StringStore classStylesheet A stylesheet which can apply properties to a tree of objects. -
Enum Summary Enum Description SizeUnits Represents a size specified in a particular unit, such as 14px or 0.2em.StyleOrigin Enumeration of the possible source or origin of a stylesheet and styles.