Class: Twb::DocDashboardImageVert

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

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.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
# File 'lib/twb/docdashboardimagevert.rb', line 24

def initialize
  @oneImageDash = Nokogiri::XML::Document.parse <<-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
  # 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



77
78
79
80
81
# File 'lib/twb/docdashboardimagevert.rb', line 77

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