C_TickableAnimation.js 2.2 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: hal
  3. // (C) Copyright IBM Corp. 2003, 2017.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. function C_TickableAnimation(_h931, _hSN1){C_TickableAnimation.baseConstructor.call(this, _h931);this._hJR1=_hSN1||NaN;var _h11=G_HAL.M_oLibraries["hal"]["animationDurationMultiplier"]||1;this._hLD1=_hSN1?Math.floor((this._hJR1*_h11)/ this._hR6):NaN;this._h7L1=0;this._hKR1=false;};C_TickableAnimation.F_Extends(C_Animation);C_TickableAnimation.prototype._hV5=Boolean(window.requestAnimationFrame||window.webkitRequestAnimationFrame);C_TickableAnimation.prototype.F_Play=function(){this._h2X();if(!this._hV5){this._hMD1=window.setInterval(this.F_Tick.bind(this), this._hR6);}else{this._hGC=Date.now();this._hMD1=this._h08(); }};C_TickableAnimation.prototype._h08=function(){if(!this._hY9){this._hY9=this.F_Tick.bind(this);}return(window.requestAnimationFrame||window.webkitRequestAnimationFrame)(this._hY9); };C_TickableAnimation.prototype._h211=function(){if(this._hMD1){if(!this._hV5){window.clearInterval(this._hMD1);}else{(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)(this._hMD1);}delete this._hMD1;}};C_TickableAnimation.prototype.F_Cancel=function(){this._h211();C_TickableAnimation.superClass.F_Cancel.call(this);};C_TickableAnimation.prototype.F_Stop=function(){this._h211();if(!this._hKR1){this._hKR1=true;C_TickableAnimation.superClass.F_Stop.call(this);}};C_TickableAnimation.prototype.F_IsComplete=function(){return this._hKR1;};C_TickableAnimation.prototype.F_IsLastTick=function(){return(this._h7L1==this._hLD1);};C_TickableAnimation.prototype.F_Tick=function(_hXA2){if(_hXA2){_hXA2=Date.now();this._hMD1=null;if((_hXA2-this._hGC)<this._hR6){this._hMD1=this._h08();return;}}var _hA71=!isNaN(this._hJR1);if((this._h7L1==0)&&!this._hQA){this._h8L1=G_Performance.F_Now();this.F_OnBeforePlay();}var _hB71=G_Performance.F_Now();if((_hB71-this._h8L1)>(this._hJR1*3)){this._h7L1=this._hLD1;}this.F_OnTick();if(_hA71&&(this._h7L1==this._hLD1)){this.F_Stop();return;}this._h7L1++;if(_hXA2){this._hMD1=this._h08();}};C_TickableAnimation.prototype.F_OnTick=function(){};