Layer class (Gauge)

Layer(oLayers, key)

new Layer(oLayers, key)

The Layer object holds a layer of the Gauge control. The Layer object holds a collection of pictures and HTML captions to be displayed on a viewable layer. Any layer can be visible, selectable or dragable. Any layer can be moved, rotated or clipped.
Parameters:
Name Type Description
oLayers Layers Specifies an object of Layers type, which indicates the layers collection that hosts the layer
key any Specifies the layer's key (ignored if missing)
Layer

Methods

GetBack() → {any}

The GetBack() method retrieves the layer's background as a name of a HTML picture or a CSS color (null indicates that no background has been provided for the layer)
Returns:
Returns the layer's background as a HTML picture or a CSS color.
Type
any
GetBack

GetBrightness() → {LayerColorAdjustment}

The GetBrightness() method gets access to the layer's brightness object.
Returns:
Returns the layer's brightness object of LayerColorAdjustment type
Type
LayerColorAdjustment
GetBrightness

GetClip() → {LayerClip}

The GetClip() method gets access to the layer's clip object.
Returns:
Returns the layer's clip object of LayerClip type
Type
LayerClip
GetClip

GetContrast() → {LayerColorAdjustment}

The GetContrast() method gets access to the layer's contrast object.
Returns:
Returns the layer's contrast object of LayerColorAdjustment type
Type
LayerColorAdjustment
GetContrast

GetDefaultOffsetX() → {number}

The GetDefaultOffsetX() method indicates the default x-offset of the layer.
Returns:
Returns the default x-offset of the layer.
Type
number
GetDefaultOffsetX

GetDefaultOffsetY() → {number}

The GetDefaultOffsetY() method indicates the default y-offset of the layer.
Returns:
Returns the default y-offset of the layer.
Type
number
GetDefaultOffsetY

GetDefaultRotateAngle() → {number}

The GetDefaultRotateAngle() method specifies the default angle to rotate the layer (equivalent of layers's [defA] flag).
Returns:
Returns the default angle to rotate the layer.
Type
number
GetDefaultRotateAngle

GetFore() → {any}

The GetFore() method retrieves HTML caption to be shown on the layer's foreground (expression) (equivalent of layers's [fore] flag) The expression supports the following keywords:
"value", indicates the layer's Value property
Returns:
Returns the layer's foreground as HTML caption.
Type
any
GetFore

GetGrayscale() → {string}

