It uses the same sort of logic that React does. Fn-fx creates a virtual dom, and then diffs the previous virtual dom against the updated one. From there you get a list of necessary updates. JavaFX has a rather uniform property interface so applying these updates is quite simple.
On Thu, Mar 17, 2016 at 11:26 AM, Jason Zwolak <jzwo...@gmail.com> wrote: > You can diff JavaFX components like that? > > -- > Jason Zwolak > > On Thu, Mar 17, 2016 at 12:51 PM, Timothy Baldridge <tbaldri...@gmail.com> > wrote: > >> >> If the app-state has changed then it starts re-rendering the UI. >> >> That's pretty much exactly what fn-fx does in the latest version, with >> two caveats: 1) there's no timer, just a watch on an atom. 2) If you >> properly diff components you don't need to re-create them every time, just >> change the properties that changed. So if you have a text box 5 components >> deep in your app, and you change the background color, only the background >> color property of that single component will be changed, the rest of the >> app will remain unmodified. >> >> On Thu, Mar 17, 2016 at 10:37 AM, Jason Zwolak <jzwo...@gmail.com> wrote: >> >>> Paul, yeap, Seesaw is definitely something worth considering. Dave Ray >>> hasn't abandoned the project, but I sent a personal email to him asking >>> about the state of the project and it does seem the Seesaw is in more of a >>> maintenance phase than a continue to move forward and improve phase. Dave >>> Ray, if you're on this list, would you chime in? >>> >>> Also, I was at the talk you mentioned and was very impressed with their >>> methods. What wasn't mentioned in the talk was the fundamental structure of >>> the interface between Clojure and JavaFX. One point that _really_ struck me >>> is that they have a reoccurring timer running in the background and each >>> time it wakes up it checks for changes on the app-state (presumably an >>> atom, but I do not remember). If the app-state has changed then it starts >>> re-rendering the UI. If I remember correctly it recreates the UI components >>> that rely on any part of the app state that has changed. It sounds a little >>> similar to Facebook React. I questioned them on this approach as it sounded >>> strange to me... and they convinced me it's a good approach for their >>> project and inspired me to try something similar on my own... which I'm >>> secretly working on ;-) >>> >>> One thing that makes this work so well for their approach is that they >>> have animations that depend on the app state. So their reoccurring timer is >>> almost like a video algorithm redrawing the on screen image at the >>> specified frame rate. >>> >>> -- >>> Jason Zwolak >>> >>> On Thu, Mar 17, 2016 at 11:06 AM, Paul L. Snyder < >>> p...@pataprogramming.com> wrote: >>> >>>> Yow, old indeed! >>>> >>>> In 2011, Dave Ray released Seesaw, which is a very nice wrapper for >>>> Swing. >>>> I've used it for a bunch of projects, and it works great. Of course, it >>>> does look like Swing, but it's plenty usable. (It's also still being >>>> maintained, so if you're looking for a toolkit that you can use right >>>> now, >>>> it's a good way to go.) >>>> >>>> https://github.com/daveray/seesaw >>>> >>>> That said, I'd also love to see a JavaFX wrapper. At the Conj in Philly, >>>> Cognitect talked about a project where they'd used it extensively: >>>> >>>> https://www.youtube.com/watch?v=ajX09xQ_UEg >>>> >>>> It's definitely piqued my interest. >>>> >>>> Paul >>>> >>>> On Sat, 12 Mar 2016, Jason Zwolak wrote: >>>> >>>> > +1 JavaFX. >>>> > >>>> > I know this is an old thread... but in case anyone comes across it >>>> (like I >>>> > did just now) and wants to see where things are, they should know that >>>> > JavaFX has come a long way and seems to be Oracle's replacement for >>>> Swing. >>>> > Now JavaFX is no longer only in JavaFXscript... in fact, I believe >>>> > JavaFXscript is deprecated in favor of the JavaFX Java classes. >>>> > >>>> > I've seen some major projects done with Clojure and JavaFX... even >>>> from the >>>> > guys at Cognitect. >>>> > >>>> > On Thursday, May 27, 2010 at 11:18:41 AM UTC-4, Luke VanderHart wrote: >>>> > > >>>> > > My side project is a fairly complex GUI application written in >>>> > > Clojure. Recently, I've become irritated with using Java interop for >>>> > > everything. It's not that Clojure doesn't have nice java interop - >>>> it >>>> > > does. It's just that when interacting with a GUI framework, which >>>> is a >>>> > > large part of my app, I have to be back in mutable object-oriented >>>> > > land, worrying about class hierarchies, mutable state, locks, etc. >>>> > > Yucky. >>>> > > >>>> > > So, with a perhaps dangerous lack of sanity and without any >>>> guarantee >>>> > > of success, I've decided to try my hand at writing an idiomatic >>>> > > Clojure GUI library. If I have success (which I doubt) I will of >>>> > > course make it available as open source. >>>> > > >>>> > > I intend for it to be mostly declarative, with a nice DSL for >>>> defining >>>> > > GUI elements. Each component will also implement map, and use one of >>>> > > Clojure's reference types as an interface for inspecting / updating >>>> > > its state. I may also implement some aspects of Functional Reactive >>>> > > Programming wherever it's convenient to do so. >>>> > > >>>> > > What you all must help me decide is what GUI framework to use as the >>>> > > underpinnings of it. It's genuinely hard to decide. I have at least >>>> > > some experience with all of them, so I have no strong preference, >>>> but >>>> > > I'd like to get your input. I did consider trying to make it >>>> abstract >>>> > > enough that you could plug in *any* of them under the hood, but >>>> > > there's enough differences between the frameworks that that would >>>> get >>>> > > very ugly very fast. >>>> > > >>>> > > Possibilities are: >>>> > > >>>> > > AWT >>>> > > Pros: native widgets, bundled with Java, low-level >>>> > > Cons: few widgets, considered somewhat obselete >>>> > > >>>> > > Swing >>>> > > Pros: bundled with Java, good widget selection >>>> > > Cons: non-native widgets >>>> > > >>>> > > SWT >>>> > > Pros: native widgets, widely used >>>> > > Cons: requires platform-specific libs >>>> > > >>>> > > QT Jambi >>>> > > Pros: native widgets, huge widget selection, highly-regarded >>>> framework >>>> > > Cons: requires platform-specific libs, writing custom widgets is >>>> > > hairy, momentum and support seem to be lagging since Nokia dropped >>>> > > official support. >>>> > > >>>> > > Remember, the actual API won't matter - that will be completely >>>> > > abstracted away. So try to focus on the framework's look and feel. >>>> > > Also let me know if I've missed any of the framework's key >>>> > > characteristics. >>>> > > >>>> > > Thanks! >>>> > > >>>> > > -Luke >>>> > > >>>> > > >>>> > >>>> > -- >>>> > You received this message because you are subscribed to the Google >>>> > Groups "Clojure" group. >>>> > To post to this group, send email to clojure@googlegroups.com >>>> > Note that posts from new members are moderated - please be patient >>>> with your first post. >>>> > To unsubscribe from this group, send email to >>>> > clojure+unsubscr...@googlegroups.com >>>> > For more options, visit this group at >>>> > http://groups.google.com/group/clojure?hl=en >>>> > --- >>>> > You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> > To unsubscribe from this group and stop receiving emails from it, >>>> send an email to clojure+unsubscr...@googlegroups.com. >>>> > For more options, visit https://groups.google.com/d/optout. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To post to this group, send email to clojure@googlegroups.com >>>> Note that posts from new members are moderated - please be patient with >>>> your first post. >>>> To unsubscribe from this group, send email to >>>> clojure+unsubscr...@googlegroups.com >>>> For more options, visit this group at >>>> http://groups.google.com/group/clojure?hl=en >>>> --- >>>> You received this message because you are subscribed to a topic in the >>>> Google Groups "Clojure" group. >>>> To unsubscribe from this topic, visit >>>> https://groups.google.com/d/topic/clojure/NkLXh8KYXqk/unsubscribe. >>>> To unsubscribe from this group and all its topics, send an email to >>>> clojure+unsubscr...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clojure@googlegroups.com >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> clojure+unsubscr...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/clojure?hl=en >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to clojure+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> “One of the main causes of the fall of the Roman Empire was that–lacking >> zero–they had no way to indicate successful termination of their C >> programs.” >> (Robert Firth) >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "Clojure" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/clojure/NkLXh8KYXqk/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.