Worked on image save as a file in Moodle.
[moodle/mihaisucan.git] / lib / paintweb / docs / api-ref / symbols / pwlib.tools.eraser.html
blob4829d5e18761749d6b3aa3b0adecfed8350c7415
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">
4 <head>
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.eraser</title>
10 <style type="text/css">
11 /* default.css */
12 body
14 font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15 width: 800px;
18 .header
20 clear: both;
21 background-color: #ccc;
22 padding: 8px;
27 font-size: 150%;
28 font-weight: bold;
29 padding: 0;
30 margin: 1em 0 0 .3em;
35 border: none 0;
36 border-top: 1px solid #7F8FB1;
37 height: 1px;
40 pre.code
42 display: block;
43 padding: 8px;
44 border: 1px dashed #ccc;
47 #index
49 margin-top: 24px;
50 float: left;
51 width: 160px;
52 position: absolute;
53 left: 8px;
54 background-color: #F3F3F3;
55 padding: 8px;
58 #content
60 margin-left: 190px;
61 width: 600px;
64 .classList
66 list-style-type: none;
67 padding: 0;
68 margin: 0 0 0 8px;
69 font-family: arial, sans-serif;
70 font-size: 1em;
71 overflow: auto;
74 .classList li
76 padding: 0;
77 margin: 0 0 8px 0;
80 .summaryTable { width: 100%; }
82 h1.classTitle
84 font-size:170%;
85 line-height:130%;
88 h2 { font-size: 110%; }
89 caption, div.sectionTitle
91 background-color: #7F8FB1;
92 color: #fff;
93 font-size:130%;
94 text-align: left;
95 padding: 2px 6px 2px 6px;
96 border: 1px #7F8FB1 solid;
99 div.sectionTitle { margin-bottom: 8px; }
100 .summaryTable thead { display: none; }
102 .summaryTable td
104 vertical-align: top;
105 padding: 4px;
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;
114 width: 140px;
115 text-align: right;
118 td.attributes, .fixedFont
120 line-height: 15px;
121 color: #002EBE;
122 font-family: "Courier New",Courier,monospace;
123 font-size: 13px;
126 .summaryTable td.nameDescription
128 text-align: left;
129 font-size: 13px;
130 line-height: 15px;
133 .summaryTable td.nameDescription, .description
135 line-height: 15px;
136 padding: 4px;
137 padding-left: 4px;
140 .summaryTable { margin-bottom: 8px; }
142 ul.inheritsList
144 list-style: square;
145 margin-left: 20px;
146 padding-left: 0;
149 .detailList {
150 margin-left: 20px;
151 line-height: 15px;
153 .detailList dt { margin-left: 20px; }
155 .detailList .heading
157 font-weight: bold;
158 padding-bottom: 6px;
159 margin-left: 0;
162 .light, td.attributes, .light a:link, .light a:visited
164 color: #777;
165 font-style: italic;
168 .fineprint
170 text-align: right;
171 font-size: 10px;
173 </style>
174 </head>
176 <body>
177 <!-- ============================== header ================================= -->
178 <!-- begin static/header.html -->
179 <div id="header">
180 </div>
181 <!-- end static/header.html -->
183 <!-- ============================== classes index ============================ -->
184 <div id="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>
188 <hr />
189 <h2>Classes</h2>
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>
316 </ul>
317 <hr />
318 <!-- end publish.classesIndex -->
319 </div>
321 <div id="content">
322 <!-- ============================== class title ============================ -->
323 <h1 class="classTitle">
325 Class pwlib.tools.eraser
326 </h1>
328 <!-- ============================== class summary ========================== -->
329 <p class="description">
332 The eraser tool.
335 <br /><i>Defined in: </i> <a href="../symbols/src/src_tools_eraser.js.html">eraser.js</a>.
337 </p>
339 <!-- ============================== constructor summary ==================== -->
341 <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class pwlib.tools.eraser.">
342 <caption>Class Summary</caption>
343 <thead>
344 <tr>
345 <th scope="col">Constructor Attributes</th>
346 <th scope="col">Constructor Name and Description</th>
347 </tr>
348 </thead>
349 <tbody>
350 <tr>
351 <td class="attributes">&nbsp;</td>
352 <td class="nameDescription" >
353 <div class="fixedFont">
354 <b><a href="../symbols/pwlib.tools.eraser.html#constructor">pwlib.tools.eraser</a></b>(app)
355 </div>
356 <div class="description"></div>
357 </td>
358 </tr>
359 </tbody>
360 </table>
363 <!-- ============================== properties summary ===================== -->
367 <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class pwlib.tools.eraser.">
368 <caption>Field Summary</caption>
369 <thead>
370 <tr>
371 <th scope="col">Field Attributes</th>
372 <th scope="col">Field Name and Description</th>
373 </tr>
374 </thead>
375 <tbody>
377 <tr>
378 <td class="attributes">&lt;private&gt; &lt;inner&gt; &nbsp;</td>
379 <td class="nameDescription">
380 <div class="fixedFont">
381 <b><a href="../symbols/pwlib.tools.eraser.html#-points">points</a></b>
382 </div>
383 <div class="description">Holds the points needed to be drawn.</div>
384 </td>
385 </tr>
387 <tr>
388 <td class="attributes">&lt;private&gt; &lt;inner&gt; &nbsp;</td>
389 <td class="nameDescription">
390 <div class="fixedFont">
391 <b><a href="../symbols/pwlib.tools.eraser.html#-timer">timer</a></b>
392 </div>
393 <div class="description">The interval ID used for running the pencil drawing operation every few
394 milliseconds.</div>
395 </td>
396 </tr>
398 <tr>
399 <td class="attributes">&lt;private&gt; &lt;inner&gt; &nbsp;</td>
400 <td class="nameDescription">
401 <div class="fixedFont">
402 <b><a href="../symbols/pwlib.tools.eraser.html#-x0">x0</a></b>
403 </div>
404 <div class="description">Holds the starting point on the <var>x</var> axis of the image, for the
405 current drawing operation.</div>
406 </td>
407 </tr>
409 <tr>
410 <td class="attributes">&lt;private&gt; &lt;inner&gt; &nbsp;</td>
411 <td class="nameDescription">
412 <div class="fixedFont">
413 <b><a href="../symbols/pwlib.tools.eraser.html#-y0">y0</a></b>
414 </div>
415 <div class="description">Holds the starting point on the <var>y</var> axis of the image, for the
416 current drawing operation.</div>
417 </td>
418 </tr>
420 </tbody>
421 </table>
427 <!-- ============================== methods summary ======================== -->
431 <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class pwlib.tools.eraser.">
432 <caption>Method Summary</caption>
433 <thead>
434 <tr>
435 <th scope="col">Method Attributes</th>
436 <th scope="col">Method Name and Description</th>
437 </tr>
438 </thead>
439 <tbody>
441 <tr>
442 <td class="attributes">&nbsp;</td>
443 <td class="nameDescription">
444 <div class="fixedFont"><b><a href="../symbols/pwlib.tools.eraser.html#activate">activate</a></b>()
445 </div>
446 <div class="description">The tool activation event handler.</div>
447 </td>
448 </tr>
450 <tr>
451 <td class="attributes">&nbsp;</td>
452 <td class="nameDescription">
453 <div class="fixedFont"><b><a href="../symbols/pwlib.tools.eraser.html#deactivate">deactivate</a></b>()
454 </div>
455 <div class="description">The tool deactivation event handler.</div>
456 </td>
457 </tr>
459 <tr>
460 <td class="attributes">&nbsp;</td>
461 <td class="nameDescription">
462 <div class="fixedFont"><b><a href="../symbols/pwlib.tools.eraser.html#draw">draw</a></b>()
463 </div>
464 <div class="description">Draw the points in the stack.</div>
465 </td>
466 </tr>
468 <tr>
469 <td class="attributes">&nbsp;</td>
470 <td class="nameDescription">
471 <div class="fixedFont"><b><a href="../symbols/pwlib.tools.eraser.html#keydown">keydown</a></b>(ev)
472 </div>
473 <div class="description">Allows the user to press <kbd>Escape</kbd> to cancel the drawing operation.</div>
474 </td>
475 </tr>
477 <tr>
478 <td class="attributes">&nbsp;</td>
479 <td class="nameDescription">
480 <div class="fixedFont"><b><a href="../symbols/pwlib.tools.eraser.html#mousedown">mousedown</a></b>()
481 </div>
482 <div class="description">Initialize the drawing operation.</div>
483 </td>
484 </tr>
486 <tr>
487 <td class="attributes">&nbsp;</td>
488 <td class="nameDescription">
489 <div class="fixedFont"><b><a href="../symbols/pwlib.tools.eraser.html#mousemove">mousemove</a></b>()
490 </div>
491 <div class="description">Save the mouse coordinates in the array.</div>
492 </td>
493 </tr>
495 <tr>
496 <td class="attributes">&nbsp;</td>
497 <td class="nameDescription">
498 <div class="fixedFont"><b><a href="../symbols/pwlib.tools.eraser.html#mouseup">mouseup</a></b>()
499 </div>
500 <div class="description">End the drawing operation, once the user releases the mouse button.</div>
501 </td>
502 </tr>
504 </tbody>
505 </table>
510 <!-- ============================== events summary ======================== -->
513 <!-- ============================== constructor details ==================== -->
515 <div class="details"><a name="constructor"> </a>
516 <div class="sectionTitle">
517 Class Detail
518 </div>
520 <div class="fixedFont">
521 <b>pwlib.tools.eraser</b>(app)
522 </div>
524 <div class="description">
527 </div>
533 <dl class="detailList">
534 <dt class="heading">Parameters:</dt>
536 <dt>
537 <span class="light fixedFont">{<a href="../symbols/PaintWeb.html">PaintWeb</a>}</span> <b>app</b>
539 </dt>
540 <dd>Reference to the main paint application object.</dd>
542 </dl>
551 </div>
554 <!-- ============================== field details ========================== -->
556 <div class="sectionTitle">
557 Field Detail
558 </div>
560 <a name="-points"> </a>
561 <div class="fixedFont">&lt;private&gt; &lt;inner&gt;
563 <span class="light">{Array}</span>
564 <b>points</b>
566 </div>
567 <div class="description">
568 Holds the points needed to be drawn. Each point is added by the
569 <code>mousemove</code> event handler.
572 </div>
581 <hr />
583 <a name="-timer"> </a>
584 <div class="fixedFont">&lt;private&gt; &lt;inner&gt;
587 <b>timer</b>
589 </div>
590 <div class="description">
591 The interval ID used for running the pencil drawing operation every few
592 milliseconds.
595 </div>
602 <dl class="detailList">
603 <dt class="heading">See:</dt>
605 <dd>PaintWeb.config.toolDrawDelay</dd>
607 </dl>
611 <hr />
613 <a name="-x0"> </a>
614 <div class="fixedFont">&lt;private&gt; &lt;inner&gt;
616 <span class="light">{Number}</span>
617 <b>x0</b>
619 </div>
620 <div class="description">
621 Holds the starting point on the <var>x</var> axis of the image, for the
622 current drawing operation.
625 </div>
634 <hr />
636 <a name="-y0"> </a>
637 <div class="fixedFont">&lt;private&gt; &lt;inner&gt;
639 <span class="light">{Number}</span>
640 <b>y0</b>
642 </div>
643 <div class="description">
644 Holds the starting point on the <var>y</var> axis of the image, for the
645 current drawing operation.
648 </div>
661 <!-- ============================== method details ========================= -->
663 <div class="sectionTitle">
664 Method Detail
665 </div>
667 <a name="activate"> </a>
668 <div class="fixedFont">
671 <b>activate</b>()
673 </div>
674 <div class="description">
675 The tool activation event handler. This is run after the tool construction
676 and after the deactivation of the previous tool. This function simply
677 disallows the rendering of shadows.
680 </div>
692 <hr />
694 <a name="deactivate"> </a>
695 <div class="fixedFont">
698 <b>deactivate</b>()
700 </div>
701 <div class="description">
702 The tool deactivation event handler. This function clears timers, clears
703 the canvas and allows shadows to be rendered again.
706 </div>
718 <hr />
720 <a name="draw"> </a>
721 <div class="fixedFont">
724 <b>draw</b>()
726 </div>
727 <div class="description">
728 Draw the points in the stack. This function is called every few
729 milliseconds.
732 </div>
743 <dl class="detailList">
744 <dt class="heading">See:</dt>
746 <dd>PaintWeb.config.toolDrawDelay</dd>
748 </dl>
751 <hr />
753 <a name="keydown"> </a>
754 <div class="fixedFont">
756 <span class="light">{Boolean}</span>
757 <b>keydown</b>(ev)
759 </div>
760 <div class="description">
761 Allows the user to press <kbd>Escape</kbd> to cancel the drawing operation.
764 </div>
769 <dl class="detailList">
770 <dt class="heading">Parameters:</dt>
772 <dt>
773 <span class="light fixedFont">{Event}</span> <b>ev</b>
775 </dt>
776 <dd>The DOM Event object.</dd>
778 </dl>
784 <dl class="detailList">
785 <dt class="heading">Returns:</dt>
787 <dd><span class="light fixedFont">{Boolean}</span> True if the drawing operation was cancelled, or false if
788 not.</dd>
790 </dl>
795 <hr />
797 <a name="mousedown"> </a>
798 <div class="fixedFont">
801 <b>mousedown</b>()
803 </div>
804 <div class="description">
805 Initialize the drawing operation.
808 </div>
820 <hr />
822 <a name="mousemove"> </a>
823 <div class="fixedFont">
826 <b>mousemove</b>()
828 </div>
829 <div class="description">
830 Save the mouse coordinates in the array.
833 </div>
845 <hr />
847 <a name="mouseup"> </a>
848 <div class="fixedFont">
851 <b>mouseup</b>()
853 </div>
854 <div class="description">
855 End the drawing operation, once the user releases the mouse button.
858 </div>
874 <!-- ============================== event details ========================= -->
877 <hr />
878 </div>
881 <!-- ============================== footer ================================= -->
882 <div class="fineprint" style="clear:both">
884 Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Mon Jul 27 2009 14:56:58 GMT+0300 (EEST)
885 </div>
886 </body>
887 </html>