yfiles.client.tiles.widget.CanvasDragLine
Class CanvasDragLine

This widget displays an interactive line connecting a start position with the current mouse position until the user releases the mouse button.

 
All Parent Classes:
dijit._Widget
dijit._Templated
 
Method Summary
  activate(/*GraphCanvas*/ canvas)
          activates the drag line for the specified canvas.
  activateAt(/*GraphCanvas*/ canvas, /*Object*/ pos)
          activates the drag line for the specified canvas at the given position.
  deactivate()
          deactivates the drag line.
  onDeactivated()
          is called when the drag line is deactivated (by deactivate() or after finishing a drag)
  onLineChange(/*Number*/ x1, /*Number*/ y1, /*Number*/ x2, /*Number*/ y2)
          is called whenever the drag line changes
  onLineDone(/*Number*/ x1, /*Number*/ y1, /*Number*/ x2, /*Number*/ y2)
          is called when the user finishes dragging the line
 
Method Detail

activate

activate(/*GraphCanvas*/ canvas)
activates the drag line for the specified canvas. The drag line becomes visible on the next mouse down event for the canvas.

activateAt

activateAt(/*GraphCanvas*/ canvas, /*Object*/ pos)
activates the drag line for the specified canvas at the given position. The drag line becomes visible at the given position. The position is assumed to have x and y attributes which are interpreted as as the view coordinates in pixels.

deactivate

deactivate()
deactivates the drag line. The canvas is release()ed and the drag line will not react on mouse events, until the next call to activate().

onDeactivated

onDeactivated()
is called when the drag line is deactivated (by deactivate() or after finishing a drag)

onLineChange

onLineChange(/*Number*/ x1, /*Number*/ y1, /*Number*/ x2, /*Number*/ y2)
is called whenever the drag line changes
Parameters:
x1 - x-coordinate of the start point of the line
y1 - y-coordinate of the start point of the line
x2 - x-coordinate of the end point of the line
y2 - y-coordinate of the end point of the line

onLineDone

onLineDone(/*Number*/ x1, /*Number*/ y1, /*Number*/ x2, /*Number*/ y2)
is called when the user finishes dragging the line
Parameters:
x1 - x-coordinate of the start point of the line
y1 - y-coordinate of the start point of the line
x2 - x-coordinate of the end point of the line
y2 - y-coordinate of the end point of the line

Copyright © 2006-2008 yWorks GmbH. All rights reserved.