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.
BASELINE_OFFSET_SAME_AS_HEIGHT
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 |
---|---|
ObjectProperty<Camera> |
cameraProperty() |
ObjectProperty<Paint> |
fillProperty() |
SceneAntialiasing |
getAntiAliasing()
Return the defined
SceneAntialiasing for this SubScene . |
Camera |
getCamera() |
Paint |
getFill() |
double |
getHeight() |
Parent |
getRoot() |
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<Boolean> unused)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
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 . |
ObjectProperty<Parent> |
rootProperty() |
void |
setCamera(Camera value) |
void |
setFill(Paint value) |
void |
setHeight(double value) |
void |
setRoot(Parent value) |
void |
setUserAgentStylesheet(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) |
ObjectProperty<String> |
userAgentStylesheetProperty() |
DoubleProperty |
widthProperty() |
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBaselineOffset, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getContentBias, getCssMetaData, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, 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, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, 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, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, 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, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, prefHeight, prefWidth, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, 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, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
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-sceneNullPointerException
- 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.
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
.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()
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()
Node
impl_updatePeer
in class Node
@Deprecated protected void impl_processCSS(WritableValue<Boolean> unused)
Node
super.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 Node
public final ObjectProperty<String> userAgentStylesheetProperty()
getUserAgentStylesheet()
,
setUserAgentStylesheet(String)
public final String getUserAgentStylesheet()
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
public final void setUserAgentStylesheet(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.@Deprecated protected NGNode impl_createPeer()
impl_createPeer
in class Node
@Deprecated public BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx)
Node
impl_computeGeomBounds
in class Node
@Deprecated protected boolean impl_computeContains(double localX, double localY)
impl_computeContains
in class Node
@Deprecated protected void impl_pickNodeLocal(PickRay localPickRay, PickResultChooser result)
impl_pickNodeLocal
in class Node
@Deprecated public Object impl_processMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx)
Node
impl_processMXNode
in class Node
alg
- current algorithm to process this nodectx
- current contextCopyright © 2020. All rights reserved.