The GanttTaskBar represents a normal task that is part of a GanttChart.
Create a GanttContainer object based on the following information: line is a reference to the GanttLine. xStart is the left edge of the task in chart coordinates. xEnd is the right edge.
# File lib/taskjuggler/reports/GanttTaskBar.rb, line 29 29: def initialize(query, lineHeight, xStart, xEnd, y) 30: @query = query 31: @lineHeight = lineHeight 32: @start = xStart 33: @end = xEnd 34: @y = y 35: end
# File lib/taskjuggler/reports/GanttTaskBar.rb, line 59 59: def addBlockedZones(router) 60: # Horizontal block for whole bar. 61: router.addZone(@start, @y + (@lineHeight / 2) - @@size - 1, 62: @end - @start + 1, 2 * @@size + 3, true, false) 63: # Block for arrowhead. 64: router.addZone(@start - 9, @y + (@lineHeight / 2) - 7, 10, 15, true, true) 65: # Vertical block for end cap 66: router.addZone(@start - 2, @y, 5, @lineHeight, 67: false, true) 68: router.addZone(@end - 2, @y, 5, @lineHeight, false, true) 69: end
Return the point [ x, y ] where task end dependency lines should end at.
# File lib/taskjuggler/reports/GanttTaskBar.rb, line 55 55: def endDepLineEnd 56: [ @end - 1, @y + @lineHeight / 2 ] 57: end
Return the point [ x, y ] where task end dependency lines should start from.
# File lib/taskjuggler/reports/GanttTaskBar.rb, line 50 50: def endDepLineStart 51: [ @end + 1, @y + @lineHeight / 2 ] 52: end
Return the point [ x, y ] where task start dependency lines should end at.
# File lib/taskjuggler/reports/GanttTaskBar.rb, line 44 44: def startDepLineEnd 45: [ @start - 1, @y + @lineHeight / 2 ] 46: end
Return the point [ x, y ] where task start dependency lines should start from.
# File lib/taskjuggler/reports/GanttTaskBar.rb, line 39 39: def startDepLineStart 40: [ @start + 1, @y + @lineHeight / 2 ] 41: end
Convert the abstact representation of the GanttTaskBar into HTML elements.
# File lib/taskjuggler/reports/GanttTaskBar.rb, line 73 73: def to_html 74: xStart = @start.to_i 75: yCenter = (@lineHeight / 2).to_i 76: width = @end.to_i - @start.to_i + 1 77: 78: html = [] 79: 80: # Invisible trigger frame for tooltips. 81: html << rectToHTML(xStart, 0, width, @lineHeight, 'tj_gantt_frame') 82: 83: # First we draw the task frame. 84: html << rectToHTML(xStart, yCenter - @@size, width, 2 * @@size, 85: 'taskbarframe') 86: 87: # The we draw the filling. 88: html << rectToHTML(xStart + 1, yCenter - @@size + 1, width - 2, 89: 2 * @@size - 2, 'taskbar') 90: # And then the progress bar. If query is null we assume 50% completion. 91: if @query 92: @query.attributeId = 'complete' 93: @query.process 94: res = @query.result 95: completion = res ? res / 100.0 : 0.0 96: else 97: completion = 0.5 98: end 99: html << rectToHTML(xStart + 1, yCenter - @@size / 2, 100: (width - 2) * completion, @@size, 'progressbar') 101: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.