Class Index | File Index

Classes


Class pwlib.tools.rectangle

The rectangle tool.
Defined in: rectangle.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<private> <inner>  
Tells if the drawing canvas needs to be updated or not.
<private> <inner>  
Tells if the Shift key is down or not.
<private> <inner>  
The interval ID used for invoking the drawing 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
 
Tool deactivation event handler.
 
draw()
Perform the drawing operation.
 
keydown(ev)
Allows the user to press Escape to cancel the drawing operation.
 
Initialize the drawing operation.
 
Store the Shift key state which is used by the drawing function.
 
mouseup(ev)
End the drawing operation, once the user releases the mouse button.
Class Detail
pwlib.tools.rectangle(app)
Parameters:
{PaintWeb} app
Reference to the main paint application object.
Field Detail
<private> <inner> {Boolean} needsRedraw
Tells if the drawing canvas needs to be updated or not.
Default Value:
false

<private> <inner> {Boolean} shiftKey
Tells if the Shift key is down or not. This is used by the drawing function.
Default Value:
false

<private> <inner> timer
The interval ID used for invoking the drawing 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
deactivate()
Tool deactivation event handler.

draw()
Perform the drawing operation. This function is called every few milliseconds.

Hold down the Shift key to draw a square.

Press Escape to cancel the drawing operation.

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(ev)
Initialize the drawing operation.
Parameters:
{Event} ev
The DOM Event object.

mousemove(ev)
Store the Shift key state which is used by the drawing function.
Parameters:
{Event} ev
The DOM Event object.

mouseup(ev)
End the drawing operation, once the user releases the mouse button.
Parameters:
{Event} ev
The DOM Event object.

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