|
4 | 4 | require_relative 'ir_visualizer' |
5 | 5 | require_relative 'cfg_visualizer' |
6 | 6 | require_relative 'jruby_visualizer' |
| 7 | +require_relative 'about_page' |
7 | 8 |
|
8 | 9 | resource_root :images, File.join(File.dirname(__FILE__), "ui", "img"), "ui/img" |
9 | 10 | fxml_root File.join(File.dirname(__FILE__), "ui") |
@@ -60,6 +61,8 @@ def initialize(view_name) |
60 | 61 | @view = IRVisualizer.new |
61 | 62 | when :cfg_view |
62 | 63 | @view = CFGVisualizer.new |
| 64 | + when :about_page |
| 65 | + @view = AboutPage.new |
63 | 66 | else |
64 | 67 | raise "unknown name for a view: #{view_name}" |
65 | 68 | end |
@@ -110,6 +113,7 @@ def initialize(compiler_data) |
110 | 113 | # background tasks for other views |
111 | 114 | @ir_view_task = SubAppTask.new(:ir_view) |
112 | 115 | @cfg_view_task = SubAppTask.new(:cfg_view) |
| 116 | + @about_task = SubAppTask.new(:about_page) |
113 | 117 |
|
114 | 118 | # Use ListCell with Delete Context Menu in the view for compile information |
115 | 119 | @compile_information.cell_factory = proc { DeletableListCell.new } |
@@ -224,6 +228,17 @@ def launch_cfg_view |
224 | 228 | end |
225 | 229 | end |
226 | 230 |
|
| 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 | + |
227 | 242 | end |
228 | 243 |
|
229 | 244 | if __FILE__ == $0 |
|
0 commit comments