Class: GenerateGraphActionListener
- Inherits:
-
Object
- Object
- GenerateGraphActionListener
- Defined in:
- lib/app/simple_controller.rb
Instance Method Summary collapse
- #actionPerformed(event) ⇒ Object
-
#initialize(controller) ⇒ GenerateGraphActionListener
constructor
A new instance of GenerateGraphActionListener.
Constructor Details
#initialize(controller) ⇒ GenerateGraphActionListener
Returns a new instance of GenerateGraphActionListener.
532 533 534 |
# File 'lib/app/simple_controller.rb', line 532 def initialize(controller) @controller = controller end |
Instance Method Details
#actionPerformed(event) ⇒ Object
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
# File 'lib/app/simple_controller.rb', line 536 def actionPerformed(event) return_value = event.source.getText a = return_value.split if a.size == 2 and a[1].to_i != 0 case a[0].downcase when "random" @controller.set_random(a[1].to_i) when "bintree" @controller.set_bintree(a[1].to_i) when "ring" @controller.set_ring(a[1].to_i) when "connected" @controller.set_connected(a[1].to_i) when "mesh" @controller.set_mesh(a[1].to_i) when "linear" @controller.set_linear(a[1].to_i) else puts "No Generator #{a[0]}" end else puts "Wrong Syntax" end @controller.view.remove_text_field @controller.view.remove_info_panel end |