Class: TaskJuggler::GanttHeaderScaleItem
- Defined in:
- lib/taskjuggler/reports/GanttHeaderScaleItem.rb
Overview
This class is a storate container for all data related to a scale step of a GanttChart header.
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(label, x, y, width, height) ⇒ GanttHeaderScaleItem
constructor
A new instance of GanttHeaderScaleItem.
- #to_html ⇒ Object
Constructor Details
#initialize(label, x, y, width, height) ⇒ GanttHeaderScaleItem
Returns a new instance of GanttHeaderScaleItem.
23 24 25 26 27 28 29 |
# File 'lib/taskjuggler/reports/GanttHeaderScaleItem.rb', line 23 def initialize(label, x, y, width, height) @label = label @x = x @y = y @width = width @height = height end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
21 22 23 |
# File 'lib/taskjuggler/reports/GanttHeaderScaleItem.rb', line 21 def label @label end |
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
21 22 23 |
# File 'lib/taskjuggler/reports/GanttHeaderScaleItem.rb', line 21 def pos @pos end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
21 22 23 |
# File 'lib/taskjuggler/reports/GanttHeaderScaleItem.rb', line 21 def width @width end |
Instance Method Details
#to_html ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/taskjuggler/reports/GanttHeaderScaleItem.rb', line 31 def to_html div = XMLElement.new('div', 'class' => 'tabhead', 'style' => "font-weight:bold; position:absolute; " + "left:#{@x}px; top:#{@y}px; width:#{@width}px; height:#{@height}px; ") div << (div1 = XMLElement.new('div', 'style' => 'padding:3px; ')) div1 << XMLText.new("#{label}") div end |