API / geotoolkit / attributes / Pattern / Pattern
attributes.Pattern.Pattern
Defines a base class to define a pattern.
↳
Pattern
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
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 |
patternname | string | Name of this pattern for indexing |
scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
Methods
▸ dispose(): void
Dispose.
void
▸ getClassName(): string
string
▸ getContainerName(): string
Returns a name of the pattern container
string
a container name
▸ getDataURL(): Promise<string>
Return the imagepattern data url promise
Promise<string>
▸ getHeight(): number
Height of this pattern's image
number
height
▸ getPattern(context, repetition, foregroundColor?, transform?): any
Makes a pattern from the image
| Name | Type | Description |
|---|---|---|
context | IPatternContext | 2d rendering context from canvas |
repetition | string | style of repetition |
Optional foregroundColor | string | of the pattern |
Optional transform | Transformation | transform |
any
pattern
▸ getPatternName(): string
Returns pattern name
string
a pattern name
▸ getPromise(): Promise<IBaseImage>
return the load image promise
Promise<IBaseImage>
▸ getProperties(context?): OptionsOut
Gets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional context | ISerializationContext | serializer context |
An object containing the properties
▸ getScaleX(): number
Gets the X scale for image transformation.
number
▸ getScaleY(): number
Gets the Y scale for image transformation.
number
▸ getSize(): Dimension
Returns size as a Dimension object with width and height attributes
size
▸ getUserHandle(): Function
Gets user handle
Deprecated
since 4.0. Not used anymore.
Function
userHandle
▸ getWidth(): number
Width of this pattern's image
number
width
▸ 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
EventDispatcher.hasEventListener
▸ invalidate(foregroundColor?): Pattern
invalidate parent
| Name | Type | Description |
|---|---|---|
Optional foregroundColor | string | of the pattern |
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?): Pattern
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | Pattern | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): Pattern
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 |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: Pattern, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): Pattern
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: Pattern, args: EventMap[E]) => void | to be called |
this
▸ setPatternName(patternName, containerName): Pattern
This method sets the container and pattern name to be used for serialization.
| Name | Type | Description |
|---|---|---|
patternName | string | pattern name |
containerName | string | container name |
this
▸ setProperties(properties?): Pattern
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Options | An object containing the properties to set |
this
▸ setSilent(bool): Pattern
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ Static getClassName(): string
string