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

Method Summary

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


bottomOffset [R/W]

This bottom pixel offset for the view.

+   Integer bottomOffset

Default Value: 0


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


displayProperties [R/W]

Properties that are bound to the views.

+   Object displayProperties


isZooming [R/W]

boolean signifying that one is zoomed in.

+   Boolean isZooming

Default Value: NO


leftOffset [R/W]

This left pixel offset for the view.

+   Integer leftOffset

Default Value: 0


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


rightOffset [R/W]

This right pixel offset for the view.

+   Integer rightOffset

Default Value: 0


topOffset [R/W]

This top pixel offset for the view.

+   Integer topOffset

Default Value: 0


zoomStep [R/W]

This is the zoom step value of the slider.

+   Integer zoomStep

Default Value: 1


zoomValue [R/W]

This is the default zoom value, 1 means that it is 1x zoom

+   Integer zoomValue

Default Value: 1


zoomValueMax [R/W]

Max zoom value.

+   Integer zoomValueMax

Default Value: 30


zoomValueMin [R/W]

Min zoom value.

+   Integer zoomValueMin

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 ()


init()

Initalization function.

+   (void) init ()

Discussion

Create the SVG elements for the fan.


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.


zoomIn()

Zoom in towards the max value.

+   (void) zoomIn ()


zoomOut()

Zoom out towards the min value.

+   (void) zoomOut ()


zoomOutFull()

Zoom out to the min value.

+   (void) zoomOutFull ()


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.


Documentation generated by JsDoc Toolkit 2.0.2 on Mon Nov 23 2009 23:08:03 GMT-0800 (PST)