/* <copyright>
This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
</copyright> */
var Montage = require("montage/core/core").Montage;
var Component = require("montage/ui/component").Component;
var nj = require("js/lib/NJUtils").NJUtils;
var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
user_layers: {
value: null,
serializable: true
},
track_container: {
value: null,
serializable: true
},
timeline_leftpane: {
value: null,
serializable: true
},
layer_tracks: {
value: null,
serializable: true
},
master_track: {
value: null,
serializable: true
},
time_markers: {
value: null,
serializable: true
},
playhead: {
value: null,
serializable: true
},
playheadmarker: {
value: null,
serializable: true
},
timetext: {
value: null,
serializable: true
},
timebar: {
value: null,
serializable: true
},
container_tracks: {
value: null,
serializable: true
},
end_hottext: {
value: null,
serializable: true
},
container_layers: {
value: null,
serializable: true
},
timeline_disabler: {
value: null,
serializable: true
},
checkable_relative: {
value: null,
serializable: true
},
checkable_absolute: {
value: null,
serializable: true
},
checkable_animated: {
value: null,
serializable: true
},
tl_configbutton: {
value: null,
serializable: true
},
/* === BEGIN: Models === */
_currentDocument: {
value : null
},
currentDocument : {
get : function() {
return this._currentDocument;
},
set : function(value) {
if (value === this._currentDocument) {
return;
}
if(!this._currentDocument && value.currentView === "design") {
this.enablePanel(true);
}
this._currentDocument = value;
if(!value) {
this.enablePanel(false);
} else if(this._currentDocument.currentView === "design") {
this._boolCacheArrays = false;
this.clearTimelinePanel();
this._boolCacheArrays = true;
// Rebind the document events for the new document context
this._bindDocumentEvents();
// TODO: Fix the init function so that it can be called here instead of when container changes
// this.initTimelineForDocument();
}
}
},
_arrLayers:{
value:[]
},
arrLayers:{
serializable:true,
get:function () {
return this._arrLayers;
},
set:function (newVal) {
this._arrLayers = newVal;
this.needsDraw = true;
this.cacheTimeline();
}
},
_temparrLayers:{
value:[]
},
temparrLayers:{
get:function () {
return this._temparrLayers;
},
set:function (newVal) {
this._temparrLayers = newVal;
}
},
_layerRepetition:{
value:null
},
layerRepetition:{
get:function () {
return this._layerRepetition;
},
set:function (newVal) {
this._layerRepetition = newVal;
},
serializable: true
},
// Set to false to skip array caching array sets in current document
_boolCacheArrays:{
value:true
},
_currentLayerNumber:{
value:0
},
currentLayerNumber:{
get:function () {
return this._currentLayerNumber;
},
set:function (newVal) {
if (newVal !== this._currentLayerNumber) {
this._currentLayerNumber = newVal;
this.cacheTimeline();
}
}
},
_currentLayerSelected:{
value: false
},
currentLayerSelected:{
get:function () {
return this._currentLayerSelected;
},
set:function (newVal) {
this._currentLayerSelected = newVal;
this.cacheTimeline();
}
},
_selectedLayerID:{
value:false
},
selectedLayerID:{
get:function () {
return this._selectedLayerID;
},
set:function (newVal) {
if (newVal === false) {
// We are clearing the timeline, so just set the value and return.
this._selectedLayerID = newVal;
return;
}
if (newVal !== this._selectedLayerID) {
var selectIndex = this.getLayerIndexByID(newVal);
this._selectedLayerID = newVal;
this._captureSelection = true;
if (this.currentLayerSelected !== false) {
this.selectLaye
|