/*jshint node: true */
'use strict';

/*
* Name :  Axis.js
* Module : FrontEnd::Model::GraphsModel
* Location : /frontend/app/Model/GraphsModel
*
* History :
* Version       Date        Programmer                  Description
* ===============================================================================================================7
* 0.1.3         2015-05-18  Maria Giovanna Chinellato   Fix attributes
*
* 0.1.2         2015-05-17  Maria Giovanna Chinellato   Fix code
*
* 0.1.1         2015-05-15  Francesco Rossetto          Fix attributes and methods
*
* 0.1.0         2015-05-14  Maria Giovanna Chinellato   Add attributes and methods
*
* 0.0.1         2015-05-14  Maria Giovanna Chinellato   Initial code      
* ===============================================================================================================
*
*/

angular.module('services')
.factory('Axis', function(){

    var name = null;
    var color = '#FFF';
    var minValue = null;
    var maxValue = null;
    var ticks = 10;
    var scale = 'linear';


    function Axis(info){

        if (info !== undefined) {
            if (info.name !== undefined) {
                name = info.name;
            }
            if (info.color !== undefined) {
                color = info.color;
            }
            if (info.minIndex !== undefined) {
                minValue = info.minIndex;
            }
            if (info.maxIndex !== undefined) {
                maxValue = info.maxIndex;
            }
            if (info.ticks !== undefined) {
                ticks = info.ticks;
            }
            if (info.scale !== undefined) {
                scale = info.scale;
            }
        }
    }

    Axis.prototype = {
        updateParameters : function(info){
            if (info !== undefined) {
                if (info.name !== undefined) {
                    name = info.name;
                }
                if (info.color !== undefined) {
                    color = info.color;
                }
                if (info.minIndex !== undefined) {
                    minValue = info.minIndex;
                }
                if (info.maxIndex !== undefined) {
                    maxValue = info.maxIndex;
                }
                if (info.ticks !== undefined) {
                    ticks = info.ticks;
                }
                if (info.scale !== undefined) {
                    scale = info.scale;
                }
            }
        },

        getName : function(){
            return name;
        },
        getColor : function(){
            return color;
        },
        getMinValue : function(){
            return minValue;
        },
        getMaxValue : function(){
            return maxValue;
        },
        getTicks : function(){
            return ticks;
        },
        getScale : function(){
            return scale;
        }

    };

    return( Axis );
});
@@ -880,16 +880,23 @@
 ry('Axis
+Factory
 ', funct
@@ -907,20 +907,51 @@
 )%7B%0A%0A    
-var 
+function Axis(info)%7B%0A        this._
 name = n
@@ -959,20 +959,26 @@
 ll;%0A    
-var 
+    this._
 color = 
@@ -989,20 +989,26 @@
 F';%0A    
-var 
+    this._
 minValue
@@ -1020,20 +1020,26 @@
 ll;%0A    
-var 
+    this._
 maxValue
@@ -1051,20 +1051,26 @@
 ll;%0A    
+   
-var 
+ this._
 ticks = 
@@ -1081,12 +1081,18 @@
     
-var 
+    this._
 scal
@@ -1110,35 +1110,8 @@
 ';%0A%0A
-%0A    function Axis(info)%7B%0A%0A
     
@@ -1191,32 +1191,38 @@
                 
+this._
 name = info.name
@@ -1289,32 +1289,38 @@
                 
+this._
 color = info.col
@@ -1392,32 +1392,38 @@
                 
+this._
 minValue = info.
@@ -1501,32 +1501,38 @@
                 
+this._
 maxValue = info.
@@ -1607,32 +1607,38 @@
                 
+this._
 ticks = info.tic
@@ -1707,32 +1707,38 @@
                 
+this._
 scale = info.sca
@@ -1943,16 +1943,22 @@
         
+this._
 name = i
@@ -2053,16 +2053,22 @@
         
+this._
 color = 
@@ -2168,16 +2168,22 @@
         
+this._
 minValue
@@ -2289,16 +2289,22 @@
         
+this._
 maxValue
@@ -2407,16 +2407,22 @@
         
+this._
 ticks = 
@@ -2519,16 +2519,22 @@
         
+this._
 scale = 
@@ -2638,16 +2638,22 @@
  return 
+this._
 name;%0A  
@@ -2711,16 +2711,22 @@
  return 
+this._
 color;%0A 
@@ -2788,16 +2788,22 @@
  return 
+this._
 minValue
@@ -2868,16 +2868,22 @@
  return 
+this._
 maxValue
@@ -2945,16 +2945,22 @@
  return 
+this._
 ticks;%0A 
@@ -3019,16 +3019,22 @@
  return 
+this._
 scale;%0A 
@@ -3051,16 +3051,126 @@
     %7D;%0A%0A
+    function AxisFactory() %7B%7D%0A%0A    AxisFactory.build = function(info) %7B%0A        return new Axis(info);%0A    %7D;%0A
     retu
@@ -3177,15 +3177,22 @@
 rn( Axis
+Factory
  );%0A%7D);

fix model