APIdia Launch Partner
Top Inners Fields Constructors Methods
com.sun.javafx.scene

public final Class SceneContext

extends Object
implements Preferences, MediaQueryContext
Class Inheritance
All Implemented Interfaces
com.sun.javafx.css.media.MediaQueryContext, javafx.scene.Scene.Preferences
Imports
com.sun.javafx.application.PlatformImpl, com.sun.javafx.beans.property.NullCoalescingPropertyBase, com.sun.javafx.css.media.ContextAwareness, .MediaQuery, .MediaQueryContext, .MediaRule, java.util.IdentityHashMap, .List, .Map, javafx.application.ColorScheme, javafx.beans.property.ObjectProperty, javafx.beans.value.ObservableValue, javafx.scene.Node, .Scene, javafx.stage.Stage, .Window

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
SceneContext.MediaProperty<T>

Property implementation for media features that causes CSS to be re-applied when the property value is changed.

Field Summary

Modifier and TypeField and Description
private final SceneContext.MediaProperty<ColorScheme>
private final Map<MediaQuery, Boolean>
private final SceneContext.MediaProperty<Boolean>
private final SceneContext.MediaProperty<Boolean>
private final SceneContext.MediaProperty<Boolean>
private final SceneContext.MediaProperty<Boolean>
private final Scene
private final Map<MediaQuery, Boolean>
viewportSizeAwareQueries

All media queries are interned, such that only a single instance exists for each distinct media query.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ObjectProperty<ColorScheme>
colorSchemeProperty()

Implements javafx.scene.Scene.Preferences.colorSchemeProperty.

Specifies whether the scene should prefer light text on dark backgrounds, or dark text on light backgrounds.

public ColorScheme
getColorScheme()

Implements javafx.scene.Scene.Preferences.getColorScheme, com.sun.javafx.css.media.MediaQueryContext.getColorScheme.

Provides the value for the prefers-color-scheme media feature.

public double
getHeight()

Implements com.sun.javafx.css.media.MediaQueryContext.getHeight.

Provides the value for the height media feature.

public double
getWidth()

Implements com.sun.javafx.css.media.MediaQueryContext.getWidth.

Provides the value for the width media feature.

public boolean
isFullScreen()

Implements com.sun.javafx.css.media.MediaQueryContext.isFullScreen.

Provides the value for the display-mode media feature.

public boolean
public boolean
public boolean
public boolean
public void
notifyQueryEvaluated(MediaQuery query, boolean currentValue)

Implements com.sun.javafx.css.media.MediaQueryContext.notifyQueryEvaluated.

Called by MediaRule when a media query has been evaluated.

public void
notifyReapplyCSS()

Called by Node when CSS is reapplied for the root node.

public void
notifySizeChanged()

Called by Scene when its size has changed.

private void
private void
public ObjectProperty<Boolean>
persistentScrollBarsProperty()

Implements javafx.scene.Scene.Preferences.persistentScrollBarsProperty.

Specifies whether applications should always show scroll bars.

public ObjectProperty<Boolean>
reducedDataProperty()

Implements javafx.scene.Scene.Preferences.reducedDataProperty.

Specifies whether the scene should minimize the amount of internet traffic, which users might request because they are on a metered network or a limited data plan.

public ObjectProperty<Boolean>
reducedMotionProperty()

Implements javafx.scene.Scene.Preferences.reducedMotionProperty.

Specifies whether the scene should minimize the amount of non-essential animations, reducing discomfort for users who experience motion sickness or vertigo.

public ObjectProperty<Boolean>
reducedTransparencyProperty()

Implements javafx.scene.Scene.Preferences.reducedTransparencyProperty.

Specifies whether the scene should minimize the amount of transparent or translucent layer effects, which can help to increase contrast and readability for some users.

public void
public void
setPersistentScrollBars(Boolean value)

Implements javafx.scene.Scene.Preferences.setPersistentScrollBars.

Sets the value of the persistentScrollBars property.

public void
setReducedData(Boolean value)

Implements javafx.scene.Scene.Preferences.setReducedData.

Sets the value of the reducedData property.

public void
setReducedMotion(Boolean value)

Implements javafx.scene.Scene.Preferences.setReducedMotion.

Sets the value of the reducedMotion property.

public void
setReducedTransparency(Boolean value)

Implements javafx.scene.Scene.Preferences.setReducedTransparency.

Sets the value of the reducedTransparency property.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

