Class: xrx.viewbox.ViewboxTranslate

xrx.viewbox. ViewboxTranslate

(private) new xrx.viewbox.ViewboxTranslate()

A class implementing translation functions for a drawing view-box.
Source:

Extends

Members

(private) xrx.viewbox.ViewboxTranslate#FixPoints_

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#zoomFactor_ :number

The current zoom factor, defaults to .1.
Type:
  • number
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#zoomMax_ :number

The maximum zoom value, defaults to 2.
Type:
  • number
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#zoomMin_ :number

The minimum zoom value, defaults to 0.1.
Type:
  • number
Inherited From:
Source:

Methods

(private) xrx.viewbox.ViewboxTranslate#center()

Translates the view-box to the center of the drawing canvas.
Source:

(private) xrx.viewbox.ViewboxTranslate#centerHorizontally()

Translates the view-box to the horizontal center of the drawing canvas.
Source:

(private) xrx.viewbox.ViewboxTranslate#centerVertically()

Translates the view-box to the vertical center of the drawing canvas.
Source:

(private) xrx.viewbox.ViewboxTranslate#containsPoint(point)

Whether a point is contained in this view-box.
Parameters:
Name Type Description
point Array.<number> The native point, without translation.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#direction_() → {number}

Returns a positional utility number representing the current orientation of the view-box.
Inherited From:
Source:
Returns:
The orientation.
Type
number

xrx.viewbox.ViewboxTranslate#disposeInternal()

Disposes this view-box.
Source:

(private) xrx.viewbox.ViewboxTranslate#getBox() → {goog.math.Box}

Returns the bounding-box for this view-box, respecting transformation.
Inherited From:
Source:
Returns:
The bounding box, coordinates are the visibles and are transformed.
Type
goog.math.Box

(private) xrx.viewbox.ViewboxTranslate#getCenterPoint_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#getFixPoint_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#getFixPoints_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#getHeight(opt_transformed, opt_visible) → {number}

Returns the height of this view-box, optionally the transformed height (respecting the current scale) and / or the visible height (respecting the current rotation).
Parameters:
Name Type Description
opt_transformed boolean Whether to return the transformed height respecting the current scale.
opt_visible boolean Whether to return the visible height respecting the current rotation.
Inherited From:
Source:
Returns:
The height.
Type
number

(private) xrx.viewbox.ViewboxTranslate#getPivotPoint_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#getPivotPoints_(reverse) → {Array.<number>}

Returns the four pivot points of this view-box.
Parameters:
Name Type Description
reverse boolean If we rotate in right or left direction. If reverse is true we assume left direction otherwise right direction.
Inherited From:
Source:
Returns:
Type
Array.<number>

xrx.viewbox.ViewboxTranslate#getRotation() → {number}

Returns the current rotation in degrees.
Inherited From:
Source:
Returns:
The current rotation in degrees.
Type
number

(private) xrx.viewbox.ViewboxTranslate#getVisibleOrientation_()

Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#getWidth(opt_transformed, opt_visible) → {number}

Returns the width of this view-box, optionally the transformed width (respecting the current scale) and / or the visible width (respecting the current rotation).
Parameters:
Name Type Description
opt_transformed boolean Whether to return the transformed width respecting the current scale.
opt_visible boolean Whether to return the visible width respecting the current rotation.
Inherited From:
Source:
Returns:
The width.
Type
number

xrx.viewbox.ViewboxTranslate#getZoomFactor() → {number}

Returns the current zoom factor, defaults to .1.
Inherited From:
Source:
Returns:
The zoom factor.
Type
number

xrx.viewbox.ViewboxTranslate#getZoomMax() → {number}

Returns the current maximum zoom value.
Inherited From:
Source:
Returns:
The maximum zoom value.
Type
number

xrx.viewbox.ViewboxTranslate#getZoomMin() → {number}

Returns the current minimum zoom value.
Inherited From:
Source:
Returns:
The minimum zoom value.
Type
number

xrx.viewbox.ViewboxTranslate#getZoomStep(opt_zoomValuenullable) → {number}

Returns the current zoom step or the zoom step of a zoom value if opt_zoomValue is defined.
Parameters:
Name Type Attributes Description
opt_zoomValue number <nullable>
A zoom value.
Inherited From:
Source:
Returns:
The zoom step.
Type
number

xrx.viewbox.ViewboxTranslate#getZoomValue() → {number}

Returns the current zoom value.
Inherited From:
Source:
Returns:
Type
number

(private) xrx.viewbox.ViewboxTranslate#isFixPoint_(fixPoint)

