bio-graphics 1.0 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/doc/classes/Bio/Graphics.html +11 -1
  2. data/doc/classes/Bio/Graphics/Panel.html +5 -2
  3. data/doc/classes/Bio/Graphics/Panel.src/M000005.html +4 -4
  4. data/doc/classes/Bio/Graphics/Panel.src/M000006.html +3 -3
  5. data/doc/classes/Bio/Graphics/Panel.src/M000007.html +6 -5
  6. data/doc/classes/Bio/Graphics/Panel/Ruler.html +16 -16
  7. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000014.html +6 -14
  8. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000015.html +10 -41
  9. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000016.html +59 -0
  10. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000017.html +20 -0
  11. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000018.html +28 -0
  12. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000019.html +59 -0
  13. data/doc/classes/Bio/Graphics/Panel/Track.html +30 -15
  14. data/doc/classes/Bio/Graphics/Panel/Track.src/M000008.html +8 -5
  15. data/doc/classes/Bio/Graphics/Panel/Track.src/M000009.html +2 -2
  16. data/doc/classes/Bio/Graphics/Panel/Track.src/M000010.html +12 -245
  17. data/doc/classes/Bio/Graphics/Panel/Track/Feature.html +109 -0
  18. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000011.html +1 -1
  19. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000012.html +39 -0
  20. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000013.html +27 -0
  21. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000014.html +209 -49
  22. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000015.html +48 -0
  23. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.html +5 -5
  24. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000013.html +18 -0
  25. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000016.html +18 -0
  26. data/doc/created.rid +1 -1
  27. data/doc/files/README_DEV.html +7 -11
  28. data/doc/files/TUTORIAL.html +3 -3
  29. data/doc/files/lib/bio-graphics_rb.html +3 -1
  30. data/doc/files/lib/bio/graphics/feature_rb.html +6 -11
  31. data/doc/files/lib/bio/graphics/image_map_rb.html +1 -1
  32. data/doc/files/lib/bio/graphics/panel_rb.html +1 -1
  33. data/doc/files/lib/bio/graphics/ruler_rb.html +1 -1
  34. data/doc/files/lib/bio/graphics/track_rb.html +1 -1
  35. data/doc/fr_method_index.html +8 -4
  36. data/doc/images/example_labels.png +0 -0
  37. data/doc/images/glyph_showcase.png +0 -0
  38. data/doc/images/terms.png +0 -0
  39. data/doc/index.html +2 -2
  40. data/images/example_labels.png +0 -0
  41. data/images/glyph_showcase.png +0 -0
  42. data/images/terms.png +0 -0
  43. data/images/terms.svg +146 -132
  44. data/lib/bio-graphics.rb +2 -1
  45. data/lib/bio/graphics/feature.rb +304 -0
  46. data/lib/bio/graphics/panel.rb +15 -11
  47. data/lib/bio/graphics/ruler.rb +1 -1
  48. data/lib/bio/graphics/track.rb +23 -254
  49. data/samples/arkdb_features.rb +8 -8
  50. data/samples/glyph_showcase.rb +10 -6
  51. data/test/unit/test_creation.rb +51 -0
  52. metadata +14 -2
@@ -139,7 +139,7 @@ Schematically:
139
139
  track1.add_feature('gene3',100,500)
140
140
 
141
141
  # Add a second track (e.g. 'polymorphisms')
142
- track2 = g.add_track('polymorphisms','red','triangle')
142
+ track2 = g.add_track('polymorphisms',, false, 'red','triangle')
143
143
 
144
144
  # And put features on this one
145
145
  track2.add_feature('polymorphism 1',56,56)
@@ -224,6 +224,16 @@ The defaults
224
224
  <td>=</td>
225
225
  <td class="context-item-value">5</td>
226
226
  </tr>
