jruby/jrubyfx — pull request #28 by whitehat101 (2013-02-10 06:04:39+00:00)
Title: Make it Sexy (FXML Controller Syntax)

After playing with the library for a bit, I asked myself: **What would the syntax look like if it was developed by Rubyists** instead of Java coders? (sorry guys!)

For the FXML component, this is what I came up with.

I made an effort to make each commit complete and meaningful, but in short:

- One initializer called `initialize` (with access to scene & nodes)
- Event handlers called on_#{event} (not fx_#{event}_handler)
- `missing_method` to lookup nodes by ID (not fx_id, fx_id_optional)
- `find`/`css` to expose CSS selectors

main script: `rake run main_script=samples/fxml/Demo.rb`

I "tested" with `rake run main_script=samples/test_all_the_samples.rb` against Java 1.8-ea-b75 and Java 1.7.0_10 on OS X 10.7

I attempted to test on Windows, but rake complained about 'ant' and 'regexp preprocess failed: too short control escape'. I'm pretty sure that's my setup failing, and not anything jRubyFX (other than maybe gemspec dependencies) – I don't code on Windows unless I must.

Enjoy!