API / geotoolkit / attributes / RadialGradientStyle / RadialGradientStyle
attributes.RadialGradientStyle.RadialGradientStyle
Defines a radial gradient fill style, which represents a gradient of colors along of cone between two circles.
Radial gradients are defined with relative numbers from 0-1 describing the inner and outer circles. radius values are percentages of the shape's radius
↳
RadialGradientStyle
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
color | string | Color in CSS form |
endcolor | string | End color in CSS format |
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 |
innercenter | Point | Centerpoint of inner circle of gradient in relative form, 0-1 or absolute coordinates |
innercenter-x | number | X coordinate |
innercenter-y | number | Y coordinate |
innerradius | number | Radius of inner circle in relative form, 0-1 or absolute coordinates |
outercenter | Point | Centerpoint of outer circle of gradient in relative form, 0-1 or absolute coordinates |
outerradius | number | Radius of outer circle of gradient from 0-1 or absolute coordinates |
pattern | Pattern | Pattern |
spreadmethod | SpreadMethods | Spread method defines how the gradient fills given area if gradient vector does not cover the whole area |
startcolor | string | Start color in CSS format |
transformation | Transformation | Gradient transformation |
transformation-dx | number | X axis translation |
transformation-dy | number | Y axis translation |
transformation-xx | number | X scale |
transformation-xy | number | Xy skew |
transformation-yx | number | Yx skew |
transformation-yy | number | Y scale |
unittype | GradientUnits | Type of coordinated used to define gradient |
Constructors
• new RadialGradientStyle(startColor?, endColor?, innerCenter?, innerRadius?, outerCenter?, outerRadius?, transformation?, unitType?)
Create RadialGradientStyle
| Name | Type | Description |
|---|---|---|
Optional startColor | string | Options | start color in CSS format or a properties |
Optional endColor | string | end color in CSS format |
Optional innerCenter | Point | centerpoint of inner circle of gradient in relative form, 0-1 or absolute coordinates |
Optional innerRadius | number | radius of inner circle in relative form, 0-1 or absolute coordinates |
Optional outerCenter | Point | centerpoint of outer circle of gradient in relative form, 0-1 or absolute coordinates |
Optional outerRadius | number | radius of outer circle of gradient from 0-1 or absolute coordinates |
Optional transformation | Transformation | Gradient transformation |
Optional unitType | string | Type of coordinated used to define gradient |
GradientStyle.constructor
Accessors
• Static get Empty(): FillStyle
Empty style
GradientStyle.Empty
• Static get Pick(): FillStyle
Pick style
GradientStyle.Pick
Methods
▸ addStopPoint(position, color): RadialGradientStyle
Add a new stop point at a given position and color.
| Name | Type | Description |
|---|---|---|
position | number | position of the stop point, if in relative coordinates from 0 to 1 |
color | string | color in CSS form for specified stop point |
this
▸ cleanDuplicatePoints(): RadialGradientStyle
Removes points that are identical, leaving only one
this
GradientStyle.cleanDuplicatePoints
▸ clearStopPoints(): RadialGradientStyle
Clear all stop points
this
▸ clone(): RadialGradientStyle
All inheritors should implement copy constructor or provide custom implementation for this method
this
▸ Protected copyConstructor(src, deepCopy?): RadialGradientStyle
copy constructor
| Name | Type | Description |
|---|---|---|
src | RadialGradientStyle | 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
▸ getEndColor(): string
Returns end color
string
color color in CSS format
▸ 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
GradientStyle.getForegroundColor
▸ getInnerCenter(): Point
Get the center of the inner circle
▸ getInnerRadius(): number
Gets inner radius
number
radius of the inner circle
▸ getOuterCenter(): Point
Return start center in relative coordinates from 0 to 1
point
▸ getOuterRadius(): number
Return start point from 0 to 1
number
radius of outer circle of gradient from 0-1
▸ 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(): OptionsOut
Gets all the properties pertaining to this object
An object containing the properties
▸ 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
▸ getSpreadMethod(): SpreadMethods
▸ getStartColor(): string
Returns start color
string
color in CSS format
▸ getStopPointColor(index): string
Return color at a stop point by index.
| Name | Type | Description |
|---|---|---|
index | number | index of a stop point |
string
color in CSS format, or null if index is out of range.
GradientStyle.getStopPointColor
▸ getStopPointPosition(index): number
Return stop point position
| Name | Type | Description |
|---|---|---|
index | number | index of stop point |
number
position either in relative or absolute terms or null if index is out of range.
GradientStyle.getStopPointPosition
▸ getStopPointsCount(): number
Return the number of defined gradient stop points
number
stops number of stops
GradientStyle.getStopPointsCount
▸ getStyleType(): string
Return type of the style.
string
STYLE_TYPE_RADIAL_GRADIENT
▸ getTimeStamp(): number
Gets time stamp
number
timeStamp
▸ getTransformation(): Transformation
Returns the transformation set on the gradient
GradientStyle.getTransformation
▸ getUnits(): GradientUnits
Gets the type of units
▸ 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
GradientStyle.hasEventListener
▸ invalidate(): RadialGradientStyle
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?): RadialGradientStyle
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?): RadialGradientStyle
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: RadialGradientStyle, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): RadialGradientStyle
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: RadialGradientStyle, args: EventMap[E]) => void | to be called |
this
▸ removeStopPoint(index): RadialGradientStyle
Removes stop point at index.
| Name | Type | Description |
|---|---|---|
index | number | index of the stop point |
this
▸ setColor(color): RadialGradientStyle
Sets color
| Name | Type | Description |
|---|---|---|
color | string | RgbaColor | HsvColor | HlsColor | in CSS string form or RgbaColor object |
this
▸ setEndColor(color): RadialGradientStyle
Sets end color
| Name | Type | Description |
|---|---|---|
color | string | color to set in CSS format |
this
▸ setEvenOddMode(evenOddMode): RadialGradientStyle
Sets the even odd fill mode
| Name | Type | Description |
|---|---|---|
evenOddMode | boolean | The even odd fill mode flag. |
this
▸ setForegroundColor(color): RadialGradientStyle
Sets foreground color
this
GradientStyle.setForegroundColor
▸ setInnerCenter(p): RadialGradientStyle
Set inner center point in relative terms
| Name | Type | Description |
|---|---|---|
p | Point | point defining center of inner circle |
this
▸ setInnerRadius(r): RadialGradientStyle
Sets inner radius
| Name | Type | Description |
|---|---|---|
r | number | Radius of inner circle |
this
▸ setOuterCenter(p): RadialGradientStyle
Set end point from 0 to 1
| Name | Type | Description |
|---|---|---|
p | Point | end point |
this
▸ setOuterRadius(r): RadialGradientStyle
Set end point from 0 to 1
| Name | Type | Description |
|---|---|---|
r | number | radius of outer circle of gradient from 0-1 |
this
▸ setPattern(pattern?): RadialGradientStyle
Sets fill pattern.
| Name | Type | Description |
|---|---|---|
Optional pattern | Pattern | fill pattern |
this
▸ setProperties(properties?): RadialGradientStyle
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Options | An object containing the properties to set |
▸ setShadow(shadow): RadialGradientStyle
Sets all properties pertaining to shadow
this
▸ setSilent(bool, force?): RadialGradientStyle
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
Optional force | boolean | true if parent should be invalidated immediately |
this
▸ setSpreadMethod(sMethod): RadialGradientStyle
Changes spread method for the gradient
| Name | Type | Description |
|---|---|---|
sMethod | "repeat" | "reflect" | "pad" | SpreadMethods | Spread method to apply to the gradient |
this
▸ setStartColor(color): RadialGradientStyle
Sets start color
| Name | Type | Description |
|---|---|---|
color | string | color to set |
this
▸ setStopPointColor(index, color): RadialGradientStyle
Sets color to a stop point by index.
| Name | Type | Description |
|---|---|---|
index | number | index of a stop point |
color | string | Color to set to the stop point |
GradientStyle.setStopPointColor
▸ setTransformation(transform): RadialGradientStyle
Sets transformation for the gradient
| Name | Type | Description |
|---|---|---|
transform | Transformation | The new gradient transformation |
GradientStyle.setTransformation
▸ setUnits(u): RadialGradientStyle
Sets unit type for the gradient
| Name | Type | Description |
|---|---|---|
u | GradientUnits | Unit type |
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?): RadialGradientStyle
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