Last updated

API / geotoolkit / attributes / FillStyle / FillStyle

Class: FillStyle

attributes.FillStyle.FillStyle

Defines fill style. This fill style can have a color and a pattern

Hierarchy

Implements

Table of contents

Constructors
[new FillStyle()](/solutions/geotoolkit/apis/classes/geotoolkit.attributes.fillstyle.fillstyle.md#new fillstyle())[new FillStyle(color)](/solutions/geotoolkit/apis/classes/geotoolkit.attributes.fillstyle.fillstyle.md#new fillstyle(color))[new FillStyle(color, pattern, foreground, evenoddmode, shadow)](/solutions/geotoolkit/apis/classes/geotoolkit.attributes.fillstyle.fillstyle.md#new fillstyle(color, pattern, foreground, evenoddmode, shadow))
[new FillStyle(fillstyle)](/solutions/geotoolkit/apis/classes/geotoolkit.attributes.fillstyle.fillstyle.md#new fillstyle(fillstyle))[new FillStyle(properties)](/solutions/geotoolkit/apis/classes/geotoolkit.attributes.fillstyle.fillstyle.md#new fillstyle(properties))
Accessors
Methods
Css Properties
Name Type Description
colorstringColor in CSS form
evenoddmodebooleanEven-odd fill mode
fillpatternPatternPattern
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
fillpattern-patternnamestringName of this pattern for indexing
fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
foregroundstringForeground color
patternPatternPattern

Contents

Constructors

new FillStyle()

new FillStyle()

Overrides

ColoredStyle.constructor


new FillStyle(color)

new FillStyle(color?)

Parameters

Name Type
Optional colorType

Overrides

ColoredStyle.constructor


new FillStyle(color, pattern, foreground, evenoddmode, shadow)

new FillStyle(color?, pattern?, foreground?, evenoddmode?, shadow?)

Create FillStyle

Parameters

Name Type Description
Optional colorstring | RgbaColorColor of FillStyle (not used in Gradient) or JSON with parameters
Optional patternPatternThe background pattern (not used in Gradient)
Optional foregroundstring | RgbaColorThe foreground color of the pattern (not used in Gradient)
Optional evenoddmodebooleanThe flag indicating whether even-odd fill mode is to be used.
Optional shadowShadowJSON for displaying shadow

Overrides

ColoredStyle.constructor


new FillStyle(fillstyle)

new FillStyle(fillstyle?)

Creates fill style

Parameters

Name Type Description
Optional fillstyleFillStyleFillStyle instance to copy

Overrides

ColoredStyle.constructor


new FillStyle(properties)

new FillStyle(properties?)

Create fill style

Parameters

Name Type Description
Optional propertiesOptionsobject to copy

Overrides

ColoredStyle.constructor

Accessors

Empty

Static get Empty(): FillStyle

Empty style

Returns

FillStyle


Pick

Static get Pick(): FillStyle

Pick style

Returns

FillStyle

Methods

clone

clone(): FillStyle

All inheritors should implement copy constructor or provide custom implementation for this method

Returns

FillStyle

this

Overrides

ColoredStyle.clone


copyConstructor

Protected copyConstructor(src, deepCopy?): FillStyle

copy constructor

Parameters

Name Type Description
srcFillStyleSource to copy from
Optional deepCopybooleandeep copy

Returns

FillStyle

this

Overrides

ColoredStyle.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

ColoredStyle.dispose


equalsTo

equalsTo(other): boolean

Returns true if fills are identical

Parameters

Name Type Description
otherFillStyleFillStyle to compare against

Returns

boolean


getClassName

getClassName(): string

Returns

string

Inherited from

ColoredStyle.getClassName


getColor

getColor(): string

Returns color

Returns

string

color in CSS form

Inherited from

ColoredStyle.getColor


getEvenOddMode

getEvenOddMode(): boolean

Gets the even odd fill mode

Returns

boolean

evenOddMode The even odd fill mode flag.


getForegroundColor

getForegroundColor(): string

Gets foreground color

Returns

string

color in CSS form


getPattern

getPattern(context?): any

Return fill pattern. Can pass in rendering context to get HTML DOM pattern, or no arguments to get fillPattern object.

Parameters

Name Type Description
Optional contextIPatternContextnative rendering context

Returns

any

image pattern


getProperties

getProperties(context?): OptionsOut

Gets all the properties pertaining to this object

Parameters

Name Type Description
Optional contextISerializationContextserialization context

Returns

OptionsOut

The object configuration

Overrides

ColoredStyle.getProperties


getRaster

getRaster(xMin?, yMin?, xMax?, yMax?): Raster

Returns a new instance of Raster

Parameters

Name Type Description
Optional xMinnumberx Min position to get color
Optional yMinnumbery Min position to get color
Optional xMaxnumberx Max position to get color
Optional yMaxnumbery Max position to get color

Returns

Raster

Implementation of

IRasterable.getRaster


getRgbaColor

getRgbaColor(): RgbaColor

Return RGBA color

Returns

RgbaColor

color

Inherited from

ColoredStyle.getRgbaColor


getShadow

getShadow(): Shadow

Gets all properties pertaining to shadow

Returns

Shadow

JSON with offsetX, offsetY, color and blur properties

Inherited from

ColoredStyle.getShadow


getStyleType

getStyleType(): string

Gets type of style this is, STYLE_TYPE_COLOR or STYLE_TYPE_PATTERN

Returns

string

styleType


getTimeStamp

getTimeStamp(): number

Gets time stamp

Returns

number

timeStamp

Inherited from

ColoredStyle.getTimeStamp


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

ColoredStyle.hasEventListener


invalidate

invalidate(): FillStyle

notify the node that the style is invalidated

Returns

FillStyle

this

Inherited from

ColoredStyle.invalidate


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

ColoredStyle.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

ColoredStyle.isSilent


notify

notify<E>(type, source, args?): FillStyle

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceStyleof the event
Optional argsEventMap[E]arguments of the event

Returns

FillStyle

this

Inherited from

ColoredStyle.notify


off

off<E>(type, callback?): FillStyle

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of the event
Optional callback(eventType: E, sender: FillStyle, args: EventMap[E]) => voidfunction to be called

Returns

FillStyle

this

Overrides

ColoredStyle.off


on

on<E>(type, callback): FillStyle

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: FillStyle, args: EventMap[E]) => voidto be called

Returns

FillStyle

this

Inherited from

ColoredStyle.on


setColor

setColor(color): FillStyle

Sets color

Parameters

Name Type Description
colorstring | RgbaColor | HsvColor | HlsColorin CSS string form or RgbaColor object

Returns

FillStyle

this

Inherited from

ColoredStyle.setColor


setEvenOddMode

setEvenOddMode(evenOddMode): FillStyle

Sets the even odd fill mode

Parameters

Name Type Description
evenOddModebooleanThe even odd fill mode flag.

Returns

FillStyle

this


setForegroundColor

setForegroundColor(color): FillStyle

Sets foreground color

Parameters

Name Type Description
colorstring | RgbaColor | HsvColor | HlsColorRgbaColor for foreground

Returns

FillStyle

this


setPattern

setPattern(pattern?): FillStyle

Sets fill pattern.

Parameters

Name Type Description
Optional patternPatternfill pattern

Returns

FillStyle

this


setProperties

setProperties(properties?): FillStyle

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

FillStyle

this

Overrides

ColoredStyle.setProperties


setShadow

setShadow(shadow): FillStyle

Sets all properties pertaining to shadow

Parameters

Name Type Description
shadowPartial<Merge<Shadow, { color?: string | RgbaColor }>>data

Returns

FillStyle

this

Inherited from

ColoredStyle.setShadow


setSilent

setSilent(bool, force?): FillStyle

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode
Optional forcebooleantrue if parent should be invalidated immediately

Returns

FillStyle

this

Inherited from

ColoredStyle.setSilent


toGrayScale

toGrayScale(clone?): FillStyle

Clone the instance in grayscale style, or convert itself if [clone] is false.

Parameters

Name Type Description
Optional clonebooleanclone instance if true, default is true

Returns

FillStyle

Overrides

ColoredStyle.toGrayScale


updateTimeStamp

updateTimeStamp(silent?): FillStyle

Update time stamp to indicate that style has been changed.

Parameters

Name Type Description
Optional silentbooleansilent mode. If this parameter equals to true then style doesn't send invalidate event

Returns

FillStyle

this

Inherited from

ColoredStyle.updateTimeStamp


getClassName

Static getClassName(): string

Returns

string

Inherited from

ColoredStyle.getClassName


isStyleNotificationEnabled

Static isStyleNotificationEnabled(): boolean

Return status of the global notification for all styles.

Returns

boolean

Inherited from

ColoredStyle.isStyleNotificationEnabled