//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='4';
var HANDLE_CENTER=-99;
var HANDLE_ROTATE=-98;
var HANDLE_RADIUS=-97;
var RANGE_ID=-102;
var Zgraphic=150;
var blinkLayer=null;
var blinkSet=false;
var blinkStatus=false;
var blinkOn=true;
function $70(angle)
{
var degree;
var a,b;
degree=(angle*180.0)/Math.PI;
return degree;
}
function ic$userMap(name,view,height,width)
{
G=this;
G.gid=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.infoLink='';
this.infoTag='';
this.infoId='';
this.modified=false;
this.dbname='';
this.view=view;
this.height=height;
this.width=width;
this.cut=$169;
this.copy=$168;
this.selectAll=$170;
this.paste=$171;
this.drawSelected=$188;
this.startEdit=$161;
this.undraw=$165;
this.isTable=false;
this.clearLayer=$186;
this.curfea=null;
this.promptSave=$167;
this.hasAll=$220;
this.hasSelected=$221;
this.previousRecord=$217;
this.nextRecord=$218;
this.firstRecord=$215;
this.lastRecord=$216;
this.autoRefresh=$179;
this.autoToolbar=$177;
this.autoCenter=$173;
this.toolbar=$178;
this.refresh=$180;
this.centerSelected=$174;
this.previousFeature=$189;
this.nextFeature=$190;
this.addFeature=$248;
this.newFeature=$231;
this.clear=$243;
this.deleteAll=$234eteAll;
this.del=$234;
this.setSize=$277;
this.setFixed=$163;
this.selectFeature=$187Feature;
this.htmlFeatures=$250;
this.findFeature=$246;
this.findAddFeature=$245;
this.activeFeature=$182;
this.listFeature=$181;
this.setFeatureVisible=$241;
this.setFeatureSnap=$242;
this.featureExists=$247;
this.clearSelected=$192;
this.deleteSelected=$211;
this.deleteSelectedGraphics=$211Graphics;
this.renameTool=$237;
this.deleteTool=$234eteTool;
this.addTool=$236;
this.renameFeature=$240;
this.deleteFeature=$234eteFeature;
this.eraseFeature=$239;
this.moveFeatureUp=$232;
this.moveFeatureDown=$233;
this.eraseSelected=$166;
this.addGraphic=$230;
this.draw=$228;
this.snap=$229;
this.redraw=$191;
this.saveToFile=$222;
this.loadFromFile=$227;
this.data=$223;
this.dataPaste=$172;
this.fdPaste=$224;
this.dataSelected=$223Selected;
this.dataLayer=$223Layer;
this.write=$219;
this.toObject=$214;
this.fromObject=$213;
this.hotspot=$175;
this.hotspot_csv=$175_csv;
this.select=$187;
this.setZ=$158;
this.setBlink=$159;
this.checkKeyEnter=$162;
this.setNavigationButtons=$270;
this.findById=$184;
this.deleteById=$185;
this.ic_Shape=ic$Shape;
this.ic_Symbol=ic$Symbol;
this.ic_Polygon=ic$Polygon;
this.ic_Line=ic$Line;
this.ic_Pline=ic$Pline;
this.ic_Circle=ic$Circle;
this.ic_Arc=ic$Arc;
this.ic_Rectangle=ic$Rectangle;
this.ic_Text=ic$Text;
this.ic_Textbox=ic$Textbox;
this.ic_Sketch=ic$Sketch;
this.ic_Image=ic$Image;
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=$253;
this.D.undelete=$252;
this.D.did=0;
this.undelete=$160;
this.L=new ic$feature('selectList',this);
this.L.isSelect=true;
this.addFeature('Notes');
this.selectFeature('Notes');
this.editSetFeature=$183;
this.forSelectedGraphics=$164;
this.edit=new ic$edit(this);
blinkSet=false;
blinkLayer=this.selectFeature('Notes');
}
function $158(layer,z)
{
var fea;
fea=this.findAddFeature(layer);
fea.layer.style.zIndex=parseInt(z);
}
function $159(checked)
{
blinkOn=checked;
}
function $160()
{
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 $161()
{
this.isSelect=false;
this.fromObject(this.activeNode);
}
function $162(evt)
{
if(window.event.keyCode !=13)return;
this.refresh();
}
function $163(checked)
{
this.forSelectedGraphics('gra.dc.fixed = '+checked);
}
function $164(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 $165(gra)
{
var obj;
obj=getObject('$g$'+gra.gid);
if(!obj)return;
obj.innerHTML='';
}
function $166()
{
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 $167()
{
if(!this.modified)return true;
this.modified=false;
fileSaveAs();
}
function $168(layer)
{
var data;
data=this.dataLayer(layer);
toClipboard(data);
}
function $169(layer)
{
var data;
data=this.dataLayer(layer);
toClipboard(data);
this.clearLayer(layer);
}
function $170()
{
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 $171(layer)
{
var data;
var fd;
var test;
data=clipboard();
this.dataPaste(layer,data);
}
function $172(layer,data)
{
var data;
var fd;
var test;
if(! data)return;
if(data=='')return;
test=data.substr(0,40).toLowerCase();
if(test.indexOf('*cg2')<0)return;
fd=new ic$memoryFile(data);
this.fdPaste(fd,layer);
}
function $173(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 $174()
{
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 $175(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 $175_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;
href=gra.href;
if(href=='')return text;
href=editHref(href);
a='';
return(a+text+'');
}
catch(e){ return text }
}
function $177()
{
if(! autoToolbar.checked)return;
this.toolbar();
}
function $178()
{
setEditTool(editMode);
}
function $179()
{
if(! autoRefresh.checked)return;
this.refresh();
}
function $180()
{
var gra;
if(! this.activeNode)return;
gra=this.activeNode.gra;
editGetDC(gra.dc,gra.type);
this.redraw(gra);
}
function $181()
{
if(this.L.curnode)return this.L;
else return this.curfea;
}
function $182()
{
if(this.L.curnode)return this.L.curnode.gra.feature;
else return this.curfea;
}
function $183()
{
upTool.style.display='';
downTool.style.display='';
}
function $184(id)
{
var fea;
var gra;
fea=this.topFeature;
while(fea)
{
gra=fea.findById(id);
if(gra)return gra;
fea=fea.next;
}
return null;
}
function $185(layer,ID)
{
var fea;
fea=this.findAddFeature(layer);
if(fea.deleteById(ID))return true;
return false;
}
function $186(layer)
{
var fea;
fea=this.findAddFeature(layer);
fea.clear();
}
function $187(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 $188()
{
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 $189()
{
}
function $190()
{
}
function $191(gra)
{
var obj;
obj=getObject('$g$'+gra.gid);
gra.feature.drawGraphic(gra);
if(!this.activeNode)return;
if(gra !=this.activeNode.gra)return;
this.E.layer.innerHTML='';
this.E.drawGraphic(gra);
}
function $192()
{
try
{
this.E.clear();
this.L.clear();
}
catch(e){ };
}
function ic$edit(parent)
{
this.parent=parent;
this.isDone=false;
this.down=$194;
this.move=$196;
this.up=$197;
this.moveEvent=$193;
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 getPointShape(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 getPointImage(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 $193(gid,n)
{
var gra;
G.snapPoint=false;
if(gid==RANGE_ID)return false;
fea=this.parent.activeFeature();
if(! fea)return true;
if(! fea.curnode)return true;
if(fea.curnode.gra.gid !=gid)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=='rectangle')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(gra.type=='shape')p=getPointShape(gra,n);
if(gra.type=='image')p=getPointImage(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 $194(x,y,gid,n)
{
var fea;
this.isDown=false;
if(gid==RANGE_ID)
{
this.gra=this.parent.L.rng;
}
else
{
fea=this.parent.activeFeature();
if(! fea)return;
if(! fea.curnode)return;
if(fea.curnode.gra.gid !=gid)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=$195;
if(this.gra.type=='line')this.edit=$199;
if(this.gra.type=='pline')this.edit=$199;
if(this.gra.type=='arc')this.edit=$209;
if(this.gra.type=='circle')this.edit=$210;
if(this.gra.type=='polygon')this.edit=$200;
if(this.gra.type=='rectangle')this.edit=$200;
if(this.gra.type=='symbol')this.edit=$202;
if(this.gra.type=='text')this.edit=$203;
if(this.gra.type=='textbox')this.edit=$203box;
if(this.gra.type=='shape')this.edit=$205;
if(this.gra.type=='image')this.edit=$206;
if(this.gra.type=='range')this.edit=$208;
if(this.gra.type=='arc')graToArc(this.gra,this);
obj=getObject('$g$'+this.gra.gid);
if(obj)obj.innerHTML='';
this.isDown=true;
this.move(x,y);
}
function $195(gra)
{
}
function $196(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 $197(x,y)
{
this.isDown=false;
this.parent.mode='build';
if(! this.gra)return;
obj=getObject('$g$'+this.gra.gid);
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 $198(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 $211Graphics()
{
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 $213(node)
{
var gra;
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.gid+')';
}
catch(e){}
editPutDC(gra.dc,gra.type);
this.redraw(gra);
this.setNavigationButtons();
}
function $214()
{
var gra;
if(!this.activeNode)return;
gra=this.activeNode.gra;
try
{
editGetDC(gra.dc,gra.type);
}
catch(e)
{
alert('error toObject')
};
}
function $215()
{
var fea;
this.toObject();
fea=this.listFeature();
if(! fea)return;
if(! fea.topGraphicNode)return;
fea.selectNode(fea.topGraphicNode);
}
function $216()
{
var fea;
this.toObject();
fea=this.listFeature();
if(!fea)return;
if(! fea.botGraphicNode)return;
fea.selectNode(fea.botGraphicNode);
}
function $217()
{
var fea;
var list;
fea=this.listFeature();
if(! fea)return;
if(! fea.curnode)return;
if(fea.curnode.prev)fea.selectNode(fea.curnode.prev);
}
function $218()
{
var fea;
fea=this.listFeature();
if(! fea)return;
if(! fea.curnode)return;
if(fea.curnode.next)fea.selectNode(fea.curnode.next);
}
function $219(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.pline)
{
names=DCNames('pline');
fd.write('*define:pline, pln, '+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.rectangle)
{
names=DCNames('rectangle');
fd.write('*define:rectangle, rec, '+names+R+',xy_list(5):(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+',XY:(X:R8+Y:R8);');
}
if(has.shape)
{
names=DCNames('shape');
fd.write('*define:shape, shp, '+names+R+',style:i4,XY:(X:R8+Y:R8);');
}
if(has.image)
{
names=DCNames('image');
fd.write('*define:image, img, '+names+R+',style:i4,XY:(X:R8+Y:R8);');
}
}
function ic$has()
{
this.line=false;
this.pline=false;
this.polyon=false;
this.symbol=false;
this.arc=false;
this.circle=false;
this.text=false;
this.textbox=false;
this.shape=false;
this.image=false;
this.lineCount=0;
this.plineCount=0;
this.polgonCount=0;
this.arcCount=0;
this.circleCount=0;
this.symbolCount=0;
this.textCount=0;
this.textboxCount=0;
this.shapeCount=0;
this.imageCount=0;
}
function $220()
{
has=new ic$has();
f=this.topFeature;
while(f)
{
f.has(has);
f=f.next;
}
return has;
}
function $221()
{
has=new ic$has();
if(this.L.graphicCount >0)this.L.has(has)
else if(this.activeNode)this.activeNode.has(has);
return has;
}
function $222(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 $223(fd,paste)
{
var f,fd;
var xin;
var has;
var p;
xin=false;
if($223.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));
gra=p.readGraphic();
while(gra)
{
gra.feature=fea;
fea.appendGraphic(gra);
if(paste)this.L.addGraphic(gra);
gra=p.readGraphic();
}
}
this.clearSelected();
this.draw();
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 $224(fd,layer)
{
var f,fd;
var xin;
var has;
var p;
var fea;
fea=this.findAddFeature(layer);
p=new ic$parser(fd);
while(p.nextSection())
{
gra=p.readGraphic();
while(gra)
{
gra.feature=fea;
fea.appendGraphic(gra);
gra=p.readGraphic();
}
}
this.draw();
}
function $223Selected(data)
{
var f,fd;
var xin;
var fea,gra;
var has;
xin=false;
if($223Selected.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 $223Layer(layer)
{
var fd;
var fea
var has;
fea=this.findFeature(layer);
if(! fea)return"";
fd=new ic$memoryFile();
has=new ic$has();
fea.has(has);
this.write(fd,has);
has=null;
fea.write(fd);
fd.write('!-------- End-of-File--------------;');
return fd.close();
}
function $227(filename)
{
var f,fd;
this.dbname=filename;
fd=new ic$file();
if(! fd.openRead(filename))return;
this.data(fd,false);
fd.close();
}
function $228()
{
var f;
f=this.topFeature;
while(f)
{
f.draw();
f=f.next;
}
}
function $229(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 $230(layer,gra,isDraw)
{
var fea;
this.modified=true;
G.activeNode=null;
fea=this.findAddFeature(layer);
fea.addGraphic(gra,isDraw);
}
function $231()
{
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 $232()
{
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 $233()
{
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 $234(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 $234eteFeature()
{
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 $236()
{
if(icFeatureEdit.checked)this.newFeature();
}
function $237()
{
if(icFeatureEdit.checked)this.renameFeature();
}
function $234eteTool()
{
if(icFeatureEdit.checked)this.deleteFeature();
}
function $239()
{
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 $240()
{
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 $241(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 $242(checked)
{
if(this.curfea)this.curfea.isSnap=checked;
}
function $243()
{
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 $234eteAll()
{
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 $245(name)
{
var fea;
fea=this.findFeature(name);
if(fea)return fea;
fea=this.addFeature(name);
return fea;
}
function $246(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 $247(name)
{
if(this.findFeature(name))return true;
return false;
}
function $248(name)
{
var fea;
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 this.curfea;
}
function $187Feature(name)
{
this.toObject();
this.curfea=this.findFeature(name);
try
{ icFeatureList.innerHTML=this.htmlFeatures(name); }
catch(e){};
if(! this.curfea)return;
this.curfea.selectNode(this.curfea.curnode);
return(this.curfea);
}
function $250(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.selectGraphic=$257;
this.selectNode=$254;
this.draw=$266;
this.drawGraphic=$266Graphic;
this.snap=$268;
this.write=$265;
this.select=$263;
this.deleteColumn=$267;
this.has=$251;
this.range=$262;
this.transform=$258;
this.findById=$255;
this.deleteById=$256;
this.addGraphic=$273;
this.appendGraphic=$272;
this.deleteGraphic=$274;
this.deleteGraphicNode=$274Node;
this.clear=$271;
this.next=null;
this.layer=document.createElement('');
this.layer.style.zIndex=Zgraphic;
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 $251(has)
{
gnode=this.topGraphicNode;
while(gnode)
{
gnode.has(has);
gnode=gnode.next;
}
}
function $252(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 $253(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 $254(node)
{
G.toObject();
this.curnode=node;
G.fromObject(this.curnode);
}
function $255(id)
{
var gnode;
gnode=this.topGraphicNode;
while(gnode)
{
if(gnode.gra.id==id)return gnode.gra;
gnode=gnode.next;
}
return null;
}
function $256(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; }
if(this.botGraphicNode==gnode)this.botGraphicNode=pnode;
this.graphicCount=this.graphicCount-1;
obj=getObject('$g$'+gnode.gra.gid);
if(obj)obj.innerHTML='';
gnode.gra=null;
gnode=null;
return true;
}
pnode=gnode;
gnode=gnode.next;
}
return false;
}
function $257(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 $258(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)
{
$260(gnode.gra,-cx1,-cy1);
$261(gnode.gra,xscl,yscl);
$260(gnode.gra,cx2,cy2);
$259(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 $259(gra)
{
var i;
if((gra.type=='line')||(gra.type=='range')||(gra.type=='polygon')||(gra.type=='rectangle'))
{
$198(gra);
return;
}
if(gra.type=='symbol')fit$symobl(gra);
if(gra.type=='text')$281(gra);
if(gra.type=='textbox')$281box(gra);
if(gra.type=='shape')fit$shape(gra);
if(gra.type=='circle')$279(gra);
if(gra.type=='arc')$278(gra);
}
function $260(gra,xorg,yorg)
{
var i;
if((gra.type=='line')||(gra.type=='range')||(gra.type=='polygon')||(gra.type=='rectangle'))
{
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 $263(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=$264;
}
function $264(has)
{
switch(this.gra.type)
{
case'line': has.line=true;
has.lineCount=has.lineCount+1;
break;
case'pline': has.line=true;
has.plineCount=has.plineCount+1;
break;
case'polygon': has.polygon=true;
has.polygonCount=has.polygonCount+1;
break;
case'rectangle': has.rectangle=true;
has.rectangleCount=has.rectangleCount+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;
case'shape': has.shape=true;
has.shapeCount=has.shapeCount+1;
break;
case'image': has.image=true;
has.imageCount=has.imageCount+1;
break;
}
}
function $265(fd)
{
var text;
fd.writeCommentLine('!');
fd.write('*section,'+this.name+';');
gnode=this.topGraphicNode
while(gnode)
{
gnode.gra.write(fd);
gnode=gnode.next;
}
}
function $266()
{
var text;
this.layer.innerHTML='';
if(! this.visible)return;
gnode=this.topGraphicNode;
while(gnode)
{
this.drawGraphic(gnode.gra);
gnode=gnode.next;
}
}
function $267(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 $268(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 $266Graphic(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)
{
text=vmlHandle(gra)+text;
}
obj.innerHTML=''+text;
obj.id='$g$'+gra.gid;
this.layer.appendChild(obj);
}
function $270()
{
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 $271()
{
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 $272(gra)
{
var gnode;
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();
this.curnode=null;
return gnode;
}
function $273(gra,isDraw)
{
var gnode;
var first;
gnode=this.appendGraphic(gra);
if(this.isEdit)return;
if(this.isSelect)return;
gra.feature=this;
G.activeNode=gnode;
G.toObject();
G.activeNode=null;
if(isDraw)this.draw(gnode);
}
function $274(gra)
{
var gnode;
gnode=this.topGraphicNode;
while(gnode)
{
if(gnode.gra==gra)
{
this.deleteGraphicNode(gnode);
return;
}
gnode=gnode.next;
}
}
function $274Node(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$dc(type)
{
this.setType=$276;
this.setType(type);
try
{
editGetDC(this,type);
}
catch(e){ alert(e.message); };
}
function $276(type)
{
this.style=$282;
if(type=='text')this.style=$287;
if(type=='textbox')this.style=$287;
if(type=='shape')this.style=$288;
if(type=='symbol')this.style=$286;
if(type=='line')this.style=$282;
if(type=='pline')this.style=$282;
if(type=='arc')this.style=$282;
if(type=='sketch')this.style=$282;
if(type=='circle')this.style=$289;
if(type=='polygon')this.style=$289;
if(type=='rectangle')this.style=$289;
if(type=='area')this.style=$284;
if(type=='measure')this.style=$283;
if(type=='range')this.style=$285;
}
function defineGraphic(gra,type)
{
gra.type=type;
gra.dc=new ic$dc(type);
G.gid=G.gid+1;
gra.gid=G.gid;
gra.id='';
gra.link='';
gra.tag='';
gra.blink=false;
gra.id=G.infoId;
gra.link=G.infoLink;
gra.tag=G.infoTag;
gra.projection=null;
gra.snap=$307;
if(type=='line')gra.snap=$300;
if(type=='pline')gra.snap=$300;
if(type=='polygon')gra.snap=$300;
if(type=='rectangle')gra.snap=$300;
if(type=='circle')gra.snap=$301;
if(type=='arc')gra.snap=$302;
if(type=='symbol')gra.snap=$303;
if(type=='text')gra.snap=$304;
if(type=='textbox')gra.snap=$304box;
if(type=='shape')gra.snap=$306;
if(type=='image')gra.snap=GRAPHIC$snapImage;
if(type=='line')gra.write=$308;
if(type=='pline')gra.write=$309;
if(type=='polygon')gra.write=$310;
if(type=='rectangle')gra.write=$311;
if(type=='circle')gra.write=$312;
if(type=='arc')gra.write=$313;
if(type=='symbol')gra.write=$314;
if(type=='text')gra.write=$315;
if(type=='textbox')gra.write=$315box;
if(type=='shape')gra.write=$317;
if(type=='image')gra.write=$318;
if(type=='line')gra.csv=$319;
if(type=='pline')gra.csv=$320;
if(type=='polygon')gra.csv=$321;
if(type=='rectangle')gra.csv=$322;
if(type=='circle')gra.csv=$323;
if(type=='arc')gra.csv=$324;
if(type=='symbol')gra.csv=$325;
if(type=='text')gra.csv=$326;
if(type=='textbox')gra.csv=$326box;
if(type=='shape')gra.csv=$328;
if(type=='image')gra.csv=$329;
}
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=$294box;
}
function ic$Image(xmin,ymin,xmax,ymax,height,width)
{
defineGraphic(this,'image');
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=$296;
}
function ic$Shape(xmin,ymin,xmax,ymax,height,width)
{
defineGraphic(this,'shape');
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=$297;
}
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 $282()
{
var value;
var text;
var color,width;
color=this.lineColor;
width=this.lineWidth;
if(G.isSelect)
{
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 $283()
{
var value;
text='strokecolor="gray" ';
text=text+' strokeweight="2px"';
text=text+'>'+"\r\n"
text=text+"";
return text;
}
function $284()
{
var value;
text='strokecolor="blue" ';
text=text+' strokeweight="2px"';
text=text+'>'+"\r\n"
text=text+'";
text=text+"";
return text;
}
function $285()
{
var value;
text='strokecolor="green" ';
text=text+' strokeweight="1px"';
text=text+'>'+"\r\n"
text=text+'";
text=text+"";
return text;
}
function $285()
{
var value;
text='strokecolor="blue" ';
text=text+' strokeweight="1px"';
text=text+'>'+"\r\n"
text=text+'";
return text;
}
function $286()
{
var text,color,width;
var value;
text='';
if(G.isSelect)
{
text='strokecolor="'+SELECT_COLOR+'" ';
text=text+' strokeweight="'+SELECT_WIDTH+'px"';
}
else
{
if(this.symbolColor !='')text='strokecolor="'+this.symbolColor+'" ';
if(this.symbolLine !='')text=text+' strokewidth="'+this.symbolLine+'" ';
}
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 $287()
{
var text,color,width;
text='';
color='black';
width=this.textLineWidth;
if(G.isSelect)
{
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 $288()
{
var text,color,width;
text='';
color='black';
width=this.textLineWidth;
if(G.isSelect)
{
color=SELECT_COLOR;
width=SELECT_WIDTH;
}
return text;
}
function $289()
{
var value;
var text;
color=this.lineColor;
width=this.lineWidth;
if(G.isSelect)
{
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+'';
if(this.blink)text=blinkTag(text);
return text;
}
function $290()
{
var xmin,ymin,xmax,ymax,text;
var coord,i,first,filled,xhref;
var cmd;
var np;
this.dc.xstyle=$285;
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="";
if(this.blink)text=blinkTag(text);
return text;
}
function $291()
{
var xmin,ymin,xmax,ymax,text;
var coord,i,first,filled,xhref;
var cmd,z;
var np,a;
np=this.x.length;
if(np <2)return"";
for(i=0; i ";
if(this.blink)text=blinkTag(text);
return G.hotspot(this,text);
}
function $292()
{
var xlen,nseg
var da,ang;
var i,a,z;
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;
z=parseInt(this.dc.z);
a='z-index:'+z+';';
text="";
if(this.blink)text=blinkTag(text);
return text;
}
function $293()
{
var text;
var size,z;
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($70(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;
z=parseInt(this.dc.z);
text="";
if(this.blink)text=blinkTag(text);
return G.hotspot(this,text);
}
function $294()
{
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+'';
if(this.blink)text=blinkTag(text);
return G.hotspot(this,txt);
}
function $294box(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:'+parseInt(this.dc.z)+';';
txt=txt+"";
{
txt=txt+'';
txt=txt+'';
txt=txt+text+'';
txt=txt+'';
}
txt=txt+"";
if(this.blink)text=blinkTag(text);
return G.hotspot(this,txt);
}
function $296(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;
}
txt="";
a='';
if(this.dc.z !=0)a='z-index:'+parseInt(this.dc.z)+';';
txt=txt+"";
txt=txt+"";
txt=txt+"";
if(this.blink)text=blinkTag(text);
return G.hotspot(this,txt);
}
function $297(isEdit)
{
var txt,angle,text;
var x1,y1,x2,y2;
var xmin,ymin,xmax,ymax;
var h,w,a,b,c;
var s,ss;
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;
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();
ss=parseInt(this.dc.shapeStyle);
if(isNaN(ss))ss=63;
if(ss <0)ss=63;
b='';
if((this.dc.textBgcolor !='')&& this.dc.textFill)
b=b+' fillcolor='+this.dc.textBgcolor;
a='';
if(this.dc.z !=0)a='z-index:'+parseInt(this.dc.z)+';';
txt="";
txt=txt+"";
c=parseInt(this.dc.shapeLineWidth);
if(c >0)
{
txt=txt+"";
}
if(text !='')
{
txt=txt+'';
txt=txt+'';
txt=txt+text+'';
txt=txt+'';
}
txt=txt+"";
if(this.blink)text=blinkTag(text);
return G.hotspot(this,txt);
}
function $294boxold()
{
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($70(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+"";
if(this.blink)txt=blinkTag(txt);
return txt;
}
function $299()
{
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:'+parseInt(this.dc.z)+';';
text="";
if(this.blink)text=blinkTag(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=$72(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=$75(x1,y1,x2,y2);
d=$72(x1,y1,x2,y2);
x=p[0]-x1;
y=p[1]-y1;
xp=$74(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=$74(x,y,ang);
p[0]=xp[0]+x1;
p[1]=xp[1]+y1;
return true;
}
function $300(p,tol)
{
var i;
if(! snapNearRange(this,p,tol))return false;
for(i=0; i tol)return false;
return false;
}
function $302(p,tol)
{
var d;
d=$72(p[0],p[1],this.cx,this.cy);
d=Math.abs(d-this.radius);
if(d >tol)return false;
return false;
}
function $303(p,tol)
{
var d;
if(! snapNearRange(this,p,tol))return false;
p[0]=this.x;
p[1]=this.y;
return true;
}
function $304(p,tol)
{
return false;
}
function $304box(p,tol)
{
return false;
}
function $306(p,tol)
{
return false;
}
function $307(p,tol)
{
return false;
}
function csvLine(gra)
{
var text;
var n;
var x,y;
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 $330(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 $331(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 $332(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);
}
function $333()
{
var obj;
var i;
var value;
obj=document.getElementsByTagName("BLINK")
blinkStatus=! blinkStatus;
value='';
if(blinkOn)
{
if(blinkStatus)value='hidden';
}
for(i=0; i '+text+'';
}