Class: Bioroebe::GUI::Jruby::BlosumMatrixViewer

Inherits:
JFrame
  • Object
show all
Includes:
BlosumMatrixViewerModule, Colours, SimpleWidgets
Defined in:
lib/bioroebe/gui/jruby/blosum_matrix_viewer/blosum_matrix_viewer.rb

Constant Summary

Constants included from BlosumMatrixViewerModule

BlosumMatrixViewerModule::HEIGHT, BlosumMatrixViewerModule::TEXT1, BlosumMatrixViewerModule::TITLE, BlosumMatrixViewerModule::USE_THIS_FONT, BlosumMatrixViewerModule::WIDTH

Instance Method Summary collapse

Constructor Details

#initialize(run_already = true) ⇒ BlosumMatrixViewer

#

initialize

#

40
41
42
43
44
45
# File 'lib/bioroebe/gui/jruby/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 40

def initialize(
    run_already = true
  )
  reset
  run if run_already
end

Instance Method Details

#resetObject

#

reset (reset tag)

#

50
51
52
# File 'lib/bioroebe/gui/jruby/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 50

def reset
  reset_the_internal_variables
end

#runObject

#

run

#

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/bioroebe/gui/jruby/blosum_matrix_viewer/blosum_matrix_viewer.rb', line 57

def run
  frame = JFrame.new(TITLE)
  panel = new_jpanel # This is an instance of Java::JavaxSwing::JPanel.
  panel.setFont(Font.new 'Sans serif', Font::PLAIN, 25)
  frame.getContentPane.add(panel)
  panel.setLayout(nil)
  panel.hint = 'A Panel container'

  entry1 = entry('Apple')
  entry1.setFont(Font.new 'Sans serif', Font::PLAIN, 28)
  entry1.setBounds(10, 60, 190, 50) # x, y, width, height
 
  panel << entry1

  frame.setDefaultCloseOperation JFrame::EXIT_ON_CLOSE
  frame.width_height(WIDTH, HEIGHT)
  frame.setLocationRelativeTo(nil)

  frame.show_all
end