The GetGrayscale() method converts the layer to grayscale (equivalent of layers's [grayscale] flag). The expression supports the following keywords:
"value", indicates the value of the control
Returns:
Returns the percent value / expression to convert the layer to grayscale
Type
string
GetGrayscale

GetHeight() → {string}

The GetHeight() method specifies the expression relative to the view, to determine the height to show the current layer on the control (equivalent of layers's [height] flag). The expression supports the following keywords:
"width", specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Returns:
Returns the expression relative to the view, to determine the y-position to show the current layer on the control.
Type
string
GetHeight

GetIdem() → {any}

The GetIdem() method indicates a list of layers the current's layer offset and rotate-angle (separated by comma character)
Returns:
Returns the list of layers (idem layers) that has the same offset and rotation-angle
Type
any
GetIdem

GetIndex() → {any}

The GetIndex() method retrieves the layer's index.
Returns:
Returns the layer's index
Type
any
GetIndex

GetKey() → {any}

The GetKey() method retrieves the layer's key.
Returns:
Returns the layer's key
Type
any
GetKey

GetLeft() → {string}

The GetLeft() method specifies the expression relative to the view, to determine the x-position to show the current layer on the control (equivalent of layers's [left] flag). The expression supports the following keywords:
"width", specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Returns:
Returns the expression relative to the view, to determine the x-position to show the current layer on the control.
Type
string
GetLeft

GetOffsetToValue() → {string}

The GetOffsetToValue() method specifies the expression to convert the offsetx,offsety to value (equivalent of layers's [o2v] flag). The expression supports the following keywords:
"value", "x", "offsetx", indicates the layer's OffsetX property
"y", "offsety", indicates the layer's OffsetY property
Returns:
Returns the expression to validate the y-offset value of the layer
Type
string
GetOffsetToValue

GetOffsetX() → {number}

The GetOffsetX() method indicates the x-offset of the layer.
Returns:
Returns the x-offset of the layer.
Type
number
GetOffsetX

GetOffsetXValid() → {string}

The GetOffsetXValid() method validates the x-offset value of the layer (equivalent of layers's [xValid] flag). The expression supports the following keywords:
"value", specifies the x-offset/y-offset of the layer
"x", specifies the x-offset of the layer
"y", specifies the y-offset of the layer
"lwidth" specifies the width in pixels of the layer's view
"lheight", specifies the height in pixels of the layer's view
"width" specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Returns:
Returns the expression to validate the x-offset value of the layer
Type
string
GetOffsetXValid

GetOffsetY() → {number}

The GetOffsetY() method indicates the y-offset of the layer.
Returns:
Returns the y-offset of the layer.
Type
number
GetOffsetY

GetOffsetYValid() → {string}

The GetOffsetYValid() method validates the y-offset value of the layer (equivalent of layers's [yValid] flag). The expression supports the following keywords:
"value", specifies the x-offset/y-offset of the layer
"x", specifies the x-offset of the layer
"y", specifies the y-offset of the layer
"lwidth" specifies the width in pixels of the layer's view
"lheight", specifies the height in pixels of the layer's view
"width" specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Returns:
Returns the eypression to validate the y-offset value of the layer
Type
string
GetOffsetYValid

GetOnDrag() → {Gauge.OnDragLayerEnum}

The GetOnDrag() method indicates the transformation of the layer once the user drags it.
Returns:
Returns a value of Gauge.OnDragLayerEnum type that specifies the operation the layer is performed once the user drags it.
Type
Gauge.OnDragLayerEnum
GetOnDrag

GetPosition() → {number}

The GetPosition() method retrieves the layer's position.
Returns:
Returns the layer's position
Type
number
GetPosition

GetRotamoveCenterX() → {number}

The GetRotamoveCenterX() method specifies the x-position of the layer's center, while the layer's drag operation is exDoRotamove.
Returns:
Returns the x-position of the layer's center, while the layer's drag operation is exDoRotamove.
Type
number
GetRotamoveCenterX

GetRotamoveCenterY() → {number}

The GetRotamoveCenterY() method specifies the y-position of the layer's center, while the layer's drag operation is exDoRotamove.
Returns:
Returns the y-position of the layer's center, while the layer's drag operation is exDoRotamove.
Type
number
GetRotamoveCenterY

GetRotamoveOffsetX() → {number}

The GetRotamoveOffsetX() method specifies the x-offset of the layer, while the layer's drag operation is exDoRotamove.
Returns:
Returns the x-offset of the layer, while the layer's drag operation is exDoRotamove..
Type
number
GetRotamoveOffsetX

GetRotamoveOffsetY() → {number}

The GetRotamoveOffsetY() method specifies the y-offset of the layer, while the layer's drag operation is exDoRotamove.
Returns:
Returns the y-offset of the layer, while the layer's drag operation is exDoRotamove..
Type
number
GetRotamoveOffsetY

GetRotateAngle() → {number}

The GetRotateAngle() method specifies the angle to rotate the layer (equivalent of layers's [a] flag).
Returns:
Returns the angle to rotate the layer.
Type
number
GetRotateAngle

GetRotateAngleToValue() → {string}

The GetRotateAngleToValue() method specifies the expression to convert the rotating angle to value (equivalent of layers's [a2v] flag). The expression supports the following keywords:
"value", indicates the layer's Value property
Returns:
Returns the expression to convert the rotating angle to value.
Type
string
GetRotateAngleToValue

GetRotateAngleValid() → {string}

The GetRotateAngleValid() method validates the layer's rotation angle (equivalent of layers's [aValid] flag). The expression supports the following keywords:
"value", indicates the cumulative rotation angle ( CumulativeRotateAngle property ), during the dragging operation.
Returns:
Returns the expression to validate rotation angle of the layer
Type
string
GetRotateAngleValid

GetRotateCenterLayer() → {any}

The GetRotateCenterLayer() method indicates the index or key of the layer the rotation is around. If -1, the rotation is relative to the current layer (equivalent of layers's [cLayer] flag).
Returns:
Returns indicates the index or key of the layer the rotation is around. If -1, the rotation is relative to the current layer.
Type
any
GetRotateCenterLayer

GetRotateCenterX() → {string}

The GetRotateCenterX() method indicates the expression that determines the x-origin of the rotation point relative to the RotateCenterLayer layer (equivalent of layers's [xCenter] flag). The expression supports the following keywords:
"lwidth", indicates the width in pixels of the layer
"width", specifies the width in pixels of the view / control
"lheight", indicates the height in pixels of the layer
"height", specifies the height in pixels of the view / control
Returns:
Returns the expression to to define the x-origin of the rotation point relative to the RotateCenterLayer layer.
Type
string
GetRotateCenterX

GetRotateCenterY() → {string}

The GetRotateCenterY() method indicates the expression that determines the y-origin of the rotation point relative to the RotateCenterLayer layer (equivalent of layers's [yCenter] flag). The expression supports the following keywords:
"lwidth", indicates the width in pixels of the layer
"width", specifies the width in pixels of the view / control
"lheight", indicates the height in pixels of the layer
"height", specifies the height in pixels of the view / control
Returns:
Returns the expression to to define the y-origin of the rotation point relative to the RotateCenterLayer layer.
Type
string
GetRotateCenterY

GetRotateClip() → {boolean}

The GetRotateClip() method indicates whether the layer's clipping region is rotated once the layer is rotated (equivalent of layers's [rotateclip] flag).
Returns:
Returns true if the layer's clipping region is rotated once the layer is rotated.
Type
boolean
GetRotateClip

GetSelectable() → {boolean}

The GetSelectable() method indicates whether the layer is selectable or un-selectable
Returns:
Returns true if the layer is selectable, or false it the layer is un-selectable
Type
boolean
GetSelectable

GetTop() → {string}

The GetTop() method specifies the expression relative to the view, to determine the y-position to show the current layer on the control (equivalent of layers's [top] flag). The expression supports the following keywords:
"width", specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Returns:
Returns the expression relative to the view, to determine the y-position to show the current layer on the control.
Type
string
GetTop

GetTransparency() → {string}

The GetTransparency() method indicates percent value / expression of the transparency to display the layer (equivalent of layers's [transparency] flag). The expression supports the following keywords:
"value", indicates the value of the control
Returns:
Returns the percent value / expression of the transparency to display the layer.
Type
string
GetTransparency

GetValue() → {number}

The GetValue() method specifies the layer's value.
Returns:
Returns the layer's value.
Type
number
GetValue

GetValueToOffsetX() → {string}

The GetValueToOffsetX() method specifies the expression to convert the value to x-offset (equivalent of layers's [v2x] flag) The expression supports the following keywords:
"value", indicates the layer's Value property
Returns:
Returns the expression to validate the y-offset value of the layer
Type
string
GetValueToOffsetX

GetValueToOffsetY() → {string}

The GetValueToOffsetY() method specifies the expression to convert the value to y-offset (equivalent of layers's [v2y] flag). The expression supports the following keywords:
"value", indicates the layer's Value property
Returns:
Returns the expression to validate the y-offset value of the layer
Type
string
GetValueToOffsetY

GetValueToRotateAngle() → {string}

The GetValueToRotateAngle() method specifies the expression to convert the value to rotating angle (equivalent of layers's [v2a] flag). The expression supports the following keywords:
"value", indicates the layer's Value property
Returns:
Returns the expression to convert the value to rotating angle.
Type
string
GetValueToRotateAngle

GetVisible() → {boolean}

The GetVisible() method indicates whether the layer is visible or hidden
Returns:
Returns true if the layer is visible, or false it the layer is hidden
Type
boolean
GetVisible

GetWidth() → {string}

The GetWidth() method specifies the expression relative to the view, to determine the width to show the current layer on the control (equivalent of layers's [width] flag). The expression supports the following keywords:
"width", specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Returns:
Returns the expression relative to the view, to determine the y-position to show the current layer on the control.
Type
string
GetWidth

SetBack(value)

The SetBack() method changes the layer's background to a HTML picture or a CSS color
Parameters:
Name Type Description
value any Specifies the layer's background as a name of an HTML picture or a CSS color
SetBack

SetDefaultOffsetX(value)

The SetDefaultOffsetX() method indicates the default x-offset of the layer.
Parameters:
Name Type Description
value number Specifies the default x-offset of the layer.
SetDefaultOffsetX

SetDefaultOffsetY(value)

The SetDefaultOffsetY() method indicates the default y-offset of the layer.
Parameters:
Name Type Description
value number Specifies the default y-offset of the layer.
SetDefaultOffsetY

SetDefaultRotateAngle(value)

The SetDefaultRotateAngle() method specifies the default angle to rotate the layer (equivalent of layers's [defA] flag).
Parameters:
Name Type Description
value number Specifies the default angle to rotate the layer.
SetDefaultRotateAngle

SetFore(value)

The SetFore() method changes the HTML caption to be shown on the layer's foreground (expression) (equivalent of layers's [fore] flag) The expression supports the following keywords:
"value", indicates the layer's Value property
Parameters:
Name Type Description
value any Specifies the HTML caption to be shown on the layer's foreground. For instance "value" displays the control's value, while "`value`" displays the value string
SetFore

SetGrayscale(value)

The SetGrayscale() method converts the layer to grayscale (equivalent of layers's [grayscale] flag). The expression supports the following keywords:
"value", indicates the value of the control
Parameters:
Name Type Description
value string Specifies the percent value / expression to convert the layer to grayscale
SetGrayscale

SetHeight(value)

The SetHeight() method specifies the expression relative to the view, to determine the height to show the current layer on the control (equivalent of layers's [height] flag). The expression supports the following keywords:
"width", specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Parameters:
Name Type Description
value string Specifies the expression relative to the view, to determine the y-position to show the current layer on the control.
SetHeight

SetIdem(value)

The SetIdem() method ensures that the layer's offset and rotation-angle is equal for all idem layers (separated by comma character).
Parameters:
Name Type Description
value any Indicates a list of layers (idem layers) that has the same offset and rotation-angle
SetIdem

SetKey(value)

The SetKey() method changes the layer's key.
Parameters:
Name Type Description
value any Specifies the layer's new key
SetKey

SetLeft(value)

The SetLeft() method specifies the expression relative to the view, to determine the x-position to show the current layer on the control (equivalent of layers's [left] flag). The expression supports the following keywords:
"width", specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Parameters:
Name Type Description
value string Specifies the expression relative to the view, to determine the x-position to show the current layer on the control.
SetLeft

SetOffsetToValue(value)

The SetOffsetToValue() method specifies the expression to convert the offsetx,offsety to value (equivalent of layers's [o2v] flag). The expression supports the following keywords:
"value", "x", "offsetx", indicates the layer's OffsetX property
"y", "offsety", indicates the layer's OffsetY property
Parameters:
Name Type Description
value string Specifies the expression to validate the y-offset value of the layer
SetOffsetToValue

SetOffsetX(value)

The SetOffsetX() method indicates the x-offset of the layer.
Parameters:
Name Type Description
value number Specifies the x-offset of the layer.
SetOffsetX

SetOffsetXValid(value)

The SetOffsetXValid() method validates the x-offset value of the layer (equivalent of layers's [xValid] flag). The expression supports the following keywords:
"value", specifies the x-offset/y-offset of the layer
"x", specifies the x-offset of the layer
"y", specifies the y-offset of the layer
"lwidth" specifies the width in pixels of the layer's view
"lheight", specifies the height in pixels of the layer's view
"width" specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Parameters:
Name Type Description
value string Specifies the expression to validate the x-offset value of the layer
SetOffsetXValid

SetOffsetY(value)

The SetOffsetY() method indicates the y-offset of the layer.
Parameters:
Name Type Description
value number Specifies the y-offset of the layer.
SetOffsetY

SetOffsetYValid(value)

The SetOffsetYValid() method validates the y-offset value of the layer (equivalent of layers's [yValid] flag). The expression supports the following keywords:
"value", specifies the x-offset/y-offset of the layer
"x", specifies the x-offset of the layer
"y", specifies the y-offset of the layer
"lwidth" specifies the width in pixels of the layer's view
"lheight", specifies the height in pixels of the layer's view
"width" specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Parameters:
Name Type Description
value string Specifies the eypression to validate the y-offset value of the layer
SetOffsetYValid

SetOnDrag(value)

The SetOnDrag() method indicates the transformation of the layer once the user drags it.
Parameters:
Name Type Description
value Gauge.OnDragLayerEnum Specifies a value of Gauge.OnDragLayerEnum type that specifies the operation the layer is performed once the user drags it.
SetOnDrag

SetPosition(value)

The SetPosition() method changes the layer's position.
Parameters:
Name Type Description
value number Specifies the layer's new position
SetPosition

SetRotateAngle(value)

The SetRotateAngle() method specifies the angle to rotate the layer (equivalent of layers's [a] flag).
Parameters:
Name Type Description
value number Specifies the angle to rotate the layer.
SetRotateAngle

SetRotateAngleToValue(value)

The SetRotateAngleToValue() method specifies the expression to convert the rotating angle to value (equivalent of layers's [a2v] flag). The expression supports the following keywords:
"value", indicates the layer's Value property
Parameters:
Name Type Description
value string Specifies Specifies the expression to convert the rotating angle to value.
SetRotateAngleToValue

SetRotateAngleValid(value)

The SetRotateAngleValid() method validates the layer's rotation angle (equivalent of layers's [aValid] flag). The expression supports the following keywords:
"value", indicates the cumulative rotation angle ( CumulativeRotateAngle property ), during the dragging operation.
Parameters:
Name Type Description
value string Specifies the expression to validate rotation angle of the layer
SetRotateAngleValid

SetRotateCenterLayer(value)

The SetRotateCenterLayer() method indicates the index or key of the layer the rotation is around. If -1, the rotation is relative to the current layer (equivalent of layers's [cLayer] flag).
Parameters:
Name Type Description
value any Specifies indicates the index or key of the layer the rotation is around. If -1, the rotation is relative to the current layer.
SetRotateCenterLayer

SetRotateCenterX(value)

The SetRotateCenterX() method indicates the expression that determines the x-origin of the rotation point relative to the RotateCenterLayer layer (equivalent of layers's [xCenter] flag). The expression supports the following keywords:
"lwidth", indicates the width in pixels of the layer
"width", specifies the width in pixels of the view / control
"lheight", indicates the height in pixels of the layer
"height", specifies the height in pixels of the view / control
Parameters:
Name Type Description
value string Specifies the expression to to define the x-origin of the rotation point relative to the RotateCenterLayer layer.
SetRotateCenterX

SetRotateCenterY(value)

The SetRotateCenterY() method indicates the expression that determines the y-origin of the rotation point relative to the RotateCenterLayer layer (equivalent of layers's [yCenter] flag). The expression supports the following keywords:
"lwidth", indicates the width in pixels of the layer
"width", specifies the width in pixels of the view / control
"lheight", indicates the height in pixels of the layer
"height", specifies the height in pixels of the view / control
Parameters:
Name Type Description
value string Specifies the expression to to define the y-origin of the rotation point relative to the RotateCenterLayer layer.
SetRotateCenterY

SetRotateClip(value)

The SetRotateClip() method rotates the layer's clipping region once the layer is rotated (equivalent of layers's [rotateclip] flag).
Parameters:
Name Type Description
value boolean Specifies whether the layer's clipping region is rotated once the layer is rotated.
SetRotateClip

SetSelectable(value)

The SetSelectable() method shows or hides the layer.
Parameters:
Name Type Description
value boolean Specifies whether the layer is selectable or un-selectable
SetSelectable

SetTop(value)

The SetTop() method specifies the expression relative to the view, to determine the y-position to show the current layer on the control (equivalent of layers's [top] flag). The expression supports the following keywords:
"width", specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Parameters:
Name Type Description
value string Specifies the expression relative to the view, to determine the y-position to show the current layer on the control.
SetTop

SetTransparency(value)

The SetTransparency() method sets the percent value / expression of the transparency to display the layer (equivalent of layers's [transparency] flag). The expression supports the following keywords:
"value", indicates the value of the control
Parameters:
Name Type Description
value string Specifies the percent value / expression of the transparency to display the layer.
SetTransparency

SetValue(value)

The SetValue() method specifies the layer's value.
Parameters:
Name Type Description
value number Specifies the layer's newly value
SetValue

SetValueToOffsetX(value)

The SetValueToOffsetX() method specifies the expression to convert the value to x-offset(equivalent of layers's [v2x] flag) The expression supports the following keywords:
"value", indicates the layer's Value property
Parameters:
Name Type Description
value string Specifies the expression to validate the y-offset value of the layer
SetValueToOffsetX

SetValueToOffsetY(value)

The SetValueToOffsetY() method specifies the expression to convert the value to y-offset (equivalent of layers's [v2y] flag). The expression supports the following keywords:
"value", indicates the layer's Value property
Parameters:
Name Type Description
value string Specifies the expression to validate the y-offset value of the layer
SetValueToOffsetY

SetValueToRotateAngle(value)

The SetValueToRotateAngle() method specifies the expression to convert the value to rotating angle (equivalent of layers's [v2a] flag). The expression supports the following keywords:
"value", indicates the layer's Value property
Parameters:
Name Type Description
value string Specifies Specifies the expression to convert the value to rotating angle.
SetValueToRotateAngle

SetVisible(value)

The SetVisible() method shows or hides the layer.
Parameters:
Name Type Description
value boolean Specifies whether the layer is visible or hidden
SetVisible

SetWidth(value)

The SetWidth() method specifies the expression relative to the view, to determine the width to show the current layer on the control (equivalent of layers's [width] flag). The expression supports the following keywords:
"width", specifies the width in pixels of the control's view
"height", specifies the height in pixels of the control's view
Parameters:
Name Type Description
value string Specifies the expression relative to the view, to determine the y-position to show the current layer on the control.
SetWidth

drawBack(ctx, client, back)

The drawBack() method draws the layer's background (only if it was specified)
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Specifies the canvas's context where the drawing occurs
client Array.<number> Indicates the layer's client rectangle
back any Indicates the HTML picture or a solid color to fill
Since:
  • 1.1
drawBack

drawFore(ctx, client, fore)

The drawFore() method draws the layer's foreground (only if it was specified)
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Specifies the canvas's context where the drawing occurs
client Array.<number> Indicates the layer's client rectangle
fore string Specifies the exHTML caption to show
Since:
  • 1.1
drawFore