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

public final Class MediaFeatures

extends Object
Class Inheritance
Imports
com.sun.javafx.PlatformUtil, com.sun.javafx.application.PlatformImpl, com.sun.javafx.css.media.expression.ConjunctionExpression, .FunctionExpression, .RangeExpression, com.sun.javafx.css.parser.Token, javafx.application.ColorScheme, .ConditionalFeature, java.util.Locale, .Map, java.util.function.BiFunction, .BooleanSupplier, .Function

Contains the implementations of all supported media feature queries.

Field Summary

Modifier and TypeField and Description
pack-priv static BiFunction<String, Token, MediaQuery>
pack-priv static Map<String, BooleanSupplier>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static MediaQuery
booleanPreferenceExpression(String featureName, Token featureValue, String trueValue, Function<MediaQueryContext, Boolean> argument)

private static <T> T
checkNotNullValue(String featureName, T featureValue)

public static MediaQuery

Returns:

the MediaQuery
discreteQueryExpression
(String
the name of the media feature
featureName
,
Token
the value of the media feature, or null to indicate no value
featureValue
)

Returns a MediaQuery that evaluates the specified feature in a discrete context.

private static <T extends Enum<T>> T
enumValue(Function<String, T> func, String featureName, String featureValue)

private static String
private static String
public static MediaQuery

Returns:

the MediaQuery
rangeQueryExpression
(String
the name of the media feature
featureName
,
Token
the value of the media feature
featureValue
,
ComparisonOp
the comparison operator
comparison
)

Returns a MediaQuery that evaluates the specified feature in a range context.

public static MediaQuery

Returns:

the MediaQuery
rangeQueryExpression
(String
the name of the media feature
featureName
,
Token
the first value of the media feature
featureValue1
,
Token
the second value of the media feature
featureValue2
,
ComparisonOp
the first comparison operator
comparison1
,
ComparisonOp
the second comparison operator
comparison2
)

Returns a MediaQuery that evaluates the specified feature as an interval in a range context.

private static MediaQuery
rangeQueryExpression(SizeQueryType featureType, Token featureValue, RangeExpression.Supplier rangeExpressionSupplier)

private static RuntimeException
unknownValue(String featureName, String featureValue)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
pack-priv static BiFunction<String, Token, MediaQuery> DEFAULT
PLATFORMSback to summary
pack-priv static Map<String, BooleanSupplier> PLATFORMS

Constructor Detail

MediaFeaturesback to summary
private MediaFeatures()

Method Detail

booleanPreferenceExpressionback to summary
private static MediaQuery booleanPreferenceExpression(String featureName, Token featureValue, String trueValue, Function<MediaQueryContext, Boolean> argument)
checkNotNullValueback to summary
private static <T> T checkNotNullValue(String featureName, T featureValue)
discreteQueryExpressionback to summary
public static MediaQuery discreteQueryExpression(String featureName, Token featureValue)

Returns a MediaQuery that evaluates the specified feature in a discrete context.

Parameters
featureName:String

the name of the media feature

featureValue:Token

the value of the media feature, or null to indicate no value

Returns:MediaQuery

the MediaQuery

Exceptions
IllegalArgumentException:
if featureName or featureValue is invalid
enumValueback to summary
private static <T extends Enum<T>> T enumValue(Function<String, T> func, String featureName, String featureValue)
lowerCaseTextValueback to summary
private static String lowerCaseTextValue(String text)
lowerCaseTextValueback to summary
private static String lowerCaseTextValue(Token token)
rangeQueryExpressionback to summary
public static MediaQuery rangeQueryExpression(String featureName, Token featureValue, ComparisonOp comparison)

Returns a MediaQuery that evaluates the specified feature in a range context.

Parameters
featureName:String

the name of the media feature

featureValue:Token

the value of the media feature

comparison:ComparisonOp

the comparison operator

Returns:MediaQuery

the MediaQuery

Exceptions
IllegalArgumentException:
if featureName or featureValue is invalid, or if comparison is null
rangeQueryExpressionback to summary
public static MediaQuery rangeQueryExpression(String featureName, Token featureValue1, Token featureValue2, ComparisonOp comparison1, ComparisonOp comparison2)

Returns a MediaQuery that evaluates the specified feature as an interval in a range context.

Parameters
featureName:String

the name of the media feature

featureValue1:Token

the first value of the media feature

featureValue2:Token

the second value of the media feature

comparison1:ComparisonOp

the first comparison operator

comparison2:ComparisonOp

the second comparison operator

Returns:MediaQuery

the MediaQuery

Exceptions
IllegalArgumentException:
if featureName, featureValue1, or featureValue2 is invalid, or if comparison1 or comparison2 is null
rangeQueryExpressionback to summary
private static MediaQuery rangeQueryExpression(SizeQueryType featureType, Token featureValue, RangeExpression.Supplier rangeExpressionSupplier)
unknownValueback to summary
private static RuntimeException unknownValue(String featureName, String featureValue)