Class: Twb::DocDashboardImageVert

Inherits:
DocDashboard show all
Defined in:
lib/twb/docdashboardimagevert.rb

Constant Summary collapse

@@dashdoc =
<<-ONEIMAGEDASH
      <dashdoc>
        <dashboard name='Dashboard Automatic Vert with Image'>
          <style>
          </style>
          <zones>
            <zone h='100000' w='100000'
                  x='0'      y='0'
                  type='layout-flow'
                  param='vert' 
                  id='7' 
                  >
              <zone h='100000' w='100000'
                    x='0'      y='0'
                    type='title'
                    id='6' 
                    >
              </zone>
              <zone h='93157' w='100000'
                    x='0'     y='6221'
                    type='bitmap' 
                    is-centered='0'
                    is-scaled='1'
                    param='{fully qualified image file name here}' 
                    id='8'
                    >
              </zone>
            </zone>
          </zones>
        </dashboard>
        <window auto-hidden='0' class='dashboard' maximized='1' name='Dashboard Automatic with Image'>
          <active id='8' />
          <zones>
            <zone is-centered='0' is-scaled='1' name='' type='bitmap' />
          </zones>
        </window>
      </dashdoc>
ONEIMAGEDASH

Instance Attribute Summary collapse

Attributes inherited from DocDashboard

#dashnode, #title, #type, #winnode

Instance Method Summary collapse

Methods inherited from DocDashboard

#size=, #to_s

Constructor Details

#initializeDocDashboardImageVert

Returns a new instance of DocDashboardImageVert.


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/twb/docdashboardimagevert.rb', line 63

def initialize
  @oneImageDash = Nokogiri::XML::Document.parse @@dashdoc 
  # notes:
  #  - adding a size element to the <dashboard element will change it from automatic, e.g.
  #
  #    <dashboard name='One Column Web Page Laptop (800w 600h)'>
  #    <style>
  #    </style>
  #    <size maxheight='600' maxwidth='800' minheight='600' minwidth='800' />
  #
  #  - the 'name' sttributes for the window and dashboard must match
  @type = 'columnar Image'
  @dashnode = @oneImageDash.at_xpath('//dashboard')
  @winnode  = @oneImageDash.at_xpath('//window')
end

Instance Attribute Details

#imageObject

Returns the value of attribute image


22
23
24
# File 'lib/twb/docdashboardimagevert.rb', line 22

def image
  @image
end

Instance Method Details

#title=(title) ⇒ Object


79
80
81
82
83
# File 'lib/twb/docdashboardimagevert.rb', line 79

def title=(title)
  @title = title
  @dashnode['name'] = title
  @winnode['name']  = title
end