Class: TaskJuggler::GanttMilestone
- Includes:
- HTMLGraphics
- Defined in:
- lib/taskjuggler/reports/GanttMilestone.rb
Overview
The GanttMilestone represents a milestone task.
Constant Summary collapse
- @@size =
The size of the milestone symbol measured from the center to the tips.
6
Instance Method Summary collapse
- #addBlockedZones(router) ⇒ Object
-
#endDepLineEnd ⇒ Object
Return the point [ x, y ] where task end dependency lines should end at.
-
#endDepLineStart ⇒ Object
Return the point [ x, y ] where task end dependency lines should start from.
-
#initialize(lineHeight, x, y) ⇒ GanttMilestone
constructor
Create a GanttMilestone object based on the following information: task is a reference to the Task to be displayed.
-
#startDepLineEnd ⇒ Object
Return the point [ x, y ] where task start dependency lines should end at.
-
#startDepLineStart ⇒ Object
Return the point [ x, y ] where task start dependency lines should start from.
-
#to_html ⇒ Object
Convert the abstact representation of the GanttMilestone into HTML elements.
Methods included from HTMLGraphics
#arrowHeadToHTML, #diamondToHTML, #jagToHTML, #lineToHTML, #rectToHTML
Constructor Details
#initialize(lineHeight, x, y) ⇒ GanttMilestone
Create a GanttMilestone object based on the following information: task is a reference to the Task to be displayed. lineHeight is the height of the line this milestone is shown in. x and y are the coordinates of the center of the milestone in the GanttChart.
30 31 32 33 34 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 30 def initialize(lineHeight, x, y) @lineHeight = lineHeight @x = x @y = y end |
Instance Method Details
#addBlockedZones(router) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 58 def addBlockedZones(router) router.addZone(@x - @@size - 2, @y + (@lineHeight / 2) - @@size - 2, 2 * @@size + 5, 2 * @@size + 5, true, true) # Block for arrowhead. router.addZone(@x - @@size - 9, @y + (@lineHeight / 2) - 7, 10, 15, true, true) end |
#endDepLineEnd ⇒ Object
Return the point [ x, y ] where task end dependency lines should end at.
54 55 56 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 54 def endDepLineEnd [ @x + @@size, @y + @lineHeight / 2 ] end |
#endDepLineStart ⇒ Object
Return the point [ x, y ] where task end dependency lines should start from.
49 50 51 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 49 def endDepLineStart [ @x + @@size , @y + @lineHeight / 2 ] end |
#startDepLineEnd ⇒ Object
Return the point [ x, y ] where task start dependency lines should end at.
43 44 45 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 43 def startDepLineEnd [ @x - @@size, @y + @lineHeight / 2 ] end |
#startDepLineStart ⇒ Object
Return the point [ x, y ] where task start dependency lines should start from.
38 39 40 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 38 def startDepLineStart [ @x + @@size, @y + @lineHeight / 2 ] end |
#to_html ⇒ Object
Convert the abstact representation of the GanttMilestone into HTML elements.
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 68 def to_html html = [] # Invisible trigger frame for tooltips. html << rectToHTML(@x - (@lineHeight / 2), 0, @lineHeight, @lineHeight, 'tj_gantt_frame') # Draw a diamond shape. html += diamondToHTML(@x, @lineHeight / 2) html end |