JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

expand all

Profile: desktop, common

Overview

The JavaFX Scene class is the root for all content in a scene graph. The background of the scene is filled as specified by the fill variable. The set of Nodes in the content sequence is then rendered on the scene.

For example:

the code:

import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;

Scene {
    width: 250
    height: 150
    fill: LinearGradient {
        endX: 0.0
        stops: [ Stop { offset: 0.0 color: Color.LIGHTGRAY }
                 Stop { offset: 1.0 color: Color.GRAY } ]
    }
    content: [
        Circle { centerX: 40 centerY: 50 radius: 25 fill: Color.GREEN }
        Rectangle { x: 100 y: 25 width: 75 height: 50 fill: Color.BLUE }
    ]
}

produces:

Profile: common

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publiccameraCameranull

Specifies the type of camera use for rendering this Scene.

Specifies the type of camera use for rendering this Scene. If camera is null, a parallel camera is used for rendering.

Note: this is a conditional feature. See ConditionalFeature.SCENE3D for more information.

null

Profile: common conditional scene3d

 
publiccontentNode[]empty

The sequence of Nodes to be rendered on this Scene.

publiccursorCursornull

Defines the mouse cursor for this Scene.

Defines the mouse cursor for this Scene. If null, then the default system cursor will be used.

null

Profile: common

 
publicfillPaintWHITE

Defines the background fill of this Scene.

Defines the background fill of this Scene. Both a null value meaning paint no background and a javafx.scene.paint.Paint with transparency are supported, but what is painted behind it will depend on the platform. The default value is the color white.

WHITE

Profile: common

 
public-initheightNumber

The height of this Scene

public-readstageStage

The Stage for this Scene

publicstylesheetsString[]

A series string urls linking to the stylesheets to use with this scene's contents.

public-initwidthNumber

The width of this Scene

public-readxNumber

The horizontal location of this Scene on the Stage.

public-readyNumber

The vertical location of this Scene on the Stage.

Inherited Variables

Script Function Summary

Function Summary

public lookup(id: java.lang.String) : Node

Looks for any node within the scene's content hierarchy with the specified id.

Looks for any node within the scene's content hierarchy with the specified id. If more than one node has the specified id, this function returns one of them. Which node it returns in that case is unspecified. If no nodes are found with this id, then null is returned. Note that the lookup function will not descend into the children of a CustomNode. A CustomNode provides a means of encapsulation for objects whose details are not exposed to the application scene graph.

Parameters
id
the id to look up
Returns
Node
the Node in the scene with the specified id, or null if no node with that id string is found.

Profile: common

 

Inherited Functions




Spec-Zone.ru - all specs in one place