Whether the fix-point is a point, that is an Array of length 2.
Parameters:
Name Type Description
fixPoint ? The fix-point.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#isHorizontal() → {boolean}

Whether the view-box currently is in horizontal orientation.
Inherited From:
Source:
Returns:
Whether the view-box is oriented horizontally.
Type
boolean

(private) xrx.viewbox.ViewboxTranslate#isOrientation_(fixPoint)

Whether the fix-point is an orientation, that is one of xrx.drawing.Orientation.*.
Parameters:
Name Type Description
fixPoint ? The fix-point.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#isValidRotation(rotation) → {boolean}

Checks whether the rotation value is valid.
Parameters:
Name Type Description
rotation number The rotation in degrees.
Inherited From:
Source:
Returns:
Whether the rotation is valid.
Type
boolean

(private) xrx.viewbox.ViewboxTranslate#isVertical() → {boolean}

Whether the view-box currently is in vertical orientation.
Inherited From:
Source:
Returns:
Whether the view-box is oriented vertically.
Type
boolean

(private) xrx.viewbox.ViewboxTranslate#rotateBy(anglenullable, opt_fixPointnullable)

Rotates the view-box by an angle, respecting a fix-point or an orientation.
Parameters:
Name Type Attributes Description
angle number <nullable>
The angle of rotation in degrees, e.g. 90 or 180.
opt_fixPoint Array.<number> | string <nullable>
A fix-point or an orientation. Defaults to the center of the view-box.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#rotateBy_(anglenullable, opt_orientationnullable, opt_fixPointnullable)

Rotates the view-box by an angle, respecting a fix-point or an orientation.
Parameters:
Name Type Attributes Description
angle number <nullable>
The angle of rotation in degrees, e.g. 90 or 180.
opt_orientation string <nullable>
An orientation, defaults to xrx.drawing.Orientation.C.
opt_fixPoint Array.<number> <nullable>
A fix-point, defaults to the center of the view-box.
Inherited From:
Source:

xrx.viewbox.ViewboxTranslate#rotateLeft(opt_fixPointnullable)

Rotates the view-box by 90° in left direction, optionally respecting a fix-point or an orientation.
Parameters:
Name Type Attributes Description
opt_fixPoint Array.<number> | string <nullable>
The fix-point.
Inherited From:
Source:

xrx.viewbox.ViewboxTranslate#rotateRight(opt_fixPointnullable)

Rotates the view-box by 90° in right direction, optionally respecting a fix-point or an orientation.
Parameters:
Name Type Attributes Description
opt_fixPoint Array.<number> | string <nullable>
The fix-point.
Inherited From:
Source:

xrx.viewbox.ViewboxTranslate#setPosition(position)

Translates the view-box to a certain position of the drawing canvas.
Parameters:
Name Type Description
position string A position as declared in {xrx.drawing.Position}.
Source:

xrx.viewbox.ViewboxTranslate#setZoomFactor(factor)

Sets a new zoom factor, e.g. 0.1.
Parameters:
Name Type Description
factor number The new zoom factor.
Inherited From:
Source:

xrx.viewbox.ViewboxTranslate#setZoomFactorMax(value)

Sets the maximum zoom value.
Parameters:
Name Type Description
value number The maximum zoom value.
Inherited From:
Source:

xrx.viewbox.ViewboxTranslate#setZoomFactorMin(value)

Sets the minimum zoom value.
Parameters:
Name Type Description
value number The minimum zoom value.
Inherited From:
Source:

xrx.viewbox.ViewboxTranslate#translate(x, y)

Translates the view-box.
Parameters:
Name Type Description
x number The distance to translate in the x direction.
y number The distance to translate in the y direction.
Source:

xrx.viewbox.ViewboxTranslate#zoomIn(opt_fixPoint)

Zoom in on the view-box, optionally respecting a fix-point.
Parameters:
Name Type Description
opt_fixPoint Array.<number> A fix-point.
Inherited From:
Source:

(private) xrx.viewbox.ViewboxTranslate#zoomOffset_()

Inherited From:
Source:

xrx.viewbox.ViewboxTranslate#zoomOut(opt_fixPoint)

Zoom out the view-box, optionally respecting a fix-point.
Parameters:
Name Type Description
opt_fixPoint Array.<number> A fix-point.
Inherited From:
Source:

xrx.viewbox.ViewboxTranslate#zoomTo(zoomValue, opt_fixPointnullable)

Zooms the view-box to a value, optionally respecting a fix-point.
Parameters:
Name Type Attributes Description
zoomValue number The zoom value.
opt_fixPoint number <nullable>
A fix-point.
Inherited From:
Source: