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.
for more information.
Possible use cases are:
A default headlight will be added to a SubScene 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 enum |
| Modifier and Type | Field and Description |
|---|---|
| private final SceneAntialiasing | |
| private ObjectProperty | camera
Specifies the type of camera use for rendering this |
| private Camera | |
| private final boolean | |
| private int | |
| pack-priv boolean | |
| private boolean | |
| private ObjectProperty | fill
Defines the background fill of this |
| private DoubleProperty | height
Defines the height of this |
| private static boolean | |
| private List | |
| private ObjectProperty | root
Defines the root |
| private TopMostTraversalEngine | |
| private ObjectProperty | |
| private DoubleProperty | width
Defines the width of this |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SubScene(Parent
The root node of the scene graph root, double The width of the sub-scene width, double The height of the sub-scene height, boolean The depth buffer flag depthBuffer, SceneAntialiasing The sub-scene anti-aliasing attribute. A value of
antiAliasing)null is treated as DISABLED.
The depthBuffer and antiAliasing flags are conditional features. With the
respective default values of: false and Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final void | |
| public final ObjectProperty | |
| private void | |
| private boolean | |
| private BaseBounds | |
| private NGNode | |
| private void | doPickNodeLocal(PickRay localPickRay, PickResultChooser result)
Hides javafx. Finds a top-most child node that contains the given local coordinates. |
| private void | |
| private void | |
| public final ObjectProperty | |
| public final SceneAntialiasing | Returns: the SceneAntialiasing for this sub-sceneReturn the defined |
| public final Camera | |
| pack-priv Camera | |
| public final Paint | |
| public final double | |
| pack-priv List | |
| public final Parent | |
| public final String | Returns: The URL of the user-agent stylesheet that will be used by this SubScene, or null if has not been set.Get the URL of the user-agent stylesheet that will be used by this SubScene. |
| public final double | |
| public final DoubleProperty | |
| public final boolean | Returns: the depth buffer attribute.Retrieves the depth buffer attribute for this |
| private boolean | |
| private boolean | |
| private boolean | |
| pack-priv void | |
| pack-priv final void | |
| private void | |
| pack-priv void | |
| private PickResult | |
| pack-priv void | |
| pack-priv final void | |
| public final ObjectProperty | |
| public final void | |
| pack-priv void | |
| private void | |
| pack-priv void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | setUserAgentStylesheet(String
the URL of the user-agent stylesheet 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. |
| public final void | |
| private boolean | Returns: true if the point is insideSubScene's area covered by its fillhorizontal coordinate in the local space of the localX, double SubScene nodevertical coordinate in the local space of the localY)SubScene nodeDetermines whether |
| private boolean | |
| pack-priv boolean | |
| pack-priv void | |
| public final ObjectProperty | Returns: the userAgentStylesheet propertyGets the userAgentStylesheet property. |
| public final DoubleProperty |
| antiAliasing | back to summary |
|---|---|
| private final SceneAntialiasing antiAliasing | |
| camera | back to summary |
|---|---|
| private ObjectProperty<Camera> camera Specifies the type of camera use for rendering this Note this is a conditional feature. See
| |
| defaultCamera | back to summary |
|---|---|
| private Camera defaultCamera | |
| depthBuffer | back to summary |
|---|---|
| private final boolean depthBuffer | |
| dirtyBits | back to summary |
|---|---|
| private int dirtyBits Hides javafx. | |
| dirtyLayout | back to summary |
|---|---|
| pack-priv boolean dirtyLayout | |
| dirtyNodes | back to summary |
|---|---|
| private boolean dirtyNodes | |
| fill | back to summary |
|---|---|
| private ObjectProperty<Paint> fill Defines the background fill of this
| |
| height | back to summary |
|---|---|
| private DoubleProperty height Defines the height of this
| |
| is3DSupported | back to summary |
|---|---|
| private static boolean is3DSupported | |
| lights | back to summary |
|---|---|
| private List<LightBase> lights | |
| root | back to summary |
|---|---|
| private ObjectProperty<Parent> root Defines the root
The
| |
| traversalEngine | back to summary |
|---|---|
| private TopMostTraversalEngine traversalEngine | |
| userAgentStylesheet | back to summary |
|---|---|
| private ObjectProperty<String> userAgentStylesheet | |
| width | back to summary |
|---|---|
| private DoubleProperty width Defines the width of this
| |
| SubScene | back to summary |
|---|---|
| public SubScene(Parent root, double width, double height) Creates a
| |
| SubScene | back to summary |
|---|---|
| public SubScene(Parent root, double width, double height, boolean depthBuffer, SceneAntialiasing antiAliasing) Constructs a
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
| |
| addLight | back to summary |
|---|---|
| pack-priv final void addLight(LightBase light) | |
| cameraProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| clearDirtyBits | back to summary |
|---|---|
| private void clearDirtyBits() | |
| doComputeContains | back to summary |
|---|---|
| private boolean doComputeContains(double localX, double localY) | |
| doComputeGeomBounds | back to summary |
|---|---|
| private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx) | |
| doCreatePeer | back to summary |
|---|---|
| private NGNode doCreatePeer() | |
| doPickNodeLocal | back to summary |
|---|---|
| private void doPickNodeLocal(PickRay localPickRay, PickResultChooser result) Hides javafx. Finds a top-most child node that contains the given local coordinates. Returns the picked node, null if no such node was found. Note This method MUST only be called via its accessor method. | |
| doProcessCSS | back to summary |
|---|---|
| private void doProcessCSS() | |
| doUpdatePeer | back to summary |
|---|---|
| private void doUpdatePeer() | |
| fillProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| getAntiAliasing | back to summary |
|---|---|
| public final SceneAntialiasing getAntiAliasing() Return the defined Note this is a conditional feature. See
| |
| getCamera | back to summary |
|---|---|
| public final Camera getCamera() | |
| getEffectiveCamera | back to summary |
|---|---|
| pack-priv Camera getEffectiveCamera() | |
| getFill | back to summary |
|---|---|
| public final Paint getFill() | |
| getHeight | back to summary |
|---|---|
| public final double getHeight() | |
| getLights | back to summary |
|---|---|
| pack-priv List | |
| getRoot | back to summary |
|---|---|
| public final Parent getRoot() | |
| getUserAgentStylesheet | back to summary |
|---|---|
| public final String getUserAgentStylesheet() Get the URL of the user-agent stylesheet that will be used by this SubScene. If the URL has not been set, the platform-default user-agent stylesheet will be used. For additional information about using CSS with the scene graph, see the CSS Reference Guide.
| |
| getWidth | back to summary |
|---|---|
| public final double getWidth() | |
| heightProperty | back to summary |
|---|---|
| public final DoubleProperty heightProperty() | |
| isDepthBuffer | back to summary |
|---|---|
| public final boolean isDepthBuffer() Retrieves the depth buffer attribute for this
| |
| isDepthBufferInternal | back to summary |
|---|---|
| private boolean isDepthBufferInternal() | |
| isDirty | back to summary |
|---|---|
| private boolean isDirty() | |
| isDirty | back to summary |
|---|---|
| private boolean isDirty(SubScene. | |
| layoutPass | back to summary |
|---|---|
| pack-priv void layoutPass() | |
| markContentDirty | back to summary |
|---|---|
| pack-priv final void markContentDirty() | |
| markDirty | back to summary |
|---|---|
| private void markDirty(SubScene. | |
| nodeResolvedOrientationChanged | back to summary |
|---|---|
| pack-priv void nodeResolvedOrientationChanged() Overrides javafx.
| |
| pickRootSG | back to summary |
|---|---|
| private PickResult pickRootSG(double localX, double localY) | |
| processCSS | back to summary |
|---|---|
| pack-priv void processCSS() Overrides javafx.
| |
| removeLight | back to summary |
|---|---|
| pack-priv final void removeLight(LightBase light) | |
| rootProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| setCamera | back to summary |
|---|---|
| public final void setCamera(Camera value) | |
| setDirty | back to summary |
|---|---|
| pack-priv void setDirty(Node n) | |
| setDirty | back to summary |
|---|---|
| private void setDirty(SubScene. | |
| setDirtyLayout | back to summary |
|---|---|
| pack-priv void setDirtyLayout(Parent p) | |
| setFill | back to summary |
|---|---|
| public final void setFill(Paint value) | |
| setHeight | back to summary |
|---|---|
| public final void setHeight(double value) | |
| setRoot | back to summary |
|---|---|
| public final void setRoot(Parent value) | |
| setUserAgentStylesheet | back to summary |
|---|---|
| public final 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. If the URL does not resolve to a valid location, the platform-default user-agent stylesheet will be used. 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.
The RFC 2397 "data" scheme for URLs is supported in addition to the protocol handlers that
are registered for the application.
If a URL uses the "data" scheme and the MIME type is either empty, "text/plain", or "text/css",
the payload will be interpreted as a CSS file.
If the MIME type is "application/octet-stream", the payload will be interpreted as a binary
CSS file (see For additional information about using CSS with the scene graph, see the CSS Reference Guide.
| |
| setWidth | back to summary |
|---|---|
| public final void setWidth(double value) | |
| subSceneComputeContains | back to summary |
|---|---|
| private boolean subSceneComputeContains(double localX, double localY) Determines whether
| |
| syncLights | back to summary |
|---|---|
| private boolean syncLights() PG Light synchronizer. | |
| traverse | back to summary |
|---|---|
| pack-priv boolean traverse(Node node, Direction dir, TraversalMethod method) | |
| updateBounds | back to summary |
|---|---|
| pack-priv void updateBounds() Overrides javafx.
| |
| userAgentStylesheetProperty | back to summary |
|---|---|
| public final ObjectProperty Gets the userAgentStylesheet property.
| |
| widthProperty | back to summary |
|---|---|
| public final DoubleProperty widthProperty() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final SubScene. | |
| public static final SubScene. | |
| public static final SubScene. | |
| public static final SubScene. | |
| private int | |
| public static final SubScene. | |
| public static final SubScene. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final int | |
| public static SubScene. | |
| public static SubScene. |
| CAMERA_DIRTY | back to summary |
|---|---|
| public static final SubScene. | |
| CONTENT_DIRTY | back to summary |
|---|---|
| public static final SubScene. | |
| FILL_DIRTY | back to summary |
|---|---|
| public static final SubScene. | |
| LIGHTS_DIRTY | back to summary |
|---|---|
| public static final SubScene. | |
| mask | back to summary |
|---|---|
| private int mask | |
| ROOT_SG_DIRTY | back to summary |
|---|---|
| public static final SubScene. | |
| SIZE_DIRTY | back to summary |
|---|---|
| public static final SubScene. | |
| SubSceneDirtyBits | back to summary |
|---|---|
| private SubSceneDirtyBits() | |
| getMask | back to summary |
|---|---|
| public final int getMask() | |
| valueOf | back to summary |
|---|---|
| public static SubScene. | |
| values | back to summary |
|---|---|
| public static SubScene. | |