01 September 2017

Dependencies

The following dependencies have been upgraded

  • org.codehaus.groovy:groovy-all:2.4.12

  • com.google.guava:guava:23.0

  • org.jetbrains.kotlin:kotlin-stdlib:1.1.4-2

  • org.apache.pivot:pivot-charts:2.0.5

  • org.apache.pivot:pivot-core:2.0.5

  • org.apache.pivot:pivot-wtk:2.0.5

  • org.apache.pivot:pivot-wtk-terra:2.0.5

Runtime

JavaFX MetaComponent Support

You can now use MVCGroups as components inside an FXML file. Let’s assume there’s an mvcGroup named form with a matching FormView. This view defines the following content in form.fxml

griffon-app/resources/com/acme/form.fxml
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.layout.VBox?>
<?import griffon.javafx.support.MetaComponent?>
<?import griffon.javafx.support.MetaComponent.MvcArg?>

<VBox xmlns:fx="http://javafx.com/fxml"
      fx:controller="com/acme/ContainerView">
    <MetaComponent mvcType="formItem">
        <MetaComponent.MvcArg name="key" value="name"/>
    </MetaComponent>
    <MetaComponent mvcType="formItem">
        <MetaComponent.MvcArg name="propertyKey" value="lastname"/>
    </MetaComponent>
</VBox>

The formItem MVC group defines a Label, a TextField, and handles validation for its input. FormView must identify the root node that can be added to its parent view; the convention is to use the group’s id plus "-rootNode", for example

griffon-app/com/acme/FormItemView.java
package org.example;

import griffon.core.artifact.GriffonView;
import griffon.inject.MVCMember;
import griffon.metadata.ArtifactProviderFor;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import org.codehaus.griffon.runtime.javafx.artifact.AbstractJavaFXGriffonView;

import java.util.Collections;
import javax.annotation.Nonnull;

@ArtifactProviderFor(GriffonView.class)
public class FormItemView extends AbstractJavaFXGriffonView {
    @MVCMember private FormItemController controller;
    @MVCMember private FormItemModel model;
    @MVCMember private String propertyKey;

    @FXML private Label propertyLabel;
    @FXML private TextField propertyValue;

    @Override
    public void initUI() {
        Node content = loadFromFXML();
        propertyLabel.setText(propertyKey);
        model.valueProperty().bindBidirectional(propertyValue.textProperty());
        connectActions(content, controller);
        connectMessageSource(content);
        getMvcGroup().getContext().put(getMvcGroup().getMvcId() + "-rootNode", content);
    }
}

Buildtime

Gradle Wrapper

Gradle wrapper version on all Lazybones templates has been bumped to 4.1.

Maven Wrapper

The mvnw wrapper files have been added to all Lazybones templates.

Compatibility

Resources

Resource tokens have been migrated from @token@ to ${token}. This affects all resources found in the following directories:

  • src/main/resources

  • griffon-app/resources

  • griffon-app/i18n

Take note that key values may not use . as a separator, use _ instead. The following keys are now available to projects created by the Lazybones templates or those that rely on the gradle-griffon plugin.

Old Format New Format

application.name

application_name

application.version

application_version

build.date

build_date

build.time

build_time

build.revision

build_revision

JavaFX Gradle Plugin

All JavaFX project templates (Lazybones) now rely on FibreFoX/javafx-gradle-plugin as it provides more features and it’s updated more constantly than the previous plugin choice.

Full binary compatibility report between Griffon 2.12.0 and 2.11.0 can be found here.

A list of fixed issues can be found at the 2.12.0 milestone page.