colorSchemeback to summary
private final SceneContext.MediaProperty<ColorScheme> colorScheme
fullScreenAwareQueriesback to summary
private final Map<MediaQuery, Boolean> fullScreenAwareQueries
persistentScrollBarsback to summary
private final SceneContext.MediaProperty<Boolean> persistentScrollBars
reducedDataback to summary
private final SceneContext.MediaProperty<Boolean> reducedData
reducedMotionback to summary
private final SceneContext.MediaProperty<Boolean> reducedMotion
reducedTransparencyback to summary
private final SceneContext.MediaProperty<Boolean> reducedTransparency
sceneback to summary
private final Scene scene
viewportSizeAwareQueriesback to summary
private final Map<MediaQuery, Boolean> viewportSizeAwareQueries

All media queries are interned, such that only a single instance exists for each distinct media query. This allows us to use an IdentityHashMap instead of a regular HashMap, saving us deep equality comparisons on a hot path.

Constructor Detail

SceneContextback to summary
public SceneContext(Scene scene)

Method Detail

colorSchemePropertyback to summary
public ObjectProperty<ColorScheme> colorSchemeProperty()

Implements javafx.scene.Scene.Preferences.colorSchemeProperty.

Doc from javafx.scene.Scene.Preferences.colorSchemeProperty.

Specifies whether the scene should prefer light text on dark backgrounds, or dark text on light backgrounds.

This property corresponds to the prefers-color-scheme media feature.

Annotations
@Override
getColorSchemeback to summary
public ColorScheme getColorScheme()

Implements javafx.scene.Scene.Preferences.getColorScheme, com.sun.javafx.css.media.MediaQueryContext.getColorScheme.

Doc from com.sun.javafx.css.media.MediaQueryContext.getColorScheme.

Provides the value for the prefers-color-scheme media feature.

Annotations
@Override
getHeightback to summary
public double getHeight()

Implements com.sun.javafx.css.media.MediaQueryContext.getHeight.

Doc from com.sun.javafx.css.media.MediaQueryContext.getHeight.

Provides the value for the height media feature.

Annotations
@Override
getWidthback to summary
public double getWidth()

Implements com.sun.javafx.css.media.MediaQueryContext.getWidth.

Doc from com.sun.javafx.css.media.MediaQueryContext.getWidth.

Provides the value for the width media feature.

Annotations
@Override
isFullScreenback to summary
public boolean isFullScreen()

Implements com.sun.javafx.css.media.MediaQueryContext.isFullScreen.

Doc from com.sun.javafx.css.media.MediaQueryContext.isFullScreen.

Provides the value for the display-mode media feature.

Annotations
@Override
isPersistentScrollBarsback to summary
public boolean isPersistentScrollBars()

Implements javafx.scene.Scene.Preferences.isPersistentScrollBars, com.sun.javafx.css.media.MediaQueryContext.isPersistentScrollBars.

Doc from javafx.scene.Scene.Preferences.isPersistentScrollBars.

Gets the value of the persistentScrollBars property.

Annotations
@Override
isReducedDataback to summary
public boolean isReducedData()

Implements javafx.scene.Scene.Preferences.isReducedData, com.sun.javafx.css.media.MediaQueryContext.isReducedData.

Doc from javafx.scene.Scene.Preferences.isReducedData.

Gets the value of the reducedData property.

Annotations
@Override
isReducedMotionback to summary
public boolean isReducedMotion()

Implements javafx.scene.Scene.Preferences.isReducedMotion, com.sun.javafx.css.media.MediaQueryContext.isReducedMotion.

Doc from javafx.scene.Scene.Preferences.isReducedMotion.

Gets the value of the reducedMotion property.

Annotations
@Override
isReducedTransparencyback to summary
public boolean isReducedTransparency()

Implements javafx.scene.Scene.Preferences.isReducedTransparency, com.sun.javafx.css.media.MediaQueryContext.isReducedTransparency.

Doc from javafx.scene.Scene.Preferences.isReducedTransparency.

Gets the value of the reducedTransparency property.

Annotations
@Override
notifyQueryEvaluatedback to summary
public void notifyQueryEvaluated(MediaQuery query, boolean currentValue)

Implements com.sun.javafx.css.media.MediaQueryContext.notifyQueryEvaluated.

Called by MediaRule when a media query has been evaluated.

Annotations
@Override
notifyReapplyCSSback to summary
public void notifyReapplyCSS()

Called by Node when CSS is reapplied for the root node.

notifySizeChangedback to summary
public void notifySizeChanged()

Called by Scene when its size has changed.

onFullScreenChangedback to summary
private void onFullScreenChanged(Boolean unused)
onShowingChangedback to summary
private void onShowingChanged(Boolean showing)
persistentScrollBarsPropertyback to summary
public ObjectProperty<Boolean> persistentScrollBarsProperty()

Implements javafx.scene.Scene.Preferences.persistentScrollBarsProperty.

Doc from javafx.scene.Scene.Preferences.persistentScrollBarsProperty.

Specifies whether applications should always show scroll bars. If set to false, applications may choose to hide scroll bars that are not actively used, or make them smaller or less noticeable.

