API / geotoolkit / attributes / FillStyle / FillStyle
attributes.FillStyle.FillStyle
Defines fill style. This fill style can have a color and a pattern
↳
FillStyle↳↳
LogDataStyle
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)) |
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
color | string | Color in CSS form |
evenoddmode | boolean | Even-odd fill mode |
fillpattern | Pattern | Pattern |
fillpattern-containername | string | An 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-patternname | string | Name of this pattern for indexing |
fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
foreground | string | Foreground color |
pattern | Pattern | Pattern |
Constructors
• new FillStyle()
ColoredStyle.constructor
• new FillStyle(color?)
| Name | Type |
|---|---|
Optional color | Type |
ColoredStyle.constructor
• new FillStyle(color?, pattern?, foreground?, evenoddmode?, shadow?)
Create FillStyle
| Name | Type | Description |
|---|---|---|
Optional color | string | RgbaColor | Color of FillStyle (not used in Gradient) or JSON with parameters |
Optional pattern | Pattern | The background pattern (not used in Gradient) |
Optional foreground | string | RgbaColor | The foreground color of the pattern (not used in Gradient) |
Optional evenoddmode | boolean | The flag indicating whether even-odd fill mode is to be used. |
Optional shadow | Shadow | JSON for displaying shadow |
ColoredStyle.constructor
• new FillStyle(fillstyle?)
Creates fill style
| Name | Type | Description |
|---|---|---|
Optional fillstyle | FillStyle | FillStyle instance to copy |
ColoredStyle.constructor
• new FillStyle(properties?)
Create fill style
| Name | Type | Description |
|---|---|---|
Optional properties | Options | object to copy |
ColoredStyle.constructor
Methods
▸ clone(): FillStyle
All inheritors should implement copy constructor or provide custom implementation for this method
this
▸ Protected copyConstructor(src, deepCopy?): FillStyle
copy constructor
| Name | Type | Description |
|---|---|---|
src | FillStyle | Source to copy from |
Optional deepCopy | boolean | deep copy |
this
▸ dispose(): void
Dispose.
void
▸ equalsTo(other): boolean
Returns true if fills are identical
| Name | Type | Description |
|---|---|---|
other | FillStyle | FillStyle to compare against |
boolean
▸ getClassName(): string
string
▸ getColor(): string
Returns color
string
color in CSS form
▸ getEvenOddMode(): boolean
Gets the even odd fill mode
boolean
evenOddMode The even odd fill mode flag.
▸ getForegroundColor(): string
Gets foreground color
string
color in CSS form
▸ getPattern(context?): any
Return fill pattern. Can pass in rendering context to get HTML DOM pattern, or no arguments to get fillPattern object.
| Name | Type | Description |
|---|---|---|
Optional context | IPatternContext | native rendering context |
any
image pattern
▸ getProperties(context?): OptionsOut
Gets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional context | ISerializationContext | serialization context |
The object configuration
▸ getRaster(xMin?, yMin?, xMax?, yMax?): Raster
Returns a new instance of Raster
| Name | Type | Description |
|---|---|---|
Optional xMin | number | x Min position to get color |
Optional yMin | number | y Min position to get color |
Optional xMax | number | x Max position to get color |
Optional yMax | number | y Max position to get color |
▸ getRgbaColor(): RgbaColor
Return RGBA color
color
▸ getShadow(): Shadow
Gets all properties pertaining to shadow
JSON with offsetX, offsetY, color and blur properties
▸ getStyleType(): string
Gets type of style this is, STYLE_TYPE_COLOR or STYLE_TYPE_PATTERN
string
styleType
▸ getTimeStamp(): number
Gets time stamp
number
timeStamp
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
▸ invalidate(): FillStyle
notify the node that the style is invalidated
this
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(type, source, args?): FillStyle
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | Style | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ 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.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of the event |
Optional callback | (eventType: E, sender: FillStyle, args: EventMap[E]) => void | function to be called |
this
▸ 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.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: FillStyle, args: EventMap[E]) => void | to be called |
this
▸ setColor(color): FillStyle
Sets color
| Name | Type | Description |
|---|---|---|
color | string | RgbaColor | HsvColor | HlsColor | in CSS string form or RgbaColor object |
this
▸ setEvenOddMode(evenOddMode): FillStyle
Sets the even odd fill mode
| Name | Type | Description |
|---|---|---|
evenOddMode | boolean | The even odd fill mode flag. |
this
▸ setForegroundColor(color): FillStyle
Sets foreground color
this
▸ setPattern(pattern?): FillStyle
Sets fill pattern.
| Name | Type | Description |
|---|---|---|
Optional pattern | Pattern | fill pattern |
this
▸ setProperties(properties?): FillStyle
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Options | An object containing the properties to set |
this
▸ setShadow(shadow): FillStyle
Sets all properties pertaining to shadow
this
▸ setSilent(bool, force?): FillStyle
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
Optional force | boolean | true if parent should be invalidated immediately |
this
▸ toGrayScale(clone?): FillStyle
Clone the instance in grayscale style, or convert itself if [clone] is false.
| Name | Type | Description |
|---|---|---|
Optional clone | boolean | clone instance if true, default is true |
▸ updateTimeStamp(silent?): FillStyle
Update time stamp to indicate that style has been changed.
| Name | Type | Description |
|---|---|---|
Optional silent | boolean | silent mode. If this parameter equals to true then style doesn't send invalidate event |
this
▸ Static getClassName(): string
string
▸ Static isStyleNotificationEnabled(): boolean
Return status of the global notification for all styles.
boolean