Class: Bioroebe::GUI::LibUI::LevenstheinDistance

Inherits:
Object
  • Object
show all
Includes:
Bioroebe::GUI::LevenstheinDistanceModule, LibuiParadise::Extensions
Defined in:
lib/bioroebe/gui/libui/levensthein_distance/levensthein_distance.rb

Overview

Bioroebe::GUI::LibUI::LevenstheinDistance

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect

Constants included from Bioroebe::GUI::LevenstheinDistanceModule

Bioroebe::GUI::LevenstheinDistanceModule::HEIGHT, Bioroebe::GUI::LevenstheinDistanceModule::INPUT_HINT, Bioroebe::GUI::LevenstheinDistanceModule::TEXT_COMPARE_THE_TWO_SEQUENCES, Bioroebe::GUI::LevenstheinDistanceModule::TITLE, Bioroebe::GUI::LevenstheinDistanceModule::USE_THIS_AS_BACKGROUND_COLOUR_FOR_THE_WIDGET, Bioroebe::GUI::LevenstheinDistanceModule::USE_THIS_FONT, Bioroebe::GUI::LevenstheinDistanceModule::USE_THIS_MONOFONT, Bioroebe::GUI::LevenstheinDistanceModule::WIDTH

Instance Method Summary collapse

Methods included from Bioroebe::GUI::LevenstheinDistanceModule

#border_size?, #check_for_commandline_arguments, #create_the_buttons, #create_the_entries, #create_the_first_row, #create_the_labels, #create_the_second_row, #create_the_third_row, #do_compare_the_two_strings, #entry1?, #entry2?, #input_field_for_gap_cost?, #instantiate_a_new_levensthein_object, #let_the_fist_entry_respond_to_on_changed_events, #levensthein_object?, #padding?, #return_hbox4, #return_hbox_containing_the_edit_distance, #return_the_edit_distance_label, #return_the_label_for_the_edit_distance, #set_edit_distance, #set_entry1, #set_entry2

Constructor Details

#initialize(commandline_arguments = ARGV, run_already = true) ⇒ LevenstheinDistance

#

initialize

#

29
30
31
32
33
34
35
36
37
38
# File 'lib/bioroebe/gui/libui/levensthein_distance/levensthein_distance.rb', line 29

def initialize(
    commandline_arguments = ARGV,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end

Instance Method Details

#create_skeletonObject

#

create_skeleton (skeleton tag, create tag)

#

53
54
55
56
57
58
59
60
# File 'lib/bioroebe/gui/libui/levensthein_distance/levensthein_distance.rb', line 53

def create_skeleton
  create_the_entries
  create_the_labels
  create_the_first_row
  create_the_second_row
  create_the_third_row
  create_the_buttons
end

#resetObject

#

reset (reset tag)

#

43
44
45
46
47
48
# File 'lib/bioroebe/gui/libui/levensthein_distance/levensthein_distance.rb', line 43

def reset
  set_title(TITLE)
  set_width(WIDTH)
  set_height(HEIGHT)
  instantiate_a_new_levensthein_object
end

#runObject

#

run

#

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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/bioroebe/gui/libui/levensthein_distance/levensthein_distance.rb', line 65

def run
  create_skeleton
  window = ui_padded_main_window(title?, width?, height?, 0)
  outer_vbox = padded_vbox

  hbox1 = hbox(@text1, @input_field_for_matches)
  outer_vbox.minimal(hbox1)
  outer_vbox.add_hsep

  hbox2 = hbox(@text2, @input_field_for_mismatches)
  outer_vbox.minimal(hbox2)
  outer_vbox.add_hsep

  hbox3 = hbox(@text3, @input_field_for_gap_cost)
  outer_vbox.minimal(hbox3)
  outer_vbox.add_hsep

  outer_vbox.minimal(@input_for_string1)
  outer_vbox.minimal(@input_for_string2)
  outer_vbox.add_hsep
  # ======================================================================= #
  # Next below these two input-fields we will add more info:
  # ======================================================================= #
  small_label = return_the_edit_distance_label
  @hbox_with_the_label_for_the_edit_distance = return_hbox_containing_the_edit_distance(
    small_label, @label_for_the_edit_distance
  )
  @hbox4 = return_hbox4(
    @label_for_the_total_score
  )
  outer_vbox.minimal(@hbox_with_the_label_for_the_edit_distance, 4)
  outer_vbox.minimal(@hbox4, 4)

  button = @button_compare_the_two_strings
  outer_vbox.minimal(button, 0)

  hbox_on_bottom = padded_hbox
  button_quit = quit_button
  hbox_on_bottom.maximal(button_quit)
  outer_vbox.minimal(hbox_on_bottom)

  check_for_commandline_arguments
  do_compare_the_two_sequences
  let_the_fist_entry_respond_to_on_changed_events

  window.add(outer_vbox)
  window.intelligent_exit
end