Top Level Namespace
Defined Under Namespace
Modules: AbbrevCheck, InitEnv, ManageYaml, MkSemiLattice, Plot, Ruby2dAction, SLComponents, StackOperations, VocaBuil Classes: CLI, Error, MkLightTable, OptionManager, SplitPDF
Constant Summary collapse
- NODE_COLOR =
'orange'- SELECT_COLOR =
'red'- FIXED_COLOR =
'green'- LINKED_COLOR =
'blue'- EDGE_COLOR =
標準色に戻す
'black'
Instance Method Summary collapse
Instance Method Details
#init ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mk_semi_lattice.rb', line 23 def init puts "mk_semi_lattice is running..." # prep semi lattice viewer app parent_dir = Dir.pwd InitEnv.init_env(parent_dir) = OptionManager.new.parse! semi_dir = File.join(parent_dir, '.semi_lattice') semi_lattice_yaml_path = File.join(semi_dir, "semi_lattice.yaml") [:parent_dir] = parent_dir [:semi_dir] = semi_dir [:semi_lattice_yaml_path] = semi_lattice_yaml_path input_path, with_semi_lattice_yaml = ManageYaml::MkSemiLattice.new( ).prepare_paths_and_flags [:with_semi_lattice_yaml] = with_semi_lattice_yaml sl_viewer_app = SLComponents::BuildViewer.new( input_path, ) return [sl_viewer_app, semi_dir, parent_dir] end |
#ruby2d_run(sl_viewer_app, semi_dir, parent_dir) ⇒ 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 |
# File 'lib/mk_semi_lattice.rb', line 47 def ruby2d_run(sl_viewer_app, semi_dir, parent_dir) require 'ruby2d' top_node_label = sl_viewer_app.nodes.first&.label || "Semi Lattice Graph" set width: 800, height: 600 set title: top_node_label set background: 'white' set fps: 15 last_click_time = nil last_click_node = nil on :key_down do |event| Ruby2dAction.on_key_down(sl_viewer_app, event) end on :key_up do |event| Ruby2dAction.on_key_up(sl_viewer_app, event) end on :mouse_down do |event| clicked_node, last_time = Ruby2dAction.on_mouse_down(sl_viewer_app, event, last_click_node, last_click_time, parent_dir) last_click_node = clicked_node last_click_time = last_time end on :mouse_up do Ruby2dAction.on_mouse_up(sl_viewer_app) end on :mouse_move do |event| Ruby2dAction.on_mouse_move(sl_viewer_app, event) end update do Ruby2dAction.update_action(sl_viewer_app) end at_exit do ManageYaml::MkSemiLattice.at_exit_action(sl_viewer_app, semi_dir, parent_dir) end show end |