227
+ <tr class="top-aligned-row context-row">
228
+ <td class="context-item-name">FONT</td>
229
+ <td>=</td>
230
+ <td class="context-item-value">['Georgia', 1, 1]</td>
231
+ <td width="3em">&nbsp;</td>
232
+ <td class="context-item-desc">
233
+ consecutive ticks. This is used for the calculation of tick distance.
234
+
235
+ </td>
236
+ </tr>
227
237
  </table>
228
238
  </div>
229
239
  </div>
@@ -167,7 +167,7 @@ Class <a href="Panel/Track.html" class="link">Bio::Graphics::Panel::Track</a><br
167
167
  <td class="context-item-desc"></td>
168
168
  </tr>
169
169
  <tr class="top-aligned-row context-row">
170
- <td class="context-item-name">number_of_times_bumped</td>
170
+ <td class="context-item-name">number_of_feature_rows</td>
171
171
  <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
172
172
  <td class="context-item-desc"></td>
173
173
  </tr>
@@ -267,7 +267,7 @@ of sequence)
267
267
  <div class="method-heading">
268
268
  <a href="Panel.src/M000006.html" target="Code" class="method-signature"
269
269
  onclick="popupCode('Panel.src/M000006.html');return false;">
270
- <span class="method-name">add_track</span><span class="method-args">(name, feature_colour = [0,0,1], feature_glyph = 'generic')</span>
270
+ <span class="method-name">add_track</span><span class="method-args">(name, label = true, feature_colour = [0,0,1], feature_glyph = 'generic')</span>
271
271
  </a>
272
272
  </div>
273
273
 
@@ -288,6 +288,9 @@ polymorphisms, ESTs, etc.
288
288
  <li><em>name</em> (required) :: Name of the track to be displayed (e.g.
289
289
  &#8216;genes&#8217;)
290
290
 
291
+ </li>
292
+ <li>_label) :: Whether the feature labels should be displayed or not
293
+
291
294
  </li>
292
295
  <li><em>colour</em> :: Colour to be used to <a
293
296
  href="Panel.html#M000007">draw</a> the features within the track. Default =
@@ -10,16 +10,16 @@
10
10
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/bio/graphics/panel.rb, line 101</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/panel.rb, line 103</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">length</span>, <span class="ruby-identifier">width</span> = <span class="ruby-constant">DEFAULT_PANEL_WIDTH</span>, <span class="ruby-identifier">clickable</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">display_start</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">display_stop</span> = <span class="ruby-keyword kw">nil</span>)
15
15
  <span class="ruby-ivar">@length</span> = <span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_i</span>
16
16
  <span class="ruby-ivar">@width</span> = <span class="ruby-identifier">width</span>.<span class="ruby-identifier">to_i</span>
17
17
  <span class="ruby-ivar">@tracks</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
18
- <span class="ruby-ivar">@number_of_times_bumped</span> = <span class="ruby-value">0</span>
18
+ <span class="ruby-ivar">@number_of_feature_rows</span> = <span class="ruby-value">0</span>
19
19
  <span class="ruby-ivar">@clickable</span> = <span class="ruby-identifier">clickable</span>
20
20
  <span class="ruby-ivar">@image_map</span> = ( <span class="ruby-identifier">clickable</span> ) <span class="ruby-operator">?</span> <span class="ruby-constant">ImageMap</span>.<span class="ruby-identifier">new</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
