Top Description Fields Constructors Methods
com.sun.javafx.css.media

public final Class MediaRule

extends Object
Class Inheritance
Imports
javafx.css.StyleConverter, javafx.scene.Scene, java.io.DataInputStream, .DataOutputStream, .IOException, java.util.List

CSS media rules are @-rules that contain media queries. A media query tests the "external" configuration of a Scene, and is independent of its scene graph content.

Field Summary

Modifier and TypeField and Description
private final MediaRule
private final List<MediaQuery>

Constructor Summary

AccessConstructor and Description
public
MediaRule(List<MediaQuery> queries, MediaRule parent)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if any of the media queries is true or if the list is empty, false otherwise
evaluate
(MediaQueryContext
the evaluation context
context
)

Evaluates whether any of the media queries is true.

public MediaRule

Returns:

the parent MediaRule, or null
getParent
()

Returns the parent media rule if this media rule is nested.

public List<MediaQuery>

Returns:

the unmodifiable list of media queries
getQueries
()

Returns the unmodifiable list of media queries.

public static MediaRule
readBinary(DataInputStream stream, String[] strings)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parentback to summary
private final MediaRule parent
queriesback to summary
private final List<MediaQuery> queries

Constructor Detail

MediaRuleback to summary
public MediaRule(List<MediaQuery> queries, MediaRule parent)

Method Detail

evaluateback to summary
public boolean evaluate(MediaQueryContext context)

Evaluates whether any of the media queries is true.

Parameters
context:MediaQueryContext

the evaluation context

Returns:boolean

true if any of the media queries is true or if the list is empty, false otherwise

getParentback to summary
public MediaRule getParent()

Returns the parent media rule if this media rule is nested.

Returns:MediaRule

the parent MediaRule, or null

getQueriesback to summary
public List<MediaQuery> getQueries()

Returns the unmodifiable list of media queries.

Returns:List<MediaQuery>

the unmodifiable list of media queries

readBinaryback to summary
public static MediaRule readBinary(DataInputStream stream, String[] strings) throws IOException
writeBinaryback to summary
public void writeBinary(DataOutputStream stream, StyleConverter.StringStore stringStore) throws IOException