Studio.Shape.Ellipse = function(){};

Studio.Shape.Ellipse.prototype = 
{
    x               : "",
    y               : "",
    width           : "",
    height          : "",
    color_fill      : "",
    color_stroke    : "",
    width_stroke    : "",
    
    createDetails : function(oElement, aParams)
    {
        this.x              = aParams['x'];
        this.y              = aParams['y'];
        this.width          = aParams['width'];
        this.height         = aParams['height'];
        this.color_fill     = new RGBColor(aParams['color_fill']).toHex();
        this.width_stroke   = aParams['width_stroke'];
    },

    getUrlAttach : function()
    {
        var sUrl = '';
        sUrl += 'shapetype/'        + 'ellipse'             + '/';
        sUrl += 'x/'                + parseInt(this.x)      + '/';
        sUrl += 'y/'                + parseInt(this.y)      + '/';
        sUrl += 'width/'            + parseInt(this.width)  + '/';
        sUrl += 'height/'           + parseInt(this.height) + '/';
        sUrl += 'color_fill/'       + this.color_fill       + '/';
        sUrl += 'color_stroke/'     + this.color_stroke     + '/';
        sUrl += 'width_stroke/'     + this.width_stroke     + '/';
        return sUrl;
    },
    
    getPostArray : function()
    {
    	return null;
    },
    
    getX : function()
    {
        var iX, iStartX;
        iX = this.x;
        if (Studio.Zoom.iX > 0 && Studio.Zoom.iY > 0)
        {
            iStartX = Math.min(Studio.Canvas.iWidth - Studio.Canvas.iWidth / Studio.Zoom.iZoom, Math.max(Studio.Zoom.iX - Studio.Canvas.iWidth / ( 2 * Studio.Zoom.iZoom ), 0));
            iX = Math.max(  (this.x - iStartX) * Studio.Zoom.iZoom, 0  );
        }
        return iX;
    },
    
    getY : function()
    {
        var iY, iStartY;
        iY = this.y;
        if (Studio.Zoom.iX > 0 && Studio.Zoom.iY > 0)
        {
            iStartY = Math.min(Studio.Canvas.iHeight - Studio.Canvas.iHeight / Studio.Zoom.iZoom, Math.max(Studio.Zoom.iY - Studio.Canvas.iHeight / ( 2 * Studio.Zoom.iZoom ), 0));
            iY = Math.max(  (this.y - iStartY) * Studio.Zoom.iZoom, 0  );
        }
        return iY;
    },
    
    getWidth : function()
    {
        return Number(this.width);// + Number(this.width_stroke) * 2;
    },
    
    getHeight : function()
    {
        return Number(this.height);// + Number(this.width_stroke) * 2;
    },
    
    getCanvasWidth : function()
    {
        return Number(this.width) + Number(this.width_stroke) * 2;
    },
    
    getCanvasHeight : function()
    {
        return Number(this.height) + Number(this.width_stroke) * 2;
    }

};