Class: Bioroebe::GUI::Gtk::ShowCodonUsage

Inherits:
Gtk::Box
  • Object
show all
Includes:
ShowCodonUsageModule, Gtk::BaseModule
Defined in:
lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb

Overview

Bioroebe::GUI::Gtk::ShowCodonUsage

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect

Constants included from ShowCodonUsageModule

ShowCodonUsageModule::HEIGHT, ShowCodonUsageModule::TEST_SEQUENCE, ShowCodonUsageModule::TITLE, ShowCodonUsageModule::USE_THIS_FONT, ShowCodonUsageModule::WIDTH

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ShowCodonUsageModule

#border_size?, #create_box_top_five_codons, #create_the_label_showing_n_nucleotides, #create_the_label_top_five_codons, #create_the_main_entry, #do_the_conversion, #do_the_conversion_then_update_the_label_as_well, #handle_the_commandline_arguments, #padding?, #reset_the_shared_module, #sync_the_input_sequence_onto_the_main_entry, #update_the_main_label_denoting_how_many_nucleotides_can_be_found_in_the_main_sequence

Constructor Details

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

#

initialize

#

34
35
36
37
38
39
40
41
42
43
44
# File 'lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb', line 34

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

Class Method Details

.run(i = ARGV) ⇒ Object

#

Bioroebe::GUI::Gtk::ShowCodonUsage.run

#

131
132
133
134
135
136
137
138
139
140
# File 'lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb', line 131

def self.run(
    i = ARGV
  )
  require 'gtk_paradise/run'
  _ = ::Bioroebe::GUI::Gtk::ShowCodonUsage.new(i)
  r = ::Gtk.run
  r << _
  r.automatic_size_then_automatic_title
  r.middle_then_run
end

Instance Method Details

#connect_skeletonObject

#

connect_skeleton (connect tag)

#

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb', line 74

def connect_skeleton
  abort_on_exception
  handle_the_commandline_arguments
  minimal(@entry1)
  update_the_main_label_denoting_how_many_nucleotides_can_be_found_in_the_main_sequence
  minimal(@label_showing_n_nucleotides)
  minimal(hspacer)
  create_box_top_five_codons
  @box_top_five_codons.minimal(@label_top_five_codons, 10)
  draggable_pane = gtk_drag_top_to_bottom(
    @scrolled_window,
    @box_top_five_codons
  )
  maximal(draggable_pane)
end

#create_skeletonObject

#

create_skeleton (create tag)

#

93
94
95
96
97
98
99
# File 'lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb', line 93

def create_skeleton
  create_the_label_showing_n_nucleotides
  create_the_main_entry
  create_the_label_top_five_codons
  create_the_text_view # Must be created before the scrolled window.
  create_the_scrolled_window
end

#create_the_scrolled_windowObject

#

create_the_scrolled_window (scrolled tag)

#

104
105
106
107
108
109
110
111
112
113
114
# File 'lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb', line 104

def create_the_scrolled_window
  # ======================================================================= #
  # === @scrolled_window
  # ======================================================================= #
  @scrolled_window = gtk_scrolled_window(@text_view) { :only_top_and_bottom_scrollbar }
  @scrolled_window.set_size_request(250, 200)
  @scrolled_window.set_font(:hack_20)
  @scrolled_window.read_only
  @scrolled_window.pad8px
  @scrolled_window.set_border_width(5)
end

#create_the_text_viewObject

#

create_the_text_view

#

66
67
68
69
# File 'lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb', line 66

def create_the_text_view
  @text_buffer = gtk_text_buffer
  @text_view   = text_view(@text_buffer)
end

#resetObject

#

reset (reset tag)

#

49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb', line 49

def reset
  reset_the_shared_module
  reset_the_internal_variables
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, NAMESPACE]
  title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
  use_gtk_paradise_project_css_file 
  append_project_css_file
  apply_the_CSS
  infer_the_size_automatically
end

#runObject

#

run (run tag)

#

119
120
121
122
123
124
125
126
# File 'lib/bioroebe/gui/gtk3/show_codon_usage/show_codon_usage.rb', line 119

def run
  create_skeleton_then_connect_skeleton
  Thread.new {
    sleep 0.02
    do_the_conversion_then_update_the_label_as_well
    @entry1.deselect
  }
end