This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jruby | |
require 'jruby' | |
def get_ast(code) | |
JRuby.parse(code) | |
end | |
def get_ir(ast_node) | |
ir_manager = JRuby::runtime.ir_manager | |
ir_manager.dry_run = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
require 'jrubyfx' | |
JavaFX = Java::javafx | |
class FormApp < JRubyFX::Application | |
def start(stage) | |
stage.set_title("JavaFX Welcome") | |
grid = JavaFX::scene.layout.GridPane.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See: http://docs.oracle.com/javafx/2/binding/jfxpub-binding.htm | |
require 'jrubyfx' | |
class MyDoubleBinding < Java::javafx.beans.binding.DoubleBinding | |
def initialize(a, b, c, d) | |
@a, @b, @c, @d = a, b, c, d | |
super() | |
bind(@a, @b, @c, @d) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See http://docs.oracle.com/javafx/2/collections/jfxpub-collections.htm | |
require 'jrubyfx' | |
# Example for an ObservableList | |
list = [] | |
observable_list = FXCollections.observable_list(list) | |
observable_list.add_change_listener do | |
puts "Detected a change!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See: http://docs.oracle.com/javafx/2/threads/jfxpub-threads.htm | |
require 'jrubyfx' | |
require 'open-uri' | |
class FirstLineURLTask < Java::javafx.concurrent.Task | |
def initalize(url) | |
@url = url | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'jrubyfx' | |
class FooApp < JRubyFX::Application | |
def initialize() | |
super() | |
@bar = 1 | |
@spam = "ham" | |
end | |
def start(stage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jruby | |
require 'jrubyfx' | |
class MyApp < JRubyFX::Application | |
def init | |
puts "called init" | |
params = getParameters | |
puts params.nil? |