Class Index | File Index

Classes


Class pwlib.tools.polygon

The polygon tool.
Defined in: polygon.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>  
Holds the points in the polygon being drawn.
<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.
Method Summary
Method Attributes Method Name and Description
 
The tool deactivation method, used for clearing the buffer.
 
draw(ev)
Draw the polygon.
 
keydown(ev)
The keydown event handler.
 
The mousedown event handler.
 
Store the Shift key state which is used by the drawing function.
 
mouseup(ev)
The mouseup event handler.
Class Detail
pwlib.tools.polygon(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> {Array} points
Holds the points in the polygon being drawn.

<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
Method Detail
deactivate()
The tool deactivation method, used for clearing the buffer.

draw(ev)
Draw the polygon.
Parameters:
ev
See:
PaintWeb.config.toolDrawDelay

{Boolean} keydown(ev)
The keydown event handler. This method allows the user to cancel drawing the current polygon, using the Escape key. The Enter key can be used to accept the current polygon shape, and end the drawing operation.
Parameters:
{Event} ev
The DOM Event object.
Returns:
{Boolean} True if the keyboard shortcut was recognized, or false if not.

{Boolean} mousedown(ev)
The mousedown event handler.
Parameters:
{Event} ev
The DOM Event object.
Returns:
{Boolean} True if the event handler executed, or false if not.

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

{Boolean} mouseup(ev)
The mouseup event handler.
Parameters:
{Event} ev
The DOM Event object.
Returns:
{Boolean} True if the event handler executed, or false if not.

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