Complex_Graphics.prototype=new Extra_Graphics();function Complex_Graphics(){this._list_of_graphics=new Array()}Complex_Graphics.prototype.add_graphics=function(a){this._list_of_graphics.push(a)};Complex_Graphics.prototype.add_list_of_graphics=function(a){this._list_of_graphics=this._list_of_graphics.concat(a)};Complex_Graphics.prototype.draw=function(a){};Complex_Graphics.prototype.clear=function(c){try{for(var a=0;a<this._list_of_graphics.length;a++){this._list_of_graphics[a].clear(c)}this._list_of_graphics.splice(0,this._list_of_graphics.length)}catch(b){alert("Complex_Graphics.clear(): "+b);return false}};Complex_Graphics.prototype.snap_point=function(a,d){var c=false;for(var b=0;b<this._list_of_graphics.length;b++){c=this._list_of_graphics[b].snap_point(a,d);if(c!=false){return c}}return c};Complex_Graphics.prototype.to_post_request=function(){try{var a="";var h="";var g=true;var f="";for(var b=0;b<this._list_of_graphics.length;b++){if(this._list_of_graphics[b].constructor==Line){if(g){g=false}else{f="_"}var d=this._list_of_graphics[b].to_post_request();a+=f+d[0];h+=f+d[1]}}return new Array(a,h)}catch(c){alert("Complex_Graphics.to_post_request() "+c);return false}};Complex_Graphics.prototype.to_polygon_post_request=function(){try{if(this._list_of_graphics.length==0){alert(_MSG_DEFINE_GEOMETRY);return false}this._list_of_graphics[this._list_of_graphics.length-1]._p2=this._list_of_graphics[0]._p1.clone();var a="";var g="";var f=true;for(var b=0;b<this._list_of_graphics.length;b++){var d=this._list_of_graphics[b];if(d.constructor!=Line){throw"Sono supportate unicamente linee nella definizione del poligono"}if(f){a+=d._p1._x;g+=d._p1._y;a+="_";g+="_";a+=d._p2._x;g+=d._p2._y;f=false}else{a+=d._p2._x;g+=d._p2._y}if(b+1<this._list_of_graphics.length){a+="_";g+="_"}}return new Array(a,g)}catch(c){alert("Complex_Graphics.to_polygon_post_request() "+c);return false}};Complex_Graphics.prototype.move=function(a,d){try{for(var b=0;b<this._list_of_graphics.length;b++){this._list_of_graphics[b].move(a,d)}}catch(c){alert("Complex_Graphics.move(): "+c);return false}};
