/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */

if(!dojo._hasResource["esri.toolbars.draw"]){dojo._hasResource["esri.toolbars.draw"]=true;dojo.provide("esri.toolbars.draw");dojo.require("esri.toolbars._toolbar");dojo.require("esri.geometry");dojo.require("esri.symbol");dojo.require("esri.utils");dojo.declare("esri.toolbars.Draw",esri.toolbars._Toolbar,{constructor:function(_1,_2){this.markerSymbol=new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SOLID,10,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([255,0,0]),2),new dojo.Color([0,0,0,0.25]));this.lineSymbol=new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([255,0,0]),2);this.fillSymbol=new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([255,0,0]),2),new dojo.Color([0,0,0,0.25]));this._points=[];this._defaultOptions={showTooltips:true,drawTime:75,tolerance:8,tooltipOffset:15};this._options=dojo.mixin(dojo.mixin({},this._defaultOptions),_2||{});if(esri.isTouchEnabled){this._options.showTooltips=false;}this._onKeyDownHandler=dojo.hitch(this,this._onKeyDownHandler);this._onMouseDownHandler=dojo.hitch(this,this._onMouseDownHandler);this._onMouseUpHandler=dojo.hitch(this,this._onMouseUpHandler);this._onClickHandler=dojo.hitch(this,this._onClickHandler);this._onMouseMoveHandler=dojo.hitch(this,this._onMouseMoveHandler);this._onMouseDragHandler=dojo.hitch(this,this._onMouseDragHandler);this._onDblClickHandler=dojo.hitch(this,this._onDblClickHandler);this._updateTooltip=dojo.hitch(this,this._updateTooltip);this._hideTooltip=dojo.hitch(this,this._hideTooltip);this._redrawGraphic=dojo.hitch(this,this._redrawGraphic);},_geometryType:null,respectDrawingVertexOrder:false,setRespectDrawingVertexOrder:function(_3){this.respectDrawingVertexOrder=_3;},setMarkerSymbol:function(_4){this.markerSymbol=_4;},setLineSymbol:function(_5){this.lineSymbol=_5;},setFillSymbol:function(_6){this.fillSymbol=_6;},activate:function(_7,_8){if(this._geometryType){this.deactivate();}var _9=this.map,dc=dojo.connect,_a=esri.toolbars.Draw;this._options=dojo.mixin(dojo.mixin({},this._options),_8||{});_9.__resetClickDuration();switch(_7){case _a.POINT:case _a.ARROW:case _a.LEFT_ARROW:case _a.RIGHT_ARROW:case _a.UP_ARROW:case _a.DOWN_ARROW:case _a.TRIANGLE:case _a.CIRCLE:case _a.ELLIPSE:case _a.RECTANGLE:this._onClickHandler_connect=dc(_9,"onClick",this._onClickHandler);break;case _a.LINE:case _a.EXTENT:case _a.FREEHAND_POLYLINE:case _a.FREEHAND_POLYGON:this._deactivateMapTools(true,false,false,true);this._onMouseDownHandler_connect=dc(_9,esri.isTouchEnabled?"onTouchStart":"onMouseDown",this._onMouseDownHandler);this._onMouseDragHandler_connect=dc(_9,esri.isTouchEnabled?"onTouchMove":"onMouseDrag",this._onMouseDragHandler);this._onMouseUpHandler_connect=dc(_9,esri.isTouchEnabled?"onTouchEnd":"onMouseUp",this._onMouseUpHandler);break;case _a.POLYLINE:case _a.POLYGON:case _a.MULTI_POINT:_9.__setClickDuration(0);this._onClickHandler_connect=dc(_9,"onClick",this._onClickHandler);this._onDblClickHandler_connect=dc(_9,"onDblClick",this._onDblClickHandler);_9.disableDoubleClickZoom();break;default:console.error(esri.bundle.toolbars.draw.invalidType+": "+_7);return;}this._onKeyDown_connect=dc(_9,"onKeyDown",this._onKeyDownHandler);this._redrawConnect=dc(_9,"onExtentChange",this._redrawGraphic);this._geometryType=_7;this._toggleTooltip(true);if(_9.snappingManager&&this._geometryType!=="freehandpolyline"&&this._geometryType!=="freehandpolygon"&&!esri.isTouchEnabled){_9.snappingManager._startSelectionLayerQuery();_9.snappingManager._setUpSnapping();}this.onActivate(this._geometryType);},deactivate:function(){var _b=this.map;this._clear();var _c=dojo.disconnect;_c(this._onMouseDownHandler_connect);_c(this._onMouseMoveHandler_connect);_c(this._onMouseDragHandler_connect);_c(this._onMouseUpHandler_connect);_c(this._onClickHandler_connect);_c(this._onDblClickHandler_connect);_c(this._onKeyDown_connect);_c(this._redrawConnect);if(_b.snappingManager){_b.snappingManager._stopSelectionLayerQuery();_b.snappingManager._killOffSnapping();}switch(this._geometryType){case esri.toolbars.Draw.LINE:case esri.toolbars.Draw.EXTENT:case esri.toolbars.Draw.FREEHAND_POLYLINE:case esri.toolbars.Draw.FREEHAND_POLYGON:this._activateMapTools(true,false,false,true);break;case esri.toolbars.Draw.POLYLINE:case esri.toolbars.Draw.POLYGON:case esri.toolbars.Draw.MULTI_POINT:_b.enableDoubleClickZoom();break;}var _d=this._geometryType;this._geometryType=null;_b.__resetClickDuration();this._toggleTooltip(false);this.onDeactivate(_d);},_clear:function(){if(this._graphic){this.map.graphics.remove(this._graphic,true);}if(this._tGraphic){this.map.graphics.remove(this._tGraphic,true);}this._graphic=this._tGraphic=null;if(this.map.snappingManager){this.map.snappingManager._setGraphic(null);}this._points=[];},finishDrawing:function(){var _e,_f=this._points,map=this.map,_10=map.spatialReference,_11=esri.toolbars.Draw;_f=_f.slice(0,_f.length);switch(this._geometryType){case _11.POLYLINE:if(!this._graphic||_f.length<2){return;}_e=new esri.geometry.Polyline(_10);_e.addPath([].concat(_f));break;case _11.POLYGON:if(!this._graphic||_f.length<3){return;}_e=new esri.geometry.Polygon(_10);var _12=[].concat(_f,[_f[0].offset(0,0)]);if(!esri.geometry.isClockwise(_12)&&!this.respectDrawingVertexOrder){console.debug(this.declaredClass+" : "+esri.bundle.toolbars.draw.convertAntiClockwisePolygon);_12.reverse();}_e.addRing(_12);break;case _11.MULTI_POINT:_e=new esri.geometry.Multipoint(_10);dojo.forEach(_f,function(pt){_e.addPoint(pt);});break;}dojo.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);if(_e){this.onDrawEnd(_e);}},_normalizeRect:function(_13,end,_14){var sx=_13.x,sy=_13.y,ex=end.x,ey=end.y,_15=Math.abs(sx-ex),_16=Math.abs(sy-ey);return {x:Math.min(sx,ex),y:Math.max(sy,ey),width:_15,height:_16,spatialReference:_14};},_onMouseDownHandler:function(evt){this._dragged=false;var _17;if(this.map.snappingManager){_17=this.map.snappingManager._snappingPoint;}var _18=_17||evt.mapPoint,_19=esri.toolbars.Draw,map=this.map,_1a=map.spatialReference;this._points.push(_18.offset(0,0));switch(this._geometryType){case _19.LINE:this._graphic=map.graphics.add(new esri.Graphic(new esri.geometry.Polyline({paths:[[[_18.x,_18.y],[_18.x,_18.y]]]}),this.lineSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}break;case _19.EXTENT:break;case _19.FREEHAND_POLYLINE:this._oldPoint=evt.screenPoint;var _1b=new esri.geometry.Polyline(_1a);_1b.addPath(this._points);this._graphic=map.graphics.add(new esri.Graphic(_1b,this.lineSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}break;case _19.FREEHAND_POLYGON:this._oldPoint=evt.screenPoint;var _1c=new esri.geometry.Polygon(_1a);_1c.addRing(this._points);this._graphic=map.graphics.add(new esri.Graphic(_1c,this.fillSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}break;}if(esri.isTouchEnabled){evt.preventDefault();}},_onMouseMoveHandler:function(evt){var _1d;if(this.map.snappingManager){_1d=this.map.snappingManager._snappingPoint;}var _1e=this._points[this._points.length-1],end=_1d||evt.mapPoint,_1f=this._tGraphic,_20=_1f.geometry;switch(this._geometryType){case esri.toolbars.Draw.POLYLINE:case esri.toolbars.Draw.POLYGON:_20.setPoint(0,0,{x:_1e.x,y:_1e.y});_20.setPoint(0,1,{x:end.x,y:end.y});_1f.setGeometry(_20);break;}},_onMouseDragHandler:function(evt){if(esri.isTouchEnabled&&!this._points.length){evt.preventDefault();return;}this._dragged=true;var _21;if(this.map.snappingManager){_21=this.map.snappingManager._snappingPoint;}var _22=this._points[0],end=_21||evt.mapPoint,map=this.map,_23=map.spatialReference,_24=this._graphic,_25=esri.toolbars.Draw;switch(this._geometryType){case _25.LINE:_24.setGeometry(dojo.mixin(_24.geometry,{paths:[[[_22.x,_22.y],[end.x,end.y]]]}));break;case _25.EXTENT:if(_24){map.graphics.remove(_24,true);}var _26=new esri.geometry.Rect(this._normalizeRect(_22,end,_23));_26._originOnly=true;this._graphic=map.graphics.add(new esri.Graphic(_26,this.fillSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}break;case _25.FREEHAND_POLYLINE:this._hideTooltip();if(this._canDrawFreehandPoint(evt)===false){if(esri.isTouchEnabled){evt.preventDefault();}return;}this._points.push(evt.mapPoint.offset(0,0));_24.geometry._insertPoints([end.offset(0,0)],0);_24.setGeometry(_24.geometry);break;case _25.FREEHAND_POLYGON:this._hideTooltip();if(this._canDrawFreehandPoint(evt)===false){if(esri.isTouchEnabled){evt.preventDefault();}return;}this._points.push(evt.mapPoint.offset(0,0));_24.geometry._insertPoints([end.offset(0,0)],0);_24.setGeometry(_24.geometry);break;}if(esri.isTouchEnabled){evt.preventDefault();}},_canDrawFreehandPoint:function(evt){if(!this._oldPoint){return false;}var dx=this._oldPoint.x-evt.screenPoint.x;dx=(dx<0)?dx*-1:dx;var dy=this._oldPoint.y-evt.screenPoint.y;dy=(dy<0)?dy*-1:dy;var _27=this._options.tolerance;if(dx<_27&&dy<_27){return false;}var now=new Date();var _28=now-this._startTime;if(_28<this._options.drawTime){return false;}this._startTime=now;this._oldPoint=evt.screenPoint;return true;},_onMouseUpHandler:function(evt){if(!this._dragged){this._clear();return;}if(this._points.length===0){this._points.push(evt.mapPoint.offset(0,0));}var _29;if(this.map.snappingManager){_29=this.map.snappingManager._snappingPoint;}var _2a=this._points[0],end=_29||evt.mapPoint,map=this.map,_2b=map.spatialReference,_2c=esri.toolbars.Draw,_2d;switch(this._geometryType){case _2c.LINE:_2d=new esri.geometry.Polyline({paths:[[[_2a.x,_2a.y],[end.x,end.y]]],spatialReference:_2b});break;case _2c.EXTENT:_2d=esri.geometry._rectToExtent(new esri.geometry.Rect(this._normalizeRect(_2a,end,_2b)));break;case _2c.FREEHAND_POLYLINE:_2d=new esri.geometry.Polyline(_2b);_2d.addPath([].concat(this._points,[end.offset(0,0)]));break;case _2c.FREEHAND_POLYGON:_2d=new esri.geometry.Polygon(_2b);var _2e=[].concat(this._points,[end.offset(0,0),this._points[0].offset(0,0)]);if(!esri.geometry.isClockwise(_2e)&&!this.respectDrawingVertexOrder){console.debug(this.declaredClass+" : "+esri.bundle.toolbars.draw.convertAntiClockwisePolygon);_2e.reverse();}_2d.addRing(_2e);break;}if(esri.isTouchEnabled){evt.preventDefault();}this._clear();this.onDrawEnd(_2d);},_onClickHandler:function(evt){var _2f;if(this.map.snappingManager){_2f=this.map.snappingManager._snappingPoint;}var _30=_2f||evt.mapPoint,map=this.map,_31=map.toScreen(_30),_32=esri.toolbars.Draw,pts,dx,dy,_33,i,_34,_35;this._points.push(_30.offset(0,0));switch(this._geometryType){case _32.POINT:this.onDrawEnd(_30.offset(0,0));this._setTooltipMessage(0);break;case _32.POLYLINE:if(this._points.length===1){var _36=new esri.geometry.Polyline(map.spatialReference);_36.addPath(this._points);this._graphic=map.graphics.add(new esri.Graphic(_36,this.lineSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}this._onMouseMoveHandler_connect=dojo.connect(map,"onMouseMove",this._onMouseMoveHandler);this._tGraphic=map.graphics.add(new esri.Graphic(new esri.geometry.Polyline({paths:[[[_30.x,_30.y],[_30.x,_30.y]]]}),this.lineSymbol),true);}else{this._graphic.geometry._insertPoints([_30.offset(0,0)],0);this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.lineSymbol);_34=this._tGraphic;_35=_34.geometry;_35.setPoint(0,0,_30.offset(0,0));_35.setPoint(0,1,_30.offset(0,0));_34.setGeometry(_35);}break;case _32.POLYGON:if(this._points.length===1){var _37=new esri.geometry.Polygon(map.spatialReference);_37.addRing(this._points);this._graphic=map.graphics.add(new esri.Graphic(_37,this.fillSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}this._onMouseMoveHandler_connect=dojo.connect(map,"onMouseMove",this._onMouseMoveHandler);this._tGraphic=map.graphics.add(new esri.Graphic(new esri.geometry.Polyline({paths:[[[_30.x,_30.y],[_30.x,_30.y]]]}),this.fillSymbol),true);}else{this._graphic.geometry._insertPoints([_30.offset(0,0)],0);this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.fillSymbol);_34=this._tGraphic;_35=_34.geometry;_35.setPoint(0,0,_30.offset(0,0));_35.setPoint(0,1,_30.offset(0,0));_34.setGeometry(_35);}break;case _32.MULTI_POINT:var tps=this._points;if(tps.length===1){var _38=new esri.geometry.Multipoint(map.spatialReference);_38.addPoint(tps[tps.length-1]);this._graphic=map.graphics.add(new esri.Graphic(_38,this.markerSymbol),true);if(map.snappingManager){map.snappingManager._setGraphic(this._graphic);}}else{this._graphic.geometry.addPoint(tps[tps.length-1]);this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.markerSymbol);}break;case _32.ARROW:pts=[[96,24],[72,52],[72,40],[0,40],[0,12],[72,12],[72,0],[96,24]];dx=_31.x-36;dy=_31.y-24;this._addShape(pts,dx,dy);break;case _32.LEFT_ARROW:pts=[[0,24],[24,52],[24,40],[96,40],[96,12],[24,12],[24,0],[0,24]];dx=_31.x-60;dy=_31.y-24;this._addShape(pts,dx,dy);break;case _32.RIGHT_ARROW:pts=[[96,24],[72,52],[72,40],[0,40],[0,12],[72,12],[72,0],[96,24]];dx=_31.x-36;dy=_31.y-24;this._addShape(pts,dx,dy);break;case _32.UP_ARROW:pts=[[24,0],[52,24],[40,24],[40,96],[12,96],[12,24],[0,24],[24,0]];dx=_31.x-24;dy=_31.y-60;this._addShape(pts,dx,dy);break;case _32.DOWN_ARROW:pts=[[24,96],[52,72],[40,72],[40,0],[12,0],[12,72],[0,72],[24,96]];dx=_31.x-24;dy=_31.y-36;this._addShape(pts,dx,dy);break;case _32.TRIANGLE:pts=[[0,96],[48,0],[96,96],[0,96]];dx=_31.x-48;dy=_31.y-48;this._addShape(pts,dx,dy);break;case _32.RECTANGLE:pts=[[0,-96],[96,-96],[96,0],[0,0],[0,-96]];dx=_31.x-48;dy=_31.y+48;this._addShape(pts,dx,dy);break;case _32.CIRCLE:_33=360;var _39=(2*Math.PI)/_33;pts=[];for(i=0;i<_33;i++){pts.push([48*Math.cos(_39*i),48*Math.sin(_39*i)]);}pts.push(pts[0]);this._addShape(pts,_31.x,_31.y);break;case _32.ELLIPSE:var rad=Math.PI/180;var _3a=-rad;var _3b=Math.sin(_3a);var _3c=Math.cos(_3a);_33=360;pts=[];for(i=0;i<_33;i++){var _3d=i*(rad);var _3e=Math.sin(_3d);var _3f=Math.cos(_3d);var x=(48*_3f*_3c-24*_3e*_3b);var y=(48*_3f*_3b+24*_3e*_3c);pts.push([x,y]);}pts.push(pts[0]);this._addShape(pts,_31.x,_31.y);break;}this._setTooltipMessage(this._points.length);},_addShape:function(_40,dx,dy){var _41=this.map.graphics.add(new esri.Graphic(this._toPolygon(_40,dx,dy),this.fillSymbol),true);this._setTooltipMessage(0);var _42;if(_41){_42=esri.geometry.fromJson(_41.geometry.toJson());this.map.graphics.remove(_41,true);}this.onDrawEnd(_42);_41=_42=null;},_toPolygon:function(_43,dx,dy){var map=this.map;var _44=new esri.geometry.Polygon(map.spatialReference);_44.addRing(dojo.map(_43,function(pt){return map.toMap({x:pt[0]+dx,y:pt[1]+dy});}));return _44;},_onDblClickHandler:function(evt){var _45,_46=this._points,map=this.map,_47=map.spatialReference,_48=esri.toolbars.Draw;if(esri.isTouchEnabled){_46.push(evt.mapPoint);}_46=_46.slice(0,_46.length);switch(this._geometryType){case _48.POLYLINE:if(!this._graphic||_46.length<2){dojo.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(evt);return;}_45=new esri.geometry.Polyline(_47);_45.addPath([].concat(_46));break;case _48.POLYGON:if(!this._graphic||_46.length<2){dojo.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(evt);return;}_45=new esri.geometry.Polygon(_47);var _49=[].concat(_46,[_46[0].offset(0,0)]);if(!esri.geometry.isClockwise(_49)&&!this.respectDrawingVertexOrder){console.debug(this.declaredClass+" : "+esri.bundle.toolbars.draw.convertAntiClockwisePolygon);_49.reverse();}_45.addRing(_49);break;case _48.MULTI_POINT:_45=new esri.geometry.Multipoint(_47);dojo.forEach(_46,function(pt){_45.addPoint(pt);});break;}dojo.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);this.onDrawEnd(_45);},_onKeyDownHandler:function(evt){if(evt.keyCode===dojo.keys.ESCAPE){dojo.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);}},_toggleTooltip:function(_4a){if(!this._options.showTooltips){return;}if(_4a){if(this._tooltip){return;}var _4b=this.map.container;this._tooltip=dojo.create("div",{"class":"tooltip"},_4b);this._tooltip.style.display="none";this._tooltip.style.position="fixed";this._setTooltipMessage(0);this._onTooltipMouseEnterHandler_connect=dojo.connect(this.map,"onMouseOver",this._updateTooltip);this._onTooltipMouseLeaveHandler_connect=dojo.connect(this.map,"onMouseOut",this._hideTooltip);this._onTooltipMouseMoveHandler_connect=dojo.connect(this.map,"onMouseMove",this._updateTooltip);}else{if(this._tooltip){dojo.disconnect(this._onTooltipMouseEnterHandler_connect);dojo.disconnect(this._onTooltipMouseLeaveHandler_connect);dojo.disconnect(this._onTooltipMouseMoveHandler_connect);dojo.destroy(this._tooltip);this._tooltip=null;}}},_hideTooltip:function(){var _4c=this._tooltip;if(!_4c){return;}_4c.style.display="none";},_setTooltipMessage:function(_4d){var _4e=this._tooltip;if(!_4e){return;}var _4f=_4d;var _50="";switch(this._geometryType){case esri.toolbars.Draw.POINT:_50=esri.bundle.toolbars.draw.addPoint;break;case esri.toolbars.Draw.ARROW:case esri.toolbars.Draw.LEFT_ARROW:case esri.toolbars.Draw.RIGHT_ARROW:case esri.toolbars.Draw.UP_ARROW:case esri.toolbars.Draw.DOWN_ARROW:case esri.toolbars.Draw.TRIANGLE:case esri.toolbars.Draw.RECTANGLE:case esri.toolbars.Draw.CIRCLE:case esri.toolbars.Draw.ELLIPSE:_50=esri.bundle.toolbars.draw.addShape;break;case esri.toolbars.Draw.LINE:case esri.toolbars.Draw.EXTENT:case esri.toolbars.Draw.FREEHAND_POLYLINE:case esri.toolbars.Draw.FREEHAND_POLYGON:_50=esri.bundle.toolbars.draw.freehand;break;case esri.toolbars.Draw.POLYLINE:case esri.toolbars.Draw.POLYGON:_50=esri.bundle.toolbars.draw.start;if(_4f===1){_50=esri.bundle.toolbars.draw.resume;}else{if(_4f>=2){_50=esri.bundle.toolbars.draw.complete;}}break;case esri.toolbars.Draw.MULTI_POINT:_50=esri.bundle.toolbars.draw.addMultipoint;if(_4f>=1){_50=esri.bundle.toolbars.draw.finish;}break;}_4e.innerHTML=_50;},_updateTooltip:function(evt){var _51=this._tooltip;if(!_51){return;}var px,py;if(evt.clientX||evt.pageY){px=evt.clientX;py=evt.clientY;}else{px=evt.clientX+dojo.body().scrollLeft-dojo.body().clientLeft;py=evt.clientY+dojo.body().scrollTop-dojo.body().clientTop;}_51.style.display="none";dojo.style(_51,{left:(px+this._options.tooltipOffset)+"px",top:(py)+"px"});_51.style.display="";},_redrawGraphic:function(_52,_53,_54,lod){if(_54||this.map.wrapAround180){var g=this._graphic;if(g){g.setGeometry(g.geometry);}g=this._tGraphic;if(g){g.setGeometry(g.geometry);}}},onActivate:function(){},onDeactivate:function(){},onDrawEnd:function(){}});dojo.mixin(esri.toolbars.Draw,{POINT:"point",MULTI_POINT:"multipoint",LINE:"line",EXTENT:"extent",POLYLINE:"polyline",POLYGON:"polygon",FREEHAND_POLYLINE:"freehandpolyline",FREEHAND_POLYGON:"freehandpolygon",ARROW:"arrow",LEFT_ARROW:"leftarrow",RIGHT_ARROW:"rightarrow",UP_ARROW:"uparrow",DOWN_ARROW:"downarrow",TRIANGLE:"triangle",CIRCLE:"circle",ELLIPSE:"ellipse",RECTANGLE:"rectangle"});}