Class Index | File Index

Classes


Class pwlib.tools.eraser

The eraser tool.
Defined in: eraser.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<private> <inner>  
Holds the points needed to be drawn.
<private> <inner>  
The interval ID used for running the erasing operation every few milliseconds.
<private> <inner>  
x0
Holds the starting point on the x axis of the image, for the current drawing operation.
<private> <inner>  
y0
Holds the starting point on the y axis of the image, for the current drawing operation.
Method Summary
Method Attributes Method Name and Description
 
The tool activation event handler.
 
The tool deactivation event handler.
 
draw()
Draw the points in the stack.
 
keydown(ev)
Allows the user to press Escape to cancel the drawing operation.
 
Initialize the drawing operation.
 
Save the mouse coordinates in the array.
 
End the drawing operation, once the user releases the mouse button.
Class Detail
pwlib.tools.eraser(app)
Parameters:
{PaintWeb} app
Reference to the main paint application object.
Field Detail
<private> <inner> {Array} points
Holds the points needed to be drawn. Each point is added by the mousemove event handler.

<private> <inner> timer
The interval ID used for running the erasing operation every few milliseconds.
See:
PaintWeb.config.toolDrawDelay

<private> <inner> {Number} x0
Holds the starting point on the x axis of the image, for the current drawing operation.

<private> <inner> {Number} y0
Holds the starting point on the y axis of the image, for the current drawing operation.
Method Detail
activate()
The tool activation event handler. This is run after the tool construction and after the deactivation of the previous tool. This function simply disallows the rendering of shadows.

deactivate()
The tool deactivation event handler. This function clears timers, clears the canvas and allows shadows to be rendered again.

draw()
Draw the points in the stack. This function is called every few milliseconds.
See:
PaintWeb.config.toolDrawDelay

{Boolean} keydown(ev)
Allows the user to press Escape to cancel the drawing operation.
Parameters:
{Event} ev
The DOM Event object.
Returns:
{Boolean} True if the drawing operation was cancelled, or false if not.

mousedown()
Initialize the drawing operation.

mousemove()
Save the mouse coordinates in the array.

mouseup()
End the drawing operation, once the user releases the mouse button.

Documentation generated by JsDoc Toolkit 2.3.0 on Sat Jun 26 2010 21:57:02 GMT+0300 (EEST)