Class Papercube.ZoomView

Extends: SC.View
Defined in: clients/papercube/views/zoom.js
Version: 1.0
Author: Peter Bergstrom
Copyright: 2008-2009 Peter Bergström.

Overview

ZoomView is the preview view and control view for the portal/canvas paradigm that allows for resolution independence.

Property Summary

Method Summary

Property Details

_actionType [R/W]

Action type is either drag or click.

-   String _actionType

Default Value: ''

Discussion

The positioning behavior changes depending on what this parameter is.


_bounds [R/W]

The bounds that are used for rendering the zoomView.

-   Array _bounds


_ptrXOffset [R/W]

Used to offset your mouse pointer's x inside the preview portal view so that it doesn't jump.

-   Integer _ptrXOffset

Default Value: 0


_ptrYOffset [R/W]

Used to offset your mouse pointer's y inside the preview portal view so that it doesn't jump.

-   Integer _ptrYOffset

Default Value: 0


_zoomDirty [R/W]

Internal boolean that specifies if the zoom has been touched or not.

-   Boolean _zoomDirty

Default Value: NO


canvasPreview [R/W]

This is the DIV element for the preview canvas.

-   Object canvasPreview


heightBinding [R/W]

The portal height, set by the canvasController.

-   Integer heightBinding

Bound To: "Papercube.canvasController.portalHeight"


isVisible [R/W]

Is the view visible?

-   Boolean isVisible

Default Value: NO


isZoomingBinding [R/W]

Zooming or not, set by the canvasController.

-   Boolean isZoomingBinding

Bound To: "Papercube.canvasController.isZooming"


outlets [R/W]

The zoom view has two outlets, the canvas and portal, the portal is the visible window.

-   Object outlets


percentageX [R/W]

The x-axis percentage.

-   Float percentageX

Default Value: 0.5


percentageXBinding [R/W]

The x percentage, set by the canvasController.

-   Float percentageXBinding

Bound To: "Papercube.canvasController.percentageX"


percentageY [R/W]

The y-axis percentage.

-   Float percentageY

Default Value: 0.5


percentageYBinding [R/W]

The y percentage, set by the canvasController.

-   Float percentageYBinding

Bound To: "Papercube.canvasController.percentageY"


portalPreview [R/W]

This is the DIV element for the preview portal.

-   Object portalPreview


widthBinding [R/W]

The portal width, set by the canvasController.

-   Integer widthBinding

Bound To: "Papercube.canvasController.portalWidth"


zoomValueBinding [R/W]

The zoom value, set by the canvasController.

-   Integer zoomValueBinding

Bound To: "Papercube.canvasController.zoomValue"


Method Detail

_setPercentage()

Set the percentage back to the controller.

-   (void) _setPercentage ()


_setPreviewPosition()

Set the preview box position as you're dragging.

-   (void) _setPreviewPosition (x, y)

Parameters

x {Integer} The x-position.

y {Integer} The y-position.

Discussion

Make sure it does not leave the bounds of the canvas.


applyZoomTransition()

Add the zoom class so it animates.

-   (void) applyZoomTransition ()


isZoomingDidChange()

Observes isZooming and shows the view it is needed.

-   (void) isZoomingDidChange ()

Observes

isZooming


mouseDown()

Handle the mouseDown action.

-   (void) mouseDown (evt)

Parameters

(DOM Event)evt The mouseDown event.


mouseDragged()

When it is dragged, handle it.

-   (void) mouseDragged (evt)

Parameters

(DOM Event)evt The mouseDragged event.


mouseUp()

This will end a drag or position after a click.

-   (void) mouseUp (evt)

Parameters

(DOM Event)evt The mouseUp event.


positionPreviewBox()

Set the position and dimensions of the portalPreview.

-   (void) positionPreviewBox (x, y, height, height)

Parameters

x {Integer} The x-position.

y {Integer} The y-position.

height {Integer} The box height

height {Integer} The box width


redrawParamsDidChange()

Redraw the zoomView as needed based on 'height', 'width', 'zoomValue'.

-   (Boolean) redrawParamsDidChange ()

Returns

(Boolean) Returns NO if there is no guid of if the view is not visible.

Observes

height

width

zoomValue


setParams()

Set the preview box position and percentages.

-   (void) setParams (pctX, pctY)

Parameters

pctX {Integer} The x percentage.

pctY {Integer} The y percentage.


updatePreviewBox()

Update preview box postion.

-   (void) updatePreviewBox (pctX, pctY)

Parameters

pctX {Integer} The x percentage.

pctY {Integer} The y percentage.


Documentation generated by JsDoc Toolkit 2.0.2 on Sat Nov 21 2009 21:24:40 GMT-0800 (PST)