Module: Bioroebe::GUI::LibUI::ThreeToOne
- Includes:
- LibuiParadise::Extensions
- Defined in:
- lib/bioroebe/gui/libui/three_to_one/three_to_one.rb
Overview
Bioroebe::GUI::LibUI::ThreeToOne
Constant Summary
collapse
- TITLE =
::Bioroebe::GUI::Gtk::ThreeToOneModule::TITLE
Class Method Summary
collapse
-
.run ⇒ Object
# === Bioroebe::GUI::LibUI::ThreeToOne.run ========================================================================= #.
Instance Method Summary
collapse
Class Method Details
.run ⇒ Object
#
Bioroebe::GUI::LibUI::ThreeToOne.run
#
103
104
105
106
107
|
# File 'lib/bioroebe/gui/libui/three_to_one/three_to_one.rb', line 103
def self.run
object = Object.new
object.extend(ThreeToOne)
object.run
end
|
Instance Method Details
#create_skeleton ⇒ Object
#
create_skeleton (create tag)
#
37
38
39
40
41
42
|
# File 'lib/bioroebe/gui/libui/three_to_one/three_to_one.rb', line 37
def create_skeleton
@entry1 = entry
@entry2 = entry
@checkbox1 = checked_checkbox
@checkbox2 = checkbox
end
|
#do_trigger_the_conversion(i = @entry1.text?, checkbox1 = @checkbox1) ⇒ Object
Also known as:
do_the_conversion
#
do_trigger_the_conversion (conversion tag)
#
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# File 'lib/bioroebe/gui/libui/three_to_one/three_to_one.rb', line 84
def do_trigger_the_conversion(
i = @entry1.text?,
checkbox1 = @checkbox1
)
i = i.to_s.dup.delete(' ')
if checkbox1.is_active?
new_result = Bioroebe.three_to_one(i).to_s
else
new_result = Bioroebe.one_to_three(i.delete('-')).to_s
end
if new_result and new_result.empty?
error_msg('No result found. Is it a three-letter aminoacid?')
end
@entry2.set_text(new_result) if new_result and !new_result.empty?
end
|
#initialize ⇒ Object
31
32
|
# File 'lib/bioroebe/gui/libui/three_to_one/three_to_one.rb', line 31
def initialize
end
|
#run ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/bioroebe/gui/libui/three_to_one/three_to_one.rb', line 47
def run
create_skeleton
main_window = ui_margined_window(TITLE, 1200, 200, 15)
outer_vbox = ui_vbox
top_hbox = ui_hbox
top_hbox << ui_text('Input sequence:')
outer_vbox << top_hbox
outer_vbox << @entry1
outer_vbox << @entry2
bottom_hbox = ui_hbox
convert_button = ui_button('Convert')
convert_button.on_clicked {
do_the_conversion
}
bottom_hbox << convert_button
vbox_with_checkbuttons = ui_vbox
small_hbox1 = ui_hbox
small_hbox1 << ui_text('3-to-1 conversion')
small_hbox1 << @checkbox1
vbox_with_checkbuttons << small_hbox1
small_hbox2 = ui_hbox
small_hbox2 << ui_text('1-to-3 conversion')
small_hbox2 << @checkbox2
vbox_with_checkbuttons << small_hbox2
vbox_with_checkbuttons << quit_button
bottom_hbox << vbox_with_checkbuttons
outer_vbox << bottom_hbox
main_window.child = outer_vbox
main_window.complex_finalizer
end
|