Module: Bioroebe::GUI::LibUI::BlosumMatrixViewer

Includes:
LibuiParadise::Extensions
Defined in:
lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb

Overview

Bioroebe::GUI::LibUI::BlosumMatrixViewer

Constant Summary collapse

TITLE =
#

TITLE

#
'Blosum Matrix Viewer'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.runObject

#

Bioroebe::GUI::LibUI::BlosumMatrixViewer.run

#

102
103
104
105
106
# File 'lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 102

def self.run
  object = Object.new
  object.extend(BlosumMatrixViewer)
  object.reset_then_run
end

Instance Method Details

#create_skeletonObject

#

create_skeleton (create tag)

#

52
53
# File 'lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 52

def create_skeleton
end

#do_sync_the_combo_box_text_onto_the_text_buffer(_ = @combo_box.text?) ⇒ Object

#

do_sync_the_combo_box_text_onto_the_text_buffer

#

89
90
91
92
93
94
95
96
97
# File 'lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 89

def do_sync_the_combo_box_text_onto_the_text_buffer(
    _ = @combo_box.text?
  )
  @text_buffer.set_text(
    Bioroebe::BlosumParser.return_as_2D_table(_).tr(
      '','|'
    )
  )
end

#initializeObject

#

initialize

#

31
32
33
# File 'lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 31

def initialize
  reset
end

#resetObject

#

reset

#

46
47
# File 'lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 46

def reset
end

#reset_then_runObject

#

reset_then_run

#

38
39
40
41
# File 'lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 38

def reset_then_run
  reset
  run
end

#runObject

#

run

#

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
# File 'lib/bioroebe/gui/libui/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 58

def run
  create_skeleton
  main_window = ui_margined_window(
    TITLE, 1200, 500, 1
  )
  outer_vbox = padded_vbox
  outer_vbox.minimal(
    ui_text('Available BLOSUM matrices:')
  )
  @combo_box = ui_combobox(
    Bioroebe.array_available_blosum_matrices?
  )
  outer_vbox.minimal(
    @combo_box
  )
  @text_buffer = ui_text_buffer
  outer_vbox.maximal(@text_buffer)
  # @combo_box.on_changed {
  #   do_sync_the_combo_box_text_onto_the_text_buffer
  # }
  # ^^ the above currently does not work.
  # This explains the manual line below for now, to
  # set up the initial value.
  do_sync_the_combo_box_text_onto_the_text_buffer('blosum45')
  main_window.child = outer_vbox
  main_window.intelligent_exit
end