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/_WidgetBase
dijit/_TemplatedMixin
 
Field Summary
 yfiles/client/tiles/widget/GraphCanvas canvas           

The graph canvas that the line should be drawn on.

 HTMLElement root           

The container in which the line should be drawn.

 String templateString           

The template used for this widget.

 
Constructor Summary
CanvasDragLine(Object|null params, DOMNode|String srcNodeRef)
           

Create the widget.

 
Method Summary
  activate(yfiles/client/tiles/widget/GraphCanvas canvas)           

activates the drag line for the specified canvas.

  activateAt(yfiles/client/tiles/widget/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

 
Field Detail

canvas

yfiles/client/tiles/widget/GraphCanvas canvas

The graph canvas that the line should be drawn on.


root

HTMLElement root

The container in which the line should be drawn.


templateString

String templateString

The template used for this widget.

 
Constructor Detail

CanvasDragLine

CanvasDragLine(Object|null params, DOMNode|String srcNodeRef)

Create the widget.

Parameters:
params -

Hash of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick. The hash can contain any of the widget's properties, excluding read-only properties.

srcNodeRef -

If a srcNodeRef (DOM node) is specified:

  • use srcNodeRef.innerHTML as my contents
  • if this is a behavioral widget then apply behavior to that srcNodeRef
  • otherwise, replace srcNodeRef with my generated DOM tree
Method Detail

activate

 activate(yfiles/client/tiles/widget/GraphCanvas canvas)

activates the drag line for the specified canvas.

The drag line becomes visible on the next mouse down event for the canvas.

Parameters:
canvas -

activateAt

 activateAt(yfiles/client/tiles/widget/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.

Parameters:
canvas -
pos -

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 -
y1 -
x2 -
y2 -

onLineDone

 onLineDone(Number x1, Number y1, Number x2, Number y2)

is called when the user finishes dragging the line

Parameters:
x1 -
y1 -
x2 -
y2 -

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