Class: Bioroebe::GUI::Gtk::BlosumMatrixViewer
- Inherits:
-
Gtk::Box
- Object
- Gtk::Box
- Bioroebe::GUI::Gtk::BlosumMatrixViewer
show all
- Includes:
- BlosumMatrixViewerModule, Gtk::BaseModule
- Defined in:
- lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb
Overview
Bioroebe::GUI::Gtk::BlosumMatrixViewer
Constant Summary
collapse
- NAMESPACE =
inspect
BlosumMatrixViewerModule::HEIGHT, BlosumMatrixViewerModule::TEXT1, BlosumMatrixViewerModule::TITLE, BlosumMatrixViewerModule::USE_THIS_FONT, BlosumMatrixViewerModule::WIDTH
Class Method Summary
collapse
-
.run(i = ARGV) ⇒ Object
# === Bioroebe::GUI::Gtk::BlosumMatrixViewer.run ========================================================================= #.
Instance Method Summary
collapse
Constructor Details
#initialize(commandline_arguments = ARGV, run_already = true) ⇒ BlosumMatrixViewer
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.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::BlosumMatrixViewer.run
#
181
182
183
184
185
186
187
188
189
190
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 181
def self.run(
i = ARGV
)
require 'gtk_paradise/run'
_ = ::Bioroebe::GUI::Gtk::BlosumMatrixViewer.new(i)
r = ::Gtk.run
r << _
r.automatic_size_then_automatic_title
r.top_left_then_run
end
|
Instance Method Details
#border_size? ⇒ Boolean
78
79
80
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 78
def border_size?
2
end
|
#connect_skeleton ⇒ Object
#
connect_skeleton (connect tag)
#
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 129
def connect_skeleton
abort_on_exception
= gtk_left_aligned_label(TEXT1)
.use_this_font = main_font?
first_row = gtk_hbox
first_row.minimal(, 5)
hbox = gtk_hbox
hbox.minimal(@combo_box)
first_row.minimal(hbox, 10)
minimal(first_row, 1)
@combo_box.on_changed {
do_sync_the_combo_box_text_onto_the_text_buffer
}
minimal(@scrolled_window)
do_sync_the_combo_box_text_onto_the_text_buffer
end
|
#create_skeleton ⇒ Object
#
create_skeleton (create tag)
#
113
114
115
116
117
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 113
def create_skeleton
create_the_text_view
create_the_combo_box
create_the_scrolled_window
end
|
#create_the_combo_box ⇒ Object
166
167
168
169
170
171
172
173
174
175
176
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 166
def create_the_combo_box
@combo_box = gtk_combo_box(
Bioroebe.available_blosum_matrices? - ['blosum_matrix']
)
@combo_box.clear_background
@combo_box.bblack2
@combo_box.css_class('BG_very_light_yellowish')
end
|
96
97
98
99
100
101
102
103
104
105
106
107
108
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 96
def create_the_scrolled_window
@scrolled_window = gtk_scrolled_window(@text_view) { :top_to_bottom }
@scrolled_window.remove_background
@scrolled_window.bblack1
@scrolled_window.width_height(500, 740)
@scrolled_window.pad5px
@scrolled_window.css_class('mar5px')
@scrolled_window.css_class('darkblue')
@scrolled_window.use_this_font = :hack_18
end
|
#create_the_text_view ⇒ Object
85
86
87
88
89
90
91
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 85
def create_the_text_view
@text_buffer = gtk_text_buffer
@text_view = gtk_text_view(@text_buffer)
end
|
#do_sync_the_combo_box_text_onto_the_text_buffer ⇒ Object
#
do_sync_the_combo_box_text_onto_the_text_buffer
#
156
157
158
159
160
161
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 156
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
|
#handle_CSS_rules ⇒ Object
63
64
65
66
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 63
def handle_CSS_rules
use_gtk_paradise_project_css_file
append_project_CSS_file
end
|
#main_font? ⇒ Boolean
122
123
124
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 122
def main_font?
USE_THIS_FONT
end
|
#padding? ⇒ Boolean
71
72
73
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 71
def padding?
12
end
|
#reset ⇒ Object
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 49
def reset
reset_the_internal_variables
@configuration = [true, __dir__, NAMESPACE]
title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
handle_CSS_rules
infer_the_size_automatically
end
|
#run ⇒ Object
149
150
151
|
# File 'lib/bioroebe/gui/gtk3/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 149
def run
create_skeleton_then_connect_skeleton
end
|