Class: Bioroebe::GUI::Gtk::ProteinToDNA

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

Overview

Bioroebe::GUI::Gtk::ProteinToDNA

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect

Constants included from ProteinToDNAModule

ProteinToDNAModule::HEIGHT, ProteinToDNAModule::TITLE, ProteinToDNAModule::USE_THIS_FONT, ProteinToDNAModule::USE_THIS_TITLE_FOR_THE_MAIN_BUTTON, ProteinToDNAModule::WIDTH

Constants included from Bioroebe::GUI

ARRAY_ALL_GTK_WIDGETS, FONT_SIZE, OLD_VERBOSE_VALUE, USE_THIS_FONT, USE_THIS_FONT_FAMILY_FOR_GUI_APPLICATIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ProteinToDNAModule

#aminoacid_sequence?, #border_size?, #create_buttons, #create_skeleton, #do_determine_the_backtrack_sequence, #filter_away_invalid_aminoacids_from_the_left_buffer, #left_buffer?, #menu, #padding?, #right_buffer?, #set_aminoacid_sequence, #shared_reset

Methods included from Bioroebe::GUI

#disable_warnings, #enable_warnings, #log_dir?

Constructor Details

#initialize(optional_commandline_arguments = nil, run_already = true) ⇒ ProteinToDNA

#

initialize

#

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

def initialize(
    optional_commandline_arguments = nil,
    run_already                    = true
  )
  super(:vertical)
  reset
  set_title(TITLE) if respond_to?(:set_title)
  if optional_commandline_arguments
    menu(optional_commandline_arguments)
  end
  signal_destroy_then_quit
  run if run_already
end

Class Method Details

.run(i = ARGV) ⇒ Object

#

Bioroebe::GUI::Gtk::ProteinToDNA.run

#

167
168
169
170
171
172
173
174
175
176
# File 'lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb', line 167

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

Instance Method Details

#connect_skeletonObject

#

connect_skeleton (connect tag)

#

151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb', line 151

def connect_skeleton
  abort_on_exception
  @main_vbox.maximal(@dataset[:top_hbox], 4)
  @main_vbox.maximal(@middle_bar)
  button_box = button_box(
    @dataset[:backtrack_button],
    @dataset[:quit_button]
  )
  button_box.vertical_layout
  @main_vbox.minimal(button_box)
  add(@main_vbox)
end

#create_left_bufferObject

#

create_left_buffer

#

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

def create_left_buffer
  # ======================================================================= #
  # === :left_buffer
  # ======================================================================= #
  @dataset[:left_buffer] = gtk_text_view # The left text view.
  @dataset[:left_buffer].bblack1
  @dataset[:left_buffer].do_wrap_properly
end

#create_middle_bar_containing_the_arrow_pointing_to_the_right_sideObject

#

create_middle_bar_containing_the_arrow_pointing_to_the_right_side

#

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb', line 83

def create_middle_bar_containing_the_arrow_pointing_to_the_right_side
  @middle_bar = gtk_vbox
  event_box = gtk_eventbox(
    gtk_label(:arrow_right)
  )
  event_box.hint = 'This arrow can be clicked, to convert from the '\
                   'aminoacid sequence to (one likely) possible '\
                   'DNA sequence.'
  event_box.on_clicked {
    do_determine_the_backtrack_sequence
  }
  @middle_bar.minimal(
    event_box
  )
end

#create_right_bufferObject

#

create_right_buffer

#

71
72
73
74
75
76
77
78
# File 'lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb', line 71

def create_right_buffer
  # ======================================================================= #
  # === :right_buffer
  # ======================================================================= #
  @dataset[:right_buffer] = gtk_text_view # The right text view.
  @dataset[:right_buffer].bblack1
  @dataset[:right_buffer].do_wrap_properly
end

#create_top_hboxObject

#

create_top_hbox

#

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb', line 102

def create_top_hbox
  # ======================================================================= #
  # The paned-widget is close to the top.
  # ======================================================================= #
  scrolled_window_right = scrolled_window(right_buffer?)
  scrolled_window_right.clear_background
  scrolled_window_right.width_height(300, 300)
  scrolled_window_right.bblack1
  scrolled_window_right.mar2px
  # ======================================================================= #
  # === scrolled_window_left
  # ======================================================================= #
  scrolled_window_left  = scrolled_window(left_buffer?)
  scrolled_window_left.clear_background
  scrolled_window_left.width_height(300, 300)
  scrolled_window_left.bblack1
  scrolled_window_left.mar2px
  top_hpaned = gtk_hpaned(
    scrolled_window_left,
    scrolled_window_right
  ) {{ border_width: 10 }}
  top_hpaned.set_position(
    (@width / 1.5).to_i
  )
  @dataset[:top_hbox] = top_hpaned
end

#resetObject

#

reset (reset tag)

#

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb', line 51

def reset
  reset_the_internal_variables
  shared_reset
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, NAMESPACE]
  infer_the_size_automatically
  set_use_this_font(USE_THIS_FONT)
  set_label_widget(
    gtk_label.set_markup(
      %Q(<span foreground="#000000" weight="bold">#{TITLE}</span>)
    )
  ) if respond_to?(:set_label_widget)
  use_gtk_paradise_css_file
end

#runObject

#

run

#

144
145
146
# File 'lib/bioroebe/gui/gtk3/protein_to_DNA/protein_to_DNA.rb', line 144

def run
  super()
end