yfiles.client.tiles.widget.Rubberband
Class Rubberband

a widget for specifying a rectangular area on a GraphCanvas

The Rubberband is realized by a transparent <div> element with the CSS class yFilesRubberbandArea. Its appearance can be modified by updating or overriding the CSS rule for this class in resources/style/yfiles-ajax.css.

 
All Parent Classes:
dijit._Widget
dijit._Templated
 
Field Summary
 HTMLDivElement area
          The element that displays the rectangular area.
 Boolean fixCanvas
          If true then the canvas will be fixed when this widget is activated. The default value is false.
 Boolean releaseCanvas
          If true then the canvas will be released when this widget is deactivated. The default value is false.
 HTMLDivElement root
          The root element of this widget.
 String templateString
          The template that is used by this widget.
 
Method Summary
  activate(/*GraphCanvas*/ canvas)
          activates the rubber band for the specified canvas.
  activateAt(/*GraphCanvas*/ canvas, /*Object*/ pos)
          activates the rubberband for the specified canvas at a specific position.
  deactivate()
          deactivates the rubber band.
  postCreate()
          
 
Event Summary
  onAreaDone(/*Number*/ x, /*Number*/ y, /*Number*/ width, /*Number*/ height)
          is called when the user finishes dragging the rubberband area
  onAreaResized(/*Number*/ x, /*Number*/ y, /*Number*/ width, /*Number*/ height)
          is called whenever the rubberband area changes
  onDeactivated()
          is called when the Rubberband is deactivated (by deactivate() or after finishing a drag)
 
Field Detail

area

/*HTMLDivElement*/ area
The element that displays the rectangular area.

fixCanvas

/*Boolean*/ fixCanvas
If true then the canvas will be fixed when this widget is activated. The default value is false.

releaseCanvas

/*Boolean*/ releaseCanvas
If true then the canvas will be released when this widget is deactivated. The default value is false.

root

/*HTMLDivElement*/ root
The root element of this widget.

templateString

/*String*/ templateString
The template that is used by this widget.
 
Method Detail

activate

activate(/*GraphCanvas*/ canvas)
activates the rubber band for the specified canvas.
The rubberband becomes visible on the next mouse down event for the canvas.
Parameters:
canvas - The canvas this widget is associated with.

activateAt

activateAt(/*GraphCanvas*/ canvas, /*Object*/ pos)
activates the rubberband for the specified canvas at a specific position.
The rubberband becomes visible at the given position.
Parameters:
canvas - The canvas.
pos - position with x and y coordinates

deactivate

deactivate()
deactivates the rubber band.
The rubberband will not react on mouse events, until the next call to activate().

postCreate

postCreate()
Event Detail

onAreaDone

onAreaDone(/*Number*/ x, /*Number*/ y, /*Number*/ width, /*Number*/ height)
is called when the user finishes dragging the rubberband area
Parameters:
x - left border of the current rubberband area in pixels
y - upper border of the current rubberband area in pixels
width - width of the current rubberband area in pixels
height - height of the current rubberband area in pixels

onAreaResized

onAreaResized(/*Number*/ x, /*Number*/ y, /*Number*/ width, /*Number*/ height)
is called whenever the rubberband area changes
Parameters:
x - left border of the current rubberband area in pixels
y - upper border of the current rubberband area in pixels
width - width of the current rubberband area in pixels
height - height of the current rubberband area in pixels

onDeactivated

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

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