Esempio n. 1
0
		drawCurveExit: function()
		{
			var curve = this.data;
			var alpha = curve.alpha;

			//if (0 === curve.points.length) {
				if (!curve.stage) {
					curve.stage = 'exiting';
					// log("curve exiting: " + curve.id);
				}
				alpha = alpha * (1 - (this.time - AnimClass.DEFAULT_ANIMATION_LENGTH)
												/ AnimClass.DEFAULT_ANIMATION_LENGTH);
				this.time += 1;
			//}
			//else {
				// log("called drawCurveExit id: " + curve.id + ",
				// curve.points.length: " + curve.points.length);
			//}

			Processing.strokeWeight(CurveSize);
			Processing.strokeCap(Processing.ROUND);
			Processing.stroke(curve.color, alpha);
			Processing.bezier(curve.buyerX, curve.buyerY, curve.buyerCX, curve.buyerCY,
							curve.supplierCX, curve.supplierCY, curve.supplierX,
							curve.supplierY);
		},
Esempio n. 2
0
		drawCurveEnter: function()
		{
			Processing.strokeWeight(CurveSize);
			Processing.strokeCap(Processing.ROUND);
			var curve = this.data;
			// log("draw curve id: " + curve.id + ", time: " + this.time);

			if (AnimClass.DEFAULT_ANIMATION_LENGTH / 2 > this.time) {
				// log("in progress curve: " + this.time);
				Processing.stroke(curve.color, curve.alpha);
				subBezier(curve, this.time / (AnimClass.DEFAULT_ANIMATION_LENGTH / 2));
				this.time += 1;
			}
			else if (AnimClass.DEFAULT_ANIMATION_LENGTH >= this.time) {
				Processing.stroke(curve.color, curve.alpha);
				Processing.bezier(curve.buyerX, curve.buyerY, curve.buyerCX, curve.buyerCY,
								curve.supplierCX, curve.supplierCY, curve.supplierX,
								curve.supplierY);
				this.time += 1;
			}
		},