//ICMap, Copyright 2006, clifford L. Collins, Collins Software, all rights reserved, http://collinssoftware.com, not for distribution or resale, use License is required: icmap var clBlack=0; var clTransparent=parseInt('0xf2f2f2'); var G; var SELECT_COLOR='#FF8000'; var SELECT_WIDTH='2'; var HANDLE_CENTER=-99; var HANDLE_ROTATE=-98; var HANDLE_RADIUS=-97; var RANGE_ID=-102; function $66(angle) { var degree; degree=(angle*180.0)/Math.PI; return degree; } function ic$userMap(name,view,height,width) { G=this; G.uid=0; G.mode='select'; this.isSelect=false; this.isEdit=false; this.activeNode=null; G.modified=false; this.name=name; this.topFeature=null; this.freeGraphic=null; this.modified=false; this.dbname=''; this.view=view; this.height=height; this.width=width; this.cut=$148; this.copy=$147; this.selectAll=$149; this.paste=$150; this.drawSelected=$166; this.startEdit=$139; this.undraw=$144; this.isTable=false; this.curfea=null; this.promptSave=$146; this.hasAll=$195; this.hasSelected=$196; this.previousRecord=$192; this.nextRecord=$193; this.firstRecord=$190; this.lastRecord=$191; this.autoRefresh=$157; this.autoToolbar=$155; this.autoCenter=$151; this.toolbar=$156; this.refresh=$158; this.centerSelected=$152; this.previousFeature=$167; this.nextFeature=$168; this.addFeature=$224; this.newFeature=$205; this.clear=$220; this.deleteAll=$208eteAll; this.del=$208; this.setSize=$263; this.setFixed=$142; this.selectFeature=$165Feature; this.htmlFeatures=$227; this.findFeature=$222; this.findCreateFeature=$221; this.activeFeature=$160; this.listFeature=$159; this.setFeatureVisible=$218; this.setFeatureSnap=$219; this.featureExists=$223; this.clearSelected=$170; this.deleteSelected=$186; this.deleteSelectedGraphics=$186Graphics; this.renameTool=$211; this.deleteTool=$208eteTool; this.addTool=$210; this.renameFeature=$214; this.deleteFeature=$208eteFeature; this.eraseFeature=$213; this.moveFeatureUp=$206; this.moveFeatureDown=$207; this.eraseSelected=$145; this.selectField=$165Field; this.renameField=$216; this.deleteField=$208eteField; this.addField=$217; this.addGraphic=$203; this.draw=$201; this.snap=$202; this.redraw=$169; this.saveToFile=$197; this.loadFromFile=$200; this.data=$198; this.dataSelected=$198Selected; this.updateValue=$141; this.write=$194; this.toObject=$189; this.fromObject=$188; this.hotspot=$153; this.hotspot_csv=$153_csv; this.setFieldLarge=$163; this.setFieldKeep=$164; this.select=$165; this.checkKeyEnter=$140; this.setNavigationButtons=$245; this.findById=MAP$findById; this.deleteById=$208eteById; this.E=new ic$feature('activeEdit',this); this.E.isEdit=true; this.E.layer.style.zIndex=ZSelectPlane+1; this.D=new ic$feature('DeletedElements',this); this.D.isDELETE=true; this.D.max=2000; this.D.addDeleted=$230; this.D.undelete=$229; this.D.did=0; this.undelete=$138; this.L=new ic$feature('selectList',this); this.L.isSelect=true; this.addFeature('Notes'); this.selectFeature('Notes'); this.editSetFeature=$161; this.editSetField=$162; this.forSelectedGraphics=$143; this.edit=new ic$edit(this); this.selectFeature('Notes') this.curfea.table.value('id',1); } function $138() { var xgra; xgra=this.D.botGraphicNode; if(!xgra)return; did=xgra.did; gra=this.D.undelete(did); while(gra) { fea=this.findFeature(gra.feature.name); if(! fea)fea=new ic$feature(gra.feature.name); fea.appendGraphic(gra); fea.drawGraphic(gra); gra=this.D.undelete(did); } this.selectFeature(xgra.feature.name); } function $139() { this.isSelect=false; this.fromObject(this.activeNode); } function $140(evt) { if(window.event.keyCode !=13)return; this.refresh(); } function $141(fieldName,value) { var fea,fld,gnode; gnode=this.activeNode; if(! gnode)return; fea=gnode.gra.feature; fld=fea.table.findField(fieldName); if(! fld)return; fld.value(value); } function $142(checked) { this.forSelectedGraphics('gra.dc.fixed = '+checked); } function $143(cmd) { var gra; var gnode; if(this.L.graphicCount==0) { gnode=this.activeNode; if(! gnode)return; gra=gnode.gra; eval(cmd); return; } gnode=this.L.topGraphicNode; while(gnode) { gra=gnode.gra; eval(cmd); gnode=gnode.next; } } function $144(gra) { var obj; obj=getObject('$g$'+gra.id); if(!obj)return; obj.innerHTML=''; } function $145() { var gnode; var nnode; var fea; this.D.did=this.D.did+1; gnode=this.L.topGraphicNode; this.L.topGraphicNode=null; this.L.botGraphicNode=null; this.L.curnode=null; if(!gnode) { gnode=this.activeNode; if(!gnode)return; fea=gnode.gra.feature; this.undraw(gnode.gra); fea.deleteGraphic(gnode.gra); gnode=null; } while(gnode) { fea=gnode.gra.feature; this.undraw(gnode.gra); fea.deleteGraphic(gnode.gra); nnode=gnode.next; gnode.gra=null; gnode=nnode; } this.clearSelected() this.draw(); this.setNavigationButtons(); } function $146() { if(!this.modified)return true; this.modified=false; fileSaveAs(); } function $147() { var data; data=this.dataSelected(); toClipboard(data); } function $148() { var data; data=this.dataSelected(); toClipboard(data); this.eraseSelected(); } function $149() { var gnode; var fea; this.clearSelected(); fea=this.topFeature; while(fea) { gnode=fea.topGraphicNode; while(gnode) { this.L.addGraphic(gnode.gra); gnode=gnode.next; } fea=fea.next; } this.drawSelected(); return; } function $150() { var data; var fd; var test; data=clipboard(); if(! data)return; if(data=='')return; test=data.substr(0,40).toLowerCase(); if(test.indexOf('*cg2')<0)return; fd=new ic$memoryFile(data); this.data(fd,true); this.centerSelected(); } function $151(gra) { var cx,cy,obj; setToolbarByName(gra.type); obj=getObject('autoCenter'); if(!obj)return; if(!obj.checked)return; cx=(gra.xmin+gra.xmax)/2; cy=(gra.ymin+gra.ymax)/2; goXY(cx,cy); draw(); } function $152() { var cx,cy,obj; var gra; if(this.L.graphicCount >0)gra=this.L.rng else{ if(! this.activeNode)return; gra=this.activeNode.gra; } if(!gra)return; cx=(gra.xmin+gra.xmax)/2; cy=(gra.ymin+gra.ymax)/2; try { goXY(cx,cy); draw(); } catch(e){return; } } function $153(gra,text) { var lnk; var a; if(text=='')return text; if(this.isSelect)return text; if(this.isEdit)return text; try { lnk=gra.link; } catch(e){lnk='' } if(lnk=='')return text; a=''; return(a+text+''); } function $153_csv(gra,text) { var hint,href,target; var obj,z,a; try { if(text=='')return text; if(this.isSelect)return text; if(this.isEdit)return text; hint=gra.feature.table.findValue('hint',gra.csv); href=gra.feature.table.findValue('hyperlink',gra.csv); target=gra.feature.table.findValue('target',gra.csv); if((href=='')&&(hint=='')) { return text; } obj=getObject('optionTarget'); if(obj&&(target==''))target=obj.value; if(target=='')target="_blank"; href=editHref(href); a=''; return(a+text+''); } catch(e){ return text } } function $155() { if(! autoToolbar.checked)return; this.toolbar(); } function $156() { setEditTool(editMode); } function $157() { if(! autoRefresh.checked)return; this.refresh(); } function $158() { var gra; if(! this.activeNode)return; gra=this.activeNode.gra; editGetDC(gra.dc,gra.type); this.redraw(gra); } function $159() { if(this.L.curnode)return this.L; else return this.curfea; } function $160() { if(this.L.curnode)return this.L.curnode.gra.feature; else return this.curfea; } function $161() { upTool.style.display=''; downTool.style.display=''; } function $162() { upTool.style.display='none'; downTool.style.display='none'; } function $163(name,checked) { var fld; var fea; fea=this.activeFeature(); if(! fea)return; fld=fea.table.findField(name); if(fld)fld.isLarge=checked; this.selectFeature(fea.name) } function $164(name,checked) { var fld; fea=this.activeFeature(); if(! fea)return; fld=fea.table.findField(name); if(fld)fld.isKeep=checked; } function MAP$findById(id) { var fea; var gra; fea=this.topFeature; while(fea) { gra=fea.findById(id); if(gra)return gra; fea=fea.next; } return null; } function $208eteById(id) { var fea; fea=this.topFeature; while(fea) { if(fea.deleteById(id))return true; fea=fea.next; } return false; } function $165(x1,y1,x2,y2) { var dx,dy; var fea; var tx1,ty1; var rng; tol=8; tx1=this.view.screenToX(0); tx2=this.view.screenToX(tol); stol=Math.abs(tx2-tx1); if(this.L.graphicCount >0) { this.toObject(); if(this.curfea)this.fromObject(this.curfea.curnode); else this.fromObject(null); } this.L.clear(); this.E.clear(); fea=this.topFeature; while(fea) { fea.select(x1,y1,x2,y2); fea=fea.next; } this.drawSelected(); } function $166() { var fea; if(this.L.graphicCount==1) { fea=this.L.topGraphicNode.gra.feature; fea.selectGraphic(this.L.topGraphicNode.gra); this.selectFeature(fea.name); this.L.clear(); } if(this.L.graphicCount==0) { fea=this.activeFeature(); if(!fea)return; this.selectFeature(fea.name); return; } this.L.rng=this.L.range(); this.draw(); this.E.drawGraphic(this.L.rng); } function $167() { } function $168() { } function $169(gra) { var obj; obj=getObject('$g$'+gra.id); if(obj)obj.innerHTML=gra.vml(); else gra.feature.drawGraphic(gra); if(!this.activeNode)return; if(gra !=this.activeNode.gra)return; this.E.layer.innerHTML=''; this.E.drawGraphic(gra); } function $170() { this.E.clear(); this.L.clear(); } function ic$edit(parent) { this.parent=parent; this.isDone=false; this.down=$172; this.move=$174; this.up=$175; this.moveEvent=$171; this.gra=null; } function getPointRange(gra,n) { var p; if(n >=0)return null; if(n <-4)return null; p=null if(n==-1) { p=new Array(2); p[0]=gra.xmin; p[1]=gra.ymin; return p; } if(n==-2) { p=new Array(2); p[0]=gra.xmin; p[1]=gra.ymax; return p; } if(n==-3) { p=new Array(2); p[0]=gra.xmax; p[1]=gra.ymax; return p; } if(n==-4) { p=new Array(2); p[0]=gra.xmax; p[1]=gra.ymin; return p; } return null; } function getPointLine(gra,n) { var p; if(n <0)return getPointRange(gra,n); if(n >=gra.x.length)return null; p=new Array(2); p[0]=gra.x[n]; p[1]=gra.y[n]; return p; } function getPointArc(gra,n) { var p; return null; if(n==HANDLE_CENTER) { p=new Array(2); p[0]=gra.cx; p[1]=gra.cy; return p; } switch(n) { case 1: p=new Array(2); p[0]=G.view.screenToX(this.ax1); p[1]=G.view.screenToX(this.ay1); break; case 2: p=new Array(2); p[0]=G.view.screenToX(this.ax2); p[1]=G.view.screenToX(this.ay2); break; case 3: p=new Array(2); p[0]=G.view.screenToX(this.ax3); p[1]=G.view.screenToX(this.ay3); break; } } function getPointCircle(gra,n) { var p; if(n==HANDLE_CENTER) { p=new Array(2); p[0]=gra.cx; p[1]=gra.cy; return p; } if(n==HANDLE_RADIUS) { p=new Array(2); p[0]=gra.cx+gra.radius; p[1]=gra.cy; return p; } return null; } function getPointSymbol(gra,n) { var p; if(n <0)return getPointRange(gra,n); if(n !=0)return null; p=new Array(2); p[0]=gra.x; p[1]=gra.y; return p; } function getPointText(gra,n) { var p; if(n <0)return getPointRange(gra,n); if(n !=0)return null; p=new Array(2); p[0]=gra.x; p[1]=gra.y; return p; } function getPointTextbox(gra,n) { var p; if(n <0)return getPointRange(gra,n); if(n !=0)return null; p=new Array(2); p[0]=gra.x; p[1]=gra.y; return p; } function $171(id,n) { var gra; G.snapPoint=false; if(id==RANGE_ID)return false; fea=this.parent.activeFeature(); if(! fea)return true; if(! fea.curnode)return true; if(fea.curnode.gra.id !=id)return true; gra=fea.curnode.gra; p=null; if(gra.type=='line')p=getPointLine(gra,n); if(gra.type=='polygon')p=getPointLine(gra,n); if(gra.type=='arc')p=getPointArc(gra,n); if(gra.type=='circle')p=getPointCircle(gra,n); if(gra.type=='symbol')p=getPointSymbol(gra,n); if(gra.type=='text')p=getPointText(gra,n); if(gra.type=='textbox')p=getPointTextbox(gra,n); if(!p)return; x=G.view.xToScreen(p[0]); y=G.view.yToScreen(p[1]); G.snapPoint=true; G.snapX=x; G.snapY=y; } function $172(x,y,id,n) { var fea; this.isDown=false; if(id==RANGE_ID) { this.gra=this.parent.L.rng; } else { fea=this.parent.activeFeature(); if(! fea)return; if(! fea.curnode)return; if(fea.curnode.gra.id !=id)return; this.gra=fea.curnode.gra; } this.parent.mode='edit'; this.x1=x; this.y1=y; this.x2=x; this.y2=y; this.x=x; this.y=y; this.n=n; this.edit=$173; if(this.gra.type=='line')this.edit=$177; if(this.gra.type=='arc')this.edit=$184; if(this.gra.type=='circle')this.edit=$185; if(this.gra.type=='polygon')this.edit=$178; if(this.gra.type=='symbol')this.edit=$179; if(this.gra.type=='text')this.edit=$180; if(this.gra.type=='textbox')this.edit=$180box; if(this.gra.type=='range')this.edit=$183; if(this.gra.type=='arc')graToArc(this.gra,this); obj=getObject('$g$'+this.gra.id); if(obj)obj.innerHTML=''; this.isDown=true; this.move(x,y); } function $173(gra) { } function $174(x,y) { var dx,dy; var rx,ry; if(! this.isDown)return; rx=this.parent.view.screenToX(x-3); ry=this.parent.view.screenToY(y-3); this.x2=x; this.y2=y; this.edit(this.gra,rx,ry,this.n); this.parent.E.layer.innerHTML=''; this.parent.E.drawGraphic(this.gra); } function $175(x,y) { this.isDown=false; this.parent.mode='build'; if(! this.gra)return; obj=getObject('$g$'+this.gra.id); if(this.gra.type=='range') { this.parent.L.transform(this.gra); this.parent.draw(); this.parent.E.drawGraphic(this.parent.L.rng); } else if(obj)obj.innerHTML=this.gra.vml(); this.gra=null; } function $176(gra) { var i; if(gra.x.length==0) { gra.xmin=0; gra.ymin=0; gra.xmax=0; gra.ymax=0; return; } gra.xmin=gra.x[0]; gra.ymin=gra.y[0]; gra.xmax=gra.x[0]; gra.ymax=gra.y[0]; for(i=1; i 0) { if(! confirm('delete '+this.L.graphicCount+' element'+S(this.L.graphicCount)))return; this.eraseSelected() return; } gnode=this.activeNode; if(! gnode)return; fea=gnode.gra.feature; this.undraw(gnode.gra); fea.deleteGraphic(gnode.gra); } function $186Graphics() { var gnode; this.D.did=this.D.did+1; gnode=this.L.topGraphicNode; while(gnode) { this.undraw(gnode.gra); gnode.gra.feature.deleteGraphic(gnode.gra); gnode=gnode.next; } this.L.clear(); } function $188(node) { var gra; var table; var fld; var fieldName; this.activeNode=node; if(! this.activeNode) { this.setNavigationButtons(); return; } fea=this.activeNode.gra.feature; gra=this.activeNode.gra; this.autoCenter(gra); try { activeName.innerText=fea.name+' ('+gra.id+')'; } catch(e){} editPutDC(gra.dc,gra.type); fieldName=''; if(fea.table) { fld=fea.table.topField; if(fld)fieldName=fld.name; try { icTableList.innerHTML=fea.table.html(); } catch(e){} this.selectField(fieldName); fea.table.csv(gra.csv); } this.setNavigationButtons(); } function $189() { var gra; if(!this.activeNode)return; gra=this.activeNode.gra; try { editGetDC(gra.dc,gra.type); gra.csv=gra.feature.table.csv(); this.redraw(gra); } catch(e) { alert('error toObject') }; } function $190() { var fea; this.toObject(); fea=this.listFeature(); if(! fea)return; if(! fea.topGraphicNode)return; fea.selectNode(fea.topGraphicNode); } function $191() { var fea; this.toObject(); fea=this.listFeature(); if(!fea)return; if(! fea.botGraphicNode)return; fea.selectNode(fea.botGraphicNode); } function $192() { var fea; var list; fea=this.listFeature(); if(! fea)return; if(! fea.curnode)return; if(fea.curnode.prev)fea.selectNode(fea.curnode.prev); } function $193() { var fea; fea=this.listFeature(); if(! fea)return; if(! fea.curnode)return; if(fea.curnode.next)fea.selectNode(fea.curnode.next); } function $194(fd,has) { var names; var R; var fea; fd.write('*cg2;'); fd.write('*style,icMap;'); fd.writeCommentLine('!'); R=',Range:(xmin:R8+ymin:R8+xmax:R8+ymax:R8)'+ ',Fixed:(isSet:A5+PixelHeight:I4+PixelWidth:I4)'; if(has.line) { names=DCNames('line'); fd.write('*define:line, lin, '+names+R+',xy_list(32000):(x:R8+y:R8);'); } if(has.polygon) { names=DCNames('polygon'); fd.write('*define:polygon, pol, '+names+R+',xy_list(32000):(x:R8+y:R8);'); } if(has.circle) { names=DCNames('circle'); fd.write('*define:circle, cir, '+names+R+',XY:(x:R8+y:R8),radius:R8;'); } if(has.arc) { names=DCNames('arc'); fd.write('*define:arc, arc, '+names+R+',XY:(x:R8+y:R8),radius:R8,start:R8,sweep:R8;'); } if(has.symbol) { names=DCNames('symbol'); fd.write('*define:symbol, sym, '+names+R+',XY:(x:R8+y:R8),angle:I4;'); } if(has.text) { names=DCNames('text'); fd.write('*define:text, txt, '+names+R+',XY:(X:r8:Y:R8),angle:I4;'); } if(has.textbox) { names=DCNames('textbox'); fd.write('*define:textbox, tbo, '+names+R+',height:R8,width:R8,XY:(X:R8+Y:R8);'); } fd.writeCommentLine('!'); fea=this.topFeature; while(fea) { fea.table.write(fd); fea=fea.next; } } function ic$has() { this.line=false; this.polyon=false; this.symbol=false; this.arc=false; this.circle=false; this.text=false; this.textbox=false; this.lineCount=0; this.polgonCount=0; this.arcCount=0; this.circleCount=0; this.symbolCount=0; this.textCount=0; this.textboxCount=0; } function $195() { has=new ic$has(); f=this.topFeature; while(f) { f.has(has); f=f.next; } return has; } function $196() { has=new ic$has(); if(this.L.graphicCount >0)this.L.has(has) else if(this.activeNode)this.activeNode.has(has); return has; } function $197(filename) { var f,fd; var has; this.dbname=filename; fd=new ic$file(); if(! fd.create(filename))return; has=this.hasAll(); this.write(fd,has); has=null; f=this.topFeature; while(f) { f.write(fd); f=f.next; } fd.write('!-------- End-of-File--------------;'); fd.close(); this.modified=false; } function $198(fd,paste) { var f,fd; var xin; var has; var p; xin=false; if($198.arguments.length >0)xin=true; if(xin) { this.clearSelected(); p=new ic$parser(fd); while(p.nextSection()) { if(paste)fea=this.curfea; else fea=this.findCreateFeature(p.sectionName,p.findTable(p.sectionName)); p.defineCsv(fea.table); gra=p.readGraphic(); while(gra) { gra.feature=fea; fea.appendGraphic(gra); fea.drawGraphic(gra); if(paste)this.L.addGraphic(gra); gra=p.readGraphic(); } } this.drawSelected(); return; } fd=new ic$memoryFile(); has=this.hasAll(); this.write(fd,has); f=this.topFeature; while(f) { f.write(fd); f=f.next; } fd.write('!-------- End-of-File--------------;'); return fd.close(); } function $198Selected(data) { var f,fd; var xin; var fea,gra; var has; xin=false; if($198Selected.arguments.length >0)xin=true; if(xin) { return false; } fd=new ic$memoryFile(); has=this.hasSelected(); this.write(fd,has); has=null; if(this.L.graphicCount >0)this.L.write(fd); else if(this.activeNode) { gra=this.activeNode.gra; fea=gra.feature; fd.writeCommentLine('!'); fd.write('*section,'+fea.name+';'); fd.write(fea.name+', '+gra.csv+';'); gra.write(fd); } fd.write('!-------- End-of-File--------------;'); return fd.close(); } function $200(filename) { var f,fd; this.dbname=filename; fd=new ic$file(); if(! fd.openRead(filename))return; this.data(fd,false); fd.close(); this.centerSelected(); } function $201() { var f; f=this.topFeature; while(f) { f.draw(); f=f.next; } } function $202(p,tol) { var f; var x1,x2,xtol; x1=this.view.screenToX(0); x2=this.view.screenToX(tol); xtol=Math.abs(x2-x1); f=this.topFeature; while(f) { if(f.snap(p,xtol))return true; f=f.next; } return false; } function $203(gra) { this.modified=true; if(! this.curfea) { this.curfea=this.topFeature; if(! this.curfea) { this.addFeature('Notes'); this.curfea=this.topFeature; } } this.curfea.addGraphic(gra); } function $204(name,value) { var f; f=this.curfea.table.findField(name); if(f)f.value(value); } function $205() { var name; name=''; while(true) { name=window.prompt('New Feature name',name); if(! name)return; name=editName(name); if(! this.featureExists(name))break; alert('feature /'+name+'/ already exists'); } this.addFeature(name); this.selectFeature(name); } function $206() { var name; var f,prev,parent; prev=null; parent=null; f=this.topFeature; while(f) { if(f==this.curfea) { if(! prev)return; if(parent) { parent.next=f; prev.next=f.next; f.next=prev; break; } else { this.topFeature=f; prev.next=f.next; f.next=prev; break; } } parent=prev; prev=f; f=f.next; } if(!f)return; this.selectFeature(f.name); } function $207() { var name; var f,prev,n1,n2; if(! this.curfea)return; if(! this.curfea.next)return; prev=null; f=this.topFeature; while(f) { if(f==this.curfea) { if(prev){ prev.next=f.next; } else{ this.topFeature=f.next; } n1=f.next; n2=f.next.next; n1.next=f; f.next=n2; break; } prev=f; f=f.next; } if(!f)return; this.selectFeature(f.name); } function $208(name) { var name; var f,prev,next; f=this.findFeature(name); if(!f)return; prev=null; next=null; this.curfea=null; f=this.topFeature; while(f !=null) { next=f.next; if(name.toLowerCase()==f.name.toLowerCase()) if(prev==null) { this.topFeature=f.next; f.clear; f=null; break; } else { prev.next=f.next; f.clear; f=null; break; } prev=f; f=f.next; } if(prev)this.curfea=prev; if(next)this.curfea=next; } function specialName(name) { nam=name.toLowerCase(); if(nam=='[selected]') { alert('operation not allowed on feature /'+name+'/'); return true; } return false; } function $208eteFeature() { var name; if(! this.curfea)return; name=this.curfea.name; if(specialName(name))return; if(! window.confirm('Delete Feature /'+name+'/'))return; this.del(name); name=''; if(this.curfea)name=this.curfea.name; this.selectFeature(name); } function $210() { if(icFeatureEdit.checked)this.newFeature() else this.addField(); } function $211() { if(icFeatureEdit.checked)this.renameFeature() else this.renameField(); } function $208eteTool() { if(icFeatureEdit.checked)this.deleteFeature() else this.deleteField(); } function $213() { var name; var cnt; if(! this.curfea)return; name=this.curfea.name; cnt=this.curfea.graphicCount; if(! window.confirm('delete '+cnt+' graphic element'+S(cnt)+' from /'+name+'/'))return; this.clearSelected(); this.curfea.clear(); this.curfea.draw(); } function $214() { var name; if(! this.curfea)return; name=this.curfea.name; if(specialName(name))return; while(true) { name=window.prompt('Rename Feature',name); if(!name)return; name=editName(name); if((name !='')&&(! this.findFeature(name,true)))break; alert('duplicate feature /'+name+'/'); } this.curfea.name=name; this.selectFeature(name); } function $208eteField() { var name; var table; if(! this.curfea)return; table=this.curfea.table; if(! table.selectedField)return; n=this.curfea.graphicCount; name=table.selectedField.name; if(! window.confirm('Delete Field /'+name+'/'+"\r\n\r\n"+ "This will delete the value from "+n+" record"+S(n)))return; table.deleteField(name); name=''; if(table.selectedField)name=table.selectedField.name; this.selectField(name); name=this.curfea.name; this.selectFeature(name); } function $216() { var name; var table; if(! this.curfea)return; table=this.curfea.table; if(! table.selectedField)return; name=table.selectedField.name; while(true) { name=window.prompt('Rename Field',name); if(!name)return; name=editName(name); if((name !='')&&(! table.findField(name,true)))break; alert('duplicate field /'+name+'/'); } table.selectedField.name=name; this.selectField(name); } function $217() { var name; var table; if(! this.curfea)return; table=this.curfea.table; name=''; while(true) { name=window.prompt('New Field Name',name); if(!name)return; name=editName(name); if((name=='')||(table.findField(name,false))) { alert('duplicate field /'+name+'/'); continue; } break; } table.selectedField=table.addField(name); this.selectField(name); name=this.curfea.name; this.selectFeature(name); } function $218(checked) { var name; var f f=this.curfea; if(!f)return; f.visible=checked; f.draw(); if(!this.activeNode)return; if(f !=this.activeNode.gra.feature)return; this.E.innerHTML=''; if(!checked)return; this.E.drawGraphic(this.activeNode.gra); } function $219(checked) { if(this.curfea)this.curfea.isSnap=checked; } function $220() { var f,n; f=this.topFeature; this.topFeature=null; this.curfea=null; while(f) { n=f.next; f.clear; f=null; f=n; } f=this.freeGraphic this.freeGraphic=null; while(f) { n=f.next; f.clear; f=null; f=n; } } function $208eteAll() { var f,n; this.L.clear(); this.E.clear(); this.D.clear(); f=this.topFeature; while(f) { n=f.next; f.clear(); f=n; } f=this.freeGraphic this.freeGraphic=null; while(f) { n=f.next; f.clear(); f=null; f=n; } } function $221(name,rtbl) { var tbl; var fea; fea=this.findFeature(name); if(fea)return fea; fea=new ic$feature(name,this); if(! rtbl)return fea; fea.table.clear(); fld=rtbl.topField; while(fld) { fea.table.addField(fld.name); fld=fld.next; } } function $222(name,excludeActive) { var f; f=this.topFeature; exclude=false; if(excludeActive !=undefined)exclude=true; while(f !=null) { if((! exclude)||(f !=this.curfea)) { if(name.toLowerCase()==f.name.toLowerCase())return f; } f=f.next; } return null; } function $223(name) { if(this.findFeature(name))return true; return false; } function $224(name) { if(this.featureExists(name)) { alert('feature already exists '+name); return false; } this.curfea=new ic$feature(name,this); if(this.topFeature==null) { this.topFeature=this.curfea; } else { bot=this.topFeature; while(bot.next !=null)bot=bot.next; bot.next=this.curfea; } this.selectFeature(name); return true; } function $165Feature(name) { var fieldName; var fld; var table; this.toObject(); this.curfea=this.findFeature(name); try { icFeatureList.innerHTML=this.htmlFeatures(name); } catch(e){}; try { icTableList.innerHTML=this.curfea.table.html(); } catch(e){}; if(! this.curfea)return; this.curfea.selectNode(this.curfea.curnode); return; } function $165Field(name) { var obj,nam; if(this.curfea) { fld=this.curfea.table.selectedField; if(fld) { nam='icFieldBox_'+fld.name; obj=getObject(nam); if(obj)obj.style.borderWidth='0'; } fld=this.curfea.table.findField(name); this.curfea.table.selectedField=fld; if(!fld)return; nam='icFieldBox_'+fld.name; obj=getObject(nam); if(obj)obj.style.borderWidth='1'; } } function $227(name) { var text; var f; var rows,a; rows=0; f=this.topFeature; while(f !=null){ rows=rows+1; f=f.next; } if(rows >6)rows=6; text=''; return text; } function ic$feature(name,parent) { this.name=name; this.visible=true; this.isSnap=true; this.parent=parent; this.isEdit=false; this.isSelect=false; this.dcTable=null; this.next=null; this.graphicCount=0; this.graphicID=0; this.topGraphicNode=null; this.botGraphicNode=null; this.table=new ic$table(this); this.table.selectedField=this.table.addField('id'); this.table.addField('hyperlink'); this.table.addField('hint') this.selectGraphic=$232; this.selectNode=$231; this.draw=$241; this.drawGraphic=$241Graphic; this.snap=$243; this.write=$240; this.select=$238; this.deleteColumn=$242; this.has=$228; this.range=$237; this.transform=$233; this.findById=FEATURE$findById; this.deleteById=FEATURE$deleteById; this.addGraphic=$248; this.appendGraphic=$247; this.deleteGraphic=$249; this.deleteGraphicNode=$249Node; this.clear=$246; this.next=null; this.layer=document.createElement('
'); this.layer.style.zIndex=ZGraphic+200; this.layer.style.borderWidth=0; this.layer.style.border=""; this.layer.style.position="absolute"; this.layer.style.posTop=0; this.layer.style.posLeft=0; this.layer.style.pixelHeight=this.parent.height; this.layer.style.pixelWidth=this.parent.width; this.layer.oncontextmenu=null; document.body.appendChild(this.layer); } function $228(has) { gnode=this.topGraphicNode; while(gnode) { gnode.has(has); gnode=gnode.next; } } function $229(did) { var gra; gra=this.botGraphicNode; if(!gra)return null; if(gra.did !=did)return null; this.graphicCount=this.graphicCount-1; if(!gra.prev) { this.topGraphicNode=null; this.botGraphicNode=null; gra.prev=null; gra.next=null; return gra; } this.botGraphicNode=gra.prev; gra.prev=null; gra.next=null; return gra; } function $230(gra) { var xgra; gra.did=this.did; if(this.graphicCount >=this.max) { xgra=this.topGraphicNode; this.topGraphicNode=xgra.next; this.graphicCount=this.graphicCount-1; xgra=null; } this.graphicCount=this.graphicCount+1; if(this.topGraphicNode) { this.botGraphicNode.next=gra; gra.next=null; gra.prev=this.botGraphicNode; this.botGraphicNode=gra; return; } else { this.topGraphicNode=gra; this.botGraphicNode=gra; gra.next=null; gra.prev=null; } } function $231(node) { G.toObject(); this.curnode=node; G.fromObject(this.curnode); } function FEATURE$findById(id) { var gnode; gnode=this.topGraphicNode; while(gnode) { if(gnode.gra.id==id)return gnode.gra; gnode=gnode.next; } return null; } function FEATURE$deleteById(id) { var gnode; var pnode; var obj; gnode=this.topGraphicNode; pnode=null; while(gnode) { if(gnode.gra.id==id) { if(pnode==null) { this.topGraphicNode=gnode.next} else{ pnode.next=gnode.next; } gnode.gra=null; gnode=null; obj=getObject('$g$'+id); if(obj)obj.innerHTML=''; return true; } pnode=gnode; gnode=gnode.next; } return false; } function $232(gra) { var gnode; gnode=this.topGraphicNode; while(gnode) { if(gnode.gra==gra) { this.selectNode(gnode); return; } gnode=gnode.next; } this.curnode=this.topGraphicNode; this.selectNode(this.topGraphicNode); } function $233(gra) { var dx,dy; var w1,h1; var w2,h2; var xscl,yscl; var cx1,cy1,cx2,cy2; if(!gra)return; if(gra.type !='range')return; if(!this.topGraphicNode)return; w1=gra.xmax_old-gra.xmin_old; h1=gra.ymax_old-gra.ymin_old; if(w1 <0.0001)return; if(h1 <0.0002)return; w2=gra.xmax-gra.xmin; h2=gra.ymax-gra.ymin; xscl=w2/w1; yscl=h2/h1; cx1=(gra.xmax_old+gra.xmin_old)/2; cy1=(gra.ymax_old+gra.ymin_old)/2; cx2=(gra.xmax+gra.xmin)/2; cy2=(gra.ymax+gra.ymin)/2; gnode=this.topGraphicNode; while(gnode) { $235(gnode.gra,-cx1,-cy1); $236(gnode.gra,xscl,yscl); $235(gnode.gra,cx2,cy2); $234(gnode.gra); gnode=gnode.next; } gra.xmin_old=gra.xmin; gra.ymin_old=gra.ymin; gra.xmax_old=gra.xmax; gra.ymax_old=gra.ymax; } function $234(gra) { var i; if((gra.type=='line')||(gra.type=='range')||(gra.type=='polygon')) { $176(gra); return; } if(gra.type=='symbol')fit$symobl(gra); if(gra.type=='text')$267(gra); if(gra.type=='textbox')$267box(gra); if(gra.type=='circle')$265(gra); if(gra.type=='arc')$264(gra); } function $235(gra,xorg,yorg) { var i; if((gra.type=='line')||(gra.type=='range')||(gra.type=='polygon')) { for(i=0; i axmax)&& (bymin >aymax)&& (axmin >bxmax)&& (aymin >bymax))return false; return true; } function RangeInsideRange(axmin,aymin,axmax,aymax,bxmin,bymin,bxmax,bymax) { if(bxmin >axmax)return false; if(bymin >aymax)return false; if(axmin >bxmax)return false; if(aymin >bymax)return false; return true; } function $238(x1,y1,x2,y2) { var gnode; gnode=this.topGraphicNode; while(gnode) { if(RangeInsideRange(gnode.gra.xmin,gnode.gra.ymin, gnode.gra.xmax,gnode.gra.ymax, x1,y1,x2,y2))G.L.addGraphic(gnode.gra); gnode=gnode.next; } } function ic$graphicNode() { this.gra=null; this.next=null; this.prev=null; this.has=$239; } function $239(has) { switch(this.gra.type) { case'line': has.line=true; has.lineCount=has.lineCount+1; break; case'polygon': has.polygon=true; has.polygonCount=has.polygonCount+1; break; case'arc': has.arc=true; has.arcCount=has.arcCount+1; break; case'circle': has.circle=true; has.circleCount=has.circleCount+1; break; case'symbol': has.symbol=true; has.symbolCount=has.symbolCount+1; break; case'text': has.text=true; has.textCount=has.textCount+1; break; case'textbox': has.textbox=true; has.textboxCount=has.textboxCount+1; break; } } function $240(fd) { var text; fd.writeCommentLine('!'); fd.write('*section,'+this.name+';'); gnode=this.topGraphicNode while(gnode) { fd.write(gnode.gra.feature.name+', '+gnode.gra.csv+';'); gnode.gra.write(fd); gnode=gnode.next; } } function $241() { var text; this.layer.innerHTML=''; if(! this.visible)return; gnode=this.topGraphicNode; while(gnode) { this.drawGraphic(gnode.gra); gnode=gnode.next; } } function $242(col) { var csv; var text; csv=new ic$csv(); gnode=this.topGraphicNode; while(gnode) { csv.data=gnode.gra.csv; csv.deleteColumn(col); gnode.gra.csv=csv.data; gnode=gnode.next; } csv=null; } function $243(p,tol) { var text; if(! this.visible)return false; if(! this.isSnap)return false; gnode=this.topGraphicNode; while(gnode) { if(gnode.gra.snap(p,tol))return true; gnode=gnode.next; } return false; } function SymbolLibrary() { return"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +""; } function $241Graphic(gra) { var text,obj; if(!gra.feature.visible)return; G.isSelect=this.isSelect; G.isEdit=this.isEdit; text=gra.vml(); G.isSelect=false; G.isEdit=false; if(this.layer.innerHTML=='') { obj=document.createElement(''); obj.innerHTML=SymbolLibrary(); this.layer.appendChild(obj); } obj=document.createElement(''); if(this.isEdit) { } toClipboard(text); obj.innerHTML=''+text; if(! this.isEdit)obj.id='$g$'+gra.id; this.layer.appendChild(obj); } function $245() { var fea; try { icGraphicFirst.disabled=true; icGraphicPrevious.disabled=true; icGraphicNext.disabled=true; icGraphicLast.disabled=true; icGraphicCount.innerText=''; this.E.layer.innerHTML=''; if(!this.activeNode)return; this.E.drawGraphic(this.activeNode.gra); fea=this.listFeature(); if(fea)icGraphicCount.innerText=fea.graphicCount; fea=this.activeNode.gra.feature; if(activeName)activeName.innerText=fea.name; if(! fea.curnode)return; if(fea.curnode.prev) { icGraphicFirst.disabled=false; icGraphicPrevious.disabled=false; } if(fea.curnode.next) { icGraphicNext.disabled=false; icGraphicLast.disabled=false; } } catch(e){}; } function $246() { var gnode; var n; this.layer.innerHTML=='' gnode=this.topGraphicNode; this.topGraphicNode=null; this.botGraphicNode=null; this.curnode=null; this.graphicCount=0; this.graphicID=0; while(gnode) { n=gnode.next; gnode.gra=null; gnode=null; gnode=n; } this.draw(); } function $247(gra) { var gnode; var table; var first; gnode=new ic$graphicNode(); gnode.gra=gra; gnode.prev=null; gnode.next=null; if(! this.topGraphicNode) { this.graphicCount=1; this.topGraphicNode=gnode; this.botGraphicNode=gnode; } else { this.graphicCount=this.graphicCount+1; gnode.prev=this.botGraphicNode; this.botGraphicNode.next=gnode; this.botGraphicNode=gnode; } this.curnode=gnode; G.toObject(); if(this.isEdit)return; if(this.isSelect)return; G.uid=G.uid+1; gra.id=G.uid; return gnode; } function $248(gra) { var gnode; var table; var first; gnode=this.appendGraphic(gra); if(this.isEdit)return; if(this.isSelect)return; gra.csv=''; gra.feature=this; return; fld=this.table.topField; while(fld) { if(! fld.isKeep)this.table.value(fld.name,''); fld=fld.next; } G.activeNode=gnode; gra.id=G.uid; G.fromObject(gnode); this.table.value('id',gra.id); G.toObject(); } function $249(gra) { var gnode; gnode=this.topGraphicNode; while(gnode) { if(gnode.gra==gra) { this.deleteGraphicNode(gnode); return; } gnode=gnode.next; } } function $249Node(gnode) { this.graphicCount=this.graphicCount-1; if(this.curnode==gnode) { this.curnode=gnode.next; if(!this.curnode)this.curnode=gnode.prev; } if(this.botGraphicNode==gnode)this.botGraphicNode=gnode.prev; if(gnode.next)gnode.next.prev=gnode.prev; if(! gnode.prev) { if(gnode.next)gnode.next.prev=null; this.topGraphicNode=gnode.next; } else { gnode.prev.next=gnode.next; } if(G.activeNode==gnode) { G.fromObject(this.curnode); } G.D.addDeleted(gnode.gra); gnode=null; } function ic$field(name) { this.name=name.toLowerCase(); this.next=null; this.isKeep=false; if(this.name=='id')this.isKeep=true; this.value=$251; } function $251(value) { var id; var xin; var obj; xin=false; if($251.arguments.length >0)xin=true; id='icField_'+this.name; obj=getObject(id); if(!obj)return''; if(xin){obj.value=value.toString(); } else{ return(obj.value); } } function ic$table(parent) { this.parent=parent; this.topField=null; this.row=0; this.fields=0; this.selectedField=null; this.indexOf=$252; this.addField=$258; this.deleteField=$260; this.findField=$259; this.fieldExists=$261; this.findValue=$253; this.csv=$254; this.value=$255; this.html=$257; this.write=$256; } function $252(name) { var index; index=-1; fld=this.topField; while(fld) { index=index+1; if(fld.name==name)return index; fld=fld.next; } return-1; } function $253(name,icsv) { var fld,csv,text; fld=this.findField(name); if(!fld)return""; csv=new ic$csv(); csv.data=icsv; for(i=0; i 0)xin=true; csv=new ic$csv(); if(xin)csv.data=icsv; fld=this.topField; text=''; while(fld) { id='icField_'+fld.name; if(xin) { text=csv.nextToken(); fld.value(text); } else { csv.add(fld.value()); } fld=fld.next; } text=csv.data; if(! xin)return text; } function $255(name,value) { var text; var id; var xin; var f; xin=false; if($255.arguments.length >1)xin=true; f=this.findField(name); if(!f)return''; if(xin){ f.value(value); } else{ return(f.value())}; } function $256(fd) { var text,fld; text='*define:record, '+Q(this.parent.name)+' '; fld=this.topField; while(fld) { text=text+','+fld.name+':A2048'; fld=fld.next; } text=text+';'; fd.write(text); } function $257() { var text; var nam; var c,cs,cl; var d; var e; var f; var u; var value; var id; var A; var x,y; var hint1,hint2; if(! G.activeNode)return""; text=''; this.selectedField=null; nam=name.toLowerCase(); f=this.topField; while(f) { nam=f.name; id='icField_'+nam; ids='icFieldBox_'+nam; d=" onClick=\"G.selectField('"+f.name+"')\""; e=' style="cursor:pointer;"'; x=''; if(f.isLarge)x=' checked'; y=''; if(f.isKeep)y=' checked'; hint1=''; hint2=''; A=hint1+""+ hint2+""; value=f.value(); nam=""+nam+'  '; text=text+''; text=text+''+nam+''; text=text+''; f=f.next; } text=text+'
'; cs=" onChange=\"G.updateValue('"+f.name+"',this.value)\""; cl=" onChange=\"G.updateValue('"+f.name+"',this.innerText)\""; if(f.isLarge)text=text+''; else text=text+''; text=text+A+'
'; return text; } function $258(name) { var fld; var bot; this.fields=this.fields+1; fld=new ic$field(name); this.selectedField=fld; bot=this.topField; if(bot==null) { this.topField=fld; return fld; } while(bot.next)bot=bot.next; bot.next=fld; return fld; } function $259(name,excludeSelected) { var nam; var f; var check,col; nam=name.toLowerCase(); exclude=false; if(excludeSelected !=undefined)exclude=excludeSelected; col=0; f=this.topField; while(f) { col=col+1; f.column=col; check=true; if((f==this.selectedField)&& exclude)check=false; if(check&&(f.name==nam))return f; f=f.next; } return null; } function $260(name) { var nam; var fld; var prev; var col; nam=name.toLowerCase(); prev=null; col=0; fld=this.topField; while(fld) { col=col+1; if(fld.name==nam)break; prev=fld; fld=fld.next; } if(! fld)return false; this.parent.deleteColumn(col); if(prev) { prev.next=fld.next; if(fld.next){ this.selectedField=fld.next } else{ this.selectedField=prev } } else { this.topField=fld.next; this.selectedField=fld.next; } fld=null; return true; } function $261(name) { var f; f=this.findField(name); if(f)return true; return false; } function ic$dc(type) { this.setType=$262; this.setType(type); try { editGetDC(this,type); } catch(e){ alert(e.message); }; } function $262(type) { this.style=$268; if(type=='text')this.style=$273; if(type=='textbox')this.style=$273; if(type=='symbol')this.style=$272; if(type=='line')this.style=$268; if(type=='arc')this.style=$268; if(type=='sketch')this.style=$268; if(type=='circle')this.style=$274; if(type=='polygon')this.style=$274; if(type=='rectangle')this.style=$274; if(type=='area')this.style=$270; if(type=='measure')this.style=$269; if(type=='range')this.style=$271; } function defineGraphic(gra,type) { gra.type=type; gra.dc=new ic$dc(type); gra.link=''; gra.snap=$289; if(type=='line')gra.snap=$283; if(type=='polygon')gra.snap=$283; if(type=='circle')gra.snap=$284; if(type=='arc')gra.snap=$285; if(type=='symbol')gra.snap=$286; if(type=='text')gra.snap=$287; if(type=='textbox')gra.snap=$287box; if(type=='line')gra.write=$290; if(type=='polygon')gra.write=$291; if(type=='circle')gra.write=$292; if(type=='arc')gra.write=$293; if(type=='symbol')gra.write=$294; if(type=='text')gra.write=$295; if(type=='textbox')gra.write=$295box; } function defineGraphicPoints(g,np,px,py,closed) { var i; var n; n=np; if(closed) { dx=px[0]-px[np-1]; dy=py[0]-py[np-1]; if(Math.sqrt(dx*dx+dy*dy)<0.0001) { px[np-1]=px[0]; py[np-1]=py[0]; } else{ n=np+1 }; } g.x=new Array(n); g.y=new Array(n); g.xmin=1.0e64; g.ymin=1.0e64; g.xmax=-1.0e64; g.ymax=-1.0e64; for(i=0; i 0)w=dx+((nt-1)*(dx*0.66)); gra.xmin=gra.x; gra.ymin=gra.y-(dx/2); gra.xmax=gra.xmin+w; gra.ymax=gra.y+(dx/2); } function ic$Textbox(xmin,ymin,xmax,ymax,height,width) { defineGraphic(this,'textbox'); this.xmin=parseFloat(xmin); this.ymin=parseFloat(ymin); this.xmax=parseFloat(xmax); this.ymax=parseFloat(ymax); this.height=parseInt(height); this.width=parseInt(width); this.angle=0; this.vml=$279box; } function editName(iname) { name=iname; if(name=='[selected]')return name; name=name.replace(/\s/g,'_');//Space name=name.replace(/\t/g,'');//Tab name=name.replace(/\;/g,''); name=name.replace(/\=/g,''); name=name.replace(/\-/g,''); name=name.replace(/\*/g,''); name=name.replace(/\+/g,''); name=name.replace(/\/g,''); name=name.replace(/\%/g,''); name=name.replace(/\@/g,''); name=name.replace(/\(/g,''); name=name.replace(/\(/g,''); name=name.replace(/\)/g,''); name=name.replace(/\\/g,''); name=name.replace(/\$/g,''); name=name.replace(/\#/g,''); name=name.replace(/\&/g,''); name=name.replace(/\//g,''); return name; } function $268() { var value; var text; var color,width; color=this.lineColor; width=this.lineWidth; if(G.isSelectx) { color=SELECT_COLOR; width=SELECT_WIDTH; } text=''; value='black'; if(color !='')value=color; text=text+' strokecolor="'+value+'" '; text=text+' filled="false"'; text=text+' strokeweight="'+width+'px"'; text=text+'>'+"\r\n" text=text+""; return text; } function $269() { var value; text='strokecolor="gray" '; text=text+' strokeweight="2px"'; text=text+'>'+"\r\n" text=text+""; return text; } function $270() { var value; text='strokecolor="green" '; text=text+' strokeweight="1px"'; text=text+'>'+"\r\n" text=text+'"; text=text+""; return text; } function $271() { var value; text='strokecolor="green" '; text=text+' strokeweight="1px"'; text=text+'>'+"\r\n" text=text+'"; text=text+""; return text; } function $271() { var value; text='strokecolor="blue" '; text=text+' strokeweight="1px"'; text=text+'>'+"\r\n" text=text+'"; return text; } function $272() { var text,color,width; var value; text=''; if(this.symbolColor !='')text='strokecolor="'+this.symbolColor+'" '; if(G.isSelectx) { text='strokecolor="'+SELECT_COLOR+'" '; text=text+' strokeweight="'+SELECT_WIDTH+'px"'; } text=text+' type="#'+this.symbolName+'" '; value=this.symbolFillcolor; if(! this.symbolFill)value=''; if(value !='')text=text+' fillcolor="'+this.symbolFillcolor+'"'; text=text+'>'; value=this.symbolFillTransparent; if(value==undefined)value=''; if(value !='')text=text+''; return text; } function $273() { var text,color,width; text=''; color='black'; width=this.textLineWidth; if(G.isSelectx) { color=SELECT_COLOR; width=SELECT_WIDTH; } if(width !='0') text=text+" border='solid "+color+" "+width+"';"; if((this.textBgcolor !='')&& this.textFill) text=text+' background-color:'+this.textBgcolor+";"; return text; } function $274() { var value; var text; color=this.lineColor; width=this.lineWidth; if(G.isSelectx) { color=SELECT_COLOR; width=SELECT_WIDTH; } text=''; if(color !='')text=' strokecolor="'+color+'" '; text=text+' strokeweight="'+width+'px"'; text=text+'>'+"\r\n" value=this.lineFillcolor; if(value !='') { text=text+'"; } text=text+""; if(this.lineShadow) text=text+''; return text; } function $275() { var xmin,ymin,xmax,ymax,text; var coord,i,first,filled,xhref; var cmd; var np; this.dc.xstyle=$271; x1=Math.round(G.view.xToScreen(this.xmin)); y1=Math.round(G.view.yToScreen(this.ymin)); x2=Math.round(G.view.xToScreen(this.xmax)); y2=Math.round(G.view.yToScreen(this.ymax)); coord=x1+','+y1+','+ x1+','+y2+','+ x2+','+y2+','+ x2+','+y1+','+ x1+','+y1; text=""; return text; } function $276() { var xmin,ymin,xmax,ymax,text; var coord,i,first,filled,xhref; var cmd; var np,a; np=this.x.length; if(np <2)return""; for(i=0; i "; return G.hotspot(this,text); } function $277() { var xlen,nseg var da,ang; var i,a; var sx,sy,radius,sx2; sx=Math.round(G.view.xToScreen(this.cx)); sy=Math.round(G.view.yToScreen(this.cy)); sx2=Math.round(G.view.xToScreen(this.cx+this.radius)); radius=Math.abs(sx2-sx); xlen=Math.abs(radius*this.sweep) nseg=Math.ceil(xlen/2); if(nseg <22)nseg=22; if(nseg >40)nseg=40; da=this.sweep/nseg; ang=0; for(i=0; i <=nseg;++i) { x=Math.round((Math.cos(ang+this.start)*radius)+sx); y=Math.round((Math.sin(ang+this.start)*radius)+sy); if(i==0){ coord=x+","+y; } else{ coord=coord+", "+x+","+y; } ang=ang+da; } a=''; if(this.dc.z==undefined)this.dc.z=0; if(this.dc.z !=0)a='z-index:'+this.dc.z+';'; text=""; return text; return this.vml(); } function $278() { var text; var size; var np,rot,deg; var x,y,dx,a; x1=Math.round(G.view.xToScreen(this.x)); y1=Math.round(G.view.yToScreen(this.y)); size=this.dc.symbolSize; if(size==undefined)size=6; dx=Math.round(size/2); x=x1-dx; y=y1-dx; rot=''; deg=Math.abs($66(this.angle)); deg=Math.round(360-deg); if((deg !=360)||(deg==0)) rot=' Rotation='+deg+';'; a=''; if(this.dc.z==undefined)this.dc.z=0; if(this.dc.z !=0)a='z-index:'+this.dc.z+';'; text=""; return G.hotspot(this,text); } function $279() { var txt,angle,text; var color1,color2; this.angle=0; x=Math.round(G.view.xToScreen(this.x)); y=Math.round(G.view.yToScreen(this.y)); text=this.dc.textText; if(text=='')text=' '; size=parseInt(this.dc.textSize); if(size <=0)size=1; y=y-size; txt=''; if(this.dc.textBold)text=''+text+''; if(this.dc.textItalic)text=''+text+''; if(this.dc.textUnderline)text=''+text+''; txt=txt+text+''; return G.hotspot(this,txt); } function $279box(isEdit) { var txt,angle,text; var x1,y1,x2,y2; var xmin,ymin,xmax,ymax; var h,w,a; x1=Math.round(G.view.xToScreen(this.xmin)); y1=Math.round(G.view.yToScreen(this.ymin)); x2=Math.round(G.view.xToScreen(this.xmax)); y2=Math.round(G.view.yToScreen(this.ymax)); xmin=Math.min(x1,x2); ymin=Math.min(y1,y2); xmax=Math.max(x1,x2); ymax=Math.max(y1,y2); w=xmax-xmin; h=ymax-ymin; if(this.dc.fixed) { w=this.width; h=this.height; } text=this.dc.textText; if(text=='')text=' '; size=parseInt(this.dc.textSize); if(size <=0)size=1; if(this.dc.textBold)text=''+text+''; if(this.dc.textItalic)text=''+text+''; if(this.dc.textUnderline)text=''+text+''; s=this.dc.style(); txt=""; a=''; if(this.dc.z !=0)a='z-index:'+this.dc.z+';'; txt=txt+""; { txt=txt+''; txt=txt+''; txt=txt+text+''; txt=txt+''; } txt=txt+""; return G.hotspot(this,txt); } function $279boxold() { var txt,angle,text; var color1,color2; this.angle=0; x=Math.round(G.view.xToScreen(this.x)); y=Math.round(G.view.yToScreen(this.y)); text=this.dc.textText; if(text=='')text=' '; size=parseInt(this.dc.textSize); if(size <=0)size=1; rot=''; if(this.angle !=0)rot=' Rotation='+Math.round($66(this.angle))+';'; color1=textColor.value; color2="black"; h=40; w=text.length*h*1.2; txt=""; txt=txt+""; txt=txt+""; txt=txt+""; txt=txt+""; txt=txt+""; txt=txt+""; return txt; } function $282() { var xmin,ymin,text; var radius; var diameter; var cx,cy; var x2,a; cx=Math.round(G.view.xToScreen(this.cx)); cy=Math.round(G.view.yToScreen(this.cy)); x2=Math.round(G.view.xToScreen(this.cx+this.radius)); radius=Math.abs(x2-cx); xmin=cx-radius; ymin=cy-radius; diameter=radius*2; a=''; if(this.dc.z !=0)a='z-index:'+this.dc.z+';'; text=""; return G.hotspot(this,text); } function snapNearRange(g,p,tol) { var i; if((p[0]+tol)g.xmax)return false; if((p[1]-tol)>g.ymax)return false; return true; } function snapNear(x1,y1,x2,y2,tol) { var d; d=$68(x1,y1,x2,y2); if(d >tol)return false; return true; } function snapSegment(p,x1,y1,x2,y2,tol) { var d; var x,y; var xp; var ang; ang=$71(x1,y1,x2,y2); d=$68(x1,y1,x2,y2); x=p[0]-x1; y=p[1]-y1; xp=$70(x,y,-ang); x=xp[0]; y=xp[1]; if(Math.abs(y)>tol)return false; if((x+tol)<0)return false; if((x-tol)>d)return false; if(x <0)x=0; if(x >d)x=d; y=0; xp=$70(x,y,ang); p[0]=xp[0]+x1; p[1]=xp[1]+y1; return true; } function $283(p,tol) { var i; if(! snapNearRange(this,p,tol))return false; for(i=0; i tol)return false; return false; } function $285(p,tol) { var d; d=$68(p[0],p[1],this.cx,this.cy); d=Math.abs(d-this.radius); if(d >tol)return false; return false; } function $286(p,tol) { var d; if(! snapNearRange(this,p,tol))return false; p[0]=this.x; p[1]=this.y; return true; } function $287(p,tol) { return false; } function $287box(p,tol) { return false; } function $289(p,tol) { return false; } function csvLine(gra) { var text; var n; n=gra.x.length; text=n; for(i=0; i 40) { text=vmlRangeHandle(gra); return text; } for(i=0; i G.width)return''; if(sy >G.height)return''; tx=sx-3; ty=sy-3; text=" "; return text; } function $297(id,n) { var x,y; if(G.isBuild&&(! window.event.ctrlKey)) { G.edit.moveEvent(id,n); return; } if(window.event.altKey)return; x=window.event.x; y=window.event.y; window.event.cancelBubble=true; window.event.returnValue=false; G.edit.down(x,y,id,n); } function $298(id,n) { var x,y; x=window.event.x; y=window.event.y; window.event.cancelBubble=true; window.event.returnValue=false; G.edit.move(x,y); } function $299(id,n) { var x,y; x=window.event.x; y=window.event.y; window.event.cancelBubble=true; window.event.returnValue=false; G.edit.up(x,y); }