Last updated

API / geotoolkit / animation / effects / AbstractEffect / AbstractEffect

Class: AbstractEffect

effects.AbstractEffect.AbstractEffect

Defines abstract animation effect, API is subset of SMIL animation with two extensions:

  1. Can accept param 'function' - like transition-timing-function in CSS
  2. Can accept value 'auto' as 'begin' parameter - animation will run automatically when animated attribute is changed.

Table of contents

Constructors
Accessors
Methods

Contents

Constructors

new AbstractEffect(options)

new AbstractEffect(options?)

Defines abstract animation effect

Parameters

Name Type Description
Optional optionsOptionsobject that contains effect options
Accessors

_active

get _active(): boolean

Deprecated

since 5.0. Use getActive() instead

Returns

boolean

set _active(active): void

Deprecated

since 5.0. Use setActive() instead

Parameters

Name Type
activeboolean

Returns

void


_attr

Protected get _attr(): string

Deprecated

since 5.0. Use getAttributeName() instead

Returns

string

Protected set _attr(attr): void

Deprecated

since 5.0. Use setAttributeName() instead

Parameters

Name Type
attrstring

Returns

void


_begin

get _begin(): string | number

Deprecated

since 5.0. Use getBegin() instead

Returns

string | number

set _begin(begin): void

Deprecated

since 5.0. Use setBegin() instead

Parameters

Name Type
beginstring | number

Returns

void


_processor

Protected get _processor(): AbstractProcessor<any>

Deprecated

since 5.0. Use getProcessor() instead

Returns

AbstractProcessor<any>

Protected set _processor(processor): void

Deprecated

since 5.0. Use setProcessor() instead

Parameters

Name Type
processorAbstractProcessor<any>

Returns

void


_repeatCount

get _repeatCount(): number

Deprecated

since 5.0. Use getRepeatCount() instead

Returns

number

set _repeatCount(repeatCount): void

Deprecated

since 5.0. Use setRepeatCount() instead

Parameters

Name Type
repeatCountnumber

Returns

void


_state

get _state(): Object

Deprecated

since 5.0. Use getState() instead

Returns

Object

NameType
current?any
repeat?number
start?number

set _state(state): void

Deprecated

since 5.0. Use setState() instead

Parameters

Name Type
stateObject
Optional state.currentany
Optional state.repeatnumber
Optional state.startnumber

Returns

void


_style

get _style(): AnimationStyle

Deprecated

since 5.0. Use getStyle() instead

Returns

AnimationStyle

set _style(style): void

Deprecated

since 5.0. Use setStyle() instead

Parameters

Name Type
styleAnimationStyle

Returns

void


_timeOffset

get _timeOffset(): number

Deprecated

since 5.0. Use getTimeOffset() instead

Returns

number

set _timeOffset(timeOffset): void

Deprecated

since 5.0. Use setTimeOffset() instead

Parameters

Name Type
timeOffsetnumber

Returns

void


_to

get _to(): any

Deprecated

since 5.0. Use getTo() instead

Returns

any

set _to(to): void

Deprecated

since 5.0. Use setTo() instead

Parameters

Name Type
toany

Returns

void


_type

Protected get _type(): string

Deprecated

since 5.0. Use getTo() instead

Returns

string

Protected set _type(type): void

Deprecated

since 5.0. Use setTo() instead

Parameters

Name Type
typestring

Returns

void


_unit

Protected get _unit(): string

Deprecated

since 5.0. Use getTo() instead

Returns

string

Protected set _unit(unit): void

Deprecated

since 5.0. Use setTo() instead

Parameters

Name Type
unitstring

Returns

void


_values

get _values(): any[]

Deprecated

since 5.0. Use getTo() instead

Returns

any[]

set _values(values): void

Deprecated

since 5.0. Use setTo() instead

Parameters

Name Type
valuesany[]

Returns

void

Methods

apply

apply(node): void

Applies effect to node and invalidate it To add animation support to target class create new Animation Effect by inherit from this class, and override method 'apply' to apply intermediate value to target class (for example with setters)

Parameters

Name Type Description
nodeAnimatedNodetarget node

Returns

void


ended

Protected ended(): void

Called immediately after the effect ends.

Returns

void


getActive

getActive(): boolean

Returns active state

Returns

boolean

active state


getAnimatedValue

getAnimatedValue(node): any

Extracts value which can animated from node

