diff -r 9d968fbcaa2a -r 0d7dac03c1a0 client/annotviz/app/js/annotsRoll.js --- a/client/annotviz/app/js/annotsRoll.js Tue Jan 20 12:00:40 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/** -* js/annotsRoll.js -* -* annotsRoll basic component -* -*/ - -'use strict'; - -var PIXI = require('pixi'); -var randomColor = require('randomColor'); - -function AnnotsRoll(parentContainer, xInit, yInit, width, height, widthRoll, pixelsPerSecond, annotColors, lineInterval){ - var _this = this; - this.container = new PIXI.DisplayObjectContainer(); - this.container.position.x = xInit; - this.container.position.y = yInit; - this.container.width = width; - parentContainer.addChild(this.container); - - this.height = height; - this.width = width; - this.widthRoll = widthRoll; - this.pixelsPerSecond = pixelsPerSecond; - this.lineInterval = lineInterval; - - this.addAnnot = function(category, user, color){ - var graphics = new PIXI.Graphics(); - var x = 0; - var y = -this.container.y; - graphics.beginFill(color); - graphics.drawRect(x, y, 10, 3); - graphics.endFill(); - - this.container.addChild(graphics); - - var catText = new PIXI.Text(category, { font: '16pt Arial', fill: color.replace("0x", "#") }); - catText.x = x + 20; - catText.y = y - 23; - this.container.addChild(catText); - - var userText = new PIXI.Text(user, { font: '10pt Arial', fill: '#444444' }); - userText.x = x + 20; - userText.y = y + 2; - this.container.addChild(userText); - - this.addAnnotLine(color); - }; - - this.addAnnotLine = function(color){ - var x = this.widthRoll; - var y = -this.container.y; - - var graphics = new PIXI.Graphics(); - - graphics.beginFill(color); - graphics.drawRect(x, y, this.width - x, 3); - graphics.endFill(); - - this.container.addChild(graphics); - }; - - this.moveTo = function(diffTime){ - this.container.y = Math.floor(diffTime*this.pixelsPerSecond); - }; - - this.removePassedObjets = function(){ - var nbChilds = _this.container.children.length; - var i = 0, childIsNowDisplayed = false, childrenToRemove = []; - while(i