21
- <span class="ruby-ivar">@display_start</span> = ( <span class="ruby-identifier">display_start</span>.<span class="ruby-identifier">nil?</span> ) <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">display_start</span>
22
- <span class="ruby-ivar">@display_stop</span> = ( <span class="ruby-identifier">display_stop</span>.<span class="ruby-identifier">nil?</span> ) <span class="ruby-operator">?</span> <span class="ruby-ivar">@length</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">display_stop</span>
21
+ <span class="ruby-ivar">@display_start</span> = ( <span class="ruby-identifier">display_start</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">display_start</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> ) <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">display_start</span>
22
+ <span class="ruby-ivar">@display_stop</span> = ( <span class="ruby-identifier">display_stop</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">display_stop</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@length</span> ) <span class="ruby-operator">?</span> <span class="ruby-ivar">@length</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">display_stop</span>
23
23
  <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@display_stop</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-ivar">@display_start</span>
24
24
  <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;[ERROR] Start coordinate to be displayed has to be smaller than stop coordinate.&quot;</span>
25
25
  <span class="ruby-keyword kw">end</span>
@@ -10,9 +10,9 @@
10
10
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/bio/graphics/panel.rb, line 136</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_track</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">feature_colour</span> = [<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">1</span>], <span class="ruby-identifier">feature_glyph</span> = <span class="ruby-value str">'generic'</span>)
15
- <span class="ruby-ivar">@tracks</span>.<span class="ruby-identifier">push</span>(<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Panel</span><span class="ruby-operator">::</span><span class="ruby-constant">Track</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">feature_colour</span>, <span class="ruby-identifier">feature_glyph</span>))
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/panel.rb, line 139</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_track</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">label</span> = <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">feature_colour</span> = [<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">1</span>], <span class="ruby-identifier">feature_glyph</span> = <span class="ruby-value str">'generic'</span>)
15
+ <span class="ruby-ivar">@tracks</span>.<span class="ruby-identifier">push</span>(<span class="ruby-constant">Bio</span><span class="ruby-operator">::</span><span class="ruby-constant">Graphics</span><span class="ruby-operator">::</span><span class="ruby-constant">Panel</span><span class="ruby-operator">::</span><span class="ruby-constant">Track</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">label</span>, <span class="ruby-identifier">feature_colour</span>, <span class="ruby-identifier">feature_glyph</span>))
16
16
  <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@tracks</span>[<span class="ruby-value">-1</span>]
17
17
  <span class="ruby-keyword kw">end</span></pre>
18
18
  </body>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/bio/graphics/panel.rb, line 148</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/panel.rb, line 151</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw</span>(<span class="ruby-identifier">file_name</span>)
15
15
  <span class="ruby-comment cmt"># Create a panel that is huge vertically
16
16
  <span class="ruby-identifier">huge_height</span> = <span class="ruby-value">2000</span>
@@ -30,14 +30,15 @@
30
30
 
31
31
  <span class="ruby-comment cmt"># Add tracks
32
32
  <span class="ruby-ivar">@tracks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">track</span><span class="ruby-operator">|</span>
33
- <span class="ruby-identifier">track</span>.<span class="ruby-identifier">draw</span>(<span class="ruby-identifier">huge_panel_drawing</span>, <span class="ruby-identifier">vertical_offset</span>)
34
- <span class="ruby-ivar">@number_of_times_bumped</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">number_of_times_bumped</span>
35
- <span class="ruby-identifier">vertical_offset</span> <span class="ruby-operator">+=</span> ( <span class="ruby-identifier">track</span>.<span class="ruby-identifier">number_of_times_bumped</span><span class="ruby-operator">*</span>(<span class="ruby-constant">FEATURE_HEIGHT</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_V_DISTANCE</span><span class="ruby-operator">+</span><span class="ruby-value">5</span>)) <span class="ruby-operator">+</span> <span class="ruby-value">10</span> <span class="ruby-comment cmt"># '10' is for the header
33
+ <span class="ruby-identifier">track</span>.<span class="ruby-identifier">vertical_offset</span> = <span class="ruby-identifier">vertical_offset</span>
34
+ <span class="ruby-identifier">track</span>.<span class="ruby-identifier">draw</span>(<span class="ruby-identifier">huge_panel_drawing</span>)
35
+ <span class="ruby-ivar">@number_of_feature_rows</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">track</span>.<span class="ruby-identifier">number_of_feature_rows</span>
36
+ <span class="ruby-identifier">vertical_offset</span> <span class="ruby-operator">+=</span> ( <span class="ruby-identifier">track</span>.<span class="ruby-identifier">number_of_feature_rows</span><span class="ruby-operator">*</span>(<span class="ruby-constant">FEATURE_HEIGHT</span><span class="ruby-operator">+</span><span class="ruby-constant">FEATURE_V_DISTANCE</span><span class="ruby-operator">+</span><span class="ruby-value">5</span>)) <span class="ruby-operator">+</span> <span class="ruby-value">10</span> <span class="ruby-comment cmt"># '10' is for the header
36
37
  <span class="ruby-keyword kw">end</span>
37
38
 
38
39
  <span class="ruby-comment cmt"># And create a smaller version of the panel
39
40
  <span class="ruby-identifier">height</span> = <span class="ruby-identifier">ruler</span>.<span class="ruby-identifier">height</span>
40
- <span class="ruby-ivar">@number_of_times_bumped</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
41
+ <span class="ruby-ivar">@number_of_feature_rows</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
41
42
  <span class="ruby-identifier">height</span> <span class="ruby-operator">+=</span> <span class="ruby-value">20</span>
42
43
  <span class="ruby-keyword kw">end</span>
43
44
  <span class="ruby-ivar">@tracks</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-comment cmt">#To correct for the track headers
@@ -95,9 +95,9 @@ explanation of interplay between different classes.
95
95
  <h3 class="section-bar">Methods</h3>
96
96
 
97
97
  <div class="name-list">
98
- <a href="#M000014">calculate_tick_distance</a>&nbsp;&nbsp;
99
- <a href="#M000015">draw</a>&nbsp;&nbsp;
100
- <a href="#M000013">new</a>&nbsp;&nbsp;
98
+ <a href="#M000018">calculate_tick_distance</a>&nbsp;&nbsp;
99
+ <a href="#M000019">draw</a>&nbsp;&nbsp;
100
+ <a href="#M000017">new</a>&nbsp;&nbsp;
101
101
  </div>
102
102
  </div>
103
103
 
@@ -157,19 +157,19 @@ explanation of interplay between different classes.
157
157
  <div id="methods">
158
158
  <h3 class="section-bar">Public Class methods</h3>
159
159
 
160
- <div id="method-M000013" class="method-detail">
161
- <a name="M000013"></a>
160
+ <div id="method-M000017" class="method-detail">
161
+ <a name="M000017"></a>
162
162
 
163
163
  <div class="method-heading">
164
- <a href="Ruler.src/M000013.html" target="Code" class="method-signature"
165
- onclick="popupCode('Ruler.src/M000013.html');return false;">
164
+ <a href="Ruler.src/M000017.html" target="Code" class="method-signature"
165
+ onclick="popupCode('Ruler.src/M000017.html');return false;">
166
166
  <span class="method-name">new</span><span class="method-args">(panel, colour = [0,0,0])</span>
167
167
  </a>
168
168
  </div>
169
169
 
170
170
  <div class="method-description">
171
171
  <p>
172
- Creates a <a href="Ruler.html#M000013">new</a> <a
172
+ Creates a <a href="Ruler.html#M000017">new</a> <a
173
173
  href="Ruler.html">Bio::Graphics::Panel::Ruler</a> object.
174
174
  </p>
175
175
  <hr size="1"></hr><p>
@@ -195,12 +195,12 @@ belongs to
195
195
 
196
196
  <h3 class="section-bar">Public Instance methods</h3>
197
197
 
198
- <div id="method-M000014" class="method-detail">
199
- <a name="M000014"></a>
198
+ <div id="method-M000018" class="method-detail">
199
+ <a name="M000018"></a>
200
200
 
201
201
  <div class="method-heading">
202
- <a href="Ruler.src/M000014.html" target="Code" class="method-signature"
203
- onclick="popupCode('Ruler.src/M000014.html');return false;">
202
+ <a href="Ruler.src/M000018.html" target="Code" class="method-signature"
203
+ onclick="popupCode('Ruler.src/M000018.html');return false;">
204
204
  <span class="method-name">calculate_tick_distance</span><span class="method-args">()</span>
205
205
  </a>
206
206
  </div>
@@ -209,12 +209,12 @@ belongs to
209
209
  </div>
210
210
  </div>
211
211
 
212
- <div id="method-M000015" class="method-detail">
213
- <a name="M000015"></a>
212
+ <div id="method-M000019" class="method-detail">
213
+ <a name="M000019"></a>
214
214
 
215
215
  <div class="method-heading">
216
- <a href="Ruler.src/M000015.html" target="Code" class="method-signature"
217
- onclick="popupCode('Ruler.src/M000015.html');return false;">
216
+ <a href="Ruler.src/M000019.html" target="Code" class="method-signature"
217
+ onclick="popupCode('Ruler.src/M000019.html');return false;">
218
218
  <span class="method-name">draw</span><span class="method-args">(panel_drawing, vertical_offset)</span>
219
219
  </a>
220
220
  </div>
@@ -5,24 +5,16 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>calculate_tick_distance (Bio::Graphics::Panel::Ruler)</title>
8
+ <title>new (Bio::Graphics::Panel::Ruler)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 35</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calculate_tick_distance</span>
15
- <span class="ruby-identifier">min_tick_distance_requirement_met</span> = <span class="ruby-keyword kw">false</span>
16
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> = <span class="ruby-value">1</span> <span class="ruby-comment cmt"># in basepairs.
17
- <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">min_tick_distance_requirement_met</span>
18
- <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span><span class="ruby-operator">/</span><span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">RULER_MIN_DISTANCE_TICKS_PIXEL</span>
19
- <span class="ruby-identifier">min_tick_distance_requirement_met</span> = <span class="ruby-keyword kw">true</span>
20
- <span class="ruby-keyword kw">else</span>
21
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span><span class="ruby-operator">*</span><span class="ruby-value">5</span>
22
- <span class="ruby-keyword kw">end</span>
23
- <span class="ruby-keyword kw">end</span>
24
-
25
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">major_tick_distance</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 28</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">panel</span>, <span class="ruby-identifier">colour</span> = [<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>])
15
+ <span class="ruby-ivar">@panel</span> = <span class="ruby-identifier">panel</span>
16
+ <span class="ruby-ivar">@name</span> = <span class="ruby-value str">'ruler'</span>
17
+ <span class="ruby-ivar">@colour</span> = <span class="ruby-identifier">colour</span>
26
18
  <span class="ruby-keyword kw">end</span></pre>
27
19
  </body>
28
20
  </html>
@@ -5,55 +5,24 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>draw (Bio::Graphics::Panel::Ruler)</title>
8
+ <title>calculate_tick_distance (Bio::Graphics::Panel::Ruler)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 49</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw</span>(<span class="ruby-identifier">panel_drawing</span>, <span class="ruby-identifier">vertical_offset</span>)
15
- <span class="ruby-identifier">ruler_drawing</span> = <span class="ruby-constant">Cairo</span><span class="ruby-operator">::</span><span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">panel_drawing</span>)
16
-
17
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">calculate_tick_distance</span>
18
-
19
- <span class="ruby-comment cmt"># Draw line
20
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-value">0</span>,<span class="ruby-value">10</span>)
21
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">width</span>, <span class="ruby-value">10</span>)
22
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">stroke</span>
23
-
24
- <span class="ruby-comment cmt"># Draw ticks
25
- <span class="ruby-comment cmt"># * Find position of first tick.
26
- <span class="ruby-comment cmt"># Most of the time, we don't want the first tick on the very first
27
- <span class="ruby-comment cmt"># basepair of the view. Suppose that would be position 333 in the
28
- <span class="ruby-comment cmt"># sequence. Then the numbers under the major tickmarks would be:
29
- <span class="ruby-comment cmt"># 343, 353, 363, 373 and so on. Instead, we want 350, 360, 370, 380.
30
- <span class="ruby-comment cmt"># So we want to find the position of the first tick.
31
- <span class="ruby-identifier">first_tick_position</span> = <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>
32
- <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">first_tick_position</span>.<span class="ruby-identifier">modulo</span>(<span class="ruby-identifier">minor_tick_distance</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
33
- <span class="ruby-identifier">first_tick_position</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
34
- <span class="ruby-keyword kw">end</span>
35
-
36
- <span class="ruby-comment cmt"># * And start drawing the rest.
37
- <span class="ruby-identifier">first_tick_position</span>.<span class="ruby-identifier">step</span>(<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_stop</span>, <span class="ruby-identifier">minor_tick_distance</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tick</span><span class="ruby-operator">|</span>
38
- <span class="ruby-identifier">tick_pixel_position</span> = (<span class="ruby-identifier">tick</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>
39
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">tick_pixel_position</span>.<span class="ruby-identifier">floor</span>, <span class="ruby-value">5</span>)
40
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tick</span>.<span class="ruby-identifier">modulo</span>(<span class="ruby-identifier">major_tick_distance</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
41
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-value">0</span>, <span class="ruby-value">15</span>)
42
-
43
- <span class="ruby-comment cmt"># Draw tick number
44
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">select_font_face</span>(<span class="ruby-value str">'Georgia'</span>, <span class="ruby-value">1</span>, <span class="ruby-value">1</span>)
45
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">set_font_size</span>(<span class="ruby-constant">RULER_TEXT_HEIGHT</span>)
46
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">tick_pixel_position</span>.<span class="ruby-identifier">floor</span>, <span class="ruby-value">20</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RULER_TEXT_HEIGHT</span>)
47
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">show_text</span>(<span class="ruby-identifier">tick</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>)
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 35</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calculate_tick_distance</span>
15
+ <span class="ruby-identifier">min_tick_distance_requirement_met</span> = <span class="ruby-keyword kw">false</span>
16
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> = <span class="ruby-value">1</span> <span class="ruby-comment cmt"># in basepairs.
17
+ <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">min_tick_distance_requirement_met</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span><span class="ruby-operator">/</span><span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">RULER_MIN_DISTANCE_TICKS_PIXEL</span>
19
+ <span class="ruby-identifier">min_tick_distance_requirement_met</span> = <span class="ruby-keyword kw">true</span>
48
20
  <span class="ruby-keyword kw">else</span>
49
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-value">0</span>, <span class="ruby-value">5</span>)
50
-
21
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span><span class="ruby-operator">*</span><span class="ruby-value">5</span>
51
22
  <span class="ruby-keyword kw">end</span>
52
- <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">stroke</span>
53
23
  <span class="ruby-keyword kw">end</span>
54
-
55
24
 
56
- <span class="ruby-ivar">@height</span> = <span class="ruby-value">25</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RULER_TEXT_HEIGHT</span>
25
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">major_tick_distance</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>
57
26
  <span class="ruby-keyword kw">end</span></pre>
58
27
  </body>
59
28
  </html>
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw (Bio::Graphics::Panel::Ruler)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 49</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw</span>(<span class="ruby-identifier">panel_drawing</span>, <span class="ruby-identifier">vertical_offset</span>)
15
+ <span class="ruby-identifier">ruler_drawing</span> = <span class="ruby-constant">Cairo</span><span class="ruby-operator">::</span><span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">panel_drawing</span>)
16
+
17
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">calculate_tick_distance</span>
18
+
19
+ <span class="ruby-comment cmt"># Draw line
20
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-value">0</span>,<span class="ruby-value">10</span>)
21
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">width</span>, <span class="ruby-value">10</span>)
22
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">stroke</span>
23
+
24
+ <span class="ruby-comment cmt"># Draw ticks
25
+ <span class="ruby-comment cmt"># * Find position of first tick.
26
+ <span class="ruby-comment cmt"># Most of the time, we don't want the first tick on the very first
27
+ <span class="ruby-comment cmt"># basepair of the view. Suppose that would be position 333 in the
28
+ <span class="ruby-comment cmt"># sequence. Then the numbers under the major tickmarks would be:
29
+ <span class="ruby-comment cmt"># 343, 353, 363, 373 and so on. Instead, we want 350, 360, 370, 380.
30
+ <span class="ruby-comment cmt"># So we want to find the position of the first tick.
31
+ <span class="ruby-identifier">first_tick_position</span> = <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>
32
+ <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">first_tick_position</span>.<span class="ruby-identifier">modulo</span>(<span class="ruby-identifier">minor_tick_distance</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
33
+ <span class="ruby-identifier">first_tick_position</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
34
+ <span class="ruby-keyword kw">end</span>
35
+
36
+ <span class="ruby-comment cmt"># * And start drawing the rest.
37
+ <span class="ruby-identifier">first_tick_position</span>.<span class="ruby-identifier">step</span>(<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_stop</span>, <span class="ruby-identifier">minor_tick_distance</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tick</span><span class="ruby-operator">|</span>
38
+ <span class="ruby-identifier">tick_pixel_position</span> = (<span class="ruby-identifier">tick</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>
39
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">tick_pixel_position</span>.<span class="ruby-identifier">floor</span>, <span class="ruby-value">5</span>)
40
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tick</span>.<span class="ruby-identifier">modulo</span>(<span class="ruby-identifier">major_tick_distance</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
41
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-value">0</span>, <span class="ruby-value">15</span>)
42
+
43
+ <span class="ruby-comment cmt"># Draw tick number
44
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">select_font_face</span>(<span class="ruby-value str">'Georgia'</span>, <span class="ruby-value">1</span>, <span class="ruby-value">1</span>)
45
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">set_font_size</span>(<span class="ruby-constant">RULER_TEXT_HEIGHT</span>)
46
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">tick_pixel_position</span>.<span class="ruby-identifier">floor</span>, <span class="ruby-value">20</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RULER_TEXT_HEIGHT</span>)
47
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">show_text</span>(<span class="ruby-identifier">tick</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>)
48
+ <span class="ruby-keyword kw">else</span>
49
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-value">0</span>, <span class="ruby-value">5</span>)
50
+
51
+ <span class="ruby-keyword kw">end</span>
52
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">stroke</span>
53
+ <span class="ruby-keyword kw">end</span>
54
+
55
+
56
+ <span class="ruby-ivar">@height</span> = <span class="ruby-value">25</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RULER_TEXT_HEIGHT</span>
57
+ <span class="ruby-keyword kw">end</span></pre>
58
+ </body>
59
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (Bio::Graphics::Panel::Ruler)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 28</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">panel</span>, <span class="ruby-identifier">colour</span> = [<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>])
15
+ <span class="ruby-ivar">@panel</span> = <span class="ruby-identifier">panel</span>
16
+ <span class="ruby-ivar">@name</span> = <span class="ruby-value str">'ruler'</span>
17
+ <span class="ruby-ivar">@colour</span> = <span class="ruby-identifier">colour</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>calculate_tick_distance (Bio::Graphics::Panel::Ruler)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 35</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calculate_tick_distance</span>
15
+ <span class="ruby-identifier">min_tick_distance_requirement_met</span> = <span class="ruby-keyword kw">false</span>
16
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> = <span class="ruby-value">1</span> <span class="ruby-comment cmt"># in basepairs.
17
+ <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">min_tick_distance_requirement_met</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span><span class="ruby-operator">/</span><span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">RULER_MIN_DISTANCE_TICKS_PIXEL</span>
19
+ <span class="ruby-identifier">min_tick_distance_requirement_met</span> = <span class="ruby-keyword kw">true</span>
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span><span class="ruby-operator">*</span><span class="ruby-value">5</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+
25
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">major_tick_distance</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>
26
+ <span class="ruby-keyword kw">end</span></pre>
27
+ </body>
28
+ </html>
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw (Bio::Graphics::Panel::Ruler)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 49</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw</span>(<span class="ruby-identifier">panel_drawing</span>, <span class="ruby-identifier">vertical_offset</span>)
15
+ <span class="ruby-identifier">ruler_drawing</span> = <span class="ruby-constant">Cairo</span><span class="ruby-operator">::</span><span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">panel_drawing</span>)
16
+
17
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">calculate_tick_distance</span>
18
+
19
+ <span class="ruby-comment cmt"># Draw line
20
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-value">0</span>,<span class="ruby-value">10</span>)
21
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">width</span>, <span class="ruby-value">10</span>)
22
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">stroke</span>
23
+
24
+ <span class="ruby-comment cmt"># Draw ticks
25
+ <span class="ruby-comment cmt"># * Find position of first tick.
26
+ <span class="ruby-comment cmt"># Most of the time, we don't want the first tick on the very first
27
+ <span class="ruby-comment cmt"># basepair of the view. Suppose that would be position 333 in the
28
+ <span class="ruby-comment cmt"># sequence. Then the numbers under the major tickmarks would be:
29
+ <span class="ruby-comment cmt"># 343, 353, 363, 373 and so on. Instead, we want 350, 360, 370, 380.
30
+ <span class="ruby-comment cmt"># So we want to find the position of the first tick.
31
+ <span class="ruby-identifier">first_tick_position</span> = <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>
32
+ <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">first_tick_position</span>.<span class="ruby-identifier">modulo</span>(<span class="ruby-identifier">minor_tick_distance</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
33
+ <span class="ruby-identifier">first_tick_position</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
34
+ <span class="ruby-keyword kw">end</span>
35
+
36
+ <span class="ruby-comment cmt"># * And start drawing the rest.
37
+ <span class="ruby-identifier">first_tick_position</span>.<span class="ruby-identifier">step</span>(<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_stop</span>, <span class="ruby-identifier">minor_tick_distance</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tick</span><span class="ruby-operator">|</span>
38
+ <span class="ruby-identifier">tick_pixel_position</span> = (<span class="ruby-identifier">tick</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>
39
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">tick_pixel_position</span>.<span class="ruby-identifier">floor</span>, <span class="ruby-value">5</span>)
40
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tick</span>.<span class="ruby-identifier">modulo</span>(<span class="ruby-identifier">major_tick_distance</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
41
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-value">0</span>, <span class="ruby-value">15</span>)
42
+
43
+ <span class="ruby-comment cmt"># Draw tick number
44
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">select_font_face</span>(<span class="ruby-operator">*</span>(<span class="ruby-constant">FONT</span>))
45
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">set_font_size</span>(<span class="ruby-constant">RULER_TEXT_HEIGHT</span>)
46
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">tick_pixel_position</span>.<span class="ruby-identifier">floor</span>, <span class="ruby-value">20</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RULER_TEXT_HEIGHT</span>)
47
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">show_text</span>(<span class="ruby-identifier">tick</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>)
48
+ <span class="ruby-keyword kw">else</span>
49
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-value">0</span>, <span class="ruby-value">5</span>)
50
+
51
+ <span class="ruby-keyword kw">end</span>
52
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">stroke</span>
53
+ <span class="ruby-keyword kw">end</span>
54
+
55
+
56
+ <span class="ruby-ivar">@height</span> = <span class="ruby-value">25</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RULER_TEXT_HEIGHT</span>
57
+ <span class="ruby-keyword kw">end</span></pre>
58
+ </body>
59
+ </html>