Class Index | File Index

Classes


Class adf.DrawPolyShapeAction


Extends .

Defined in: Action.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Extends adf.Action to handle user interaction witht the mouse in order to draw a polygon or polyline onto an adf.graphics.Element.
Method Summary
Method Attributes Method Name and Description
 
activate(element, callBack, continuousCallBack, graphicsElement)
This method activates the action and registers the required event listeners to handle mouse events in order to draw a polygon or polyline.
 
Deactivates the action by removing all event listeners that were created during activate().
 
Reactivates the action and the event listeners set by this action
Class Detail
adf.DrawPolyShapeAction(isPolygon)
Extends adf.Action to handle user interaction witht the mouse in order to draw a polygon or polyline onto an adf.graphics.Element.
Parameters:
{Boolean} isPolygon
When set to true the action draws an enclosed polygon otherwsie will draw a polyline
Method Detail
activate(element, callBack, continuousCallBack, graphicsElement)
This method activates the action and registers the required event listeners to handle mouse events in order to draw a polygon or polyline. The second parameter callBack(), a function, will be executed when the ondblclick event has been fired. Its will be called with a single parameter, an Array of adf.Point objects. This will complete the drawing of the shape. The third parameter continuousCallBack(), also a function, will be called each time the onmouseup event has been fired after the onmousedown event has been fired and before the ondblclick event has been fired. Its only parameter will be an adf.Point object with coordinates representing where the onclick has fired on the element receiving the event.
Parameters:
{HTMLElement} element
The HTML element that is the action's container on which the events are attached
{Function} callBack
Callback function to be called after action is completed
{Function} continuousCallBack
Continuous callback function is called as the line is being drawn
{adf.graphics.Element} graphicsElement
Parameter to set graphics container for the action.

deactivate()
Deactivates the action by removing all event listeners that were created during activate(). If a an adf.graphics.Element was created, this element will be destroyed since it is no longer used.

reactivate()
Reactivates the action and the event listeners set by this action

Documentation generated by JsDoc Toolkit 2.1.0 on Mon May 17 2010 13:45:41 GMT-0700 (PDT)