//ICMap, Copyright 2006, clifford L. Collins, Collins Software, all rights reserved, http://collinssoftware.com, not for distribution or resale, use License is required: iccallbackfunctions var activeGra; var M; function $522(glist) { var g; var x,y,angle; var gra; g=new $545(glist); gra=this.frame.addSymbol(g.x,g.y,g.angle); if(! gra)return; gra.id=g.id; gra.link=g.link; gra.dc.symbolSize=g.size; gra.dc.symbolFillcolor=g.color; gra.dc.symbolFill=true; gra.dc.symbolName='icSymbol'+g.symbol; gra.dc.symbolColor='black'; this.frame.G.redraw(gra); } function ic$map(frame) { this.frame=frame; M=this; this.activeGra=null; this.add=$526; this.deleteById=IC_$179; this.selectById=IC_$180ById; this.refresh=IC_$174; this.selectClear=IC_$180Clear; this.scale=$543; this.deleteAll=IC_$224eteAll; this.position=$544; this.symbol=$522; this.makeSymbol=$527; this.makePolygon=$528; this.makeLine=$529; this.makeShape=$530; this.makeArc=$532; this.makePline=$534; this.makeCircle=$531; this.makeRectangle=$533; this.makeText=$535; this.makeTextBox=$535Box; this.makeImage=$537; this.saveToFile=IC_$214; this.loadFromFile=IC_$217; this.makeData=$525; this.frame.setMode('pan'); this.frame.draw(); } function IC_$214(filename) { this.frame.G.saveToFile(filename); } function IC_$217(filename) { this.frame.G.loadFromFile(filename); } function $525(id,tag,href) { if(! this.frame.G)return; this.frame.G.infoLink=href; this.frame.G.infoId=id; this.frame.G.infoTag=tag; } function $526(gra) { if(! this.frame.G)return; this.frame.G.addGraphic(gra); } function $527(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.symbol('parent.onNewSymbol'); } function $528(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.polygon('parent.onNewPolygon'); } function $529(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.line('parent.onNewLine'); } function $530(onComplete,text,shape) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.shapeText.value=text; this.frame.shapeStyle.value=parseInt(shape); this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.shape('parent.onNewShape'); } function $531(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.circle('parent.onNewCircle'); } function $532(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.arc('parent.onNewArc'); } function $533(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.rectangle('parent.onNewRectangle'); } function $534(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.pline('parent.onNewPline'); } function $535(onComplete,text) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.textText.value=text; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.text('parent.onNewText'); } function $535Box(onComplete,text) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.textBox('parent.onNewTextBox'); } function $537(onComplete,text) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.imageName.value=text; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.image('parent.onNewImage'); } function IC_$179(id) { this.selectClear(); if(! this.frame.G)return; this.frame.G.deleteById(id); } function IC_$180ById(id) { this.selectClear(); if(! this.frame.G)return; activeGra=this.frame.G.findById(id); if(! this.activeGra)return; this.activeGra.dc.symbolFillcolor='blue'; this.frame.G.redraw(this.activeGra); } function IC_$180Clear() { if(! this.frame.G)return; if(! this.activeGra)return; this.activeGra.dc.symbolFillcolor='green'; this.frame.G.redraw(this.activeGra); this.activeGra=null; } function IC_$174() { this.frame.draw(); } function IC_$224eteAll() { this.activeGra=null; if(! this.frame.G)return; this.frame.G.deleteAll(); } function $543(level) { var lev; lev=parseInt(level); lev=lev-1; goLevel(this.frame.id,lev); } function $544(x,y) { moveTo(this.frame.ID,x,y); } function $545(glist) { this.name='symbol'; this.id=get_String(glist,0,''); this.link=get_String(glist,1,''); this.x=get_Float(glist,2,0); this.y=get_Float(glist,3,0); this.angle=get_Float(glist,4,0); this.color=get_String(glist,5,'yellow'); this.symbol=get_String(glist,6,'box'); this.size=get_Int(glist,7,8); } function get_String(glist,index,def) { if(index >glist.length)return def; if(glist[index]==undefined)return''; return glist[index]; } function get_Float(glist,index,def) { try { if(index >glist.length)return parseFloat(def); if(glist[index]==undefined)return 0.0; return parseFloat(glist[index]); } catch(e){ return parseFloat(def)} } function get_Int(glist,index,def) { try { if(index >glist.length)return parseInt(def); if(glist[index]==undefined)return 0; return parseInt(glist[index]); } catch(e){ return parseInt(def)} } function onNewLine(m,x1,y1,x2,y2) { var gra; gra=new M.frame.G.ic_Line(x1,y1,x2,y2); M.onComplete(gra); M.frame.setMode('pan'); } function onNewCircle(m,x1,y1,x2,y2) { var gra; var cx,cy,radius; cx=x1; cy=y1; radius=$69(x1,y1,x2,y2); gra=new M.frame.G.ic_Circle(cx,cy,radius); M.onComplete(gra); M.frame.setMode('pan'); } function onNewRectangle(m,x1,y1,x2,y2) { var gra; gra=new M.frame.G.ic_Rectangle(x1,y1,x2,y2); M.onComplete(gra); M.frame.setMode('pan'); } function onNewPolygon(m,np,xlist,ylist) { var gra; gra=new M.frame.G.ic_Polygon(np,xlist,ylist); M.onComplete(gra); M.frame.setMode('pan'); } function onNewPline(m,np,xlist,ylist) { var gra; gra=new M.frame.G.ic_Pline(np,xlist,ylist); M.onComplete(gra); M.frame.setMode('pan'); } function onNewArc(m,cx,cy,radius,start,sweep) { var gra; gra=new M.frame.G.ic_Arc(cx,cy,radius,start,sweep); M.onComplete(gra); M.frame.setMode('pan'); } function onNewSketch(m,np,xlist,ylist) { var gra; gra=new M.frame.G.ic_Sketch(np,xlist,ylist); M.onComplete(gra); M.frame.setMode('pan'); } function onNewSymbol(m,x,y,angle) { var gra; gra=new M.frame.G.ic_Symbol(x,y,angle); M.onComplete(gra); M.frame.setMode('pan'); } function onNewText(m,x,y,angle) { var gra; gra=new M.frame.G.ic_Text(x,y,angle); M.onComplete(gra); M.frame.setMode('pan'); } function onNewTextbox(m,xmin,ymin,xmax,ymax,height,width) { var gra; gra=new M.frame.G.ic_TextBox(xmin,ymin,xmax,ymax,height,width); M.onComplete(gra); M.frame.setMode('pan'); } function onNewImage(m,xmin,ymin,xmax,ymax,height,width) { var gra; gra=new M.frame.G.ic_Image(xmin,ymin,xmax,ymax,height,width); M.onComplete(gra); M.frame.setMode('pan'); } function onNewShape(m,xmin,ymin,xmax,ymax,height,width) { var gra; gra=new M.frame.G.ic_Shape(xmin,ymin,xmax,ymax,height,width); M.onComplete(gra); M.frame.setMode('pan'); }