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.
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.
| Type | Property and Description |
|---|---|
ObjectProperty<Camera> |
camera
Specifies the type of camera use for rendering this
SubScene. |
ObjectProperty<Paint> |
fill
Defines the background fill of this
SubScene. |
DoubleProperty |
height
Defines the height of this
SubScene |
ObjectProperty<Parent> |
root
Defines the root
Node of the SubScene scene graph. |
ObjectProperty<String> |
userAgentStylesheet |
DoubleProperty |
width
Defines the width of this
SubScene |
blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, visibleBASELINE_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()
Specifies the type of camera use for rendering this
SubScene. |
ObjectProperty<Paint> |
fillProperty()
Defines the background fill of this
SubScene. |
SceneAntialiasing |
getAntiAliasing()
Return the defined
SceneAntialiasing for this SubScene. |
Camera |
getCamera()
Gets the value of the property camera.
|
Paint |
getFill()
Gets the value of the property fill.
|
double |
getHeight()
Gets the value of the property height.
|
Parent |
getRoot()
Gets the value of the property root.
|
String |
getUserAgentStylesheet()
Get the URL of the user-agent stylesheet that will be used by this SubScene.
|
double |
getWidth()
Gets the value of the property width.
|
DoubleProperty |
heightProperty()
Defines the height of this
SubScene |
boolean |
isDepthBuffer()
Retrieves the depth buffer attribute for this
SubScene. |
ObjectProperty<Parent> |
rootProperty()
Defines the root
Node of the SubScene scene graph. |
void |
setCamera(Camera value)
Sets the value of the property camera.
|
void |
setFill(Paint value)
Sets the value of the property fill.
|
void |
setHeight(double value)
Sets the value of the property height.
|
void |
setRoot(Parent value)
Sets the value of the property root.
|
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)
Sets the value of the property width.
|
ObjectProperty<String> |
userAgentStylesheetProperty() |
DoubleProperty |
widthProperty()
Defines the width of this
SubScene |
addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, 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_findStyles, 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, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, nodeOrientationProperty, 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, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, 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, visiblePropertypublic final ObjectProperty<Parent> rootProperty
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.getRoot(),
setRoot(Parent)public final ObjectProperty<Camera> cameraProperty
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.
getCamera(),
setCamera(Camera)public final DoubleProperty widthProperty
SubScenegetWidth(),
setWidth(double)public final DoubleProperty heightProperty
SubScenegetHeight(),
setHeight(double)public final ObjectProperty<Paint> fillProperty
SubScene. Both a null
value meaning paint no background and a Paint
with transparency are supported. The default value is null.getFill(),
setFill(Paint)public final ObjectProperty<String> userAgentStylesheetProperty
getUserAgentStylesheet(),
setUserAgentStylesheet(String)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-sceneIllegalStateException - if this constructor is called on a thread
other than the JavaFX Application Thread.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.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.
IllegalStateException - if this constructor is called on a thread
other than the JavaFX Application Thread.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)
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.public final Parent getRoot()
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.public final ObjectProperty<Parent> rootProperty()
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.getRoot(),
setRoot(Parent)public final void setCamera(Camera value)
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.
public final Camera getCamera()
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.
public final ObjectProperty<Camera> cameraProperty()
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.
getCamera(),
setCamera(Camera)public final void setWidth(double value)
SubScenepublic final double getWidth()
SubScenepublic final DoubleProperty widthProperty()
SubScenegetWidth(),
setWidth(double)public final void setHeight(double value)
SubScenepublic final double getHeight()
SubScenepublic final DoubleProperty heightProperty()
SubScenegetHeight(),
setHeight(double)public final void setFill(Paint value)
SubScene. Both a null
value meaning paint no background and a Paint
with transparency are supported. The default value is null.public final Paint getFill()
SubScene. Both a null
value meaning paint no background and a Paint
with transparency are supported. The default value is null.public final ObjectProperty<Paint> fillProperty()
SubScene. Both a null
value meaning paint no background and a Paint
with transparency are supported. The default value is null.getFill(),
setFill(Paint)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.Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.