Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Generated Object

javafx.scene.shape.Path

Attributes

This node takes the attributes from the javafx.scene.shape.Path class. see javafx.scene.shape.Path.

Content

This node takes path elements as content, arcTo, cubicCurveTo, hLineTo, lineTo, moveTo, quadCurveTo,  vLineTo and closePath

Usage

Create a shape based on a Path.

Examples

Code Block
import groovyx.javafx.GroovyFX
import groovyx.javafx.SceneGraphBuilder

GroovyFX.start({
    def sg = new SceneGraphBuilder();

    sg.stage(
        title: "Path Example (Groovy)",
        width: 400, height:250,
        visible: true,
    ){ 
        scene (fill: white) {
            path( translateX: 50, translateY: 50, fill: red) {
                moveTo(x: 0, y: 0)
                lineTo(x: 100, y: 0)
                arcTo(x: 200, y: 0, radiusX: 25, radiusY: 20)
                lineTo(x: 300, y: 0)
                lineTo(x: 150, y: 100)
                closePath()
            }
        }
    }
});