Class: RubyRich
- Inherits:
-
JRubyFX::Application
- Object
- JRubyFX::Application
- RubyRich
- Defined in:
- lib/ruby_rich/ruby_rich.rb
Overview
This is JRubyFX application.
Class Attribute Summary collapse
-
.height ⇒ Object
Returns the value of attribute height.
-
.launched ⇒ Object
Returns the value of attribute launched.
-
.width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
-
.launch(width, height) ⇒ Object
—————————————————————————————-.
-
.launched? ⇒ Boolean
—————————————————————————————- Checks to see if DCFX was already launched.
Instance Method Summary collapse
-
#start(stage) ⇒ Object
—————————————————————————————-.
Class Attribute Details
.height ⇒ Object
Returns the value of attribute height.
39 40 41 |
# File 'lib/ruby_rich/ruby_rich.rb', line 39 def height @height end |
.launched ⇒ Object
Returns the value of attribute launched.
40 41 42 |
# File 'lib/ruby_rich/ruby_rich.rb', line 40 def launched @launched end |
.width ⇒ Object
Returns the value of attribute width.
38 39 40 |
# File 'lib/ruby_rich/ruby_rich.rb', line 38 def width @width end |
Class Method Details
Instance Method Details
#start(stage) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/ruby_rich/ruby_rich.rb', line 47 def start(stage) # Create a Browser and BrowserView and embedd it in FX. Use the default Browser # context. Also create a javascript class for operating on this browser @browser = Browser.new browser_view = BrowserView.new(@browser) $js = Sol::Js.new(@browser) #-------------------------------------------------------------------------------------- # User Interface #-------------------------------------------------------------------------------------- with(stage, title: "Ruby Rich Client Interface - RubyRich") do Platform.set_implicit_exit(false) layout_scene(RubyRich.width, RubyRich.height, :oldlace) do pane = border_pane do top center browser_view end end set_on_close_request do stage.close # dispose of the browser and end the application $js.browser.dispose end show end #-------------------------------------------------------------------------------------- # Load configuration file. This loads all the Javascript scripts onto the embbeded # web browser #-------------------------------------------------------------------------------------- f = Java::JavaIo.File.new("#{File.dirname(__FILE__)}/config.html") fil = f.toURI().toURL().toString() @browser.addLoadListener( Class.new(LoadAdapter) { def onFinishLoadingFrame(event) if (event.isMainFrame) # Wait for the browser to finish loading # Signal Sol that browser loading is done Sol.resource.signal end end }.new) @browser.loadURL(fil) end |