1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
<meta name="generator" content="JsDoc Toolkit" />
8
<title>JsDoc Reference - ViewportHandlers</title>
10
<style type="text/css">
14
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
21
background-color: #ccc;
36
border-top: 1px solid #7F8FB1;
44
border: 1px dashed #ccc;
54
background-color: #F3F3F3;
66
list-style-type: none;
69
font-family: arial, sans-serif;
80
.summaryTable { width: 100%; }
88
h2 { font-size: 110%; }
89
caption, div.sectionTitle
91
background-color: #7F8FB1;
95
padding: 2px 6px 2px 6px;
96
border: 1px #7F8FB1 solid;
99
div.sectionTitle { margin-bottom: 8px; }
100
.summaryTable thead { display: none; }
106
border-bottom: 1px #7F8FB1 solid;
107
border-right: 1px #7F8FB1 solid;
110
/*col#summaryAttributes {}*/
111
.summaryTable td.attributes
113
border-left: 1px #7F8FB1 solid;
118
td.attributes, .fixedFont
122
font-family: "Courier New",Courier,monospace;
126
.summaryTable td.nameDescription
133
.summaryTable td.nameDescription, .description
140
.summaryTable { margin-bottom: 8px; }
153
.detailList dt { margin-left: 20px; }
162
.light, td.attributes, .light a:link, .light a:visited
177
<!-- ============================== header ================================= -->
178
<!-- begin static/header.html -->
181
<!-- end static/header.html -->
183
<!-- ============================== classes index ============================ -->
185
<!-- begin publish.classesIndex -->
186
<div align="center"><a href="../index.html">Class Index</a>
187
| <a href="../files.html">File Index</a></div>
190
<ul class="classList">
192
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
194
<li><a href="../symbols/Config.html">Config</a></li>
196
<li><a href="../symbols/Date.html">Date</a></li>
198
<li><a href="../symbols/EventLayer.html">EventLayer</a></li>
200
<li><a href="../symbols/EventLayerAccordion.html">EventLayerAccordion</a></li>
202
<li><a href="../symbols/EventLayerManager.html">EventLayerManager</a></li>
204
<li><a href="../symbols/EventMarker.html">EventMarker</a></li>
206
<li><a href="../symbols/EventTimeline.html">EventTimeline</a></li>
208
<li><a href="../symbols/Helioviewer.html">Helioviewer</a></li>
210
<li><a href="../symbols/IconPicker.html">IconPicker</a></li>
212
<li><a href="../symbols/ImageSelectTool.html">ImageSelectTool</a></li>
214
<li><a href="../symbols/KeyboardManager.html">KeyboardManager</a></li>
216
<li><a href="../symbols/Layer.html">Layer</a></li>
218
<li><a href="../symbols/LayerManager.html">LayerManager</a></li>
220
<li><a href="../symbols/Math.html">Math</a></li>
222
<li><a href="../symbols/MediaSettings.html">MediaSettings</a></li>
224
<li><a href="../symbols/MessageConsole.html">MessageConsole</a></li>
226
<li><a href="../symbols/MovieBuilder.html">MovieBuilder</a></li>
228
<li><a href="../symbols/ScreenshotBuilder.html">ScreenshotBuilder</a></li>
230
<li><a href="../symbols/String.html">String</a></li>
232
<li><a href="../symbols/TileLayer.html">TileLayer</a></li>
234
<li><a href="../symbols/TileLayerAccordion.html">TileLayerAccordion</a></li>
236
<li><a href="../symbols/TileLayerManager.html">TileLayerManager</a></li>
238
<li><a href="../symbols/Time.html">Time</a></li>
240
<li><a href="../symbols/TimeControls.html">TimeControls</a></li>
242
<li><a href="../symbols/TooltipHelper.html">TooltipHelper</a></li>
244
<li><a href="../symbols/TreeSelect.html">TreeSelect</a></li>
246
<li><a href="../symbols/UserSettings.html">UserSettings</a></li>
248
<li><a href="../symbols/Viewport.html">Viewport</a></li>
250
<li><a href="../symbols/ViewportHandlers.html">ViewportHandlers</a></li>
252
<li><a href="../symbols/ZoomControls.html">ZoomControls</a></li>
256
<!-- end publish.classesIndex -->
260
<!-- ============================== class title ============================ -->
261
<h1 class="classTitle">
263
Class ViewportHandlers
266
<!-- ============================== class summary ========================== -->
267
<p class="description">
274
<br /><i>Defined in: </i> <a href="../symbols/src/lib_helioviewer_ViewportHandlers.js.html">ViewportHandlers.js</a>.
278
<!-- ============================== constructor summary ==================== -->
280
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class ViewportHandlers.">
281
<caption>Class Summary</caption>
284
<th scope="col">Constructor Attributes</th>
285
<th scope="col">Constructor Name and Description</th>
290
<td class="attributes"> </td>
291
<td class="nameDescription" >
292
<div class="fixedFont">
293
<b><a href="../symbols/ViewportHandlers.html#constructor">ViewportHandlers</a></b>(viewport)
295
<div class="description">Contains a collection of event-handlers for dealing with Viewport-related events</div>
302
<!-- ============================== properties summary ===================== -->
305
<!-- ============================== methods summary ======================== -->
309
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class ViewportHandlers.">
310
<caption>Method Summary</caption>
313
<th scope="col">Method Attributes</th>
314
<th scope="col">Method Name and Description</th>
320
<td class="attributes"><private> </td>
321
<td class="nameDescription">
322
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#_initEvents">_initEvents</a></b>()
324
<div class="description"></div>
329
<td class="attributes"> </td>
330
<td class="nameDescription">
331
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#computeMouseCoords">computeMouseCoords</a></b>(screenX, screenY)
333
<div class="description">Computes the scaled mouse coordinates relative to the size and center of the Sun.</div>
338
<td class="attributes"> </td>
339
<td class="nameDescription">
340
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#doubleClick">doubleClick</a></b>(e)
342
<div class="description">Handles double-clicks</div>
347
<td class="attributes"> </td>
348
<td class="nameDescription">
349
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#getRelativeCoords">getRelativeCoords</a></b>(screenx, screeny)
351
<div class="description">Get the mouse-coords relative to top-left of the viewport frame</div>
356
<td class="attributes"> </td>
357
<td class="nameDescription">
358
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#mouseDown">mouseDown</a></b>(event)
360
<div class="description">Fired when a mouse is pressed</div>
365
<td class="attributes"> </td>
366
<td class="nameDescription">
367
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#mouseMove">mouseMove</a></b>(an)
369
<div class="description">Handle drag events</div>
374
<td class="attributes"> </td>
375
<td class="nameDescription">
376
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#mouseUp">mouseUp</a></b>(event)
378
<div class="description">Fired when a mouse button is released</div>
383
<td class="attributes"> </td>
384
<td class="nameDescription">
385
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#mouseWheel">mouseWheel</a></b>(event, delta)
387
<div class="description">Handles mouse-wheel movements</div>
392
<td class="attributes"> </td>
393
<td class="nameDescription">
394
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#toggleMouseCoords">toggleMouseCoords</a></b>()
396
<div class="description">Toggles mouse-coords visibility
398
TODO (2009/07/27) Disable mouse-coords display during drag & drop</div>
403
<td class="attributes"> </td>
404
<td class="nameDescription">
405
<div class="fixedFont"><b><a href="../symbols/ViewportHandlers.html#updateShadows">updateShadows</a></b>()
407
<div class="description">Adds an animated text shadow based on the position and size of the Sun (Firefox 3.5+)
409
TODO: Apply to other text based on it's position on screen? Adjust blue based on zoom-level?
410
Use viewport size to determine appropriate scales for X & Y offsets (normalize)
411
Re-use computeCoordinates?</div>
421
<!-- ============================== events summary ======================== -->
424
<!-- ============================== constructor details ==================== -->
426
<div class="details"><a name="constructor"> </a>
427
<div class="sectionTitle">
431
<div class="fixedFont">
432
<b>ViewportHandlers</b>(viewport)
435
<div class="description">
436
Contains a collection of event-handlers for dealing with Viewport-related events
444
<dl class="detailList">
445
<dt class="heading">Parameters:</dt>
448
<span class="light fixedFont">{Object}</span> <b>viewport</b>
451
<dd>A Reference to the Helioviewer application class</dd>
461
<dl class="detailList">
462
<dt class="heading">See:</dt>
464
<dd><a href="../symbols/Viewport.html">Viewport</a></dd>
472
<!-- ============================== field details ========================== -->
475
<!-- ============================== method details ========================= -->
477
<div class="sectionTitle">
481
<a name="_initEvents"> </a>
482
<div class="fixedFont"><private>
488
<div class="description">
506
<a name="computeMouseCoords"> </a>
507
<div class="fixedFont">
510
<b>computeMouseCoords</b>(screenX, screenY)
513
<div class="description">
514
Computes the scaled mouse coordinates relative to the size and center of the Sun.
518
X = location of mouse-pointer
519
V = viewport top-left corner
520
S = sandbox top-left corner
521
M = moving container top-let corner
523
Each of the two-letter abbreviations represents the vector <x,y> going from one
524
location to the other. See wiki documentation below for more details.
532
<dl class="detailList">
533
<dt class="heading">Parameters:</dt>
555
<dl class="detailList">
556
<dt class="heading">See:</dt>
558
<dd>http://helioviewer.org/wiki/index.php?title=Co-ordinate_System_I</dd>
565
<a name="doubleClick"> </a>
566
<div class="fixedFont">
569
<b>doubleClick</b>(e)
572
<div class="description">
573
Handles double-clicks
581
<dl class="detailList">
582
<dt class="heading">Parameters:</dt>
585
<span class="light fixedFont">{Event}</span> <b>e</b>
601
<a name="getRelativeCoords"> </a>
602
<div class="fixedFont">
605
<b>getRelativeCoords</b>(screenx, screeny)
608
<div class="description">
609
Get the mouse-coords relative to top-left of the viewport frame
617
<dl class="detailList">
618
<dt class="heading">Parameters:</dt>
621
<span class="light fixedFont">{Int}</span> <b>screenx</b>
624
<dd>X-dimensions of the user's screen</dd>
627
<span class="light fixedFont">{Int}</span> <b>screeny</b>
630
<dd>Y-dimensions of the user's screen</dd>
643
<a name="mouseDown"> </a>
644
<div class="fixedFont">
647
<b>mouseDown</b>(event)
650
<div class="description">
651
Fired when a mouse is pressed
659
<dl class="detailList">
660
<dt class="heading">Parameters:</dt>
663
<span class="light fixedFont">{Event}</span> <b>event</b>
666
<dd>Prototype Event class</dd>
679
<a name="mouseMove"> </a>
680
<div class="fixedFont">
686
<div class="description">
695
<dl class="detailList">
696
<dt class="heading">Parameters:</dt>
699
<span class="light fixedFont">{Object}</span> <b>an</b>
702
<dd>Event object</dd>
715
<a name="mouseUp"> </a>
716
<div class="fixedFont">
719
<b>mouseUp</b>(event)
722
<div class="description">
723
Fired when a mouse button is released
731
<dl class="detailList">
732
<dt class="heading">Parameters:</dt>
735
<span class="light fixedFont">{Event}</span> <b>event</b>
738
<dd>Event object</dd>
751
<a name="mouseWheel"> </a>
752
<div class="fixedFont">
755
<b>mouseWheel</b>(event, delta)
758
<div class="description">
759
Handles mouse-wheel movements
767
<dl class="detailList">
768
<dt class="heading">Parameters:</dt>
771
<span class="light fixedFont">{Event}</span> <b>event</b>
793
<a name="toggleMouseCoords"> </a>
794
<div class="fixedFont">
797
<b>toggleMouseCoords</b>()
800
<div class="description">
801
Toggles mouse-coords visibility
803
TODO (2009/07/27) Disable mouse-coords display during drag & drop
820
<a name="updateShadows"> </a>
821
<div class="fixedFont">
824
<b>updateShadows</b>()
827
<div class="description">
828
Adds an animated text shadow based on the position and size of the Sun (Firefox 3.5+)
830
TODO: Apply to other text based on it's position on screen? Adjust blue based on zoom-level?
831
Use viewport size to determine appropriate scales for X & Y offsets (normalize)
832
Re-use computeCoordinates?
851
<!-- ============================== event details ========================= -->
858
<!-- ============================== footer ================================= -->
859
<div class="fineprint" style="clear:both">
861
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Sun Feb 07 2010 16:13:45 GMT-0500 (EST)