Skip to content

Commit 806c9bf

Browse files
committed
Launching functionality for the About
1 parent 49fbd1c commit 806c9bf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/jruby_visualizer/visualizer_main_app.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
require_relative 'ir_visualizer'
55
require_relative 'cfg_visualizer'
66
require_relative 'jruby_visualizer'
7+
require_relative 'about_page'
78

89
resource_root :images, File.join(File.dirname(__FILE__), "ui", "img"), "ui/img"
910
fxml_root File.join(File.dirname(__FILE__), "ui")
@@ -60,6 +61,8 @@ def initialize(view_name)
6061
@view = IRVisualizer.new
6162
when :cfg_view
6263
@view = CFGVisualizer.new
64+
when :about_page
65+
@view = AboutPage.new
6366
else
6467
raise "unknown name for a view: #{view_name}"
6568
end
@@ -110,6 +113,7 @@ def initialize(compiler_data)
110113
# background tasks for other views
111114
@ir_view_task = SubAppTask.new(:ir_view)
112115
@cfg_view_task = SubAppTask.new(:cfg_view)
116+
@about_task = SubAppTask.new(:about_page)
113117

114118
# Use ListCell with Delete Context Menu in the view for compile information
115119
@compile_information.cell_factory = proc { DeletableListCell.new }
@@ -224,6 +228,17 @@ def launch_cfg_view
224228
end
225229
end
226230

231+
def launch_about
232+
worker_state = Java::javafx.concurrent.Worker::State
233+
state = @about_task.state
234+
if state == worker_state::READY
235+
Platform.run_later(@about_task)
236+
elsif state != worker_state::RUNNING
237+
@about_task = SubAppTask.new(:about_page)
238+
Platform.run_later(@about_task)
239+
end
240+
end
241+
227242
end
228243

229244
if __FILE__ == $0

0 commit comments

Comments
 (0)