Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A plugin for creating JavaFX applications with the Griffon framework.
Java Groovy Shell

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
griffon-app/conf
scripts GRIFFON-654
src
test/unit/griffon/javafx/editors Update ColorPropertyEditor with the same behavior as its swing counte…
wrapper release 0.7
.gitignore Update JavaFXApplication and editors with latest changes from Griffon…
JavafxGriffonAddon.groovy Update ColorPropertyEditor with the same behavior as its swing counte…
JavafxGriffonPlugin.groovy GRIFFON-670 initial arguments were not sent to the application instance
LICENSE.txt
README.md
application.properties
griffonw
griffonw.bat Initial commit.
release_notes.md GRIFFON-670 initial arguments were not sent to the application instance

README.md

Griffon JavaFX Plugin

Plugin page: http://artifacts.griffon-framework.org/plugin/javafx

Allows writing Griffon JavaFX applications using GroovyFX for the views.

This plugin assumes the existence of JavaFX on the developer's computer. The environment variable JAVAFX_HOME should point to the root directory of the JavaFX SDK installation.

Usage

Once installed, you can use any of the nodes provided by GroovyFX in your views. GroovyFX documentation can be found here and JavaFX documentation can be found here. In addition, you will be able to use the @FXBindable annotation on your models.

Property Editors

This plugin contributes the following property editors

Type Format
javafx.scene.paint.Color #RGB ; #RGBA ; #RRGGBB; #RRGGBBAA ; Color constant
javafx.geometry.Dimension2D width, height
javafx.scene.image.Image path/to/image_file
javafx.geometry.Insets top, left, bottom, right
javafx.geometry.Point2D x, y
javafx.geometry.Rectangle2D x, y , width, height

Notes:

  • Color supports all color constants defined by javafx.scene.paint.Color.

Default Imports

This plugin enables additional imports to be used in Groovy based artifacts. Here's the full list per type

  • Controller
    • javafx.collections
    • javafx.application
    • javafx.util
  • Model
    • javafx.collections
    • javafx.beans
    • javafx.beans.binding
    • javafx.beans.property
    • javafx.util.
    • groovyx.javafx.beans.
  • View
    • javafx.collections
    • javafx.concurrent
    • javafx.event
    • javafx.geometry
    • javafx.scene
    • javafx.scene.chart
    • javafx.scene.control
    • javafx.scene.control.cell
    • javafx.scene.effect
    • javafx.scene.image
    • javafx.scene.input
    • javafx.scene.layout
    • javafx.scene.media
    • javafx.scene.paint
    • javafx.scene.shape
    • javafx.scene.text
    • javafx.scene.transform
    • javafx.scene.web
    • javafx.stage
    • javafx.util

Example

Your main application's view might look like this (in fact it will look very similar if you create your application with the JavaFX archetype):

application(title: 'Cool App', sizeToScene: true, centerOnScreen: true) {
    scene(fill: black, width: 400, height: 300) {
        hbox(padding: 80) {
            text(text: "Java", font: "80pt sanserif") {
                fill linearGradient(endX: 0, stops: [[0, orange], [1, chocolate]])
            }
            text(text: "FX", font: "80pt sanserif") {
                fill linearGradient(endX: 0, stops: [[0, cyan], [1, dodgerblue]])
                effect dropShadow(color: dodgerblue, radius: 25, spread: 0.25)
            }
        }
    }
}
Something went wrong with that request. Please try again.