Parameters

Name Type Description
nodeNodeanimated node

Returns

any


getAttributeName

getAttributeName(): string

Returns attribute name

Returns

string

attribute name


getBegin

getBegin(): string | number

Returns begin value

Returns

string | number

begin value


getClassName

getClassName(): string

Returns

string


getCurrentValue

getCurrentValue(): any

Returns current value, which should be applied

Returns

any


getProcessor

Protected getProcessor(): AbstractProcessor<any>

Get processor, which will be used for calculate intermediate values

Returns

AbstractProcessor<any>


getRepeatCount

getRepeatCount(): number

Returns repeat count

Returns

number


getState

getState(): Object

Return state

Returns

Object

NameType
current?any
repeat?number
start?number

getStyle

getStyle(): AnimationStyle

Return style owner

Returns

AnimationStyle

style owner


getTimeOffset

getTimeOffset(): number

Return time offset

Returns

number

time offset


getTimeSegmentIndex

getTimeSegmentIndex(time): number

Gets the number of the time segment.

Parameters

Name Type Description
timenumbertime from effect's start

Returns

number

result time segment


getTo

getTo(): any

Return to value

Returns

any

to value


getTransformation

Protected getTransformation(node): Transformation

Returns transformation, that will be applied to the node

Parameters

Name Type Description
nodeAnimatedNodetarget node

Returns

Transformation

transformation


getType

Protected getType(): string

Returns effect type

Returns

string

effect type


getUnit

Protected getUnit(): string

Return effect unit

Returns

string

effect unit


getValues

getValues(): any[]

return values

Returns

any[]


isApplicable

isApplicable(effect, node): boolean

Returns true if this class can accept passed effect as a parameter

Parameters

Name Type Description
effectOptionseffect parameters
nodeNodetarget node

Returns

boolean


run

run(owner): AbstractEffect

Runs effect after creation

Parameters

Name Type Description
ownerAnimationStyleowner style

Returns

AbstractEffect

this


setActive

setActive(active): AbstractEffect

Set active state

Parameters

Name Type Description
activebooleanactive state

Returns

AbstractEffect

this


setAttributeName

setAttributeName(attribute): AbstractEffect

Set attribute name

Parameters

Name Type Description
attributestringattribute name

Returns

AbstractEffect

this


setBegin

setBegin(begin): AbstractEffect

Set begin balue

Parameters

Name Type Description
beginstring | numberbegin value

Returns

AbstractEffect

this


setProcessor

Protected setProcessor(processor): AbstractEffect

Set processor, which will be used for calculate intermediate values

Parameters

Name Type Description
processorAbstractProcessor<any>processor for calculate intermediate values

Returns

AbstractEffect


setState

setState(state): AbstractEffect

Set State

Parameters

Name Type Description
stateObjectstate of effect
Optional state.currentany
Optional state.repeatnumber
Optional state.startnumber

Returns

AbstractEffect

this


setStyle

setStyle(style): AbstractEffect

Set style owner

Parameters

Name Type Description
styleAnimationStylestyle owner

Returns

AbstractEffect

this


setTimeOffset

setTimeOffset(timeOffset): AbstractEffect

Set time offset

Parameters

Name Type Description
timeOffsetnumbertime offset

Returns

AbstractEffect

this


setTo

setTo(to): AbstractEffect

Set to value

Parameters

Name Type Description
toanyto value

Returns

AbstractEffect

this


setType

Protected setType(type): AbstractEffect

Set effect type

Parameters

Name Type Description
typestringeffect type

Returns

AbstractEffect

this


setUnit

Protected setUnit(unit): AbstractEffect

Set effect unit

Parameters

Name Type
unitstring

Returns

AbstractEffect

this


setValues

setValues(values): void

Sets a collection of values to the internal value list. After the values have been added, key times will be recalculated.

Parameters

Name Type Description
valuesany[]Values to be added to the internal collection

Returns

void


started

Protected started(): void

Called immediately after the effect begins.

Returns

void


stop

stop(node): void

Stop effect

Parameters

Name Type Description
nodeAnimatedNodetarget node

Returns

void


fromObject

Static fromObject(object?): AbstractEffect

Create or get effect from object

Parameters

Name Type Description
Optional objectAbstractEffect | Optionseffect

Returns

AbstractEffect

effect


getClassName

Static getClassName(): string

Returns

string