groovyfx-project / groovyfx

A library for writing JavaFX 8 applications in the Groovy language.
http://groovyfx.org
Apache License 2.0
199 stars 50 forks source link

Can groovyfx use other JavaFX library like JFoenix #55

Open bitsnaps opened 6 years ago

bitsnaps commented 6 years ago

Hi, I'm trying to include JFoenix widgets into groovyfx example, here a sample:

@Grapes([
    @Grab('org.codehaus.groovyfx:groovyfx:0.4.0'),
    @Grab('com.jfoenix:jfoenix:8.0.3')
])

import static groovyx.javafx.GroovyFX.start
import com.jfoenix.controls.JFXTextField

start {
    stage(title: 'GroovyFX with jFoenix', visible: true) {
        scene(fill: BLACK, width: 500, height: 250) {
            hbox(padding: 60) {
                text(text: 'Groovy', font: '80pt sanserif') {
                    fill linearGradient(endX: 0, stops: [PALEGREEN, SEAGREEN])
                }
                text(text: 'FX', font: '80pt sanserif') {
                    fill linearGradient(endX: 0, stops: [CYAN, DODGERBLUE])
                    effect dropShadow(color: DODGERBLUE, radius: 25, spread: 0.25)
                }
            }
        }
    }
}

This example is working fine, and you can see I could import some jfoenix controls without any error or warning on console log, now how can groovyfx builder handle/show jfoenix controls ?

Dierk commented 6 years ago

if you want to have it named, you can register the name in the bean factory: https://github.com/groovyfx-project/groovyfx/blob/master/src/demo/groovy/CustomFieldDemo.groovy

for anonymous use, you can use the 'node' or 'container' scenegraph wrappers.

Happy coding Dierk

Am 11.05.2018 um 13:14 schrieb bitsnaps notifications@github.com:

Hi, I'm trying to include JFoenix widgets into groovyfx example, here a sample: `@Grapes([ @grab('org.codehaus.groovyfx:groovyfx:0.4.0'), @grab('com.jfoenix:jfoenix:8.0.3') ])

import static groovyx.javafx.GroovyFX.start import com.jfoenix.controls.JFXTextField

start { stage(title: 'GroovyFX with jFoenix', visible: true) { scene(fill: BLACK, width: 500, height: 250) { hbox(padding: 60) { text(text: 'Groovy', font: '80pt sanserif') { fill linearGradient(endX: 0, stops: [PALEGREEN, SEAGREEN]) } text(text: 'FX', font: '80pt sanserif') { fill linearGradient(endX: 0, stops: [CYAN, DODGERBLUE]) effect dropShadow(color: DODGERBLUE, radius: 25, spread: 0.25) } } } } } ` This example is working fine, and you can see I could import some jfoenix controls without any error or warning on console log, now how can groovyfx builder handle/show jfoenix controls ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

bitsnaps commented 6 years ago

Great! it works :) https://gist.github.com/bitsnaps/8a04c04519b22a9833a88cd5e0b9ddb1

Dierk commented 6 years ago

🤓

Am 11.05.2018 um 16:04 schrieb bitsnaps notifications@github.com:

Great! it works and it was great :) https://gist.github.com/bitsnaps/8a04c04519b22a9833a88cd5e0b9ddb1

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.