Class adf.DrawLineAction
Extends
adf.Action.
Defined in: Action.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Extends adf.Action to handle user interaction with the mouse to draw a line segment
which contains only two points.
|
Field Attributes | Field Name and Description |
---|---|
- Fields borrowed from class adf.Action:
- cursor, graphicsZIndex, symbol
Method Attributes | Method Name and Description |
---|---|
activate(element, callBack, continuousCallBack, graphicsElement)
This method activates the action and registers the required event listeners to draw a line segment.
|
|
Deactivates this action by removing all event listeners that were registered
in adf.DrawLineAction#activate.
|
|
Reinitializes this action.
|
Class Detail
adf.DrawLineAction()
Extends adf.Action to handle user interaction with the mouse to draw a line segment
which contains only two points. Drawing a line segment requires a user to press the
mouse button (start point), move the cursor, and finally release the mouse button (end point).
Field Detail
{String}
name
- Default Value:
- "adf.DrawLineAction"
Method Detail
activate(element, callBack, continuousCallBack, graphicsElement)
This method activates the action and registers the required event listeners to draw a line segment.
- Parameters:
- {Element} element
- The HTML DOM element that user interacts with to draw the line segment.
- {Function} callBack
- Callback function is called when drawing of the line segment is complete. The function is passed two adf.Points as parameters indicating the start and end points of the line segment.
- {Function} continuousCallBack
- Continuous callback function is called as the line
segment is being drawn. The function is called each time the browser fires the
onmousemove
event. The function is passed two adf.Points as parameters indicating the start point of the line segment and current mouse cursor position. - {adf.graphics.Element} graphicsElement Optional
- The adf.graphics.Element to draw the line segment on. If null or undefined, a adf.graphics.Element instance will be created automatically and superimposed on HTML DOM specified by the "element" parameter.
deactivate()
Deactivates this action by removing all event listeners that were registered
in adf.DrawLineAction#activate.
reactivate()
Reinitializes this action. Reconnects all event listeners just as adf.DrawLineAction#activate does.