Class TaskJuggler::GanttMilestone
In: lib/taskjuggler/reports/GanttMilestone.rb
Parent: Object

The GanttMilestone represents a milestone task.

Methods

Included Modules

HTMLGraphics

Public Class methods

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.

[Source]

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

Public Instance methods

[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

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

[Source]

# File lib/taskjuggler/reports/GanttMilestone.rb, line 54
    def endDepLineEnd
      [ @x + @@size, @y + @lineHeight / 2 ]
    end

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

[Source]

# File lib/taskjuggler/reports/GanttMilestone.rb, line 49
    def endDepLineStart
      [ @x + @@size , @y + @lineHeight / 2 ]
    end

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

[Source]

# File lib/taskjuggler/reports/GanttMilestone.rb, line 43
    def startDepLineEnd
      [ @x - @@size, @y + @lineHeight / 2 ]
    end

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

[Source]

# File lib/taskjuggler/reports/GanttMilestone.rb, line 38
    def startDepLineStart
      [ @x + @@size, @y + @lineHeight / 2 ]
    end

Convert the abstact representation of the GanttMilestone into HTML elements.

[Source]

# 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

[Validate]