Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

[be sure to tile the page <BuilderName>.<node> i.e., SwingBuilder.frame]

Generated Object

javafx.scene.Scene

Attributes

This node accepts the attributes for a javafx.scene.Scene class. See the JavaDoc for javafx.scene.Scene

Content

May include stylesheets, mouse events, key events, javafx container Panes, or javafx Nodes. 

Usage

Each stage must have a Scene.

Examples

Code Block
GroovyFX.start({ primaryStage ->  
    def sg = new SceneGraphBuilder(primaryStage);
    
    sg.stage(
        title: "CircleT3D (Groovy)",
        visible: true,
        resizable: true
    ) {
         scene(fill: lightgreen, camera: new PerspectiveCamera(), width: 400, height:300) {
             stylesheets( urls: "file://mystyle.css" )
             onMousePressed( onEvent: { event -> println "scene mouse press"})
             onKeyReleased( onEvent: { event -> println "scene key" + event.text}) 
            
             circle(centerX: 200, centerY: 150, radius: 75, fill: blue,
                rotate: 30, rotationAxis: Rotate.Y_AXIS)
         }
    }
})