class TaskJuggler::GanttMilestone

The GanttMilestone represents a milestone task.

Public Class Methods

new(lineHeight, x, y) click to toggle source

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.

# File lib/taskjuggler/reports/GanttMilestone.rb, line 30
def initialize(lineHeight, x, y)
  @lineHeight = lineHeight
  @x = x
  @y = y
end

Public Instance Methods

addBlockedZones(router) click to toggle source
# 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() click to toggle source

Return the point [ x, y ] where task end dependency lines should end at.

# File lib/taskjuggler/reports/GanttMilestone.rb, line 54
def endDepLineEnd
  [ @x + @@size, @y + @lineHeight / 2 ]
end
endDepLineStart() click to toggle source

Return the point [ x, y ] where task end dependency lines should start from.

# File lib/taskjuggler/reports/GanttMilestone.rb, line 49
def endDepLineStart
  [ @x + @@size , @y + @lineHeight / 2 ]
end
startDepLineEnd() click to toggle source

Return the point [ x, y ] where task start dependency lines should end at.

# File lib/taskjuggler/reports/GanttMilestone.rb, line 43
def startDepLineEnd
  [ @x - @@size, @y + @lineHeight / 2 ]
end
startDepLineStart() click to toggle source

Return the point [ x, y ] where task start dependency lines should start from.

# File lib/taskjuggler/reports/GanttMilestone.rb, line 38
def startDepLineStart
  [ @x + @@size, @y + @lineHeight / 2 ]
end
to_html() click to toggle source

Convert the abstact representation of the GanttMilestone into HTML elements.

# 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