|
|||||
SUMMARY: FIELD | CONSTR | METHOD| EVENT | DETAIL: FIELD | CONSTR | METHOD| EVENT |
This widget displays an interactive line connecting a start position with the current mouse position until the user releases the mouse button.
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 |
---|
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 Detail |
---|
CanvasDragLine(Object|null params, DOMNode|String srcNodeRef)
Create the widget.
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:
Method Detail |
---|
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.
canvas
-
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.
canvas
-
pos
-
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()
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
x1
-
y1
-
x2
-
y2
-
onLineDone(Number x1, Number y1, Number x2, Number y2)
is called when the user finishes dragging the line
x1
-
y1
-
x2
-
y2
-