Namespace NodeGraph.NodeGraphDelegate
| Extends: | SC.Object |
| Defined in: | frameworks/nodegraph/controllers/nodegraph_delegate.js |
| Version: | 1.0 |
| Author: | Peter Bergstrom |
| Copyright: | 2008-2009 Peter Bergström. |
Overview
NodeGraph.animator
This is the NodeGraph delegate controller. Extend this to customize functionality for your NodeGraph.
Property Summary
-
+ (Integer) _scrollCoolDown [R/W]The scroll zoom cool off. -
+ (Integer) _scrollCoolDownAmount [R/W]The amount to wait between scroll zoom events. -
+ (Integer) bottomOffset [R/W]This bottom pixel offset for the view. -
+ (Integer) canvasHeight [R/W]Canvas dimension height, the canvas is the underlying view. -
+ (Integer) canvasLeft [R/W]Canvas dimension left, the canvas is the underlying view. -
+ (Integer) canvasTop [R/W]Canvas dimension top, the canvas is the underlying view. -
+ (Integer) canvasWidth [R/W]Canvas dimension width, the canvas is the underlying view. -
+ (Object) displayProperties [R/W]Properties that are bound to the views. -
+ (Boolean) isZooming [R/W]boolean signifying that one is zoomed in. -
+ (Integer) leftOffset [R/W]This left pixel offset for the view. -
+ (Integer) percentageX [R/W]x-axis offet percentage, this is used to position the canvas inside the portal. -
+ (Integer) percentageY [R/W]y-axis offet percentage, this is used to position the canvas inside the portal. -
+ (Integer) portalHeight [R/W]Portal dimension height, the portal is the "mask" of the canvas. -
+ (Integer) portalWidth [R/W]Portal dimension width, the portal is the "mask" of the canvas. -
+ (Integer) rightOffset [R/W]This right pixel offset for the view. -
+ (Integer) topOffset [R/W]This top pixel offset for the view. -
+ (Integer) zoomStep [R/W]This is the zoom step value of the slider. -
+ (Integer) zoomValue [R/W]This is the default zoom value, 1 means that it is 1x zoom -
+ (Integer) zoomValueMax [R/W]Max zoom value. -
+ (Integer) zoomValueMin [R/W]Min zoom value.
Method Summary
-
+ (void) finishInitForGraph(nodeGraph)Allow for additional customized setup of the NodeGraph view. -
+ (void) getWindowProperties()Get window properties and set the portal dimensions then reposition the canvas. -
+ (void) init()Initalization function. -
+ (void) nodeGraphDidMouseDown(evt, The, guid)Called by the NodeGraph instance when a mouseDown is triggered. -
+ (Boolean) panToCoordinates(xDiff, yDiff)Zoom to a set of coordinates. -
+ (void) repositionCanvasDidChange()Reposition the canvas inside the portal if needed, This is triggered if the percentages or the zoom value changes. -
+ (void) scrollZoom(evt)When scolling, call this function to zoom in or out. -
+ (Boolean) setZoomToPointerLocation(xPos, yPos, zoomIn)Zoom in or out to center around where the pointer location. -
+ (void) zoomIn()Zoom in towards the max value. -
+ (void) zoomOut()Zoom out towards the min value. -
+ (void) zoomOutFull()Zoom out to the min value. -
+ (Boolean) zoomToLocation(pctX, pctY, zoomValue)Zoom in or out to center around a desired x and y percentage.
Property Details
_scrollCoolDown [R/W]
The scroll zoom cool off.
+ Integer _scrollCoolDown
Discussion
Record scroll time to compare with the _scrollCoolDownAmount.
_scrollCoolDownAmount [R/W]
The amount to wait between scroll zoom events.
+ Integer _scrollCoolDownAmount
Default Value: 200 milliseconds
canvasHeight [R/W]
Canvas dimension height, the canvas is the underlying view.
+ Integer canvasHeight
Default Value: 0px
canvasLeft [R/W]
Canvas dimension left, the canvas is the underlying view.
+ Integer canvasLeft
Default Value: 0px
canvasTop [R/W]
Canvas dimension top, the canvas is the underlying view.
+ Integer canvasTop
Default Value: 0px
canvasWidth [R/W]
Canvas dimension width, the canvas is the underlying view.
+ Integer canvasWidth
Default Value: 0px
percentageX [R/W]
x-axis offet percentage, this is used to position the canvas inside the portal.
+ Integer percentageX
Default Value: 0.5
percentageY [R/W]
y-axis offet percentage, this is used to position the canvas inside the portal.
+ Integer percentageY
Default Value: 0.5
portalHeight [R/W]
Portal dimension height, the portal is the "mask" of the canvas.
+ Integer portalHeight
Default Value: 0px
portalWidth [R/W]
Portal dimension width, the portal is the "mask" of the canvas.
+ Integer portalWidth
Default Value: 0px
zoomValue [R/W]
This is the default zoom value, 1 means that it is 1x zoom
+ Integer zoomValue
Default Value: 1
Method Detail
finishInitForGraph()
Allow for additional customized setup of the NodeGraph view.
+ (void) finishInitForGraph (nodeGraph)
Parameters
(NodeGraph.NodeGraphView)nodeGraph The NodeGraph instance.
getWindowProperties()
Get window properties and set the portal dimensions then reposition the canvas.
+ (void) getWindowProperties ()
nodeGraphDidMouseDown()
Called by the NodeGraph instance when a mouseDown is triggered.
+ (void) nodeGraphDidMouseDown (evt, The, guid)
Parameters
(DOM Event)evt The mouseDown event.
(NodeGraph.NodeGraphView)The NodeGraph view.
guid {String} The guid of the node.
panToCoordinates()
Zoom to a set of coordinates.
+ (Boolean) panToCoordinates (xDiff, yDiff)
Parameters
xDiff {Integer} The x position of the mouse pointer.
yDiff {Integer} The y position of the mouse pointer.
Returns
(Boolean) Returns NO if there is an error.
repositionCanvasDidChange()
Reposition the canvas inside the portal if needed, This is triggered if the percentages or the zoom value changes.
+ (void) repositionCanvasDidChange ()
Observes
percentageX
percentageY
zoomValue
scrollZoom()
When scolling, call this function to zoom in or out.
+ (void) scrollZoom (evt)
Parameters
(DOM Event)evt The scroll event.
Discussion
If there was a scroll event within the time period specified by the _scrollCoolDownAmount variable, then don't do anything.
setZoomToPointerLocation()
Zoom in or out to center around where the pointer location.
+ (Boolean) setZoomToPointerLocation (xPos, yPos, zoomIn)
Parameters
xPos {Integer} The x position of the mouse pointer.
yPos {Integer} The y position of the mouse pointer.
zoomIn {boolean} If YES, zoom in, otherwise, zoom out.
Returns
(Boolean) Returns NO if there is an error.
zoomToLocation()
Zoom in or out to center around a desired x and y percentage.
+ (Boolean) zoomToLocation (pctX, pctY, zoomValue)
Parameters
pctX {Integer} The x position percentage.
pctY {Integer} The y position percentage.
zoomValue {Integer} The desired zoomValue.
Returns
(Boolean) Returns NO if there is an error.