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) |
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
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
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
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
GetDefaultOffsetX() → {number}
The GetDefaultOffsetX() method indicates the default x-offset of the layer.
Returns:
Returns the default x-offset of the layer.
- Type
- number
GetDefaultOffsetY() → {number}
The GetDefaultOffsetY() method indicates the default y-offset of the layer.
Returns:
Returns the default y-offset of the layer.
- Type
- number
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
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
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
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
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
GetIndex() → {any}
The GetIndex() method retrieves the layer's index.
Returns:
Returns the layer's index
- Type
- any
GetKey() → {any}
The GetKey() method retrieves the layer's key.
Returns:
Returns the layer's key
- Type
- any
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
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
GetOffsetX() → {number}
The GetOffsetX() method indicates the x-offset of the layer.
Returns:
Returns the x-offset of the layer.
- Type
- number
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
GetOffsetY() → {number}
The GetOffsetY() method indicates the y-offset of the layer.
Returns:
Returns the y-offset of the layer.
- Type
- number
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
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.
GetOnDrag
GetPosition() → {number}
The GetPosition() method retrieves the layer's position.
Returns:
Returns the layer's position
- Type
- number
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
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
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
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
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
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
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
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
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
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
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
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
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
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
GetValue() → {number}
The GetValue() method specifies the layer's value.
Returns:
Returns the layer's value.
- Type
- number
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
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
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
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
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
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 |
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. |
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. |
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. |
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 |
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 |
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. |
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 |
SetKey(value)
The SetKey() method changes the layer's key.
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Specifies the layer's new key |
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. |
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 |
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. |
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 |
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. |
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 |
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. |
SetPosition(value)
The SetPosition() method changes the layer's position.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Specifies the layer's new position |
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. |
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. |
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 |
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. |
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. |
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. |
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. |
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 |
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. |
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. |
SetValue(value)
The SetValue() method specifies the layer's value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Specifies the layer's newly value |
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 |
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 |
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. |
SetVisible(value)
The SetVisible() method shows or hides the layer.
Parameters:
Name | Type | Description |
---|---|---|
value |
boolean | Specifies whether the layer is visible or hidden |
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. |
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
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