aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Tween.reel/Tween.js
blob: 64e998c3b3c98761bad4c1a121094fc9c0b086a9 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
var Montage = require("montage/core/core").Montage;
var Component = require("montage/ui/component").Component;

var Tween = exports.Tween = Montage.create(Component, {

    hasTemplate:{
        value: true
    },

    _spanWidth: {
        value: 0
    },

    spanWidth: {
        serializable:true,
        get: function(){
            return this._spanWidth;
        },
        set: function(value){
            this._spanWidth = value;
        }
    },

    _spanPosition:{
        value: 0
    },

    spanPosition:{
        serializable:true,
        get:function () {
            return this._spanPosition;
        },
        set:function (value) {
            this._spanPosition = value;
        }
    },

    _keyFramePosition:{
        value:0
    },

    keyFramePosition:{
        serializable:true,
        get:function () {
            return this._keyFramePosition;
        },
        set:function (value) {
            this._keyFramePosition = value;
        }
    },

    _keyFrameMillisec:{
        value:0
    },

    keyFrameMillisec:{
        serializable:true,
        get:function () {
            return this._keyFrameMillisec;
        },
        set:function (value) {
            this._keyFrameMillisec = value;
        }
    },

    _keyframeID:{
        value:0
    },

    keyframeID:{
        serializable:true,
        get:function () {
            return this._keyframeID;
        },
        set:function (value) {
            this._keyframeID = value;
        }
    },

    _timelineTrack:{
        value:0
    },

    timelineTrack:{
        serializable:true,
        get:function () {
            return this._timelineTrack;
        },
        set:function (value) {
            this._timelineTrack = value;
        }
    },

    prepareForDraw:{
        value:function(){
            this.keyframe.containingTrack = this.timelineTrack;
        }
    },

    draw:{
        value:function(){
            this.span.spanWidth = this.spanWidth;
            this.keyframe.position = this.spanWidth;
            this.keyframe.timelinePosition = this.keyFramePosition;
            this.keyframe.id = this.keyframeID;
            this.tweencontainer.style.left = this.spanPosition + "px";
        }
    }
});