IlvDragRectangleInteractor

IlvObject
  |
  +--IlvInteractor
       |
       +--IlvDragRectangleInteractor
Category:
Graphics Framework component
JavaScript File:
IlvDragRectangleInteractor.js
Description:
The IlvDragRectangleInteractor is an interactor that lets you drag a rectangle over an IlvView.

Constructor Summary
IlvDragRectangleInteractor()

Method Summary
addRectangleDraggedListener(listener)
Adds a listener that is called every time a rectangle was dragged.
getColor()
Returns the color of the dragged rectangle.
getLineWidth()
Returns the line width of the dragged rectangle.
getRectangle()
Returns the bounds of the dragged rectangle.
getXYRatio()
Returns the ratio (width/height) that the dragged rectangle must respect.
onmousedown(e)
Handles mouse down events.
onmousemove(e)
Handles mouse move events.
onmouseup(e)
Handles mouse up events.
removeRectangleDraggedListener(listener)
Removes a listener installed with addRectangleDraggedListener.
setColor(color)
Sets the color of the dragged rectangle.
setLineWidth(lineWidth)
Sets the line width of the dragged rectangle.
setXYRatio(r)
Sets the ratio (width/height) that the dragged rectangle must respect.
startDragging(e)
Starts the drag.
stopDragging(e)
Ends the drag.
whileDragging(e)
When dragging.

Constructor Detail

IlvDragRectangleInteractor

IlvDragRectangleInteractor()
Creates an instance of IlvDragRectangleInteractor.

Method Detail

addRectangleDraggedListener

addRectangleDraggedListener(listener)
Adds a listener that is called every time a rectangle was dragged. The listener object should be a function with one parameter: event. The event parameter contains six attributes: left, top, width, and height describe the dragged rectangle in the view coordinate system. The fifth parameter is corner, which is the index of the corner where the rectangle was started (0 for top-left, 1 for bottom-left, 2 for bottom-right, and 3 for top-right). The last parameter is mouseEvent, which contains the mouse event that generated the end drag.

getColor

getColor()
Returns the color of the dragged rectangle.

getLineWidth

getLineWidth()
Returns the line width of the dragged rectangle.

getRectangle

getRectangle()
Returns the bounds of the dragged rectangle.
Returns:
An object with four properties: left, top, width, and height. These properties represent the bounds of the dragged rectangle expressed in the coordinates of the browser window.

getXYRatio

getXYRatio()
Returns the ratio (width/height) that the dragged rectangle must respect.

onmousedown

onmousedown(e)
Handles mouse down events.

onmousemove

onmousemove(e)
Handles mouse move events.

onmouseup

onmouseup(e)
Handles mouse up events.

removeRectangleDraggedListener

removeRectangleDraggedListener(listener)
Removes a listener installed with addRectangleDraggedListener.

setColor

setColor(color)
Sets the color of the dragged rectangle.
Parameters:
color - The new color.

setLineWidth

setLineWidth(lineWidth)
Sets the line width of the dragged rectangle.

setXYRatio

setXYRatio(r)
Sets the ratio (width/height) that the dragged rectangle must respect.

startDragging

startDragging(e)
Starts the drag.

stopDragging

stopDragging(e)
Ends the drag.

whileDragging

whileDragging(e)
When dragging.

Inherited Methods from IlvInteractor
getCursor, getMenuModelId, getMessage, getView, setCursor, setMenuModelId, setMessage, setView
Inherited Methods from IlvObject
callDispose, dispose, getClassName, hashCode, inherits, instanceOf, invoke, registerDispose, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility