Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Andres Almiray
@aalmiray
You can make it any type you need. You can also use the type conversions provided by JavaFX bindings, such as someIntegerValueProperty().asString()
Mark Nellemann
@mnellemann
Awesome :) Comming from Grails and web this is all new to me, but really exicting. Works perfectly as an Integer, and with .asString() in my label.
Vincenzo Forchì
@vforchi
Hi, a user just made me realize that the start scripts do not work on shells other than bash: as a workaround I modified them from gradle, but you may want to change the templates
Andres Almiray
@aalmiray
@vforchi could you share some details on the changes you had to make? I could adapt those changes and make them available in the project templates ;-)
Vincenzo Forchì
@vforchi
I just made a quick hack to force it to use bash:
startScripts {
doLast {
unixScript.text = unixScript.text.replaceAll("#!/usr/bin/env sh", "#!/usr/bin/env bash")
}
}
I think that if you want it to work on any shell you would pretty much have to write two or three different scripts
Andres Almiray
@aalmiray
got it, thanks! griffon/griffon#305
Mark Nellemann
@mnellemann
The application.title from conf/Config.groovy set's the title in my app window, but griffon.javafx.JavaFXGriffonApplication is shown in task-switch and in the task-bar, as seen here; is there another place to configure this ?
Andres Almiray
@aalmiray
Does this happen when running on Linux?
In oSX you may need to use https://github.com/codecentric/NSMenuFX
Mark Nellemann
@mnellemann
Does this happen when running on Linux? Yes, testing on Gnome desktop.
Andres Almiray
@aalmiray
Hmmm
I'd recommend following up with the people at Gluon http://gluonhq.com/
I assume you're running JavaFX 8 given that GroovyFX does not work with Java 9 yet
Mark Nellemann
@mnellemann
yes
I'll check w. gluonhq or maybe it will be fixed in javafx 9 or 11. Lot's of other things to discover and learn anyways :) Thanks.
Andres Almiray
@aalmiray
Be advised that a new version of GroovyFX will be needed post Java9. The current work targets JavaFX 11 and onwards
Mark Nellemann
@mnellemann
Question regarding testing - from the example app I see how the verifyThat('#someField', hasText('some text') works. Is it possible to verify that a field has text of a certain length? The text will be random, so can't verify the exact content.
Andres Almiray
@aalmiray
It all depends on the matchers exposed by https://github.com/TestFX/TestFX
Mark Nellemann
@mnellemann
Happy New Year everyone. I'm trying to add a custom application icon, and from the 2.15.1 guide I've used the example code iconImage: imageIcon("/griffon-icon-48x48.png").image as parameter to builder.application(). When I try to run the app, I get this error: griffon.exceptions.GriffonViewInitializationException: Unexpected error when initializing view of type biz.nellemann.pwdfx.PasswordFxView belonging to mvcgroup [passwordFx:passwordFx] Caused by: groovy.lang.MissingMethodException: No signature of method: biz.nellemann.pwdfx.PasswordFxView.imageIcon() is applicable for argument types: (java.lang.String) values: [/griffon-icon-48x48.png] at biz.nellemann.pwdfx.PasswordFxView.initUI(PasswordFxView.groovy:27). Works perfectly fine without the iconImage.
Andres Almiray
@aalmiray
It may be the case that imageIcon is evaluated eagerly, specially if the code is written as builder.application(iconImage: imageIcon(...)). The solution is to prefix the node with the builder, such as builder.application(iconImage: builder.imageIcon(...)).
Mark Nellemann
@mnellemann
Thanks. I've just tried it, but when line 27 in PasswordFxView.groovy is uncommented, it says: groovy.lang.MissingMethodException: No signature of method: griffon.util.CompositeBuilder.imageIcon() is applicable for argument types: ([Ljava.lang.Object;) values: [[/griffon-icon-48x48.png]].
Andres Almiray
@aalmiray
the imageIcon node does not accept Object[] not List as arguments.
Mark Nellemann
@mnellemann
Not sure I understand that - sorry for the newbie questions... but I got it working w. icons: new Image('/griffon-icon-48x48.png'), so I'm good.
myteer
@myteer
@aalmiray when will griffon 3.0.0 be released?
Andres Almiray
@aalmiray
@myteer we don’t have a concrete date yet. JSR-377 must have a final release yet. We hope to get it done by August 2019. Is there something you need from the 3.x line?
myteer
@myteer
Oh I got it! Just want to try JPMS in griffon.
Bytecod3r
@bytecod3r

Hello all, I am extremely happy to found this channel accidentally!
I have a question about Griffon and basically, need some expert advice.

I want to develop a client/server JavaFX 11 Desktop Application. And I came across Griffon a few days ago. I would like to know the expert opinions here on using Griffon or any better alternative for the following project.

In my project, I will have a JavaFx Server, and JavaFX Client, the server can support many clients to be connected at the same time. There will be Agents connected to the server (Agents are not Java, think about it as Web Browsers), and the JavaFX Clients will be able to manage Agents through Server and execute tasks on them.

An example task would be: Client A removes an agent from the list; other clients should have updated their table view to reflect the same simultaneously.

Each JavaFX Clients also can load plugins; the plugins can be only loaded for the user who loads it, or there will be an option to load the Plugin for the server.

I have explored Java RMI, Socket programming, Sping boot, Netty, Griffon, etc.etc. I am not an expert Java programmer; I appreciate if any advice on what should I use for the project to be safe and secure, I don't want to redesign the whole application after a few years.

Mark Nellemann
@mark_nellemann_twitter
My griffon swing app is fetching some images remotely, which in same cases takes a few seconds. I would like to display a 'loading' gif or similar to indicate to the user that something is happening. Recommendations or examples are greatly appreciated, thanks.
Andres Almiray
@aalmiray
What’s the particular problem in this case:
  • displaying an animation (gif or else)
  • showing/hiding animation (in place, blocking layer, dialog)
Mark Nellemann
@mark_nellemann_twitter
Thanks for reply Andres. I am interested in learning about the 2nd option - show/hide animation on top of window or as new dialog.
Andres Almiray
@aalmiray
Then I'd recommend using any of the following:
CardPane - displays animation on cards 1, load content on cards 2. When done, switch cards
JLayer - similar to CardPane but closer to <div> in HTML
popping a temporary window can be done with a small MVC group. Trigger the dialog using withMVCGroup
Even though this tutorial (http://griffon-framework.org/tutorials/4_javafx_views.html) shows JavaFX the mechanics for using a CardPane with Swing are similar
Mark Nellemann
@mark_nellemann_twitter
I tried the small MVC group approach, but could not remove/hide it again , but I thought this was the right way, as I could also provide params with text to show, etc.
The code shown is for Griffon 1.x and Groovy DSL but the mechanics are also similar for Java and Griffon 2.x
Mark Nellemann
@mark_nellemann_twitter
I will read your blog post and see if I can make it work in my project, and also have the CardPane and JLayer in mind. Thanks :)
Andres Almiray
@aalmiray
The benefit from Griffon 2.x is that withMVCGroup does exist as a provided feature
Mark Nellemann
@mark_nellemann_twitter
as a side note - I really enjoy working w. Griffon. Do you have any information about what version 3 will include ?
Andres Almiray
@aalmiray
Well, first and foremost a full implementation of JSR-377 (desktop application framework). JUnit 5 support. Removal of split packages. Auto-module support (JPMS). This means there will be binary breakages but the code changes are minimal
Mark Nellemann
@mark_nellemann_twitter
Thanks.
Mark Nellemann
@mark_nellemann_twitter
@aalmiray I am trying to work with CardLayout as below in my view (swing/groovy). How would I change between the cards from my controller?
/* -- CENTER --- */ cardPanel = panel(id: 'centerPanel', constraints: BorderLayout.CENTER, minimumSize: new Dimension(640, 480)) { cardLayout() panel(constraints:'Card with Image') { gridLayout() label(icon: bind { model.thisMarkedImageIcon }, horizontalAlignment: JLabel.CENTER, verticalAlignment: JLabel.CENTER) } panel(constraints:'Card with Loading') { label(null, icon: imageIcon('/ajax-loader.gif'), horizontalAlignment: JLabel.CENTER, verticalAlignment: JLabel.CENTER) } panel(constraints:'Card with Error') { label(null, icon: imageIcon('/ajax-loader.gif'), horizontalAlignment: JLabel.CENTER, verticalAlignment: JLabel.CENTER) } }
Andres Almiray
@aalmiray

I believe the trick is to add a name to the panel. A title as you currently do can also work.
Based on https://docs.oracle.com/javase/tutorial/uiswing/layout/card.html
the important part is

CardLayout cl = (CardLayout)(cards.getLayout());
cl.show(cards, (String)evt.getItem());

evt.getItem() is the name/title of the card

Mark Nellemann
@mark_nellemann_twitter
panel(id: 'cards', constraints: BorderLayout.CENTER, minimumSize: new Dimension(640, 480)) { cardLayout() is it possible to get the component by 'id'? To call the getLayout().
1 reply
Mark Nellemann
@mark_nellemann_twitter
Looking into using the quartz plugin. In what folder should I put my Job classes? Tried src/main/groovy, but I don't think they were picked up.
Andres Almiray
@aalmiray
There’s no need for a custom folder for jobs unless you really want to separate them by responsibility, in which case additional configuration would be needed in the build file. Jobs should be picked up automatically given the @ServiceProviderFor(Job) annotation. You can increase the log level to INFO or DEBUG to have a better of look at the internals. Perhaps that can share some light into why your Job is not being picked up.
4 replies