Class: ControlFlowGraphView

Inherits:
Object
  • Object
show all
Includes:
JRubyFX
Defined in:
lib/jruby_visualizer/control_flow_graph_view.rb

Overview

The UI for the CFG as a wrapper for a ListView that is directly built from JRuby’s CFG. In order to get a resizable UI element, a BorderPane is used

Instance Method Summary collapse

Constructor Details

#initialize(cfg) ⇒ ControlFlowGraphView

Returns a new instance of ControlFlowGraphView.



83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/jruby_visualizer/control_flow_graph_view.rb', line 83

def initialize(cfg)
  super()
  @cfg = cfg
  @cfg_list_view = ListView.new
  @bb_cells = FXCollections.observable_array_list([])
  @cfg.sorted_basic_blocks.each do |bb|
    bb_cell = BasicBlockBox.new(bb, cfg, @cfg_list_view)
    @bb_cells << bb_cell
  end
  @cfg_list_view.set_items(@bb_cells)
  set_center(@cfg_list_view)
end