//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 $528(glist) { var g; var x,y,angle; var gra; g=new $554(glist); gra=this.frame.addSymbol(g.x,g.y,g.angle); if(! gra)return null; gra.id=g.id; gra.link=g.link; gra.blink=g.blink; gra.dc.symbolSize=g.size; gra.dc.symbolFillcolor=g.color; gra.dc.symbolFill=g.fill; gra.dc.symbolName='icSymbol'+g.symbol; gra.dc.symbolColor='black'; gra.dc.symbolFillTransparent='100'; if(! g.fill) { gra.dc.symbolFillColor=''; gra.dc.symbolFillTransparent='0'; } this.frame.G.redraw(gra); return gra; } function ic$map(frame) { this.frame=frame; M=this; this.activeGra=null; this.add=$534; this.redraw=IC_$186; this.draw=IC_$221; this.deleteById=IC_$181; this.selectById=IC_$182ById; this.findById=IC_$180; this.refresh=IC_$176; this.selectClear=IC_$182Clear; this.scale=$552; this.deleteAll=IC_$227eteAll; this.position=$553; this.symbol=$528; this.makeSymbol=$535; this.makePolygon=$536; this.makeLine=$537; this.makeShape=$538; this.makeArc=$540; this.makePline=$542; this.makeCircle=$539; this.makeRectangle=$541; this.makeText=$543; this.makeTextBox=$543Box; this.makeImage=$545; this.saveToFile=IC_$217; this.loadFromFile=IC_$220; this.makeData=$533; this.frame.setMode('pan'); this.frame.draw(); } function IC_$217(filename) { this.frame.G.saveToFile(filename); } function IC_$220(filename) { this.frame.G.loadFromFile(filename); } function IC_$221() { this.frame.draw(); } function IC_$186(gra) { if(! this.frame.G)return; this.frame.G.redraw(gra); } function $533(id,tag,href) { if(! this.frame.G)return; this.frame.G.infoLink=href; this.frame.G.infoId=id; this.frame.G.infoTag=tag; } function $534(gra) { if(! this.frame.G)return; this.frame.G.addGraphic(gra); } function $535(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.symbol('parent.onNewSymbol'); } function $536(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.polygon('parent.onNewPolygon'); } function $537(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.line('parent.onNewLine'); } function $538(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 $539(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.circle('parent.onNewCircle'); } function $540(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.arc('parent.onNewArc'); } function $541(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.rectangle('parent.onNewRectangle'); } function $542(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.pline('parent.onNewPline'); } function $543(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 $543Box(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 $545(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_$181(id) { this.selectClear(); if(! this.frame.G)return; this.frame.G.deleteById(id); } function IC_$180(id) { var gra; if(! this.frame.G)return null; gra=this.frame.G.findById(id); return gra; } function IC_$182ById(xid) { this.selectClear(); if(! this.frame.G)return null; this.activeGra=this.frame.G.findById(xid); if(! this.activeGra)return this.activeGra; this.activeGra.dc.symbolFillcolor='white'; this.frame.G.redraw(this.activeGra); return this.activeGra; } function IC_$182Clear() { 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_$176() { this.frame.draw(); } function IC_$227eteAll() { this.activeGra=null; if(! this.frame.G)return; this.frame.G.deleteAll(); } function $552(level) { var lev; lev=parseInt(level); lev=lev-1; goLevel(this.frame.id,lev); } function $553(x,y) { moveTo(this.frame.ID,x,y); } function $554(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); this.blink=get_bool(glist,8,false); this.fill=get_bool(glist,9,true); } 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 get_bool(glist,index,def) { var temp try { if(index >glist.length)return def; if(glist[index]==undefined)return def; temp=glist[index]; if(typeof(temp)=='boolean')return temp; temp=temp.toLowerCase(); if(temp=='f')return false; if(temp=='false')return false; if(temp=='0')return false; if(temp=='n')return false; if(temp=='no')return false; if(temp=='y')return true; if(temp=='yes')return true; if(temp=='t')return true; if(temp=='true')return true; if(temp=='1')return true; return false; } catch(e){ return def } } function onNewLine(m,x1,y1,x2,y2) { var gra; gra=new M.frame.G.ic_Line(x1,y1,x2,y2); M.frame.setMode('pan'); M.onComplete(gra); } 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.frame.setMode('pan'); M.onComplete(gra); } function onNewPolygon(m,np,xlist,ylist) { var gra; gra=new M.frame.G.ic_Polygon(np,xlist,ylist); M.frame.setMode('pan'); M.onComplete(gra); } function onNewPline(m,np,xlist,ylist) { var gra; gra=new M.frame.G.ic_Pline(np,xlist,ylist); M.frame.setMode('pan'); M.onComplete(gra); } function onNewArc(m,cx,cy,radius,start,sweep) { var gra; gra=new M.frame.G.ic_Arc(cx,cy,radius,start,sweep); M.frame.setMode('pan'); M.onComplete(gra); } function onNewSketch(m,np,xlist,ylist) { var gra; gra=new M.frame.G.ic_Sketch(np,xlist,ylist); M.frame.setMode('pan'); M.onComplete(gra); } function onNewSymbol(m,x,y,angle) { var gra; gra=new M.frame.G.ic_Symbol(x,y,angle); M.frame.setMode('pan'); M.onComplete(gra); } function onNewText(m,x,y,angle) { var gra; gra=new M.frame.G.ic_Text(x,y,angle); M.frame.setMode('pan'); M.onComplete(gra); } 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.frame.setMode('pan'); M.onComplete(gra); } 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.frame.setMode('pan'); M.onComplete(gra); } 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.frame.setMode('pan'); M.onComplete(gra); }