This property corresponds to the -fx-prefers-persistent-scrollbars media feature.

Annotations
@Override
reducedDataPropertyback to summary
public ObjectProperty<Boolean> reducedDataProperty()

Implements javafx.scene.Scene.Preferences.reducedDataProperty.

Doc from javafx.scene.Scene.Preferences.reducedDataProperty.

Specifies whether the scene should minimize the amount of internet traffic, which users might request because they are on a metered network or a limited data plan.

This property corresponds to the prefers-reduced-data media feature.

Annotations
@Override
reducedMotionPropertyback to summary
public ObjectProperty<Boolean> reducedMotionProperty()

Implements javafx.scene.Scene.Preferences.reducedMotionProperty.

Doc from javafx.scene.Scene.Preferences.reducedMotionProperty.

Specifies whether the scene should minimize the amount of non-essential animations, reducing discomfort for users who experience motion sickness or vertigo.

This property corresponds to the prefers-reduced-motion media feature.

Annotations
@Override
reducedTransparencyPropertyback to summary
public ObjectProperty<Boolean> reducedTransparencyProperty()

Implements javafx.scene.Scene.Preferences.reducedTransparencyProperty.

Doc from javafx.scene.Scene.Preferences.reducedTransparencyProperty.

Specifies whether the scene should minimize the amount of transparent or translucent layer effects, which can help to increase contrast and readability for some users.

This property corresponds to the prefers-reduced-transparency media feature.

Annotations
@Override
setColorSchemeback to summary
public void setColorScheme(ColorScheme colorScheme)

Implements javafx.scene.Scene.Preferences.setColorScheme.

Annotations
@Override
setPersistentScrollBarsback to summary
public void setPersistentScrollBars(Boolean value)

Implements javafx.scene.Scene.Preferences.setPersistentScrollBars.

Doc from javafx.scene.Scene.Preferences.setPersistentScrollBars.

Sets the value of the persistentScrollBars property.

Annotations
@Override
setReducedDataback to summary
public void setReducedData(Boolean value)

Implements javafx.scene.Scene.Preferences.setReducedData.

Doc from javafx.scene.Scene.Preferences.setReducedData.

Sets the value of the reducedData property.

Annotations
@Override
setReducedMotionback to summary
public void setReducedMotion(Boolean value)

Implements javafx.scene.Scene.Preferences.setReducedMotion.

Doc from javafx.scene.Scene.Preferences.setReducedMotion.

Sets the value of the reducedMotion property.

Annotations
@Override
setReducedTransparencyback to summary
public void setReducedTransparency(Boolean value)

Implements javafx.scene.Scene.Preferences.setReducedTransparency.

Doc from javafx.scene.Scene.Preferences.setReducedTransparency.

Sets the value of the reducedTransparency property.

Annotations
@Override
com.sun.javafx.scene back to summary

private Class SceneContext.MediaProperty<T>

extends NullCoalescingPropertyBase<T>
Class Inheritance

Property implementation for media features that causes CSS to be re-applied when the property value is changed. This is required to re-evaluate media queries in stylesheets.

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
MediaProperty(String name, ObservableValue<T> defaultValue)

Method Summary

Modifier and TypeMethod and Description
public Object
getBean()

Implements javafx.beans.property.ReadOnlyProperty.getBean.

Returns the Object that contains this property.

public String
getName()

Implements javafx.beans.property.ReadOnlyProperty.getName.

Returns the name of this property.

protected void
onInvalidated()

Overrides com.sun.javafx.beans.property.NullCoalescingPropertyBase.onInvalidated.

Called when the current value has changed.

Inherited from com.sun.javafx.beans.property.NullCoalescingPropertyBase:
connectdisconnectfireValueChangedEventgetinvalidated

Field Detail

nameback to summary
private final String name

Constructor Detail

MediaPropertyback to summary
pack-priv MediaProperty(String name, ObservableValue<T> defaultValue)

Method Detail

getBeanback to summary
public Object getBean()

Implements javafx.beans.property.ReadOnlyProperty.getBean.

Doc from javafx.beans.property.ReadOnlyProperty.getBean.

Returns the Object that contains this property. If this property is not contained in an Object, null is returned.

Annotations
@Override
getNameback to summary
public String getName()

Implements javafx.beans.property.ReadOnlyProperty.getName.

Doc from javafx.beans.property.ReadOnlyProperty.getName.

Returns the name of this property. If the property does not have a name, this method returns an empty String.

Annotations
@Override
onInvalidatedback to summary
protected void onInvalidated()

Overrides com.sun.javafx.beans.property.NullCoalescingPropertyBase.onInvalidated.

Doc from com.sun.javafx.beans.property.NullCoalescingPropertyBase.onInvalidated.

Called when the current value has changed.

Annotations
@Override