Last updated

API / geotoolkit / gauges / layout / Region / Region

Class: Region

layout.Region.Region

Implements a region which is the main component in the process of layouting the gauge elements. A region is an abstract rectangle which defines some area withing the gauge bounds and can contain any part of the gauge. By default, gauge is divided into 9 regions, but not limited to that. Custom regions can be added. Since regions are an abstract object, no fill style and/or linestyle can be applied to them. Bounds of a region are calculated and set by the gauge, thus, setting bounds from an application will be overridden.

Table of contents

Constructors
Methods
Css Properties
Name Type Description
boundsRectThe region bounds
bounds-heightnumberHeight
bounds-readonlybooleanReadonly
bounds-widthnumberWidth
bounds-xnumberLeft
bounds-ynumberTop
fillstylestringThe region fill style
fillstyleFillStyleThe region fill style
fillstyle-colorstringColor in CSS form
fillstyle-evenoddmodebooleanEven-odd fill mode
fillstyle-fillpatternPatternPattern
fillstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
fillstyle-fillpattern-patternnamestringName of this pattern for indexing
fillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
fillstyle-foregroundstringForeground color
fillstyle-patternPatternPattern
heightnumber | stringHeight of the region
linestylestringThe region line style
linestyleLineStyleThe region line style
linestyle-colorstringColor in CSS form
linestyle-fillstringOptional fill style to be used to fill lines generated with this style
linestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
linestyle-linecapCapStyleThe line cap style
linestyle-linedashoffsetnumberLine dash offset of dashed line
linestyle-linejoinJoinStyleThe line join style
linestyle-pixelsnapmodebooleanPixel Snap Mode, default(
linestyle-scalablebooleanTrue if width should depend on transformation
linestyle-unitstringOptional unit for the width
linestyle-widthnumber | stringThe line thickness
namestringThe region name
parentRegionsThe region relative to which this region is calculated
widthnumber | stringWidth of the region
xnumber | stringX coordinate of the region
ynumber | stringY coordinate of the region

Contents

Constructors

new Region(options)

new Region(options?)

Parameters

Name Type
Optional optionsOptions
Methods

clone

clone(): Region

Get a clone of this object

Returns

Region

clone


getBounds

getBounds(): Rect

Returns bounds of the region

Returns

Rect


getClassName

getClassName(): string

Returns

string


getFillStyle

getFillStyle(): FillStyle

Gets Fill Style of this region

Returns

FillStyle


getHeight

getHeight(): number

Returns Height property of region

Returns

number


getLineStyle

getLineStyle(): LineStyle

Gets Line Style of this region

Returns

LineStyle


getParent

getParent(): string

Gets the parent where this region is rendered

Returns

string


getProperties

getProperties(): Required<Omit<Options, "width" | "height" | "x" | "y">>

Gets properties pertaining to this object

Returns

Required<Omit<Options, "width" | "height" | "x" | "y">>

properties


getWidth

getWidth(): number

Returns Width property of region

Returns

number


setBounds

setBounds(bounds): Region

Sets bounds for this region

Parameters

Name Type Description
boundsRectNew bounds

Returns

Region


setFillStyle

setFillStyle(fillStyle, merge?): Region

Sets fill style

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

Region


setHeight

setHeight(h): Region

Sets Height property of region

Parameters

Name Type Description
hnumberNew Height to set

Returns

Region


setLineStyle

setLineStyle(lineStyle, merge?): Region

Sets line style

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

Region

this


setParent

setParent(parent): Region

Sets the name of region relative to which this region is calculated

Parameters

Name Type Description
parentstringregion parent

Returns

Region


setProperties

setProperties(params?): Region

Sets properties pertaining to this object

Parameters

Name Type Description
Optional paramsOptionsproperties

Returns

Region


setWidth

setWidth(w): Region

Sets Width property of region

Parameters

Name Type Description
wnumberNew Width to set

Returns

Region


setX

setX(x): Region

Sets X property of region

Parameters

Name Type Description
xnumberNew X to set

Returns

Region


setY

setY(y): Region

Sets Y property of region

Parameters

Name Type Description
ynumberNew Y to set

Returns

Region


fromObject

Static fromObject(region): Region

Create or get a region from an object

Parameters

Name Type Description
regionOptions | RegionA region or an object with region properties

Returns

Region

region


getClassName

Static getClassName(): string

Returns

string