Class: Bioroebe::GUI::UniversalWidgets::Sizeseq
- Inherits:
-
UniversalWidgets::Base
- Object
- UniversalWidgets::Base
- Bioroebe::GUI::UniversalWidgets::Sizeseq
show all
- Includes:
- CommandlineArguments, Bioroebe::GUI
- Defined in:
- lib/bioroebe/gui/universal_widgets/shell/shell.rb,
lib/bioroebe/gui/universal_widgets/sizeseq/sizeseq.rb more...
Overview
Constant Summary
collapse
- TITLE =
#
TITLE
Specify which title to use for this small widget.
#
'Sizeseq'
- WIDTH =
'75% or 800px minimum'
- HEIGHT =
'55% or 500px minimum'
- FONT_LARGE =
'Calibri 32'
- MONOSPACED_FONT =
#
MONOSPACED_FONT
When this font is changed, don’t forget to also change the font at SMALLER_FONT.
#
:hack_20
- USE_THIS_FONT =
MONOSPACED_FONT
- SMALLER_FONT =
:hack_16
- USE_THIS_SLIGHTLY_SMALLER_FONT =
#
USE_THIS_SLIGHTLY_SMALLER_FONT
#
:hack_16
- TEXT_COMPARE_THE_TWO_SEQUENCES =
#
TEXT_COMPARE_THE_TWO_SEQUENCES
#
'_Compare the two sequences'
- PADDING_TO_USE =
4
ARRAY_ALL_GTK_WIDGETS, FONT_SIZE, OLD_VERBOSE_VALUE, Bioroebe::GUI::USE_THIS_FONT_FAMILY_FOR_GUI_APPLICATIONS
ColoursForBase::ARRAY_HTML_COLOURS_IN_USE
Class Method Summary
collapse
Instance Method Summary
collapse
#disable_warnings, #enable_warnings, #log_dir?
#commandline_arguments?, #commandline_arguments_that_are_files?, #e, #first?, #first_non_hyphen_argument?, #remove_hyphens_from_the_commandline_arguments, #return_commandline_arguments_as_string, #return_commandline_arguments_that_are_not_files, #return_entries_without_two_leading_hyphens, #select_commandline_arguments, #select_entries_starting_with_two_hyphens, #set_commandline_arguments
#colourize_this_aminoacid_sequence_for_the_commandline, #colourize_this_nucleotide_sequence, #disable_colours, #ecomment, #efancy, #egold, #enable_colours, #eorange, #eparse, #erev, #red, #remove_trailing_escape_part, #return_colour_for_nucleotides, #rev, #sdir, #set_will_we_use_colours, #sfancy, #sfile, #simp, #swarn, #use_colours?, #use_colours_within_the_bioroebe_namespace?
Constructor Details
#initialize(commandline_arguments = nil, run_already = true) ⇒ Sizeseq
[View source]
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 80
def initialize(
commandline_arguments = nil,
run_already = true
)
determine_the_GUI_to_be_used(commandline_arguments)
reset
set_commandline_arguments(
commandline_arguments
)
run if run_already
end
|
Class Method Details
.[](i = ARGV) ⇒ Object
[View source]
266
267
268
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 266
def self.[](i = ARGV)
new(i)
end
|
.run(i = ARGV) ⇒ Object
#
Bioroebe::GUI::Gtk::Sizeseq.run
#
[View source]
273
274
275
276
277
278
279
280
281
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 273
def self.run(
i = ARGV
)
r = ::Gtk.runner_factory(
::Bioroebe::GUI::Gtk::Sizeseq.new(i)
)
r.modify_background(:normal, :mintcream)
return r
end
|
Instance Method Details
#border_size? ⇒ Boolean
[View source]
122
123
124
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 122
def border_size?
2
end
|
#clear_the_primary_textview ⇒ Object
#
clear_the_primary_textview
#
[View source]
190
191
192
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 190
def clear_the_primary_textview
@textarea1.clear
end
|
#connect_the_skeleton ⇒ Object
#
connect_the_skeleton (connect tag, skeleton tag)
#
[View source]
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 225
def connect_the_skeleton
abort_on_exception
grid1 = create_grid('2x2')
text1 = text('User input')
text1.complex_font(FONT_LARGE)
grid1.left(text1)
@textview1.on_enter_key_pressed {|event|
do_evaluate_the_user_input
}
small_hbox = create_hbox
small_hbox.maximal(@textview1)
button1 = create_button('_Evaluate', self, :use_mnemonic) {
:do_evaluate_the_user_input
}
small_hbox.minimal(button1)
grid1.right(small_hbox)
scrolled_window = create_scrolled_window(@textarea1)
scrolled_window.width_height(1600, 800)
grid1.full_row(scrolled_window)
grid1.width_height(1600, 800)
window = runner_widget(nil, width?, height?, title?)
window << grid1
::UniversalWidgets.set_main_window(window)
upon_delete_event_quit_the_application
window.use_this_font = font?
window.show_all
window.set_size_request(width?, height?)
window.set_default_size(width?, height?)
window.set_padding(padding?)
window.set_border_size(border_size?)
window.top_left
run_main
end
|
#create_a_new_bioroebe_shell_instance ⇒ Object
#
create_a_new_bioroebe_shell_instance
#
[View source]
173
174
175
176
177
178
179
180
181
182
183
184
185
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 173
def create_a_new_bioroebe_shell_instance
@shell = Bioroebe::Shell.new(ARGV) { :do_not_run_yet }
@shell.set_runmode(:GUI)
@shell.extended_disable_colours @shell.run
@result_from_the_shell = nil
end
|
#create_the_skeleton ⇒ Object
#
create_the_skeleton (create tag, skeleton tag)
#
[View source]
154
155
156
157
158
159
160
161
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 154
def create_the_skeleton
@textarea1 = create_textview
@textarea1.use_this_font = 'Monospace 30'
@textarea1.width_height(850, 450)
@textview1 = create_textview
@textview1.width_height(400, 80)
@textview1.complex_font(FONT_LARGE)
end
|
[View source]
214
215
216
217
218
219
220
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 214
def do_evaluate_the_user_input(
i = @textview1.text?
)
e 'Evaluating this input now: '+i.to_s
clear_the_primary_textview
the_user_has_input_this_command(i)
end
|
#do_open_a_file(i = main_file?.to_s) ⇒ Object
[View source]
227
228
229
230
231
232
233
234
235
236
237
238
|
# File 'lib/bioroebe/gui/universal_widgets/sizeseq/sizeseq.rb', line 227
def do_open_a_file(
i = main_file?.to_s
)
create_a_new_file_chooser_dialog(self) {{
additional_folders: ::Bioroebe.log_dir?,
start_directory: ::Bioroebe.log_dir?+'fasta/'
}}
_ = ::Gtk.main_file?
if _ and File.exist?(_)
set_use_this_file(_)
end
end
|
#handle_CSS_rules ⇒ Object
Also known as:
handle_CSS
#
handle_CSS_rules (CSS tag, css tag)
#
[View source]
143
144
145
146
147
148
149
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 143
def handle_CSS_rules
use_gtk_paradise_project_css_file
append_project_css_file
add_these_custom_CSS_rules '
'
apply_the_CSS_rules
end
|
#main_font? ⇒ Boolean
[View source]
129
130
131
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 129
def main_font?
USE_THIS_FONT
end
|
#padding? ⇒ Boolean
[View source]
115
116
117
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 115
def padding?
4
end
|
#reset ⇒ Object
[View source]
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 95
def reset
super() if respond_to?(:super)
reset_the_internal_variables
reset_the_base_module infer_the_namespace
@configuration = [true, __dir__, namespace?]
title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
handle_CSS if use_gtk3?
create_a_new_bioroebe_shell_instance
end
|
[View source]
252
253
254
255
256
257
258
259
260
261
|
# File 'lib/bioroebe/gui/universal_widgets/sizeseq/sizeseq.rb', line 252
def return_widget_containing_the_filepath
vbox = create_vbox
vbox << text('Use this file:')
@entry_use_this_file = create_entry
@entry_use_this_file.yellow_background
@entry_use_this_file.center_align
vbox.minimal(@entry_use_this_file, 1)
@entry_use_this_file.set_text(@use_this_file)
return vbox
end
|
[View source]
214
215
216
217
218
219
220
221
222
|
# File 'lib/bioroebe/gui/universal_widgets/sizeseq/sizeseq.rb', line 214
def return_widget_containing_the_top_bar
_ = default_top_bar
button_open_file = button('_Open file', self, :use_mnemonics) {
:do_open_a_file if use_gtk3?
}
button_open_file.bblack1
_.add(button_open_file)
return _
end
|
#run ⇒ Object
[View source]
166
167
168
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 166
def run
run_super
end
|
#set_use_this_file(i) ⇒ Object
[View source]
243
244
245
246
247
|
# File 'lib/bioroebe/gui/universal_widgets/sizeseq/sizeseq.rb', line 243
def set_use_this_file(i)
if File.exist?(i)
@textview.set_text(File.read(i))
end
end
|
#slightly_smaller_font? ⇒ Boolean
#
slightly_smaller_font?
#
[View source]
#
This will be passed into menu.
#
[View source]
199
200
201
202
203
204
205
206
207
208
209
|
# File 'lib/bioroebe/gui/universal_widgets/shell/shell.rb', line 199
def the_user_has_input_this_command(i)
i = i.dup if i.frozen?
i.rstrip!
@shell.parse_this_user_input(i)
@shell.
@shell.append_this_onto_the_history(i)
@result_from_the_shell = @shell.result?
if @result_from_the_shell
@textarea1.set_text(@result_from_the_shell.to_s)
end
end
|