public class SubScene extends Node
SubScene class is the container for content in a scene graph.
SubScene provides separation of different parts of a scene, each
of which can be rendered with a different camera, depth buffer, or scene
anti-aliasing. A SubScene is embedded into the main scene or another
sub-scene.
An application may request depth buffer support or scene anti-aliasing
support at the creation of a SubScene. A sub-scene with only 2D
shapes and without any 3D transforms does not need a depth buffer nor scene
anti-aliasing support. A sub-scene containing 3D shapes or 2D shapes with 3D
transforms may use depth buffer support for proper depth sorted rendering; to
avoid depth fighting (also known as Z fighting), disable depth testing on 2D
shapes that have no 3D transforms. See
depthTest for more information. A sub-scene
with 3D shapes may enable scene anti-aliasing to improve its rendering
quality.
The depthBuffer and antiAliasing flags are conditional features. With the
respective default values of: false and SceneAntialiasing.DISABLED.
See ConditionalFeature.SCENE3D
for more information.
Possible use cases are:
A default headlight will be added to a that contains one or more
Shape3D nodes, but no light nodes. This light source is a
Color.WHITE PointLight placed at the camera position.
| Modifier and Type | Class and Description |
|---|---|
private static class |
SubScene.SubSceneDirtyBits |
Node.FocusedProperty, Node.TreeVisiblePropertyReadOnly| Modifier and Type | Field and Description |
|---|---|
private SceneAntialiasing |
antiAliasing |
private ObjectProperty<Camera> |
camera
Specifies the type of camera use for rendering this
SubScene. |
private Camera |
defaultCamera |
private boolean |
depthBuffer |
private int |
dirtyBits |
(package private) boolean |
dirtyLayout
Dirty Bits *
|
private boolean |
dirtyNodes |
private ObjectProperty<Paint> |
fill
Defines the background fill of this
SubScene. |
private DoubleProperty |
height
Defines the height of this
SubScene |
private static boolean |
is3DSupported |
private java.util.List<LightBase> |
lights |
private ObjectProperty<Parent> |
root
Defines the root
Node of the SubScene scene graph. |
private TopMostTraversalEngine |
traversalEngine |
private ObjectProperty<java.lang.String> |
userAgentStylesheet |
private DoubleProperty |
width
Defines the width of this
SubScene |
accessibilityProperties, accessible, BASELINE_OFFSET_SAME_AS_HEIGHT, boundsChanged, cssFlag, pseudoClassStates, styleHelper| Constructor and Description |
|---|
SubScene(Parent root,
double width,
double height)
Creates a
SubScene for a specific root Node with a specific size. |
SubScene(Parent root,
double width,
double height,
boolean depthBuffer,
SceneAntialiasing antiAliasing)
Constructs a
SubScene consisting of a root, with a dimension of width and
height, specifies whether a depth buffer is created for this scene and
specifies whether scene anti-aliasing is requested. |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addLight(LightBase light) |
ObjectProperty<Camera> |
cameraProperty() |
private void |
clearDirtyBits() |
ObjectProperty<Paint> |
fillProperty() |
SceneAntialiasing |
getAntiAliasing()
Return the defined
SceneAntialiasing for this SubScene. |
Camera |
getCamera() |
(package private) Camera |
getEffectiveCamera() |
Paint |
getFill() |
double |
getHeight() |
Parent |
getRoot() |
java.lang.String |
getUserAgentStylesheet()
Get the URL of the user-agent stylesheet that will be used by this SubScene.
|
double |
getWidth() |
DoubleProperty |
heightProperty() |
protected boolean |
impl_computeContains(double localX,
double localY)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
BaseBounds |
impl_computeGeomBounds(BaseBounds bounds,
BaseTransform tx)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected NGNode |
impl_createPeer()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected void |
impl_pickNodeLocal(PickRay localPickRay,
PickResultChooser result)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected void |
impl_processCSS(WritableValue<java.lang.Boolean> unused)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
java.lang.Object |
impl_processMXNode(MXNodeAlgorithm alg,
MXNodeAlgorithmContext ctx)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_updatePeer()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
boolean |
isDepthBuffer()
Retrieves the depth buffer attribute for this
SubScene. |
private boolean |
isDepthBufferInternal() |
private boolean |
isDirty() |
private boolean |
isDirty(SubScene.SubSceneDirtyBits dirtyBit) |
(package private) void |
layoutPass() |
(package private) void |
markContentDirty() |
private void |
markDirty(SubScene.SubSceneDirtyBits dirtyBit) |
(package private) void |
nodeResolvedOrientationChanged() |
private PickResult |
pickRootSG(double localX,
double localY) |
(package private) void |
processCSS() |
(package private) void |
removeLight(LightBase light) |
ObjectProperty<Parent> |
rootProperty() |
void |
setCamera(Camera value) |
(package private) void |
setDirty(Node n) |
private void |
setDirty(SubScene.SubSceneDirtyBits dirtyBit) |
(package private) void |
setDirtyLayout(Parent p) |
void |
setFill(Paint value) |
void |
setHeight(double value) |
void |
setRoot(Parent value) |
void |
setUserAgentStylesheet(java.lang.String url)
Set the URL of the user-agent stylesheet that will be used by this SubScene in place of the
the platform-default user-agent stylesheet.
|
void |
setWidth(double value) |
private boolean |
subSceneComputeContains(double localX,
double localY)
Determines whether
SubScene contains the given point. |
private boolean |
syncLights()
PG Light synchronizer.
|
(package private) boolean |
traverse(Node node,
Direction dir) |
(package private) void |
updateBounds() |
ObjectProperty<java.lang.String> |
userAgentStylesheetProperty() |
DoubleProperty |
widthProperty() |
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, almostZero, applyCss, autosize, blendModeProperty, boundedSize, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, computeDerivedDepthTest, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessible, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBaselineOffset, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getClipParent, getContentBias, getCSSFlags, getCssMetaData, getCurrentLocalToSceneTransformState, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getGeomBounds, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalBounds, getLocalToParentTransform, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getSubScene, getTransformedBounds, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasMirroring, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_computeLayoutBounds, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_notifyLayoutBoundsChanged, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, indent, inputMethodRequestsProperty, intersects, intersects, isCache, isCanReceiveFocus, isConnected, isDerivedDepthTest, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localBoundsChanged, localToParent, localToParent, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, lookupAll, managedProperty, markDirtyLayoutBranch, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, nodeOrientationProperty, nodeResolvedOrientationInvalidated, notifyAccessibleAttributeChanged, notifyManagedChanged, notifyParentOfBoundsChange, notifyParentsOfInvalidatedCSS, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentResolvedOrientationInvalidated, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, prefHeight, prefWidth, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, releaseAccessible, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, scenesChanged, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDerivedDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setParent, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setScenes, setStyle, setTranslateX, setTranslateY, setTranslateZ, setTreeVisible, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, transformedBoundsChanged, translateXProperty, translateYProperty, translateZProperty, updateGeomBounds, updateLocalToParentTransform, updateTxBounds, usesMirroring, visibleProperty, wouldCreateCycleprivate static boolean is3DSupported
private final SceneAntialiasing antiAliasing
private final boolean depthBuffer
private ObjectProperty<Parent> root
Node of the SubScene scene graph.
If a Group is used as the root, the
contents of the scene graph will be clipped by the SubScene's width and height.
SubScene doesn't accept null root.private ObjectProperty<Camera> camera
SubScene.
If camera is null, a parallel camera is used for rendering.
It is illegal to set a camera that belongs to other Scene
or SubScene.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
private Camera defaultCamera
private DoubleProperty width
SubSceneprivate DoubleProperty height
SubSceneprivate ObjectProperty<Paint> fill
SubScene. Both a null
value meaning paint no background and a Paint
with transparency are supported. The default value is null.private ObjectProperty<java.lang.String> userAgentStylesheet
boolean dirtyLayout
private boolean dirtyNodes
private TopMostTraversalEngine traversalEngine
private int dirtyBits
private java.util.List<LightBase> lights
public SubScene(Parent root, double width, double height)
SubScene for a specific root Node with a specific size.root - The root node of the scene graphwidth - The width of the sub-sceneheight - The height of the sub-scenejava.lang.NullPointerException - if root is nullpublic SubScene(Parent root, double width, double height, boolean depthBuffer, SceneAntialiasing antiAliasing)
SubScene consisting of a root, with a dimension of width and
height, specifies whether a depth buffer is created for this scene and
specifies whether scene anti-aliasing is requested.
A sub-scene with only 2D shapes and without any 3D transforms does not
need a depth buffer nor scene anti-aliasing support. A sub-scene
containing 3D shapes or 2D shapes with 3D transforms may use depth buffer
support for proper depth sorted rendering; to avoid depth fighting (also
known as Z fighting), disable depth testing on 2D shapes that have no 3D
transforms. See depthTest for more
information. A sub-scene with 3D shapes may enable scene anti-aliasing to
improve its rendering quality.
root - The root node of the scene graphwidth - The width of the sub-sceneheight - The height of the sub-scenedepthBuffer - The depth buffer flagantiAliasing - The sub-scene anti-aliasing attribute. A value of
null is treated as DISABLED.
The depthBuffer and antiAliasing flags are conditional features. With the
respective default values of: false and SceneAntialiasing.DISABLED.
See ConditionalFeature.SCENE3D
for more information.
java.lang.NullPointerException - if root is nullNode.setDepthTest(DepthTest)public final SceneAntialiasing getAntiAliasing()
SceneAntialiasing for this SubScene.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
and SceneAntialiasing
for more information.
public final boolean isDepthBuffer()
SubScene.private boolean isDepthBufferInternal()
public final void setRoot(Parent value)
public final Parent getRoot()
public final ObjectProperty<Parent> rootProperty()
public final void setCamera(Camera value)
public final Camera getCamera()
public final ObjectProperty<Camera> cameraProperty()
Camera getEffectiveCamera()
final void markContentDirty()
public final void setWidth(double value)
public final double getWidth()
public final DoubleProperty widthProperty()
public final void setHeight(double value)
public final double getHeight()
public final DoubleProperty heightProperty()
public final void setFill(Paint value)
public final Paint getFill()
public final ObjectProperty<Paint> fillProperty()
@Deprecated public void impl_updatePeer()
Nodeimpl_updatePeer in class Nodevoid nodeResolvedOrientationChanged()
nodeResolvedOrientationChanged in class Node@Deprecated protected void impl_processCSS(WritableValue<java.lang.Boolean> unused)
Nodesuper.impl_processCSS() to ensure that
this Node's CSS state is properly updated.
Note that the difference between this method and Node.impl_processCSS(boolean) is that this method
updates styles for this node on down; whereas, impl_processCSS(boolean) invokes
Node.applyCss() which will look for the top-most ancestor that needs CSS update and apply styles
from that node on down.
The WritableValue<Boolean> parameter is no longer used.impl_processCSS in class Nodevoid processCSS()
processCSS in class Nodepublic final ObjectProperty<java.lang.String> userAgentStylesheetProperty()
getUserAgentStylesheet(),
setUserAgentStylesheet(String)public final java.lang.String getUserAgentStylesheet()
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
public final void setUserAgentStylesheet(java.lang.String url)
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
url - The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL
does not have a [scheme:] component, the URL is considered to be the [path] component only.
Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to
the root of the application's classpath.void updateBounds()
updateBounds in class Node@Deprecated protected NGNode impl_createPeer()
impl_createPeer in class Node@Deprecated public BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx)
Nodeimpl_computeGeomBounds in class Nodevoid setDirtyLayout(Parent p)
void setDirty(Node n)
void layoutPass()
private void clearDirtyBits()
private boolean isDirty()
private void setDirty(SubScene.SubSceneDirtyBits dirtyBit)
private boolean isDirty(SubScene.SubSceneDirtyBits dirtyBit)
private void markDirty(SubScene.SubSceneDirtyBits dirtyBit)
@Deprecated
protected boolean impl_computeContains(double localX,
double localY)
impl_computeContains in class Nodeprivate boolean subSceneComputeContains(double localX,
double localY)
SubScene contains the given point.
It does not consider the contained nodes, only SubScene's
size and fills.localX - horizontal coordinate in the local space of the SubScene nodelocalY - vertical coordinate in the local space of the SubScene nodeSubScene's area covered by its fillprivate PickResult pickRootSG(double localX, double localY)
@Deprecated protected void impl_pickNodeLocal(PickRay localPickRay, PickResultChooser result)
impl_pickNodeLocal in class Node@Deprecated public java.lang.Object impl_processMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx)
Nodeimpl_processMXNode in class Nodealg - current algorithm to process this nodectx - current contextfinal void addLight(LightBase light)
final void removeLight(LightBase light)
private boolean syncLights()