doc/TaskJuggler/GanttChart.html in taskjuggler-0.0.5 vs doc/TaskJuggler/GanttChart.html in taskjuggler-0.0.6

- old
+ new

@@ -67,35 +67,35 @@ <div id="method-list-section" class="section"> <h3 class="section-header">Methods</h3> <ul class="link-list"> - <li><a href="#M000709">::new</a></li> + <li><a href="#method-c-new">::new</a></li> - <li><a href="#M000710">#addTask</a></li> + <li><a href="#method-i-addTask">#addTask</a></li> - <li><a href="#M000721">#collectAndSortArrows</a></li> + <li><a href="#method-i-collectAndSortArrows">#collectAndSortArrows</a></li> - <li><a href="#M000719">#completeChart</a></li> + <li><a href="#method-i-completeChart">#completeChart</a></li> - <li><a href="#M000715">#dateToX</a></li> + <li><a href="#method-i-dateToX">#dateToX</a></li> - <li><a href="#M000712">#generateByScale</a></li> + <li><a href="#method-i-generateByScale">#generateByScale</a></li> - <li><a href="#M000711">#generateByWidth</a></li> + <li><a href="#method-i-generateByWidth">#generateByWidth</a></li> - <li><a href="#M000720">#generateDepArrows</a></li> + <li><a href="#method-i-generateDepArrows">#generateDepArrows</a></li> - <li><a href="#M000717">#hasScrollbar?</a></li> + <li><a href="#method-i-hasScrollbar%3F">#hasScrollbar?</a></li> - <li><a href="#M000722">#routeArrow</a></li> + <li><a href="#method-i-routeArrow">#routeArrow</a></li> - <li><a href="#M000718">#scaleByName</a></li> + <li><a href="#method-i-scaleByName">#scaleByName</a></li> - <li><a href="#M000714">#to_csv</a></li> + <li><a href="#method-i-to_csv">#to_csv</a></li> - <li><a href="#M000713">#to_html</a></li> + <li><a href="#method-i-to_html">#to_html</a></li> </ul> </div> @@ -119,10 +119,12 @@ <div id="fileindex-section" class="section project-section"> <h3 class="section-header">Files</h3> <ul> + <li class="file"><a href="../CHANGELOG.html">CHANGELOG</a></li> + <li class="file"><a href="../COPYING.html">COPYING</a></li> <li class="file"><a href="../README.html">README</a></li> </ul> @@ -288,10 +290,12 @@ <li><a href="../TaskJuggler/NikuReport.html">TaskJuggler::NikuReport</a></li> <li><a href="../TaskJuggler/NikuResource.html">TaskJuggler::NikuResource</a></li> + <li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li> + <li><a href="../TaskJuggler/OnShiftCache.html">TaskJuggler::OnShiftCache</a></li> <li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li> <li><a href="../TaskJuggler/ProcessIntercomIface.html">TaskJuggler::ProcessIntercomIface</a></li> @@ -302,10 +306,12 @@ <li><a href="../TaskJuggler/ProjectBrokerIface.html">TaskJuggler::ProjectBrokerIface</a></li> <li><a href="../TaskJuggler/ProjectFileParser.html">TaskJuggler::ProjectFileParser</a></li> + <li><a href="../TaskJuggler/ProjectFileScanner.html">TaskJuggler::ProjectFileScanner</a></li> + <li><a href="../TaskJuggler/ProjectRecord.html">TaskJuggler::ProjectRecord</a></li> <li><a href="../TaskJuggler/ProjectServer.html">TaskJuggler::ProjectServer</a></li> <li><a href="../TaskJuggler/ProjectServerIface.html">TaskJuggler::ProjectServerIface</a></li> @@ -318,16 +324,20 @@ <li><a href="../TaskJuggler/PropertyTreeNode.html">TaskJuggler::PropertyTreeNode</a></li> <li><a href="../TaskJuggler/Query.html">TaskJuggler::Query</a></li> + <li><a href="../TaskJuggler/RTFHandlers.html">TaskJuggler::RTFHandlers</a></li> + <li><a href="../TaskJuggler/RTFNavigator.html">TaskJuggler::RTFNavigator</a></li> <li><a href="../TaskJuggler/RTFQuery.html">TaskJuggler::RTFQuery</a></li> <li><a href="../TaskJuggler/RTFReport.html">TaskJuggler::RTFReport</a></li> + <li><a href="../TaskJuggler/RTFReportLink.html">TaskJuggler::RTFReportLink</a></li> + <li><a href="../TaskJuggler/RealFormat.html">TaskJuggler::RealFormat</a></li> <li><a href="../TaskJuggler/RealFormatAttribute.html">TaskJuggler::RealFormatAttribute</a></li> <li><a href="../TaskJuggler/ReferenceAttribute.html">TaskJuggler::ReferenceAttribute</a></li> @@ -342,10 +352,12 @@ <li><a href="../TaskJuggler/ReportServerIface.html">TaskJuggler::ReportServerIface</a></li> <li><a href="../TaskJuggler/ReportServerRecord.html">TaskJuggler::ReportServerRecord</a></li> + <li><a href="../TaskJuggler/ReportServlet.html">TaskJuggler::ReportServlet</a></li> + <li><a href="../TaskJuggler/ReportTable.html">TaskJuggler::ReportTable</a></li> <li><a href="../TaskJuggler/ReportTableCell.html">TaskJuggler::ReportTableCell</a></li> <li><a href="../TaskJuggler/ReportTableColumn.html">TaskJuggler::ReportTableColumn</a></li> @@ -470,10 +482,12 @@ <li><a href="../TaskJuggler/TextScanner/BufferStreamHandle.html">TaskJuggler::TextScanner::BufferStreamHandle</a></li> <li><a href="../TaskJuggler/TextScanner/FileStreamHandle.html">TaskJuggler::TextScanner::FileStreamHandle</a></li> + <li><a href="../TaskJuggler/TextScanner/MacroStackEntry.html">TaskJuggler::TextScanner::MacroStackEntry</a></li> + <li><a href="../TaskJuggler/TextScanner/StreamHandle.html">TaskJuggler::TextScanner::StreamHandle</a></li> <li><a href="../TaskJuggler/TimeSheet.html">TaskJuggler::TimeSheet</a></li> <li><a href="../TaskJuggler/TimeSheetReceiver.html">TaskJuggler::TimeSheetReceiver</a></li> @@ -514,12 +528,16 @@ <li><a href="../TaskJuggler/TjpExportRE.html">TaskJuggler::TjpExportRE</a></li> <li><a href="../TaskJuggler/TjpSyntaxRules.html">TaskJuggler::TjpSyntaxRules</a></li> + <li><a href="../TaskJuggler/URLParameter.html">TaskJuggler::URLParameter</a></li> + <li><a href="../TaskJuggler/UserManual.html">TaskJuggler::UserManual</a></li> + <li><a href="../TaskJuggler/WebServer.html">TaskJuggler::WebServer</a></li> + <li><a href="../TaskJuggler/WorkingHours.html">TaskJuggler::WorkingHours</a></li> <li><a href="../TaskJuggler/WorkingHoursAttribute.html">TaskJuggler::WorkingHoursAttribute</a></li> <li><a href="../TaskJuggler/XMLBlob.html">TaskJuggler::XMLBlob</a></li> @@ -542,10 +560,12 @@ <li><a href="../RuntimeConfig.html">RuntimeConfig</a></li> <li><a href="../String.html">String</a></li> + <li><a href="../StringIO.html">StringIO</a></li> + </ul> <div id="no-class-search-results" style="display: none;">No matching classes.</div> </div> @@ -753,11 +773,11 @@ <div id="public-class-method-details" class="method-section section"> <h3 class="section-header">Public Class Methods</h3> <div id="new-method" class="method-detail "> - <a name="M000709"></a> + <a name="method-c-new"></a> <div class="method-heading"> <span class="method-name">new</span><span class="method-args">(now, weekStartsMonday, table = nil)</span> @@ -856,11 +876,11 @@ <div id="public-instance-method-details" class="method-section section"> <h3 class="section-header">Public Instance Methods</h3> <div id="add-ask-method" class="method-detail "> - <a name="M000710"></a> + <a name="method-i-addTask"></a> <div class="method-heading"> <span class="method-name">addTask</span><span class="method-args">(task, line)</span> @@ -900,11 +920,11 @@ </div> <div id="date-o--method" class="method-detail "> - <a name="M000715"></a> + <a name="method-i-dateToX"></a> <div class="method-heading"> <span class="method-name">dateToX</span><span class="method-args">(date)</span> @@ -922,14 +942,14 @@ <div class="method-source-code" id="date-o--source"> <pre> - <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 207</span> -207: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dateToX</span>(<span class="ruby-identifier">date</span>) -208: (<span class="ruby-ivar">@width</span> <span class="ruby-operator">/</span> (<span class="ruby-ivar">@end</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@start</span>)) * (<span class="ruby-identifier">date</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@start</span>) -209: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 208</span> +208: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dateToX</span>(<span class="ruby-identifier">date</span>) +209: (<span class="ruby-ivar">@width</span> <span class="ruby-operator">/</span> (<span class="ruby-ivar">@end</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@start</span>)) * (<span class="ruby-identifier">date</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@start</span>) +210: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -937,11 +957,11 @@ </div> <div id="generate-y-cale-method" class="method-detail "> - <a name="M000712"></a> + <a name="method-i-generateByScale"></a> <div class="method-heading"> <span class="method-name">generateByScale</span><span class="method-args">(periodStart, periodEnd, scaleName)</span> @@ -984,11 +1004,11 @@ </div> <div id="generate-y-idth-method" class="method-detail "> - <a name="M000711"></a> + <a name="method-i-generateByWidth"></a> <div class="method-heading"> <span class="method-name">generateByWidth</span><span class="method-args">(periodStart, periodEnd, width)</span> @@ -1021,11 +1041,11 @@ </div> <div id="has-crollbar--method" class="method-detail "> - <a name="M000717"></a> + <a name="method-i-hasScrollbar%3F"></a> <div class="method-heading"> <span class="method-name">hasScrollbar?</span><span class="method-args">()</span> @@ -1042,14 +1062,14 @@ <div class="method-source-code" id="has-crollbar--source"> <pre> - <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 221</span> -221: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hasScrollbar?</span> -222: <span class="ruby-ivar">@viewWidth</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@viewWidth</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@width</span>) -223: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 222</span> +222: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hasScrollbar?</span> +223: <span class="ruby-ivar">@viewWidth</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@viewWidth</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@width</span>) +224: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1057,16 +1077,16 @@ </div> <div id="to-csv-method" class="method-detail "> - <a name="M000714"></a> + <a name="method-i-to_csv"></a> <div class="method-heading"> <span class="method-name">to_csv</span><span - class="method-args">(csv)</span> + class="method-args">()</span> <span class="method-click-advice">click to toggle source</span> </div> <div class="method-description"> @@ -1079,13 +1099,14 @@ <div class="method-source-code" id="to-csv-source"> <pre> <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 201</span> -201: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_csv</span>(<span class="ruby-identifier">csv</span>) +201: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_csv</span> 202: <span class="ruby-comment cmt"># Can't put a Gantt chart into a CSV file.</span> -203: <span class="ruby-keyword kw">end</span></pre> +203: <span class="ruby-value str">''</span> +204: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1093,11 +1114,11 @@ </div> <div id="to-html-method" class="method-detail "> - <a name="M000713"></a> + <a name="method-i-to_html"></a> <div class="method-heading"> <span class="method-name">to_html</span><span class="method-args">()</span> @@ -1190,11 +1211,11 @@ <div id="private-instance-method-details" class="method-section section"> <h3 class="section-header">Private Instance Methods</h3> <div id="collect-nd-ort-rrows-method" class="method-detail "> - <a name="M000721"></a> + <a name="method-i-collectAndSortArrows"></a> <div class="method-heading"> <span class="method-name">collectAndSortArrows</span><span class="method-args">(kind, task, scenarioIdx, lineIndex, startX, startY)</span> @@ -1217,47 +1238,47 @@ <div class="method-source-code" id="collect-nd-ort-rrows-source"> <pre> - <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 280</span> -280: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collectAndSortArrows</span>(<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">task</span>, <span class="ruby-identifier">scenarioIdx</span>, <span class="ruby-identifier">lineIndex</span>, <span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>) -281: <span class="ruby-comment cmt"># We need to sort the arrows. This is an Array that holds 6 values for</span> -282: <span class="ruby-comment cmt"># each entry: The x and y coordinates for start and end points, the</span> -283: <span class="ruby-comment cmt"># sinus value of the angle between a vertical and the line specified by</span> -284: <span class="ruby-comment cmt"># the points and the length of the line.</span> -285: <span class="ruby-identifier">touples</span> = [] -286: <span class="ruby-identifier">task</span>[<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">scenarioIdx</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span>, <span class="ruby-identifier">onEnd</span><span class="ruby-operator">|</span> -287: <span class="ruby-comment cmt"># Skip inherited dependencies and tasks that are not included in the</span> -288: <span class="ruby-comment cmt"># chart.</span> -289: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">t</span>.<span class="ruby-identifier">parent</span> <span class="ruby-operator">&amp;&amp;</span> -290: <span class="ruby-identifier">task</span>.<span class="ruby-identifier">hasDependency?</span>(<span class="ruby-identifier">scenarioIdx</span>, <span class="ruby-identifier">kind</span>, <span class="ruby-identifier">t</span>.<span class="ruby-identifier">parent</span>, <span class="ruby-identifier">onEnd</span>)) <span class="ruby-operator">||</span> -291: <span class="ruby-operator">!</span><span class="ruby-ivar">@tasks</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">t</span>) -292: <span class="ruby-keyword kw">next</span> -293: <span class="ruby-keyword kw">end</span> -294: <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span> = <span class="ruby-ivar">@tasks</span>[<span class="ruby-identifier">t</span>][<span class="ruby-identifier">lineIndex</span>].<span class="ruby-identifier">getTask</span>.<span class="ruby-identifier">send</span>( -295: <span class="ruby-identifier">onEnd</span> <span class="ruby-operator">?</span> <span class="ruby-value">:endDepLineEnd</span> <span class="ruby-operator">:</span> <span class="ruby-value">:startDepLineEnd</span>) -296: <span class="ruby-comment cmt"># To make sure that we minimize the crossings of arrows that</span> -297: <span class="ruby-comment cmt"># originate from the same position, we sort the arrows by the</span> -298: <span class="ruby-comment cmt"># smallest angle between the vertical line through the task end</span> -299: <span class="ruby-comment cmt"># and the line between the start and end of the arrow.</span> -300: <span class="ruby-identifier">oppLeg</span> = <span class="ruby-identifier">endX</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">startX</span> -301: <span class="ruby-identifier">adjLeg</span> = (<span class="ruby-identifier">startY</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">endY</span>).<span class="ruby-identifier">abs</span> -302: <span class="ruby-identifier">hypothenuse</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">adjLeg</span> <span class="ruby-operator">**</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">oppLeg</span> <span class="ruby-operator">**</span> <span class="ruby-value">2</span>) -303: <span class="ruby-comment cmt"># We can now calculate the sinus values of the angle between the</span> -304: <span class="ruby-comment cmt"># vertical and a line through the coordinates.</span> -305: <span class="ruby-identifier">touples</span> <span class="ruby-operator">&lt;&lt;</span> [ <span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>, <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>, -306: (<span class="ruby-identifier">oppLeg</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">hypothenuse</span>), <span class="ruby-identifier">hypothenuse</span> ] -307: <span class="ruby-keyword kw">end</span> -308: <span class="ruby-comment cmt"># We sort the arrows from small to a large angle. In case the angle is</span> -309: <span class="ruby-comment cmt"># identical, we use the length of the line as second criteria.</span> -310: <span class="ruby-identifier">touples</span>.<span class="ruby-identifier">sort!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t1</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">t2</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">t1</span>[<span class="ruby-value">5</span>] <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">t2</span>[<span class="ruby-value">5</span>] <span class="ruby-operator">:</span> -311: <span class="ruby-identifier">t1</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">t2</span>[<span class="ruby-value">4</span>] } -312: <span class="ruby-identifier">touples</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> -313: <span class="ruby-identifier">routeArrow</span>(*<span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">4</span>]) -314: <span class="ruby-keyword kw">end</span> -315: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 281</span> +281: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collectAndSortArrows</span>(<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">task</span>, <span class="ruby-identifier">scenarioIdx</span>, <span class="ruby-identifier">lineIndex</span>, <span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>) +282: <span class="ruby-comment cmt"># We need to sort the arrows. This is an Array that holds 6 values for</span> +283: <span class="ruby-comment cmt"># each entry: The x and y coordinates for start and end points, the</span> +284: <span class="ruby-comment cmt"># sinus value of the angle between a vertical and the line specified by</span> +285: <span class="ruby-comment cmt"># the points and the length of the line.</span> +286: <span class="ruby-identifier">touples</span> = [] +287: <span class="ruby-identifier">task</span>[<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">scenarioIdx</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span>, <span class="ruby-identifier">onEnd</span><span class="ruby-operator">|</span> +288: <span class="ruby-comment cmt"># Skip inherited dependencies and tasks that are not included in the</span> +289: <span class="ruby-comment cmt"># chart.</span> +290: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">t</span>.<span class="ruby-identifier">parent</span> <span class="ruby-operator">&amp;&amp;</span> +291: <span class="ruby-identifier">task</span>.<span class="ruby-identifier">hasDependency?</span>(<span class="ruby-identifier">scenarioIdx</span>, <span class="ruby-identifier">kind</span>, <span class="ruby-identifier">t</span>.<span class="ruby-identifier">parent</span>, <span class="ruby-identifier">onEnd</span>)) <span class="ruby-operator">||</span> +292: <span class="ruby-operator">!</span><span class="ruby-ivar">@tasks</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">t</span>) +293: <span class="ruby-keyword kw">next</span> +294: <span class="ruby-keyword kw">end</span> +295: <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span> = <span class="ruby-ivar">@tasks</span>[<span class="ruby-identifier">t</span>][<span class="ruby-identifier">lineIndex</span>].<span class="ruby-identifier">getTask</span>.<span class="ruby-identifier">send</span>( +296: <span class="ruby-identifier">onEnd</span> <span class="ruby-operator">?</span> <span class="ruby-value">:endDepLineEnd</span> <span class="ruby-operator">:</span> <span class="ruby-value">:startDepLineEnd</span>) +297: <span class="ruby-comment cmt"># To make sure that we minimize the crossings of arrows that</span> +298: <span class="ruby-comment cmt"># originate from the same position, we sort the arrows by the</span> +299: <span class="ruby-comment cmt"># smallest angle between the vertical line through the task end</span> +300: <span class="ruby-comment cmt"># and the line between the start and end of the arrow.</span> +301: <span class="ruby-identifier">oppLeg</span> = <span class="ruby-identifier">endX</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">startX</span> +302: <span class="ruby-identifier">adjLeg</span> = (<span class="ruby-identifier">startY</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">endY</span>).<span class="ruby-identifier">abs</span> +303: <span class="ruby-identifier">hypothenuse</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">adjLeg</span> <span class="ruby-operator">**</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">oppLeg</span> <span class="ruby-operator">**</span> <span class="ruby-value">2</span>) +304: <span class="ruby-comment cmt"># We can now calculate the sinus values of the angle between the</span> +305: <span class="ruby-comment cmt"># vertical and a line through the coordinates.</span> +306: <span class="ruby-identifier">touples</span> <span class="ruby-operator">&lt;&lt;</span> [ <span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>, <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>, +307: (<span class="ruby-identifier">oppLeg</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">hypothenuse</span>), <span class="ruby-identifier">hypothenuse</span> ] +308: <span class="ruby-keyword kw">end</span> +309: <span class="ruby-comment cmt"># We sort the arrows from small to a large angle. In case the angle is</span> +310: <span class="ruby-comment cmt"># identical, we use the length of the line as second criteria.</span> +311: <span class="ruby-identifier">touples</span>.<span class="ruby-identifier">sort!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t1</span>, <span class="ruby-identifier">t2</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t1</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">t2</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">t1</span>[<span class="ruby-value">5</span>] <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">t2</span>[<span class="ruby-value">5</span>] <span class="ruby-operator">:</span> +312: <span class="ruby-identifier">t1</span>[<span class="ruby-value">4</span>] <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">t2</span>[<span class="ruby-value">4</span>] } +313: <span class="ruby-identifier">touples</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> +314: <span class="ruby-identifier">routeArrow</span>(*<span class="ruby-identifier">t</span>[<span class="ruby-value">0</span>, <span class="ruby-value">4</span>]) +315: <span class="ruby-keyword kw">end</span> +316: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1265,11 +1286,11 @@ </div> <div id="complete-hart-method" class="method-detail "> - <a name="M000719"></a> + <a name="method-i-completeChart"></a> <div class="method-heading"> <span class="method-name">completeChart</span><span class="method-args">()</span> @@ -1286,28 +1307,28 @@ <div class="method-source-code" id="complete-hart-source"> <pre> - <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 237</span> -237: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">completeChart</span> -238: <span class="ruby-ivar">@lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> -239: <span class="ruby-ivar">@height</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">height</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">height</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@height</span> -240: <span class="ruby-keyword kw">end</span> -241: -242: <span class="ruby-ivar">@router</span> = <span class="ruby-constant">GanttRouter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@width</span>, <span class="ruby-ivar">@height</span>) -243: -244: <span class="ruby-ivar">@lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> -245: <span class="ruby-identifier">line</span>.<span class="ruby-identifier">addBlockedZones</span>(<span class="ruby-ivar">@router</span>) -246: <span class="ruby-keyword kw">end</span> -247: -248: <span class="ruby-ivar">@router</span>.<span class="ruby-identifier">addZone</span>(<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">nowLineX</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, <span class="ruby-value">0</span>, <span class="ruby-value">3</span>, <span class="ruby-ivar">@height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>) -249: -250: <span class="ruby-ivar">@tasks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">task</span>, <span class="ruby-identifier">lines</span><span class="ruby-operator">|</span> -251: <span class="ruby-identifier">generateDepArrows</span>(<span class="ruby-identifier">task</span>, <span class="ruby-identifier">lines</span>) -252: <span class="ruby-keyword kw">end</span> -253: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 238</span> +238: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">completeChart</span> +239: <span class="ruby-ivar">@lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> +240: <span class="ruby-ivar">@height</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">height</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">height</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@height</span> +241: <span class="ruby-keyword kw">end</span> +242: +243: <span class="ruby-ivar">@router</span> = <span class="ruby-constant">GanttRouter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@width</span>, <span class="ruby-ivar">@height</span>) +244: +245: <span class="ruby-ivar">@lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> +246: <span class="ruby-identifier">line</span>.<span class="ruby-identifier">addBlockedZones</span>(<span class="ruby-ivar">@router</span>) +247: <span class="ruby-keyword kw">end</span> +248: +249: <span class="ruby-ivar">@router</span>.<span class="ruby-identifier">addZone</span>(<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">nowLineX</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, <span class="ruby-value">0</span>, <span class="ruby-value">3</span>, <span class="ruby-ivar">@height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>) +250: +251: <span class="ruby-ivar">@tasks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">task</span>, <span class="ruby-identifier">lines</span><span class="ruby-operator">|</span> +252: <span class="ruby-identifier">generateDepArrows</span>(<span class="ruby-identifier">task</span>, <span class="ruby-identifier">lines</span>) +253: <span class="ruby-keyword kw">end</span> +254: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1315,11 +1336,11 @@ </div> <div id="generate-ep-rrows-method" class="method-detail "> - <a name="M000720"></a> + <a name="method-i-generateDepArrows"></a> <div class="method-heading"> <span class="method-name">generateDepArrows</span><span class="method-args">(task, lines)</span> @@ -1339,26 +1360,26 @@ <div class="method-source-code" id="generate-ep-rrows-source"> <pre> - <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 259</span> -259: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generateDepArrows</span>(<span class="ruby-identifier">task</span>, <span class="ruby-identifier">lines</span>) -260: <span class="ruby-comment cmt"># Since we need the line and the index we use an index iterator.</span> -261: <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lineIndex</span><span class="ruby-operator">|</span> -262: <span class="ruby-identifier">line</span> = <span class="ruby-identifier">lines</span>[<span class="ruby-identifier">lineIndex</span>] -263: <span class="ruby-identifier">scenarioIdx</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">query</span>.<span class="ruby-identifier">scenarioIdx</span> -264: -265: <span class="ruby-comment cmt"># Generate the dependencies on the start of the task.</span> -266: <span class="ruby-identifier">collectAndSortArrows</span>(<span class="ruby-value str">'startsuccs'</span>, <span class="ruby-identifier">task</span>, <span class="ruby-identifier">scenarioIdx</span>, <span class="ruby-identifier">lineIndex</span>, -267: *<span class="ruby-identifier">line</span>.<span class="ruby-identifier">getTask</span>.<span class="ruby-identifier">startDepLineStart</span>) -268: -269: <span class="ruby-comment cmt"># Generate the dependencies on the end of the task.</span> -270: <span class="ruby-identifier">collectAndSortArrows</span>(<span class="ruby-value str">'endsuccs'</span>, <span class="ruby-identifier">task</span>, <span class="ruby-identifier">scenarioIdx</span>, <span class="ruby-identifier">lineIndex</span>, -271: *<span class="ruby-identifier">line</span>.<span class="ruby-identifier">getTask</span>.<span class="ruby-identifier">endDepLineStart</span>) -272: <span class="ruby-keyword kw">end</span> -273: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 260</span> +260: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generateDepArrows</span>(<span class="ruby-identifier">task</span>, <span class="ruby-identifier">lines</span>) +261: <span class="ruby-comment cmt"># Since we need the line and the index we use an index iterator.</span> +262: <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lineIndex</span><span class="ruby-operator">|</span> +263: <span class="ruby-identifier">line</span> = <span class="ruby-identifier">lines</span>[<span class="ruby-identifier">lineIndex</span>] +264: <span class="ruby-identifier">scenarioIdx</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">query</span>.<span class="ruby-identifier">scenarioIdx</span> +265: +266: <span class="ruby-comment cmt"># Generate the dependencies on the start of the task.</span> +267: <span class="ruby-identifier">collectAndSortArrows</span>(<span class="ruby-value str">'startsuccs'</span>, <span class="ruby-identifier">task</span>, <span class="ruby-identifier">scenarioIdx</span>, <span class="ruby-identifier">lineIndex</span>, +268: *<span class="ruby-identifier">line</span>.<span class="ruby-identifier">getTask</span>.<span class="ruby-identifier">startDepLineStart</span>) +269: +270: <span class="ruby-comment cmt"># Generate the dependencies on the end of the task.</span> +271: <span class="ruby-identifier">collectAndSortArrows</span>(<span class="ruby-value str">'endsuccs'</span>, <span class="ruby-identifier">task</span>, <span class="ruby-identifier">scenarioIdx</span>, <span class="ruby-identifier">lineIndex</span>, +272: *<span class="ruby-identifier">line</span>.<span class="ruby-identifier">getTask</span>.<span class="ruby-identifier">endDepLineStart</span>) +273: <span class="ruby-keyword kw">end</span> +274: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1366,11 +1387,11 @@ </div> <div id="route-rrow-method" class="method-detail "> - <a name="M000722"></a> + <a name="method-i-routeArrow"></a> <div class="method-heading"> <span class="method-name">routeArrow</span><span class="method-args">(startX, startY, endX, endY)</span> @@ -1387,21 +1408,21 @@ <div class="method-source-code" id="route-rrow-source"> <pre> - <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 318</span> -318: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">routeArrow</span>(<span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>, <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>) -319: <span class="ruby-ivar">@depArrows</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@router</span>.<span class="ruby-identifier">route</span>([<span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>], [<span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>]) -320: -321: <span class="ruby-comment cmt"># It's enough to have only a single arrow drawn at the end point even if</span> -322: <span class="ruby-comment cmt"># it's the destination of multiple lines.</span> -323: <span class="ruby-ivar">@arrowHeads</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span><span class="ruby-operator">|</span> -324: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">endX</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">y</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">endY</span> -325: <span class="ruby-keyword kw">end</span> -326: <span class="ruby-ivar">@arrowHeads</span> <span class="ruby-operator">&lt;&lt;</span> [ <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span> ] -327: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 319</span> +319: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">routeArrow</span>(<span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>, <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>) +320: <span class="ruby-ivar">@depArrows</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@router</span>.<span class="ruby-identifier">route</span>([<span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>], [<span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>]) +321: +322: <span class="ruby-comment cmt"># It's enough to have only a single arrow drawn at the end point even if</span> +323: <span class="ruby-comment cmt"># it's the destination of multiple lines.</span> +324: <span class="ruby-ivar">@arrowHeads</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span><span class="ruby-operator">|</span> +325: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">endX</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">y</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">endY</span> +326: <span class="ruby-keyword kw">end</span> +327: <span class="ruby-ivar">@arrowHeads</span> <span class="ruby-operator">&lt;&lt;</span> [ <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span> ] +328: <span class="ruby-keyword kw">end</span></pre> </div> </div> @@ -1409,11 +1430,11 @@ </div> <div id="scale-y-ame-method" class="method-detail "> - <a name="M000718"></a> + <a name="method-i-scaleByName"></a> <div class="method-heading"> <span class="method-name">scaleByName</span><span class="method-args">(name)</span> @@ -1431,16 +1452,16 @@ <div class="method-source-code" id="scale-y-ame-source"> <pre> - <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 229</span> -229: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scaleByName</span>(<span class="ruby-identifier">name</span>) -230: <span class="ruby-identifier">@@scales</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">scale</span><span class="ruby-operator">|</span> -231: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">scale</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">scale</span>[<span class="ruby-value str">'name'</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span> -232: <span class="ruby-keyword kw">end</span> -233: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown scale #{name}&quot;</span> -234: <span class="ruby-keyword kw">end</span></pre> + <span class="ruby-comment cmt"># File lib/reports/GanttChart.rb, line 230</span> +230: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scaleByName</span>(<span class="ruby-identifier">name</span>) +231: <span class="ruby-identifier">@@scales</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">scale</span><span class="ruby-operator">|</span> +232: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">scale</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">scale</span>[<span class="ruby-value str">'name'</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span> +233: <span class="ruby-keyword kw">end</span> +234: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown scale #{name}&quot;</span> +235: <span class="ruby-keyword kw">end</span></pre> </div> </div>