APIdia Launch Partner
Top Description Methods
com.sun.javafx.css.media

public sealed Interface MediaQuery

permits ConstantExpression, ConjunctionExpression, DisjunctionExpression, FunctionExpression<T>, NegationExpression, RangeExpression
Known Direct Implementers
com.sun.javafx.css.media.expression.ConjunctionExpression, com.sun.javafx.css.media.expression.ConstantExpression, com.sun.javafx.css.media.expression.DisjunctionExpression, com.sun.javafx.css.media.expression.FunctionExpression, com.sun.javafx.css.media.expression.NegationExpression, com.sun.javafx.css.media.expression.RangeExpression
Imports
com.sun.javafx.css.media.expression.ConjunctionExpression, .ConstantExpression, .FunctionExpression, .NegationExpression, .DisjunctionExpression, .RangeExpression

MediaQuery is the runtime representation of a CSS media query expression.

It is evaluated against a context that provides the values that are referenced in the expression, and evaluates to either true or false.

Method Summary

Modifier and TypeMethod and Description
public TriState

Returns:

TriState#TRUE if the query is always true, TriState#FALSE if the query is always false, otherwise TriState#UNKNOWN
evaluate
()

Attempts to determine the result of this media query without a context, and returns TriState#TRUE if the query always matches, TriState#FALSE if it never matches, or TriState#UNKNOWN if the result depends on the context or cannot be determined.

public boolean

Returns:

true if the media query matches, false otherwise
evaluate
(MediaQueryContext
the evaluation context
context
)

Evaluates this media query against the provided context.

public int

Returns:

the context awareness flags
getContextAwareness
()

Gets the context awareness flags of this media query, indicating which aspects of the media query context are probed by the query.

Method Detail

evaluateback to summary
public TriState evaluate()

Attempts to determine the result of this media query without a context, and returns TriState#TRUE if the query always matches, TriState#FALSE if it never matches, or TriState#UNKNOWN if the result depends on the context or cannot be determined.

Returns:TriState

TriState#TRUE if the query is always true, TriState#FALSE if the query is always false, otherwise TriState#UNKNOWN

evaluateback to summary
public boolean evaluate(MediaQueryContext context)

Evaluates this media query against the provided context.

Parameters
context:MediaQueryContext

the evaluation context

Returns:boolean

true if the media query matches, false otherwise

getContextAwarenessback to summary
public int getContextAwareness()

Gets the context awareness flags of this media query, indicating which aspects of the media query context are probed by the query.

Returns:int

the context awareness flags