Class: Cosmos::TabbedPlotsTab

Inherits:
Object
  • Object
show all
Defined in:
lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb

Overview

Represents a tab in a tabbed plots definition

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tab_text = nil) ⇒ TabbedPlotsTab

Create a new TabbedPlotsTab



34
35
36
37
38
39
40
# File 'lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb', line 34

def initialize(tab_text = nil)
  @tab_text = tab_text
  @plots = []
  @gui_item = nil
  @gui_frame = nil
  @gui_layout = nil
end

Instance Attribute Details

#gui_frameObject

Gui object for tab frame



28
29
30
# File 'lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb', line 28

def gui_frame
  @gui_frame
end

#gui_itemObject

Gui object for tab item



25
26
27
# File 'lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb', line 25

def gui_item
  @gui_item
end

#gui_layoutObject

Gui object for tab layout



31
32
33
# File 'lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb', line 31

def gui_layout
  @gui_layout
end

#plotsObject

Array of plots in the tab



22
23
24
# File 'lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb', line 22

def plots
  @plots
end

#tab_textObject

Text to display in a tab



19
20
21
# File 'lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb', line 19

def tab_text
  @tab_text
end

Instance Method Details

#configuration_stringObject

Returns the configuration lines used to create this tab



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/cosmos/tools/tlm_grapher/tabbed_plots_tool/tabbed_plots_tab.rb', line 43

def configuration_string
  if @tab_text
    string = "TAB \"#{@tab_text}\"\n"
  else
    string = "TAB\n"
  end
  @plots.each do |plot|
    string << plot.configuration_string
  end
  string
end