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.
31 32 33 34 35 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 31 def initialize(lineHeight, x, y) @lineHeight = lineHeight @x = x @y = y end |
Instance Method Details
#addBlockedZones(router) ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 59 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.
55 56 57 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 55 def endDepLineEnd [ @x + @@size, @y + @lineHeight / 2 ] end |
#endDepLineStart ⇒ Object
Return the point [ x, y ] where task end dependency lines should start from.
50 51 52 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 50 def endDepLineStart [ @x + @@size , @y + @lineHeight / 2 ] end |
#startDepLineEnd ⇒ Object
Return the point [ x, y ] where task start dependency lines should end at.
44 45 46 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 44 def startDepLineEnd [ @x - @@size, @y + @lineHeight / 2 ] end |
#startDepLineStart ⇒ Object
Return the point [ x, y ] where task start dependency lines should start from.
39 40 41 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 39 def startDepLineStart [ @x + @@size, @y + @lineHeight / 2 ] end |
#to_html ⇒ Object
Convert the abstact representation of the GanttMilestone into HTML elements.
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/taskjuggler/reports/GanttMilestone.rb', line 69 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 |