//ICMap, Copyright 2008, 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 $536(glist) { var g; var x,y,angle; var gra; try { g=new $562(glist); this.deleteById(g.layer,g.id); gra=this.frame.addSymbol(g.layer,g.id,g.x,g.y,g.angle); 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; } catch(e){ alert('map.symbol -- '+e.message+' '+glist)} } function ic$map(frame) { this.frame=frame; M=this; this.activeGra=null; this.add=$542; this.redraw=IC_$191; this.draw=IC_$228; this.deleteById=IC_$185; this.selectById=IC_$187ById; this.findById=IC_$184; this.refresh=IC_$180; this.selectClear=IC_$187Clear; this.scale=$560; this.clearLayer=IC_$186; this.position=$561; this.symbol=$536; this.makeSymbol=$543; this.makePolygon=$544; this.makeLine=$545; this.makeShape=$546; this.makeArc=$548; this.makePline=$550; this.makeCircle=$547; this.makeRectangle=$549; this.makeText=$551; this.makeTextBox=$551Box; this.makeImage=$553; this.saveToFile=IC_$222; this.loadFromFile=IC_$227; this.makeData=$541; this.frame.setMode('pan'); this.frame.draw(); } function IC_$222(filename) { this.frame.G.saveToFile(filename); } function IC_$227(filename) { this.frame.G.loadFromFile(filename); } function IC_$228() { this.frame.draw(); } function IC_$191(gra) { if(! this.frame.G)return; this.frame.G.redraw(gra); } function $541(ID,tag,href) { if(! this.frame.G)return; this.frame.G.infoLink=href; this.frame.G.infoId=ID; this.frame.G.infoTag=tag; } function $542(layer,gra) { if(! this.frame.G)return; this.frame.G.addGraphic(layer,gra); } function $543(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.symbol('parent.onNewSymbol'); } function $544(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.polygon('parent.onNewPolygon'); } function $545(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.line('parent.onNewLine'); } function $546(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 $547(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.circle('parent.onNewCircle'); } function $548(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.arc('parent.onNewArc'); } function $549(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.rectangle('parent.onNewRectangle'); } function $550(onComplete) { if(! this.frame.G)return; this.onComplete=onComplete; this.frame.G.isBuild=true; this.frame.setModeEdit(); this.frame.make.pline('parent.onNewPline'); } function $551(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 $551Box(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 $553(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_$185(layer,ID) { this.selectClear(); if(! this.frame.G)return; this.frame.G.deleteById(layer,ID); } function IC_$184(layer,ID) { var gra; if(! this.frame.G)return null; gra=this.frame.G.findById(layer,ID); return gra; } function IC_$187ById(layer,ID) { this.selectClear(); if(! this.frame.G)return null; this.activeGra=this.frame.G.findById(layer,ID); if(! this.activeGra)return this.activeGra; this.activeGra.dc.symbolFillcolor='white'; this.frame.G.redraw(this.activeGra); return this.activeGra; } function IC_$187Clear() { 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_$180() { this.frame.draw(); } function IC_$186(layer) { this.activeGra=null; if(! this.frame.G)return; this.frame.G.clearLayer(layer); } function $560(level) { var lev; lev=parseInt(level); lev=lev-1; goLevel(this.frame.id,lev); } function $561(x,y) { moveTo(this.frame.ID,x,y); } function $562(glist) { this.name='symbol'; this.layer=get_String(glist,0,''); this.id=get_String(glist,1,''); this.link=get_String(glist,2,''); this.x=get_Float(glist,3,0); this.y=get_Float(glist,4,0); this.angle=get_Float(glist,5,0); this.color=get_String(glist,6,'yellow'); this.symbol=get_String(glist,7,'box'); this.size=get_Int(glist,8,8); this.blink=get_bool(glist,9,false); this.fill=get_bool(glist,10,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=$72(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); }