/**
* @fileoverview Code for the viewport.
*/
-base.require('base.events');
-base.require('tracing.draw_helpers');
-base.require('tracing.timeline_display_transform');
-base.require('ui.animation');
-base.require('ui.animation_controller');
+tvcm.require('tvcm.events');
+tvcm.require('tracing.draw_helpers');
+tvcm.require('tracing.timeline_display_transform');
+tvcm.require('tvcm.ui.animation');
+tvcm.require('tvcm.ui.animation_controller');
-base.exportTo('tracing', function() {
+tvcm.exportTo('tracing', function() {
var TimelineDisplayTransform = tracing.TimelineDisplayTransform;
* ways.
*
* @constructor
- * @extends {base.EventTarget}
+ * @extends {tvcm.EventTarget}
*/
function TimelineViewport(parentEl) {
this.parentEl_ = parentEl;
this.currentDisplayTransform_ = new TimelineDisplayTransform();
this.initAnimationController_();
- // Flow events
- this.showFlowEvents_ = false;
-
// Grid system.
this.gridTimebase_ = 0;
this.gridStep_ = 1000 / 60;
}
TimelineViewport.prototype = {
- __proto__: base.EventTarget.prototype,
+ __proto__: tvcm.EventTarget.prototype,
/**
* Allows initialization of the viewport when the viewport's parent element
* to redraw when the underlying model has been mutated.
*/
dispatchChangeEvent: function() {
- base.dispatchSimpleEvent(this, 'change');
+ tvcm.dispatchSimpleEvent(this, 'change');
},
dispatchMarkersChangeEvent_: function() {
- base.dispatchSimpleEvent(this, 'markersChange');
+ tvcm.dispatchSimpleEvent(this, 'markersChange');
},
detach: function() {
},
initAnimationController_: function() {
- this.dtAnimationController_ = new ui.AnimationController();
+ this.dtAnimationController_ = new tvcm.ui.AnimationController();
this.dtAnimationController_.addEventListener(
'didtick', function(e) {
this.onCurentDisplayTransformChange_(e.oldTargetState);
},
queueDisplayTransformAnimation: function(animation) {
- if (!(animation instanceof ui.Animation))
- throw new Error('animation must be instanceof ui.Animation');
+ if (!(animation instanceof tvcm.ui.Animation))
+ throw new Error('animation must be instanceof tvcm.ui.Animation');
this.dtAnimationController_.queueAnimation(animation);
},
onCurentDisplayTransformChange_: function(oldDisplayTransform) {
// Ensure panY stays clamped in the track container's scroll range.
if (this.modelTrackContainer_) {
- this.currentDisplayTransform.panY = base.clamp(
+ this.currentDisplayTransform.panY = tvcm.clamp(
this.currentDisplayTransform.panY,
0,
this.modelTrackContainer_.scrollHeight -
this.onModelTrackControllerScroll_);
},
- get showFlowEvents() {
- return this.showFlowEvents_;
- },
-
- set showFlowEvents(showFlowEvents) {
- this.showFlowEvents_ = showFlowEvents;
- this.dispatchChangeEvent();
- },
-
get gridEnabled() {
return this.gridEnabled_;
},
},
getMarkerBounds: function() {
- var bounds = new base.Range();
+ var bounds = new tvcm.Range();
for (var i = 0; i < this.markers.length; ++i)
bounds.addValue(this.markers[i].positionWorld);
return bounds;