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 - pwlib.tools.line
</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/PaintWeb.html">PaintWeb
</a></li>
196 <li><a href=
"../symbols/pwlib.html">pwlib
</a></li>
198 <li><a href=
"../symbols/pwlib.appEvent.html">pwlib.appEvent
</a></li>
200 <li><a href=
"../symbols/pwlib.appEvent.appDestroy.html">pwlib.appEvent.appDestroy
</a></li>
202 <li><a href=
"../symbols/pwlib.appEvent.appInit.html">pwlib.appEvent.appInit
</a></li>
204 <li><a href=
"../symbols/pwlib.appEvent.canvasSizeChange.html">pwlib.appEvent.canvasSizeChange
</a></li>
206 <li><a href=
"../symbols/pwlib.appEvent.clipboardUpdate.html">pwlib.appEvent.clipboardUpdate
</a></li>
208 <li><a href=
"../symbols/pwlib.appEvent.commandRegister.html">pwlib.appEvent.commandRegister
</a></li>
210 <li><a href=
"../symbols/pwlib.appEvent.commandUnregister.html">pwlib.appEvent.commandUnregister
</a></li>
212 <li><a href=
"../symbols/pwlib.appEvent.configChange.html">pwlib.appEvent.configChange
</a></li>
214 <li><a href=
"../symbols/pwlib.appEvent.extensionRegister.html">pwlib.appEvent.extensionRegister
</a></li>
216 <li><a href=
"../symbols/pwlib.appEvent.extensionUnregister.html">pwlib.appEvent.extensionUnregister
</a></li>
218 <li><a href=
"../symbols/pwlib.appEvent.guiFloatingPanelStateChange.html">pwlib.appEvent.guiFloatingPanelStateChange
</a></li>
220 <li><a href=
"../symbols/pwlib.appEvent.guiHide.html">pwlib.appEvent.guiHide
</a></li>
222 <li><a href=
"../symbols/pwlib.appEvent.guiResizeEnd.html">pwlib.appEvent.guiResizeEnd
</a></li>
224 <li><a href=
"../symbols/pwlib.appEvent.guiResizeStart.html">pwlib.appEvent.guiResizeStart
</a></li>
226 <li><a href=
"../symbols/pwlib.appEvent.guiShow.html">pwlib.appEvent.guiShow
</a></li>
228 <li><a href=
"../symbols/pwlib.appEvent.guiTabActivate.html">pwlib.appEvent.guiTabActivate
</a></li>
230 <li><a href=
"../symbols/pwlib.appEvent.historyUpdate.html">pwlib.appEvent.historyUpdate
</a></li>
232 <li><a href=
"../symbols/pwlib.appEvent.imageCrop.html">pwlib.appEvent.imageCrop
</a></li>
234 <li><a href=
"../symbols/pwlib.appEvent.imageSave.html">pwlib.appEvent.imageSave
</a></li>
236 <li><a href=
"../symbols/pwlib.appEvent.imageSaveResult.html">pwlib.appEvent.imageSaveResult
</a></li>
238 <li><a href=
"../symbols/pwlib.appEvent.imageSizeChange.html">pwlib.appEvent.imageSizeChange
</a></li>
240 <li><a href=
"../symbols/pwlib.appEvent.imageZoom.html">pwlib.appEvent.imageZoom
</a></li>
242 <li><a href=
"../symbols/pwlib.appEvent.selectionChange.html">pwlib.appEvent.selectionChange
</a></li>
244 <li><a href=
"../symbols/pwlib.appEvent.shadowAllow.html">pwlib.appEvent.shadowAllow
</a></li>
246 <li><a href=
"../symbols/pwlib.appEvent.toolActivate.html">pwlib.appEvent.toolActivate
</a></li>
248 <li><a href=
"../symbols/pwlib.appEvent.toolPreactivate.html">pwlib.appEvent.toolPreactivate
</a></li>
250 <li><a href=
"../symbols/pwlib.appEvent.toolRegister.html">pwlib.appEvent.toolRegister
</a></li>
252 <li><a href=
"../symbols/pwlib.appEvent.toolUnregister.html">pwlib.appEvent.toolUnregister
</a></li>
254 <li><a href=
"../symbols/pwlib.appEvents.html">pwlib.appEvents
</a></li>
256 <li><a href=
"../symbols/pwlib.browser.html">pwlib.browser
</a></li>
258 <li><a href=
"../symbols/pwlib.dom.html">pwlib.dom
</a></li>
260 <li><a href=
"../symbols/pwlib.dom.KeyboardEventListener.html">pwlib.dom.KeyboardEventListener
</a></li>
262 <li><a href=
"../symbols/pwlib.dom.keyCodes.html">pwlib.dom.keyCodes
</a></li>
264 <li><a href=
"../symbols/pwlib.dom.keyCodes_fixes.html">pwlib.dom.keyCodes_fixes
</a></li>
266 <li><a href=
"../symbols/pwlib.dom.keyCodes_Safari2.html">pwlib.dom.keyCodes_Safari2
</a></li>
268 <li><a href=
"../symbols/pwlib.dom.keyNames.html">pwlib.dom.keyNames
</a></li>
270 <li><a href=
"../symbols/pwlib.extensions.html">pwlib.extensions
</a></li>
272 <li><a href=
"../symbols/pwlib.extensions.colormixer.html">pwlib.extensions.colormixer
</a></li>
274 <li><a href=
"../symbols/pwlib.extensions.moodle.html">pwlib.extensions.moodle
</a></li>
276 <li><a href=
"../symbols/pwlib.extensions.mousekeys.html">pwlib.extensions.mousekeys
</a></li>
278 <li><a href=
"../symbols/pwlib.fileCache.html">pwlib.fileCache
</a></li>
280 <li><a href=
"../symbols/pwlib.gui.html">pwlib.gui
</a></li>
282 <li><a href=
"../symbols/pwlib.guiColorInput.html">pwlib.guiColorInput
</a></li>
284 <li><a href=
"../symbols/pwlib.guiFloatingPanel.html">pwlib.guiFloatingPanel
</a></li>
286 <li><a href=
"../symbols/pwlib.guiResizer.html">pwlib.guiResizer
</a></li>
288 <li><a href=
"../symbols/pwlib.guiTabPanel.html">pwlib.guiTabPanel
</a></li>
290 <li><a href=
"../symbols/pwlib.tools.html">pwlib.tools
</a></li>
292 <li><a href=
"../symbols/pwlib.tools.bcurve.html">pwlib.tools.bcurve
</a></li>
294 <li><a href=
"../symbols/pwlib.tools.cpicker.html">pwlib.tools.cpicker
</a></li>
296 <li><a href=
"../symbols/pwlib.tools.ellipse.html">pwlib.tools.ellipse
</a></li>
298 <li><a href=
"../symbols/pwlib.tools.eraser.html">pwlib.tools.eraser
</a></li>
300 <li><a href=
"../symbols/pwlib.tools.hand.html">pwlib.tools.hand
</a></li>
302 <li><a href=
"../symbols/pwlib.tools.insertimg.html">pwlib.tools.insertimg
</a></li>
304 <li><a href=
"../symbols/pwlib.tools.line.html">pwlib.tools.line
</a></li>
306 <li><a href=
"../symbols/pwlib.tools.pencil.html">pwlib.tools.pencil
</a></li>
308 <li><a href=
"../symbols/pwlib.tools.polygon.html">pwlib.tools.polygon
</a></li>
310 <li><a href=
"../symbols/pwlib.tools.rectangle.html">pwlib.tools.rectangle
</a></li>
312 <li><a href=
"../symbols/pwlib.tools.selection.html">pwlib.tools.selection
</a></li>
314 <li><a href=
"../symbols/pwlib.tools.text.html">pwlib.tools.text
</a></li>
318 <!-- end publish.classesIndex -->
322 <!-- ============================== class title ============================ -->
323 <h1 class=
"classTitle">
325 Class pwlib.tools.line
328 <!-- ============================== class summary ========================== -->
329 <p class=
"description">
335 <br /><i>Defined in:
</i> <a href=
"../symbols/src/src_tools_line.js.html">line.js
</a>.
339 <!-- ============================== constructor summary ==================== -->
341 <table class=
"summaryTable" cellspacing=
"0" summary=
"A summary of the constructor documented in the class pwlib.tools.line.">
342 <caption>Class Summary
</caption>
345 <th scope=
"col">Constructor Attributes
</th>
346 <th scope=
"col">Constructor Name and Description
</th>
351 <td class=
"attributes"> </td>
352 <td class=
"nameDescription" >
353 <div class=
"fixedFont">
354 <b><a href=
"../symbols/pwlib.tools.line.html#constructor">pwlib.tools.line
</a></b>(app)
356 <div class=
"description"></div>
363 <!-- ============================== properties summary ===================== -->
367 <table class=
"summaryTable" cellspacing=
"0" summary=
"A summary of the fields documented in the class pwlib.tools.line.">
368 <caption>Field Summary
</caption>
371 <th scope=
"col">Field Attributes
</th>
372 <th scope=
"col">Field Name and Description
</th>
378 <td class=
"attributes"><private
> <inner
> </td>
379 <td class=
"nameDescription">
380 <div class=
"fixedFont">
381 <b><a href=
"../symbols/pwlib.tools.line.html#-needsRedraw">needsRedraw
</a></b>
383 <div class=
"description">Tells if the drawing canvas needs to be updated or not.
</div>
388 <td class=
"attributes"><private
> <inner
> </td>
389 <td class=
"nameDescription">
390 <div class=
"fixedFont">
391 <b><a href=
"../symbols/pwlib.tools.line.html#-shiftKey">shiftKey
</a></b>
393 <div class=
"description">Tells if the
<kbd>Shift
</kbd> key is down or not.
</div>
398 <td class=
"attributes"><private
> <inner
> </td>
399 <td class=
"nameDescription">
400 <div class=
"fixedFont">
401 <b><a href=
"../symbols/pwlib.tools.line.html#-timer">timer
</a></b>
403 <div class=
"description">The interval ID used for invoking the drawing operation every few
409 <td class=
"attributes"><private
> <inner
> </td>
410 <td class=
"nameDescription">
411 <div class=
"fixedFont">
412 <b><a href=
"../symbols/pwlib.tools.line.html#-x0">x0
</a></b>
414 <div class=
"description">Holds the starting point on the
<var>x
</var> axis of the image, for the
415 current drawing operation.
</div>
420 <td class=
"attributes"><private
> <inner
> </td>
421 <td class=
"nameDescription">
422 <div class=
"fixedFont">
423 <b><a href=
"../symbols/pwlib.tools.line.html#-y0">y0
</a></b>
425 <div class=
"description">Holds the starting point on the
<var>y
</var> axis of the image, for the
426 current drawing operation.
</div>
437 <!-- ============================== methods summary ======================== -->
441 <table class=
"summaryTable" cellspacing=
"0" summary=
"A summary of the methods documented in the class pwlib.tools.line.">
442 <caption>Method Summary
</caption>
445 <th scope=
"col">Method Attributes
</th>
446 <th scope=
"col">Method Name and Description
</th>
452 <td class=
"attributes"> </td>
453 <td class=
"nameDescription">
454 <div class=
"fixedFont"><b><a href=
"../symbols/pwlib.tools.line.html#deactivate">deactivate
</a></b>()
456 <div class=
"description">Tool deactivation event handler.
</div>
461 <td class=
"attributes"> </td>
462 <td class=
"nameDescription">
463 <div class=
"fixedFont"><b><a href=
"../symbols/pwlib.tools.line.html#draw">draw
</a></b>()
465 <div class=
"description">Perform the drawing operation.
</div>
470 <td class=
"attributes"> </td>
471 <td class=
"nameDescription">
472 <div class=
"fixedFont"><b><a href=
"../symbols/pwlib.tools.line.html#keydown">keydown
</a></b>(ev)
474 <div class=
"description">Allows the user to press
<kbd>Escape
</kbd> to cancel the drawing operation.
</div>
479 <td class=
"attributes"> </td>
480 <td class=
"nameDescription">
481 <div class=
"fixedFont"><b><a href=
"../symbols/pwlib.tools.line.html#mousedown">mousedown
</a></b>(ev)
483 <div class=
"description">Initialize the drawing operation, by storing the location of the pointer,
484 the start position.
</div>
489 <td class=
"attributes"> </td>
490 <td class=
"nameDescription">
491 <div class=
"fixedFont"><b><a href=
"../symbols/pwlib.tools.line.html#mousemove">mousemove
</a></b>(ev)
493 <div class=
"description">Store the
<kbd>Shift
</kbd> key state which is used by the drawing function.
</div>
498 <td class=
"attributes"> </td>
499 <td class=
"nameDescription">
500 <div class=
"fixedFont"><b><a href=
"../symbols/pwlib.tools.line.html#mouseup">mouseup
</a></b>(ev)
502 <div class=
"description">End the drawing operation, once the user releases the mouse button.
</div>
512 <!-- ============================== events summary ======================== -->
515 <!-- ============================== constructor details ==================== -->
517 <div class=
"details"><a name=
"constructor"> </a>
518 <div class=
"sectionTitle">
522 <div class=
"fixedFont">
523 <b>pwlib.tools.line
</b>(app)
526 <div class=
"description">
535 <dl class=
"detailList">
536 <dt class=
"heading">Parameters:
</dt>
539 <span class=
"light fixedFont">{
<a href=
"../symbols/PaintWeb.html">PaintWeb
</a>}
</span> <b>app
</b>
542 <dd>Reference to the main paint application object.
</dd>
556 <!-- ============================== field details ========================== -->
558 <div class=
"sectionTitle">
562 <a name=
"-needsRedraw"> </a>
563 <div class=
"fixedFont"><private
> <inner
>
565 <span class=
"light">{Boolean}
</span>
569 <div class=
"description">
570 Tells if the drawing canvas needs to be updated or not.
581 <dl class=
"detailList">
582 <dt class=
"heading">Default Value:
</dt>
591 <a name=
"-shiftKey"> </a>
592 <div class=
"fixedFont"><private
> <inner
>
594 <span class=
"light">{Boolean}
</span>
598 <div class=
"description">
599 Tells if the
<kbd>Shift
</kbd> key is down or not. This is used by the
611 <dl class=
"detailList">
612 <dt class=
"heading">Default Value:
</dt>
621 <a name=
"-timer"> </a>
622 <div class=
"fixedFont"><private
> <inner
>
628 <div class=
"description">
629 The interval ID used for invoking the drawing operation every few
640 <dl class=
"detailList">
641 <dt class=
"heading">See:
</dt>
643 <dd>PaintWeb.config.toolDrawDelay
</dd>
652 <div class=
"fixedFont"><private
> <inner
>
654 <span class=
"light">{Number}
</span>
658 <div class=
"description">
659 Holds the starting point on the
<var>x
</var> axis of the image, for the
660 current drawing operation.
675 <div class=
"fixedFont"><private
> <inner
>
677 <span class=
"light">{Number}
</span>
681 <div class=
"description">
682 Holds the starting point on the
<var>y
</var> axis of the image, for the
683 current drawing operation.
699 <!-- ============================== method details ========================= -->
701 <div class=
"sectionTitle">
705 <a name=
"deactivate"> </a>
706 <div class=
"fixedFont">
712 <div class=
"description">
713 Tool deactivation event handler.
731 <div class=
"fixedFont">
737 <div class=
"description">
738 Perform the drawing operation. This function is called every few
741 <p>Hold down the
<kbd>Shift
</kbd> key to draw a straight
742 horizontal/vertical line.
743 <p>Press
<kbd>Escape
</kbd> to cancel the drawing operation.
757 <dl class=
"detailList">
758 <dt class=
"heading">See:
</dt>
760 <dd>PaintWeb.config.toolDrawDelay
</dd>
767 <a name=
"keydown"> </a>
768 <div class=
"fixedFont">
770 <span class=
"light">{Boolean}
</span>
774 <div class=
"description">
775 Allows the user to press
<kbd>Escape
</kbd> to cancel the drawing operation.
783 <dl class=
"detailList">
784 <dt class=
"heading">Parameters:
</dt>
787 <span class=
"light fixedFont">{Event}
</span> <b>ev
</b>
790 <dd>The DOM Event object.
</dd>
798 <dl class=
"detailList">
799 <dt class=
"heading">Returns:
</dt>
801 <dd><span class=
"light fixedFont">{Boolean}
</span> True if the drawing operation was cancelled, or false if
811 <a name=
"mousedown"> </a>
812 <div class=
"fixedFont">
818 <div class=
"description">
819 Initialize the drawing operation, by storing the location of the pointer,
828 <dl class=
"detailList">
829 <dt class=
"heading">Parameters:
</dt>
832 <span class=
"light fixedFont">{Event}
</span> <b>ev
</b>
835 <dd>The DOM Event object.
</dd>
848 <a name=
"mousemove"> </a>
849 <div class=
"fixedFont">
855 <div class=
"description">
856 Store the
<kbd>Shift
</kbd> key state which is used by the drawing function.
864 <dl class=
"detailList">
865 <dt class=
"heading">Parameters:
</dt>
868 <span class=
"light fixedFont">{Event}
</span> <b>ev
</b>
871 <dd>The DOM Event object.
</dd>
884 <a name=
"mouseup"> </a>
885 <div class=
"fixedFont">
891 <div class=
"description">
892 End the drawing operation, once the user releases the mouse button.
900 <dl class=
"detailList">
901 <dt class=
"heading">Parameters:
</dt>
904 <span class=
"light fixedFont">{Event}
</span> <b>ev
</b>
907 <dd>The DOM Event object.
</dd>
922 <!-- ============================== event details ========================= -->
929 <!-- ============================== footer ================================= -->
930 <div class=
"fineprint" style=
"clear:both">
932 Documentation generated by
<a href=
"http://code.google.com/p/jsdoc-toolkit/" target=
"_blank">JsDoc Toolkit
</a> 2.3.0 on Fri Jul
31 2009 20:
23:
24 GMT+
0300 (EEST)