groovyfx-project / groovyfx Goto Github PK
View Code? Open in Web Editor NEWA library for writing JavaFX 8 applications in the Groovy language.
Home Page: http://groovyfx.org
License: Apache License 2.0
A library for writing JavaFX 8 applications in the Groovy language.
Home Page: http://groovyfx.org
License: Apache License 2.0
As explained at #10
Creating a table view on a view with groovyFx does not work as the following exception is thrown:
[2015-08-25 19:25:27,570] [JavaFX Application Thread] ERROR griffon.core.GriffonExceptionHandler - Uncaught Exception
java.lang.NoClassDefFoundError: com/sun/javafx/accessible/providers/AccessibleProvider
at groovyx.javafx.factory.EditingCallback.call(TableFactory.groovy:41)
at javafx.scene.control.TableRow.createDefaultSkin(TableRow.java:212)
at javafx.scene.control.Control.impl_processCSS(Control.java:859)
at javafx.scene.Node.processCSS(Node.java:9056)
at javafx.scene.Node.applyCss(Node.java:9153)
at javafx.scene.Parent.layout(Parent.java:1079)
at javafx.scene.Parent.layout(Parent.java:1085)
at javafx.scene.Scene.doLayoutPass(Scene.java:552)
at javafx.scene.Scene.preferredSize(Scene.java:1646)
at javafx.scene.Scene.impl_preferredSize(Scene.java:1720)
at javafx.stage.Window$9.invalidated(Window.java:846)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
at javafx.stage.Window.setShowing(Window.java:922)
at javafx.stage.Window.show(Window.java:937)
at javafx.stage.Stage.show(Stage.java:259)
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.accessible.providers.AccessibleProvider
... 16 more
There are references and links in the following places to Codehaus mailing lists:
(Looks like there's only one place, but I thought I saw it somewhere else. On http://groovyfx.org the Mailing Lists link points to the Mailing Lists page on the groovy-lang.org website. Are those the correct lists now for GroovyFX discussion?)
Missing Person definition and imports to support Person
`org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/usr/local/ext/src/github.com/groovyfx-project/groovyfx/src/demo/groovy/TableView2Demo.groovy: 27: unable to resolve class Person
@ line 27, column 5.
new Person(
[....]
`
When trying to run an example using the suggested @grab approach. Receive an exception.
e.g. this is the accordion example copied from the demos directory. Then, as suggested in README, add the Grab annotation.
@Grab('org.groovyfx:groovyfx:8.0.0')
import static groovyx.javafx.GroovyFX.start
start {
stage(title: "GroovyFX Accordion Demo", x: 100, y: 100, visible: true, style: "decorated", primary: true) {
scene(fill: GROOVYBLUE, width: 400, height: 400) {
accordion {
titledPane(id: "t1", text: "Label 1") {
content {
label(text: "This is Label 1\n\nAnd there were a few empty lines just there!")
}
}
titledPane(id: "t2", text: "Label 2") {
content {
label(text: "This is Label 2\n\nAnd there were a few empty lines just there!")
}
}
titledPane(id: "t3", text: "Label 3") {
// this is content
label(text: "This is Label 3\n\nAnd there were a few empty lines just there!")
}
}
}
}
}
Then, using either
groovy AccordionDemo.groovy
or
groovy -cp $JAVA_HOME/jre/lib/ext/jfxrt.jar AccordionDemo.groovy
results in
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
at com.sun.proxy.$Proxy4.onClassInfo(Unknown Source)
Caused by: java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:273)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:268)
at com.sun.javafx.application.PlatformImpl.setPlatformUserAgentStylesheet(PlatformImpl.java:550)
at com.sun.javafx.application.PlatformImpl.setDefaultPlatformUserAgentStylesheet(PlatformImpl.java:512)
at javafx.scene.control.Control.<clinit>(Control.java:87)
... 1 more
The google machine suggests this error can be corrected by instantiating a JFXPanel
by hand, but I'm not sure where you would do this. I tried it at the root script level:
new JFXPanel()
start {
...
and also at the top of the start block with no success.
Also, I've seen people suggest this
@GrabConfig(systemClassLoader=true, initContextClassLoader=true)
Also no change
So it seem like there must be a missing step in those places where you suggest a @Grape
invocation to pull in groovyfx.
I'd try it with the 9.0 snapshot, but it doesn't seem to resolve.
grape resolve org.groovyfx groovyfx 8.0.0
/Users/kirk/.groovy/grapes/org.groovyfx/groovyfx/jars/groovyfx-8.0.0.jar
/Users/kirk/.groovy/grapes/org.codehaus.groovy/groovy-all/jars/groovy-all-2.4.6.jar
grape resolve org.groovyfx groovyfx 9.0.0-SNAPSHOT
Error in resolve:
Error grabbing Grapes -- [unresolved dependency: org.groovyfx#groovyfx;9.0.0-SNAPSHOT: not found]
Perhaps the grape is not installed?
Same problem on Debian Sid and Fedora Rawhide, both using Oracle JDK 8u72.
|> gradle -s test
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
JavaFX runtime jar: /home/users/russel/lib.Linux.x86_64/jdk1.8.0_72/jre/lib/ext/jfxrt.jar
Groovy: 2.4.5; JUnit: 4.12
[versioning] WARNING - the working copy has unstaged or uncommitted changes.
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileTestJava UP-TO-DATE
:compileTestGroovy UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test
groovyx.javafx.SceneGraphBuilderTest > testId FAILED
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:68)
at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:65)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:65)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:162)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at groovyx.javafx.GroovyFXEnhancer.enhanceClasses(GroovyFXEnhancer.groovy:499)
at groovyx.javafx.GroovyFXEnhancer$enhanceClasses.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at groovyx.javafx.SceneGraphBuilder.(SceneGraphBuilder.groovy:150)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:239)
at groovyx.javafx.SceneGraphBuilderTest.testId(SceneGraphBuilderTest.groovy:21)
Caused by:
java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:273)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:268)
at com.sun.javafx.application.PlatformImpl.setPlatformUserAgentStylesheet(PlatformImpl.java:550)
at com.sun.javafx.application.PlatformImpl.setDefaultPlatformUserAgentStylesheet(PlatformImpl.java:512)
at javafx.scene.control.Control.<clinit>(Control.java:87)
... 26 more
groovyx.javafx.GroovyFXTest > testStartSetsDelegate FAILED
java.lang.NoClassDefFoundError: Could not initialize class groovyx.javafx.SceneGraphBuilder
at groovyx.javafx.GroovyFX.start(GroovyFX.java:35)
at groovyx.javafx.GroovyFX$start.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at groovyx.javafx.GroovyFXTest.testStartSetsDelegate(GroovyFXTest.groovy:38)
6 tests completed, 2 failed
:test FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':test'.
There were failing tests. See the report at: file:///home/users/russel/Repositories/Git/Git/GroovyFX/build/reports/tests/index.html
Try:
Run with --info or --debug option to get more log output.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':test'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.GradleException: There were failing tests. See the report at: file:///home/users/russel/Repositories/Git/Git/GroovyFX/build/reports/tests/index.html
at org.gradle.api.tasks.testing.Test.handleTestFailures(Test.java:1157)
at org.gradle.api.tasks.testing.Test.executeTests(Test.java:570)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 68 more
BUILD FAILED
Total time: 6.703 secs
java.lang.RuntimeException: Could not init groovyx.javafx.SceneGraphBuilder because of an exception in groovyx.javafx.SceneGraphBuilder.registerControls
at groovy.util.FactoryBuilderSupport.callAutoRegisterMethods(FactoryBuilderSupport.java:214)
at groovy.util.FactoryBuilderSupport.autoRegisterNodes(FactoryBuilderSupport.java:188)
at groovy.util.FactoryBuilderSupport.<init>(FactoryBuilderSupport.java:162)
at groovyx.javafx.SceneGraphBuilder.<init>(SceneGraphBuilder.groovy:91)
at groovyx.javafx.SceneGraphBuilder.<init>(SceneGraphBuilder.groovy)
at groovyx.javafx.GroovyFX.start(GroovyFX.java:34)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(javafx.graphics@9-ea/LauncherImpl.java:843)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(javafx.graphics@9-ea/PlatformImpl.java:449)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$9(javafx.graphics@9-ea/PlatformImpl.java:418)
at java.security.AccessController.doPrivileged(java.base@9-ea/Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(javafx.graphics@9-ea/PlatformImpl.java:417)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(javafx.graphics@9-ea/InvokeLaterDispatcher.java:96)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(javafx.graphics@9-ea/Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$8(javafx.graphics@9-ea/GtkApplication.java:195)
at java.lang.Thread.run(java.base@9-ea/Thread.java:843)
Caused by: java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:535)
at groovy.util.FactoryBuilderSupport.callAutoRegisterMethods(FactoryBuilderSupport.java:209)
... 14 more
Caused by: java.lang.ExceptionInInitializerError
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(java.base@9-ea/Native Method)
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(java.base@9-ea/NativeConstructorAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(java.base@9-ea/DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(java.base@9-ea/Constructor.java:455)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at groovyx.javafx.SceneGraphBuilder.registerControls(SceneGraphBuilder.groovy:569)
... 19 more
Caused by: java.lang.NumberFormatException: For input string: "9-e"
at jdk.internal.math.FloatingDecimal.readJavaFormatString(java.base@9-ea/FloatingDecimal.java:2054)
at jdk.internal.math.FloatingDecimal.parseFloat(java.base@9-ea/FloatingDecimal.java:122)
at java.lang.Float.parseFloat(java.base@9-ea/Float.java:451)
at java.lang.Float.valueOf(java.base@9-ea/Float.java:415)
at org.codehaus.groovy.runtime.StringGroovyMethods.toFloat(StringGroovyMethods.java:3450)
at org.codehaus.groovy.runtime.dgm$1185.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at groovyx.javafx.JdkUtil.jdkIsBefore8(JdkUtil.groovy:5)
at groovyx.javafx.JdkUtil$jdkIsBefore8.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at groovyx.javafx.factory.TreeItemFactory.<clinit>(TreeItemFactory.groovy:41)
... 29 more
Sorry for posting a really novice question. I love the declarative, straight forward look of GroovyFX. How can I execute a simple hello world style example multiple times from a script evaluating console without getting the following exception : javax.script.ScriptException: java.lang.IllegalStateException: Application launch must not be called more than once?
Line 154-
case Worker.State.CANCELED:
System.out.println(wv.engine.loadWorker.message);
wv.engine.loadWorker.stateProperty().removeListener(this);
break;
S/be CANCELLED (with 2 x L's)
The title on this page still says
A library for writing JavaFX 2.0 applications in the Groovy language
I'd send a pull request for this fix, but it requires someone with repo admin privilege to edit via the Github Web UI.
I've looked at the JavaFX Gradle plugin choices out there and am not happy. I wish that Gradle, Inc. would produce or bless one that does the complete job. My understanding is that the leading plugin https://bitbucket.org/shemnon/javafx-gradle is not being maintained (last update 2014)
This is a problem for the whole JavaFX ecosystem and affects more than just GroovyFX. Maybe I'm wrong -- I'd be happy to find out that I am.
So my intention for this issue is that it be for tracking and discussing a solution for GroovyFX. Whatever the best available plugin(s) for JavaFX is (are) we should probably be using it.
A plugin may or may not help with Issue #31. But I think many (most?) GroovyFX apps will want to build bundled Mac OS X apps, bundled Windows .EXEs, etc.
I'm a long-time Groovy developer that is new to JavaFX and I'm looking at GroovyFX as a place to learn beast practices -- e.g. steal a nice build.gradle
file.
It would be nice to do something like the following:
toolBar {
pane { hgrow: 'always' }
}
Refer to equivalent FXML solution - http://stackoverflow.com/questions/24896498/how-to-right-allign-a-button-in-java-fx-toolbar:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<ToolBar prefHeight="40.0" prefWidth="318.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8">
<Button text="Apples" />
<Button text="Oranges" />
<Pane HBox.hgrow="ALWAYS" />
<Button text="Help" />
</ToolBar>
A toolbar lays out its children using HBox or VBox - depending on orientation.
My current workaround is to specify in full:
toolBar(orientation: HORIZONTAL) {
...
toolBarSpring = pane(); HBox.setHgrow(toolBarSpring, Priority.ALWAYS)
...
}
A solution could be look at AbstractNodeFactory.handleLayoutConstraints allowing special case if parent instanceof ToolBar. In this case it would need to explicitly invoke HBox.setHgrow or VBox.setVgrow.
original issue report: groovyfx-project/groovyfx-project.github.com#5
The 'ColorPicker' is not available in the current version.
On startup, when you start to type in the textBox, NPE is logged.
Using the pull down and setting an available font corrects the error.
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at com.sun.javafx.scene.web.skin.HTMLEditorSkin.applyTextFormatting(HTMLEditorSkin.java:1100) at com.sun.javafx.scene.web.skin.HTMLEditorSkin.lambda$new$3(HTMLEditorSkin.java:293) at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$KeyHandler.process(Scene.java:3964) at javafx.scene.Scene$KeyHandler.access$1800(Scene.java:3910) at javafx.scene.Scene.impl_processKeyEvent(Scene.java:2040) at javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2501) at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:197) at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:147) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$353(GlassViewEventHandler.java:228) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:227) at com.sun.glass.ui.View.handleKeyEvent(View.java:546) at com.sun.glass.ui.View.notifyKey(View.java:966) at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139) at java.lang.Thread.run(Thread.java:745)
If a node containing binding is added directly into borderPane (top, center..etc) we get an exception.
e.g.
groovy.lang.MissingMethodException: No signature of method: groovyx.javafx.factory.BorderPanePosition.addNode() is applicable for argument types: (groovyx.javafx.binding.BindingHolder) values: [groovyx.javafx.binding.BindingHolder@2d3e0ea3]
Possible solutions: addNode(javafx.scene.Node), getNode(), hashCode()
Possible Solution:
BorderPanePositionFactory
public void setChild( FactoryBuilderSupport builder, Object parent, Object child ) {
parent.addNode(child);
}
above method should ensure child instanceof Node
User workaround is to wrap the node using a container that supports binding e.g. hbox etc
JDK: 1.8.0_92
Gradle: 2.14
OS: Linux
groovyfx/groovy version:
compile 'org.codehaus.groovy:groovy-all:2.4.6'
compile 'org.groovyfx:groovyfx:8.0.0'
When i try to run the CanvasDemo, I get the following:
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to javafx.collections.ObservableList
at javafx.beans.property.ListProperty.setValue(ListProperty.java:56)
at javafx.beans.value.WritableValue$setValue.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at groovyx.javafx.canvas.DrawOperations.setOperations(DrawOperations.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2702)
at groovy.lang.ExpandoMetaClass.setProperty(ExpandoMetaClass.java:1185)
at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3746)
at groovy.lang.MetaClassImpl.setProperties(MetaClassImpl.java:1746)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$NoParamSite.callConstructor(ConstructorSite.java:125)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at groovyx.javafx.factory.CanvasFactory.onNodeCompleted(CanvasFactory.groovy:56)
3 Other demos I've tried so far (only just started on groovyfx) are working, i.e. Accordian, Animation and HelloWorld.
Sometimes it is necessary to have access to the instance of Application
. For example to call getHostServices()
or getParameters()
. Is there any way to do it? Seems like GroovyFX hides this instance completely.
I see the latest commit dates from 2019-07-30, so I'm full of hope.
I just included this as a dependency in build.gradle:
implementation 'org.groovyfx:groovyfx:8.0.0'
./gradlew build gives:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.groovyfx:groovyfx:8.0.0.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/groovyfx/groovyfx/8.0.0/groovyfx-8.0.0.pom
- https://repo.maven.apache.org/maven2/org/groovyfx/groovyfx/8.0.0/groovyfx-8.0.0.jar
Required by:
project :
I go to Maven Central: it appears to be there. Baffled.
Then I see here that you say there is a newer version, 9.0.0 snapshot (not a release). I try this, I also try jcenter instead of maven central. All attempts fail.
I see it is possible to download the 8.0.0. jar from maven central. Done that. I am also cloning the latest commit, on the assumption that this is your latest stable snapshot...
oops: after cloning, and ./gradlew build, fails:
> Task :licenseGradle FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':licenseGradle'.
> License violations were found: /home/chris/.groovy/groovyfx/9_0_0_snapshot/groovyfx/gradle/code-quality.gradle,/home/chris/.groovy/groovyfx/9_0_0_snapshot/groovyfx/build.gradle,/home/chris/.groovy/groovyfx/9_0_0_snapshot/groovyfx/settings.gradle,/home/chris/.groovy/groovyfx/9_0_0_snapshot/groovyfx/gradle/demo.gradle}
Please let me know what's going on with this project & why maven central is not working.
https://dl.bintray.com/groovyfx/maven/org/groovyfx/groovyfx/8.0.0/:groovyfx-8.0.0.jar
(need to remove colon before groovyfx)
Has anyone started writing this? If so, please point me at the work in progress.
I'd like to contribute this section unless someone else is working on it.
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 ?
It appears that the 'org.groovyfx:groovyfx:8.0.0' artefact has not been propagated to Maven Central. This seems to mean that a @grab of the artefact in a Groovy script fails.
This is a feature request.
I'm looking for a reusable, embeddable Groovy console window for scripting in my JavaFX app. What is the best starting point in all of Groovydom? Does it make sense to include something like that in this project?
The following classes are in GroovyFX 8 but not in GroovyFX 9:
javafx.scene.NodeBuilder
com.sun.javafx.css.parser.CSSParser
com.sun.javafx.css.Stylesheet
javafx.scene.paint.RadialGradientBuilder
javafx.scene.paint.RadialGradientBuilder
com.sun.javafx.css.parser.CSSParser
javafx.scene.paint.LinearGradientBuilder
com.sun.javafx.css.Stylesheet
javafx.scene.paint.LinearGradientBuilder
javafx.scene.chart.XYChartBuilder
javafx.scene.media.MediaPlayerBuilder
javafx.scene.NodeBuilder
javafx.scene.media.MediaPlayerBuilder
javafx.scene.SceneBuilder
MediaPlayerBuilder
SceneBuilder
original issue report: groovyfx-project/groovyfx-project.github.com#8
Preferably use JaCoCo
I think it would be wise to implement the extension methods in this library using extension modules rather than adding them directly to the metaclass so that IDEs can have intelligence over these methods and not show them as unrecognized
Exception in Application start method Caught: java.lang.RuntimeException: Exception in Application start method java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182) Caused by: java.lang.NullPointerException: Cannot set property 'title' on null object at FXMLDemoFromSceneBuilderFile$_run_closure1.doCall(FXMLDemoFromSceneBuilderFile.groovy:30) at groovyx.javafx.GroovyFX.start(GroovyFX.java:40) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863) at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326) at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295) at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139)
According to https://stackoverflow.com/questions/32773847/scene-lookup-returns-null-if-i-search-my-vbox lookups ''are not very robust"
groovy.util.FactoryBuilderSupport createNode
WARNING: Could not find match for name 'buttonBar'
e.g.
buttonBar {
button buttonData: OK
button buttonData: APPLY
button buttonData: CANCEL
}
I'm trying to use this inside a Griffon application if it makes any difference
Use travis
s/println:/println
original issue report: groovyfx-project/groovyfx-project.github.com#3
Minor issue:-
TableFactory refers to non-existant class PatientView in EnumEditingCell.createChoiceBox() exception handler.
original issue report: groovyfx-project/groovyfx-project.github.com#2
original issue report: groovyfx-project/groovyfx-project.github.com#7
For example:
import groovy.transform.CompileStatic
import groovyx.javafx.beans.FXBindable
@CompileStatic
class Foo {
static class Bar {
@FXBindable
Object baz
}
}
Decompiled:
public class Foo implements GroovyObject {
...
public static class Bar implements GroovyObject {
private ObjectProperty bazProp;
...
public final Object getBaz() {
return ((ObjectProperty)this).getValue();
}
public final void setBaz(Object value) {
this.setValue(value);
}
...
}
...
}
So getter/setter not work :(
duplicate in registerNodes()
original issue report: groovyfx-project/groovyfx-project.github.com#6
Rather than
styleClass: ['my-list', 'special-list']
would be groovy to have
styleClass: 'my-list special-list'
In reference to http://dev.w3.org/html5/spec-preview/global-attributes.html#classes
...the class attribute is split on spaces. (Duplicates are ignored.)
The space characters, for the purposes of this specification, are U+0020 SPACE, "tab" (U+0009), "LF" (U+000A), "FF" (U+000C), and "CR" (U+000D).
original issue report: groovyfx-project/groovyfx-project.github.com#4
If jfxrt.jar is not found int classpath, a message is issued requesting that JAVAFX_HOME be set:
Please set the environment variable JAVAFX_HOME
to the directory that contains rt/lib/jfxrt.jar
of JavaFX version 8.0.*.
That jar is found in jre/lib/ext for Java8 distributions.
On Windows, setting JAVAFX_HOME to JAVAFX_HOME=/Java/java8/jre/lib/ext appears to be the only way to get it to work (C:\ at the front doesn't work, and the 's in middle also seem to cause problems)
Also need to correct the docs page on how to build (there is no separate JAVAFX SDK to download anymore.).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.