-
-
Notifications
You must be signed in to change notification settings - Fork 353
/
AthensAnimatedPresenter.class.st
53 lines (45 loc) · 1.2 KB
/
AthensAnimatedPresenter.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Class {
#name : #AthensAnimatedPresenter,
#superclass : #AthensStaticPresenter,
#traits : 'TSpecObservable',
#classTraits : 'TSpecObservable classTrait',
#instVars : [
'timeline',
'updateBlock'
],
#category : #'Spec-Core-Widgets-Athens'
}
{ #category : #specs }
AthensAnimatedPresenter class >> adapterName [
^ #AthensAnimatedAdapter
]
{ #category : #initialization }
AthensAnimatedPresenter >> initialize [
super initialize.
updateBlock := [ ].
self timeline: Timeline new.
]
{ #category : #initialization }
AthensAnimatedPresenter >> tick [
timeline tick
]
{ #category : #initialization }
AthensAnimatedPresenter >> timeline: aTimeline [
self flag: #comment.
" Should check what happens if there is arleady a timeline in use "
timeline := aTimeline.
timeline whenTickDo: [ :tick | self updateModelToMoment: tick ]
]
{ #category : #initialization }
AthensAnimatedPresenter >> updateBlock [
^ updateBlock
]
{ #category : #initialization }
AthensAnimatedPresenter >> updateBlock: aBlock [
updateBlock := aBlock
]
{ #category : #initialization }
AthensAnimatedPresenter >> updateModelToMoment: aTick [
updateBlock cull: aTick.
self adapter ifNotNil: [ self adapter updateModelToMoment: aTick]
]