5.7.2.2 release

This commit is contained in:
David Benson 2016-10-27 16:53:53 +01:00
parent d3ec52879f
commit 85b106c668
36 changed files with 5362 additions and 4829 deletions

View file

@ -1,6 +1,19 @@
18-OCT-2016: 5.7.2-0
27-OCT-2016: 5.7.2.2
- Adds page view state to realtime
- Uses mxGraph 3.7.0.0 beta 8
- Adds diagram option in From Text dialog
- Adds incremental find plugin
26-OCT-2016: 5.7.2.1
- Uses mxGraph 3.7.0.0 beta 7
- Adds page format option in print dialog
- Shift+alt+rubberband removes selection cells
- Shift+click adds edges for delete in toolbar
18-OCT-2016: 5.7.2.0
- Switches to semantic versioning
- Uses mxGraph 3.7.0.0 beta 6
- Adds experimental sql plugin

View file

@ -1 +1 @@
5.7.2-0
5.7.2.2

View file

@ -55,7 +55,7 @@ a?a=c:a==mxConstants.NONE&&(a=null);return a},clone:function(a,b,c){c=null!=c?c:
return!0},equalEntries:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){var c=0,d;for(d in b)c++;for(d in a)if(c--,(!mxUtils.isNaN(a[d])||!mxUtils.isNaN(b[d]))&&a[d]!=b[d])return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=
b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" \x3d [null]\n";else if("function"==typeof a[c])b+=c+" \x3d\x3e [Function]\n";else if("object"==typeof a[c])var d=mxUtils.getFunctionName(a[c].constructor),b=b+(c+" \x3d\x3e ["+d+"]\n");else b+=c+" \x3d "+a[c]+"\n"}catch(e){b+=c+"\x3d"+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,
k,l){k-=a;l-=b;if(0===c||0===d)return q;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180),q=Math.sin(e*Math.PI/180);e=p*m+q*n;var m=-1*q*m+p*n,n=e*e,s=m*m,r=c*c,t=d*d,y=n/r+s/t;1<y?(c*=Math.sqrt(y),d*=Math.sqrt(y),f=0):(y=1,f===g&&(y=-1),f=y*Math.sqrt((r*t-r*s-t*n)/(r*s+t*n)));n=f*c*m/d;s=-1*f*d*e/c;k=p*n-q*s+k/2;l=q*n+p*s+l/2;r=Math.atan2((m-s)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;r=Math.atan2((-m-s)/d,(-e-n)/c)-Math.atan2((m-s)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==
g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=q;d*=q;for(var v=Math.cos(f),z=Math.sin(f),s=-m*(n*z+d*v),r=-m*(c*z-p*v),y=t=0,q=[],x=0;x<g;++x){f+=e;var v=Math.cos(f),z=Math.sin(f),t=n*v-d*z+k,y=c*v+p*z+l,u=-m*(n*z+d*v),v=-m*(c*z-p*v),z=6*x;q[z]=Number(s+a);q[z+1]=Number(r+b);q[z+2]=Number(t-u+a);q[z+3]=Number(y-v+b);q[z+4]=Number(t+a);q[z+5]=Number(y+b);s=t+u;r=y+v}return q},getBoundingBox:function(a,
g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=q;d*=q;for(var x=Math.cos(f),z=Math.sin(f),s=-m*(n*z+d*x),r=-m*(c*z-p*x),y=t=0,q=[],v=0;v<g;++v){f+=e;var x=Math.cos(f),z=Math.sin(f),t=n*x-d*z+k,y=c*x+p*z+l,u=-m*(n*z+d*x),x=-m*(c*z-p*x),z=6*v;q[z]=Number(s+a);q[z+1]=Number(r+b);q[z+2]=Number(t-u+a);q[z+3]=Number(y-x+b);q[z+4]=Number(t+a);q[z+5]=Number(y+b);s=t+u;r=y+x}return q},getBoundingBox:function(a,
b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);var d=Math.cos(b),e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,
g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,null);if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<
c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=
@ -327,13 +327,13 @@ mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=n&&n
g=0;e==mxConstants.ALIGN_CENTER?g-=c/2:e==mxConstants.ALIGN_RIGHT&&(g-=c);a+=g;f==mxConstants.ALIGN_MIDDLE?l-=d/2:f==mxConstants.ALIGN_BOTTOM&&(l-=d);"fill"!=k&&(mxClient.IS_FF&&mxClient.IS_WIN)&&(l-=2);b+=l;e=1!=s.scale?"scale("+s.scale+")":"";0!=s.rotation&&this.rotateHtml?(e+="rotate("+s.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*s.scale,(b+d/2)*s.scale,s.rotation,s.rotationCx,s.rotationCy),a=b.x-c*s.scale/2,b=b.y-d*s.scale/2):(a*=s.scale,b*=s.scale);0!=m&&(e+="rotate("+m+","+-g+","+
-l+")");n.setAttribute("transform","translate("+Math.round(a)+","+Math.round(b)+")"+e);p.setAttribute("width",Math.round(Math.max(1,c)));p.setAttribute("height",Math.round(Math.max(1,d)))}};
mxSvgCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e){p=null!=p?p:0;var s=this.state;a+=s.dx;b+=s.dy;if(this.foEnabled&&"html"==l){var r="vertical-align:top;";n?r+="overflow:hidden;max-height:"+Math.round(d)+"px;max-width:"+Math.round(c)+"px;":"fill"==m?r+="width:"+Math.round(c+1)+"px;height:"+Math.round(d+1)+"px;overflow:hidden;":"width"==m&&(r+="width:"+Math.round(c+1)+"px;",0<d&&(r+="max-height:"+Math.round(d)+"px;overflow:hidden;"));var r=k&&0<c?r+("width:"+
Math.round(c+1)+"px;white-space:normal;word-wrap:"+mxConstants.WORD_WRAP+";"):r+"white-space:nowrap;",t=this.createElement("g");1>s.alpha&&t.setAttribute("opacity",s.alpha);var y=this.createElement("foreignObject");y.setAttribute("style","overflow:visible;");y.setAttribute("pointer-events","all");r=this.createDiv(e,f,g,r,m);if(null!=r){null!=q&&r.setAttribute("dir",q);t.appendChild(y);this.root.appendChild(t);var v=0,z=0;q=v=2;if(mxClient.IS_IE&&(9==document.documentMode||!mxClient.IS_SVG)){var x=
document.createElement("div");x.style.cssText=r.getAttribute("style");x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.style.position="absolute";x.style.visibility="hidden";z=document.createElement("div");z.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";z.style.wordWrap=mxConstants.WORD_WRAP;z.innerHTML=mxUtils.isNode(e)?e.outerHTML:e;x.appendChild(z);document.body.appendChild(x);8!=document.documentMode&&(9!=document.documentMode&&null!=s.fontBorderColor)&&(v+=2,q+=2);if(k&&
0<c){var u=z.offsetWidth;if(!n&&k&&0<c&&this.root.ownerDocument!=document&&"fill"!=m){var A=x.style.whiteSpace;z.style.whiteSpace="nowrap";u<z.offsetWidth&&(x.style.whiteSpace=A)}n&&(u=Math.min(u,c));x.style.width=u+"px";v=z.offsetWidth+v+0;z=z.offsetHeight+q;x.style.display="inline-block";x.style.position="";x.style.visibility="";x.style.width=v+"px";r.setAttribute("style",x.style.cssText)}else v=z.offsetWidth+v,z=z.offsetHeight+q;x.parentNode.removeChild(x);y.appendChild(r)}else this.root.ownerDocument!=
document?(r.style.visibility="hidden",document.body.appendChild(r)):y.appendChild(r),x=r,null!=x.firstChild&&"DIV"==x.firstChild.nodeName&&(x=x.firstChild,k&&"break-word"==r.style.wordWrap&&(x.style.width="100%")),u=x.offsetWidth,0==u&&r.parentNode==y&&(r.style.visibility="hidden",document.body.appendChild(r),u=x.offsetWidth),this.cacheOffsetSize&&(t.mxCachedOffsetWidth=u),!n&&(k&&0<c&&this.root.ownerDocument!=document&&"fill"!=m&&"width"!=m)&&(A=r.style.whiteSpace,r.style.whiteSpace="nowrap",u<x.offsetWidth&&
(r.style.whiteSpace=A)),v=u+v-1,k&&("fill"!=m&&"width"!=m)&&(n&&(v=Math.min(v,c)),r.style.width=v+"px"),v=x.offsetWidth,z=x.offsetHeight,this.cacheOffsetSize&&(t.mxCachedFinalOffsetWidth=v,t.mxCachedFinalOffsetHeight=z),z-=q,r.parentNode!=y&&(y.appendChild(r),r.style.visibility="");n&&(z=Math.min(z,d),v=Math.min(v,c));"width"==m?d=z:"fill"!=m&&(c=v,d=z);1>s.alpha&&t.setAttribute("opacity",s.alpha);q=r=0;f==mxConstants.ALIGN_CENTER?r-=c/2:f==mxConstants.ALIGN_RIGHT&&(r-=c);a+=r;g==mxConstants.ALIGN_MIDDLE?
q-=d/2:g==mxConstants.ALIGN_BOTTOM&&(q-=d);"fill"!=m&&(mxClient.IS_FF&&mxClient.IS_WIN)&&(q-=2);b+=q;x=1!=s.scale?"scale("+s.scale+")":"";0!=s.rotation&&this.rotateHtml?(x+="rotate("+s.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*s.scale,(b+d/2)*s.scale,s.rotation,s.rotationCx,s.rotationCy),a=b.x-c*s.scale/2,b=b.y-d*s.scale/2):(a*=s.scale,b*=s.scale);0!=p&&(x+="rotate("+p+","+-r+","+-q+")");t.setAttribute("transform","translate("+(Math.round(a)+this.foOffset)+","+(Math.round(b)+this.foOffset)+
")"+x);y.setAttribute("width",Math.round(Math.max(1,c)));y.setAttribute("height",Math.round(Math.max(1,d)));this.root.ownerDocument!=document&&(a=this.createAlternateContent(y,a,b,c,d,e,f,g,k,l,m,n,p),null!=a&&(y.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),c=this.createElement("switch"),c.appendChild(y),c.appendChild(a),t.appendChild(c)))}}else this.plainText(a,b,c,d,e,f,g,k,m,n,p,q)}};
Math.round(c+1)+"px;white-space:normal;word-wrap:"+mxConstants.WORD_WRAP+";"):r+"white-space:nowrap;",t=this.createElement("g");1>s.alpha&&t.setAttribute("opacity",s.alpha);var y=this.createElement("foreignObject");y.setAttribute("style","overflow:visible;");y.setAttribute("pointer-events","all");r=this.createDiv(e,f,g,r,m);if(null!=r){null!=q&&r.setAttribute("dir",q);t.appendChild(y);this.root.appendChild(t);var x=0,z=0;q=x=2;if(mxClient.IS_IE&&(9==document.documentMode||!mxClient.IS_SVG)){var v=
document.createElement("div");v.style.cssText=r.getAttribute("style");v.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";v.style.position="absolute";v.style.visibility="hidden";z=document.createElement("div");z.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";z.style.wordWrap=mxConstants.WORD_WRAP;z.innerHTML=mxUtils.isNode(e)?e.outerHTML:e;v.appendChild(z);document.body.appendChild(v);8!=document.documentMode&&(9!=document.documentMode&&null!=s.fontBorderColor)&&(x+=2,q+=2);if(k&&
0<c){var u=z.offsetWidth;if(!n&&k&&0<c&&this.root.ownerDocument!=document&&"fill"!=m){var A=v.style.whiteSpace;z.style.whiteSpace="nowrap";u<z.offsetWidth&&(v.style.whiteSpace=A)}n&&(u=Math.min(u,c));v.style.width=u+"px";x=z.offsetWidth+x+0;z=z.offsetHeight+q;v.style.display="inline-block";v.style.position="";v.style.visibility="";v.style.width=x+"px";r.setAttribute("style",v.style.cssText)}else x=z.offsetWidth+x,z=z.offsetHeight+q;v.parentNode.removeChild(v);y.appendChild(r)}else this.root.ownerDocument!=
document?(r.style.visibility="hidden",document.body.appendChild(r)):y.appendChild(r),v=r,null!=v.firstChild&&"DIV"==v.firstChild.nodeName&&(v=v.firstChild,k&&"break-word"==r.style.wordWrap&&(v.style.width="100%")),u=v.offsetWidth,0==u&&r.parentNode==y&&(r.style.visibility="hidden",document.body.appendChild(r),u=v.offsetWidth),this.cacheOffsetSize&&(t.mxCachedOffsetWidth=u),!n&&(k&&0<c&&this.root.ownerDocument!=document&&"fill"!=m&&"width"!=m)&&(A=r.style.whiteSpace,r.style.whiteSpace="nowrap",u<v.offsetWidth&&
(r.style.whiteSpace=A)),x=u+x-1,k&&("fill"!=m&&"width"!=m)&&(n&&(x=Math.min(x,c)),r.style.width=x+"px"),x=v.offsetWidth,z=v.offsetHeight,this.cacheOffsetSize&&(t.mxCachedFinalOffsetWidth=x,t.mxCachedFinalOffsetHeight=z),z-=q,r.parentNode!=y&&(y.appendChild(r),r.style.visibility="");n&&(z=Math.min(z,d),x=Math.min(x,c));"width"==m?d=z:"fill"!=m&&(c=x,d=z);1>s.alpha&&t.setAttribute("opacity",s.alpha);q=r=0;f==mxConstants.ALIGN_CENTER?r-=c/2:f==mxConstants.ALIGN_RIGHT&&(r-=c);a+=r;g==mxConstants.ALIGN_MIDDLE?
q-=d/2:g==mxConstants.ALIGN_BOTTOM&&(q-=d);"fill"!=m&&(mxClient.IS_FF&&mxClient.IS_WIN)&&(q-=2);b+=q;v=1!=s.scale?"scale("+s.scale+")":"";0!=s.rotation&&this.rotateHtml?(v+="rotate("+s.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*s.scale,(b+d/2)*s.scale,s.rotation,s.rotationCx,s.rotationCy),a=b.x-c*s.scale/2,b=b.y-d*s.scale/2):(a*=s.scale,b*=s.scale);0!=p&&(v+="rotate("+p+","+-r+","+-q+")");t.setAttribute("transform","translate("+(Math.round(a)+this.foOffset)+","+(Math.round(b)+this.foOffset)+
")"+v);y.setAttribute("width",Math.round(Math.max(1,c)));y.setAttribute("height",Math.round(Math.max(1,d)));this.root.ownerDocument!=document&&(a=this.createAlternateContent(y,a,b,c,d,e,f,g,k,l,m,n,p),null!=a&&(y.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),c=this.createElement("switch"),c.appendChild(y),c.appendChild(a),t.appendChild(c)))}}else this.plainText(a,b,c,d,e,f,g,k,m,n,p,q)}};
mxSvgCanvas2D.prototype.createClip=function(a,b,c,d){a=Math.round(a);b=Math.round(b);c=Math.round(c);d=Math.round(d);for(var e="mx-clip-"+a+"-"+b+"-"+c+"-"+d,f=0,g=e+"-"+f;null!=document.getElementById(g);)g=e+"-"+ ++f;clip=this.createElement("clipPath");clip.setAttribute("id",g);e=this.createElement("rect");e.setAttribute("x",a);e.setAttribute("y",b);e.setAttribute("width",c);e.setAttribute("height",d);clip.appendChild(e);return clip};
mxSvgCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,p){n=null!=n?n:0;k=this.state;var q=k.fontSize,s=this.createElement("g"),r=k.transform||"";this.updateFont(s);0!=n&&(r+="rotate("+n+","+this.format(a*k.scale)+","+this.format(b*k.scale)+")");null!=p&&s.setAttribute("direction",p);m&&(0<c&&0<d)&&(p=a,n=b,f==mxConstants.ALIGN_CENTER?p-=c/2:f==mxConstants.ALIGN_RIGHT&&(p-=c),"fill"!=l&&(g==mxConstants.ALIGN_MIDDLE?n-=d/2:g==mxConstants.ALIGN_BOTTOM&&(n-=d)),n=this.createClip(p*k.scale-
2,n*k.scale-2,c*k.scale+4,d*k.scale+4),null!=this.defs?this.defs.appendChild(n):this.root.appendChild(n),!mxClient.IS_CHROME_APP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document?(p=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),s.setAttribute("clip-path","url("+p+"#"+n.getAttribute("id")+")")):s.setAttribute("clip-path","url(#"+n.getAttribute("id")+")"));n=f==mxConstants.ALIGN_RIGHT?"end":f==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=n&&s.setAttribute("text-anchor",
@ -365,11 +365,11 @@ mxVmlCanvas2D.prototype.createDiv=function(a,b,c,d){c=this.createElement("div");
f,c.innerHTML=a);a=c.style;a.fontSize=e.fontSize/this.vmlScale+"px";a.fontFamily=e.fontFamily;a.color=e.fontColor;a.verticalAlign="top";a.textAlign=b||"left";a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?e.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT;(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold");(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic");(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&
(a.textDecoration="underline");return c};
mxVmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e){var s=this.state;if("html"==l){null!=s.rotation&&(b=this.rotatePoint(a,b,s.rotation,s.rotationCx,s.rotationCy),a=b.x,b=b.y);8==document.documentMode&&!mxClient.IS_EM?(a+=s.dx,b+=s.dy,"fill"!=m&&g==mxConstants.ALIGN_TOP&&(b-=1)):(a*=s.scale,b*=s.scale);l=8==document.documentMode&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");l.style.position="absolute";l.style.display="inline";
l.style.left=this.format(a)+"px";l.style.top=this.format(b)+"px";l.style.zoom=s.scale;var r=this.createElement("div");r.style.position="relative";r.style.display="inline";var t=mxUtils.getAlignmentAsPoint(f,g),y=t.x,t=t.y;e=this.createDiv(e,f,g,m);f=this.createElement("div");null!=q&&e.setAttribute("dir",q);if(k&&0<c){if(n||(e.style.width=Math.round(c)+"px"),e.style.wordWrap=mxConstants.WORD_WRAP,e.style.whiteSpace="normal","break-word"==e.style.wordWrap){var v=e;null!=v.firstChild&&"DIV"==v.firstChild.nodeName&&
(v.firstChild.style.width="100%")}}else e.style.whiteSpace="nowrap";p=s.rotation+(p||0);this.rotateHtml&&0!=p?(f.style.display="inline",f.style.zoom="1",f.appendChild(e),8==document.documentMode&&!mxClient.IS_EM&&"DIV"!=this.root.nodeName?(r.appendChild(f),l.appendChild(r)):l.appendChild(f)):8==document.documentMode&&!mxClient.IS_EM?(r.appendChild(e),l.appendChild(r)):(e.style.display="inline",l.appendChild(e));"DIV"!=this.root.nodeName?(q=this.createVmlElement("rect"),q.stroked="false",q.filled=
"false",q.appendChild(l),this.root.appendChild(q)):this.root.appendChild(l);n?(e.style.overflow="hidden",e.style.width=Math.round(c)+"px",mxClient.IS_QUIRKS||(e.style.maxHeight=Math.round(d)+"px")):"fill"==m?(e.style.overflow="hidden",e.style.width=Math.max(0,c)+1+"px",e.style.height=Math.max(0,d)+1+"px"):"width"==m&&(e.style.overflow="hidden",e.style.width=Math.max(0,c)+1+"px",e.style.maxHeight=Math.max(0,d)+1+"px");if(this.rotateHtml&&0!=p){v=p*(Math.PI/180);p=parseFloat(parseFloat(Math.cos(v)).toFixed(8));
q=parseFloat(parseFloat(Math.sin(-v)).toFixed(8));v%=2*Math.PI;0>v&&(v+=2*Math.PI);v%=Math.PI;v>Math.PI/2&&(v=Math.PI-v);g=Math.cos(v);var z=Math.sin(v);8==document.documentMode&&!mxClient.IS_EM&&(e.style.display="inline-block",f.style.display="inline-block",r.style.display="inline-block");e.style.visibility="hidden";e.style.position="absolute";document.body.appendChild(e);r=e;null!=r.firstChild&&"DIV"==r.firstChild.nodeName&&(r=r.firstChild);v=r.offsetWidth+3;r=r.offsetHeight;n?(c=Math.min(c,v),
r=Math.min(r,d)):c=v;k&&(e.style.width=c+"px");if(mxClient.IS_QUIRKS&&(n||"width"==m)&&r>d)r=d,e.style.height=r+"px";d=r;n=(d-d*g+c*-z)/2-q*c*(y+0.5)+p*d*(t+0.5);k=(c-c*g+d*-z)/2+p*c*(y+0.5)+q*d*(t+0.5);"group"==l.nodeName&&"DIV"==this.root.nodeName?(m=this.createElement("div"),m.style.display="inline-block",m.style.position="absolute",m.style.left=this.format(a+(k-c/2)*s.scale)+"px",m.style.top=this.format(b+(n-d/2)*s.scale)+"px",l.parentNode.appendChild(m),m.appendChild(l)):(s=8==document.documentMode&&
l.style.left=this.format(a)+"px";l.style.top=this.format(b)+"px";l.style.zoom=s.scale;var r=this.createElement("div");r.style.position="relative";r.style.display="inline";var t=mxUtils.getAlignmentAsPoint(f,g),y=t.x,t=t.y;e=this.createDiv(e,f,g,m);f=this.createElement("div");null!=q&&e.setAttribute("dir",q);if(k&&0<c){if(n||(e.style.width=Math.round(c)+"px"),e.style.wordWrap=mxConstants.WORD_WRAP,e.style.whiteSpace="normal","break-word"==e.style.wordWrap){var x=e;null!=x.firstChild&&"DIV"==x.firstChild.nodeName&&
(x.firstChild.style.width="100%")}}else e.style.whiteSpace="nowrap";p=s.rotation+(p||0);this.rotateHtml&&0!=p?(f.style.display="inline",f.style.zoom="1",f.appendChild(e),8==document.documentMode&&!mxClient.IS_EM&&"DIV"!=this.root.nodeName?(r.appendChild(f),l.appendChild(r)):l.appendChild(f)):8==document.documentMode&&!mxClient.IS_EM?(r.appendChild(e),l.appendChild(r)):(e.style.display="inline",l.appendChild(e));"DIV"!=this.root.nodeName?(q=this.createVmlElement("rect"),q.stroked="false",q.filled=
"false",q.appendChild(l),this.root.appendChild(q)):this.root.appendChild(l);n?(e.style.overflow="hidden",e.style.width=Math.round(c)+"px",mxClient.IS_QUIRKS||(e.style.maxHeight=Math.round(d)+"px")):"fill"==m?(e.style.overflow="hidden",e.style.width=Math.max(0,c)+1+"px",e.style.height=Math.max(0,d)+1+"px"):"width"==m&&(e.style.overflow="hidden",e.style.width=Math.max(0,c)+1+"px",e.style.maxHeight=Math.max(0,d)+1+"px");if(this.rotateHtml&&0!=p){x=p*(Math.PI/180);p=parseFloat(parseFloat(Math.cos(x)).toFixed(8));
q=parseFloat(parseFloat(Math.sin(-x)).toFixed(8));x%=2*Math.PI;0>x&&(x+=2*Math.PI);x%=Math.PI;x>Math.PI/2&&(x=Math.PI-x);g=Math.cos(x);var z=Math.sin(x);8==document.documentMode&&!mxClient.IS_EM&&(e.style.display="inline-block",f.style.display="inline-block",r.style.display="inline-block");e.style.visibility="hidden";e.style.position="absolute";document.body.appendChild(e);r=e;null!=r.firstChild&&"DIV"==r.firstChild.nodeName&&(r=r.firstChild);x=r.offsetWidth+3;r=r.offsetHeight;n?(c=Math.min(c,x),
r=Math.min(r,d)):c=x;k&&(e.style.width=c+"px");if(mxClient.IS_QUIRKS&&(n||"width"==m)&&r>d)r=d,e.style.height=r+"px";d=r;n=(d-d*g+c*-z)/2-q*c*(y+0.5)+p*d*(t+0.5);k=(c-c*g+d*-z)/2+p*c*(y+0.5)+q*d*(t+0.5);"group"==l.nodeName&&"DIV"==this.root.nodeName?(m=this.createElement("div"),m.style.display="inline-block",m.style.position="absolute",m.style.left=this.format(a+(k-c/2)*s.scale)+"px",m.style.top=this.format(b+(n-d/2)*s.scale)+"px",l.parentNode.appendChild(m),m.appendChild(l)):(s=8==document.documentMode&&
!mxClient.IS_EM?1:s.scale,l.style.left=this.format(a+(k-c/2)*s)+"px",l.style.top=this.format(b+(n-d/2)*s)+"px");f.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+p+", M12\x3d"+q+", M21\x3d"+-q+", M22\x3d"+p+", sizingMethod\x3d'auto expand')";f.style.backgroundColor=this.rotatedHtmlBackground;1>this.state.alpha&&(f.style.filter+="alpha(opacity\x3d"+100*this.state.alpha+")");f.appendChild(e);e.style.position="";e.style.visibility=""}else 8!=document.documentMode||mxClient.IS_EM?(e.style.verticalAlign=
"top",1>this.state.alpha&&(l.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),s=e.parentNode,e.style.visibility="hidden",document.body.appendChild(e),c=e.offsetWidth,r=e.offsetHeight,mxClient.IS_QUIRKS&&(n&&r>d)&&(r=d,e.style.height=r+"px"),d=r,e.style.visibility="",s.appendChild(e),l.style.left=this.format(a+c*y*this.state.scale)+"px",l.style.top=this.format(b+d*t*this.state.scale)+"px"):(1>this.state.alpha&&(e.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),r.style.left=100*
y+"%",r.style.top=100*t+"%")}else this.plainText(a,b,c,d,mxUtils.htmlEntities(e,!1),f,g,k,l,m,n,p,q)}};
@ -378,9 +378,9 @@ mxVmlCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,p,q){k=this.sta
g==mxConstants.ALIGN_BOTTOM?f=-k/2:g!=mxConstants.ALIGN_MIDDLE&&(f=k/2);null!=p&&(c.style.rotation=p,g=p*(Math.PI/180),e=Math.sin(g)*f,f*=Math.cos(g));c.appendChild(d);c.style.left=this.format(a-e)+"px";c.style.top=this.format(b+f)+"px";this.root.appendChild(c)};mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};
function mxGuide(a,b){this.graph=a;this.setStates(b)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=!0;mxGuide.prototype.vertical=!0;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null;mxGuide.prototype.setStates=function(a){this.states=a};mxGuide.prototype.isEnabledForEvent=function(a){return!0};mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize/2};
mxGuide.prototype.createGuideShape=function(a){a=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);a.isDashed=!0;return a};
mxGuide.prototype.move=function(a,b,c){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=b){var d=this.graph.getView().translate,e=this.graph.getView().scale,f=b.x,g=b.y,k=!1,l=null,m=null,n=!1,p=null,q=null,s=this.getGuideTolerance(),r=s,t=s,s=a.clone();s.x+=b.x;s.y+=b.y;var y=s.x,v=s.x+s.width,z=s.getCenterX(),x=s.y,u=s.y+s.height,A=s.getCenterY();b=function(b,c){b+=this.graph.panDx;var d=!1;Math.abs(b-z)<r?(f=b-a.getCenterX(),r=Math.abs(b-z),d=!0):Math.abs(b-y)<r?(f=b-a.x,
r=Math.abs(b-y),d=!0):Math.abs(b-v)<r&&(f=b-a.x-a.width,r=Math.abs(b-v),d=!0);d&&(l=c,m=Math.round(b-this.graph.panDx),null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane())));k=k||d};for(var s=function(b){b+=this.graph.panDy;var c=!1;Math.abs(b-A)<t?(g=b-a.getCenterY(),t=Math.abs(b-A),c=!0):Math.abs(b-
x)<t?(g=b-a.y,t=Math.abs(b-x),c=!0):Math.abs(b-u)<t&&(g=b-a.y-a.height,t=Math.abs(b-u),c=!0);c&&(p=B,q=Math.round(b-this.graph.panDy),null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane())));n=n||c},C=0;C<this.states.length;C++){var B=this.states[C];null!=B&&(this.horizontal&&(b.call(this,B.getCenterX(),
mxGuide.prototype.move=function(a,b,c){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=b){var d=this.graph.getView().translate,e=this.graph.getView().scale,f=b.x,g=b.y,k=!1,l=null,m=null,n=!1,p=null,q=null,s=this.getGuideTolerance(),r=s,t=s,s=a.clone();s.x+=b.x;s.y+=b.y;var y=s.x,x=s.x+s.width,z=s.getCenterX(),v=s.y,u=s.y+s.height,A=s.getCenterY();b=function(b,c){b+=this.graph.panDx;var d=!1;Math.abs(b-z)<r?(f=b-a.getCenterX(),r=Math.abs(b-z),d=!0):Math.abs(b-y)<r?(f=b-a.x,
r=Math.abs(b-y),d=!0):Math.abs(b-x)<r&&(f=b-a.x-a.width,r=Math.abs(b-x),d=!0);d&&(l=c,m=Math.round(b-this.graph.panDx),null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane())));k=k||d};for(var s=function(b){b+=this.graph.panDy;var c=!1;Math.abs(b-A)<t?(g=b-a.getCenterY(),t=Math.abs(b-A),c=!0):Math.abs(b-
v)<t?(g=b-a.y,t=Math.abs(b-v),c=!0):Math.abs(b-u)<t&&(g=b-a.y-a.height,t=Math.abs(b-u),c=!0);c&&(p=B,q=Math.round(b-this.graph.panDy),null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane())));n=n||c},C=0;C<this.states.length;C++){var B=this.states[C];null!=B&&(this.horizontal&&(b.call(this,B.getCenterX(),
B),b.call(this,B.x,B),b.call(this,B.x+B.width,B)),this.vertical&&(s.call(this,B.getCenterY(),B),s.call(this,B.y,B),s.call(this,B.y+B.height,B)))}c&&(k||(c=a.x-(this.graph.snap(a.x/e-d.x)+d.x)*e,f=this.graph.snap(f/e)*e-c),n||(d=a.y-(this.graph.snap(a.y/e-d.y)+d.y)*e,g=this.graph.snap(g/e)*e-d));e=this.graph.container;!k&&null!=this.guideX?this.guideX.node.style.visibility="hidden":null!=this.guideX&&(null!=l&&null!=a&&(minY=Math.min(a.y+g-this.graph.panDy,l.y),maxY=Math.max(a.y+a.height+g-this.graph.panDy,
l.y+l.height)),this.guideX.points=null!=minY&&null!=maxY?[new mxPoint(m,minY),new mxPoint(m,maxY)]:[new mxPoint(m,-this.graph.panDy),new mxPoint(m,e.scrollHeight-3-this.graph.panDy)],this.guideX.stroke=this.getGuideColor(l,!0),this.guideX.node.style.visibility="visible",this.guideX.redraw());!n&&null!=this.guideY?this.guideY.node.style.visibility="hidden":null!=this.guideY&&(null!=p&&null!=a&&(minX=Math.min(a.x+f-this.graph.panDx,p.x),maxX=Math.max(a.x+a.width+f-this.graph.panDx,p.x+p.width)),this.guideY.points=
null!=minX&&null!=maxX?[new mxPoint(minX,q),new mxPoint(maxX,q)]:[new mxPoint(-this.graph.panDx,q),new mxPoint(e.scrollWidth-3-this.graph.panDx,q)],this.guideY.stroke=this.getGuideColor(p,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw());b=new mxPoint(f,g)}return b};mxGuide.prototype.getGuideColor=function(a,b){return mxConstants.GUIDE_COLOR};mxGuide.prototype.hide=function(){this.setVisible(!1)};
@ -458,19 +458,19 @@ mxRhombus.prototype.paintVertexShape=function(a,b,c,d,e){var f=d/2,g=e/2,k=mxUti
mxPolyline.prototype.getShapeRotation=function(){return 0};mxPolyline.prototype.isPaintBoundsInverted=function(){return!1};mxPolyline.prototype.paintEdgeShape=function(a,b){null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(a,b,this.isRounded):this.paintCurvedLine(a,b)};mxPolyline.prototype.paintLine=function(a,b,c){var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,b,c,d,!1);a.stroke()};
mxPolyline.prototype.paintCurvedLine=function(a,b){a.begin();var c=b[0],d=b.length;a.moveTo(c.x,c.y);for(c=1;c<d-2;c++){var e=b[c],f=b[c+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}e=b[d-2];f=b[d-1];a.quadTo(e.x,e.y,f.x,f.y);a.stroke()};
function mxArrow(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.spacing=null!=f?f:mxConstants.ARROW_SPACING;this.endSize=null!=g?g:mxConstants.ARROW_SIZE}mxUtils.extend(mxArrow,mxShape);mxArrow.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=Math.max(this.arrowWidth,this.endSize);a.grow((b/2+this.strokewidth)*this.scale)};
mxArrow.prototype.paintEdgeShape=function(a,b){var c=mxConstants.ARROW_SPACING,d=mxConstants.ARROW_WIDTH,e=mxConstants.ARROW_SIZE,f=b[0],g=b[b.length-1],k=g.x-f.x,l=g.y-f.y,m=Math.sqrt(k*k+l*l),n=m-2*c-e,k=k/m,l=l/m,m=d*l/3,d=-d*k/3,e=f.x-m/2+c*k,f=f.y-d/2+c*l,p=e+m,q=f+d,s=p+n*k,n=q+n*l,r=s+m,t=n+d,y=r-3*m,v=t-3*d;a.begin();a.moveTo(e,f);a.lineTo(p,q);a.lineTo(s,n);a.lineTo(r,t);a.lineTo(g.x-c*k,g.y-c*l);a.lineTo(y,v);a.lineTo(y+m,v+d);a.close();a.fillAndStroke()};
mxArrow.prototype.paintEdgeShape=function(a,b){var c=mxConstants.ARROW_SPACING,d=mxConstants.ARROW_WIDTH,e=mxConstants.ARROW_SIZE,f=b[0],g=b[b.length-1],k=g.x-f.x,l=g.y-f.y,m=Math.sqrt(k*k+l*l),n=m-2*c-e,k=k/m,l=l/m,m=d*l/3,d=-d*k/3,e=f.x-m/2+c*k,f=f.y-d/2+c*l,p=e+m,q=f+d,s=p+n*k,n=q+n*l,r=s+m,t=n+d,y=r-3*m,x=t-3*d;a.begin();a.moveTo(e,f);a.lineTo(p,q);a.lineTo(s,n);a.lineTo(r,t);a.lineTo(g.x-c*k,g.y-c*l);a.lineTo(y,x);a.lineTo(y+m,x+d);a.close();a.fillAndStroke()};
function mxArrowConnector(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.arrowSpacing=null!=f?f:mxConstants.ARROW_SPACING;this.startSize=mxConstants.ARROW_SIZE/5;this.endSize=mxConstants.ARROW_SIZE/5}mxUtils.extend(mxArrowConnector,mxShape);mxArrowConnector.prototype.useSvgBoundingBox=!0;
mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))};
mxArrowConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=this.getEdgeWidth();this.isMarkerStart()&&(b=Math.max(b,this.getStartArrowWidth()));this.isMarkerEnd()&&(b=Math.max(b,this.getEndArrowWidth()));a.grow((b/2+this.strokewidth)*this.scale)};
mxArrowConnector.prototype.paintEdgeShape=function(a,b){var c=this.strokewidth;this.outline&&(c=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));for(var d=this.getStartArrowWidth()+c,e=this.getEndArrowWidth()+c,f=this.outline?this.getEdgeWidth()+c:this.getEdgeWidth(),g=this.isOpenEnded(),k=this.isMarkerStart(),l=this.isMarkerEnd(),m=g?0:this.arrowSpacing+c/2,n=this.startSize+c,c=this.endSize+c,p=this.isArrowRounded(),q=b[b.length-1],s=1;s<b.length-1&&b[s].x==
b[0].x&&b[s].y==b[0].y;)s++;var r=b[s].x-b[0].x,s=b[s].y-b[0].y,t=Math.sqrt(r*r+s*s);if(0!=t){var y=r/t,v,z=y,x=s/t,u,A=x,t=f*x,C=-f*y,B=[];p?a.setLineJoin("round"):2<b.length&&a.setMiterLimit(1.42);a.begin();r=y;s=x;if(k&&!g)this.paintMarker(a,b[0].x,b[0].y,y,x,n,d,f,m,!0);else{v=b[0].x+t/2+m*y;u=b[0].y+C/2+m*x;var I=b[0].x-t/2+m*y,J=b[0].y-C/2+m*x;g?(a.moveTo(v,u),B.push(function(){a.lineTo(I,J)})):(a.moveTo(I,J),a.lineTo(v,u))}for(var D=u=v=0,t=0;t<b.length-2;t++)if(C=mxUtils.relativeCcw(b[t].x,
b[t].y,b[t+1].x,b[t+1].y,b[t+2].x,b[t+2].y),v=b[t+2].x-b[t+1].x,u=b[t+2].y-b[t+1].y,D=Math.sqrt(v*v+u*u),0!=D&&(z=v/D,A=u/D,tmp=Math.max(Math.sqrt((y*z+x*A+1)/2),0.04),v=y+z,u=x+A,D=Math.sqrt(v*v+u*u),0!=D)){v/=D;u/=D;var D=Math.max(tmp,Math.min(this.strokewidth/200+0.04,0.35)),D=0!=C&&p?Math.max(0.1,D):Math.max(tmp,0.06),E=b[t+1].x+u*f/2/D,F=b[t+1].y-v*f/2/D;u=b[t+1].x-u*f/2/D;v=b[t+1].y+v*f/2/D;0==C||!p?(a.lineTo(E,F),function(b,c){B.push(function(){a.lineTo(b,c)})}(u,v)):-1==C?(C=u+A*f,D=v-z*f,
a.lineTo(u+x*f,v-y*f),a.quadTo(E,F,C,D),function(b,c){B.push(function(){a.lineTo(b,c)})}(u,v)):(a.lineTo(E,F),function(b,c){var d=E-x*f,e=F+y*f,g=E-A*f,k=F+z*f;B.push(function(){a.quadTo(b,c,d,e)});B.push(function(){a.lineTo(g,k)})}(u,v));y=z;x=A}t=f*A;C=-f*z;if(l&&!g)this.paintMarker(a,q.x,q.y,-y,-x,c,e,f,m,!1);else{a.lineTo(q.x-m*z+t/2,q.y-m*A+C/2);var G=q.x-m*z-t/2,H=q.y-m*A-C/2;g?(a.moveTo(G,H),B.splice(0,0,function(){a.moveTo(G,H)})):a.lineTo(G,H)}for(t=B.length-1;0<=t;t--)B[t]();g?(a.end(),
a.stroke()):(a.close(),a.fillAndStroke());a.setShadow(!1);a.setMiterLimit(4);p&&a.setLineJoin("flat");2<b.length&&(a.setMiterLimit(4),k&&!g&&(a.begin(),this.paintMarker(a,b[0].x,b[0].y,r,s,n,d,f,m,!0),a.stroke(),a.end()),l&&!g&&(a.begin(),this.paintMarker(a,q.x,q.y,-y,-x,c,e,f,m,!0),a.stroke(),a.end()))}};
b[0].x&&b[s].y==b[0].y;)s++;var r=b[s].x-b[0].x,s=b[s].y-b[0].y,t=Math.sqrt(r*r+s*s);if(0!=t){var y=r/t,x,z=y,v=s/t,u,A=v,t=f*v,C=-f*y,B=[];p?a.setLineJoin("round"):2<b.length&&a.setMiterLimit(1.42);a.begin();r=y;s=v;if(k&&!g)this.paintMarker(a,b[0].x,b[0].y,y,v,n,d,f,m,!0);else{x=b[0].x+t/2+m*y;u=b[0].y+C/2+m*v;var G=b[0].x-t/2+m*y,H=b[0].y-C/2+m*v;g?(a.moveTo(x,u),B.push(function(){a.lineTo(G,H)})):(a.moveTo(G,H),a.lineTo(x,u))}for(var D=u=x=0,t=0;t<b.length-2;t++)if(C=mxUtils.relativeCcw(b[t].x,
b[t].y,b[t+1].x,b[t+1].y,b[t+2].x,b[t+2].y),x=b[t+2].x-b[t+1].x,u=b[t+2].y-b[t+1].y,D=Math.sqrt(x*x+u*u),0!=D&&(z=x/D,A=u/D,tmp=Math.max(Math.sqrt((y*z+v*A+1)/2),0.04),x=y+z,u=v+A,D=Math.sqrt(x*x+u*u),0!=D)){x/=D;u/=D;var D=Math.max(tmp,Math.min(this.strokewidth/200+0.04,0.35)),D=0!=C&&p?Math.max(0.1,D):Math.max(tmp,0.06),E=b[t+1].x+u*f/2/D,F=b[t+1].y-x*f/2/D;u=b[t+1].x-u*f/2/D;x=b[t+1].y+x*f/2/D;0==C||!p?(a.lineTo(E,F),function(b,c){B.push(function(){a.lineTo(b,c)})}(u,x)):-1==C?(C=u+A*f,D=x-z*f,
a.lineTo(u+v*f,x-y*f),a.quadTo(E,F,C,D),function(b,c){B.push(function(){a.lineTo(b,c)})}(u,x)):(a.lineTo(E,F),function(b,c){var d=E-v*f,e=F+y*f,g=E-A*f,k=F+z*f;B.push(function(){a.quadTo(b,c,d,e)});B.push(function(){a.lineTo(g,k)})}(u,x));y=z;v=A}t=f*A;C=-f*z;if(l&&!g)this.paintMarker(a,q.x,q.y,-y,-v,c,e,f,m,!1);else{a.lineTo(q.x-m*z+t/2,q.y-m*A+C/2);var I=q.x-m*z-t/2,J=q.y-m*A-C/2;g?(a.moveTo(I,J),B.splice(0,0,function(){a.moveTo(I,J)})):a.lineTo(I,J)}for(t=B.length-1;0<=t;t--)B[t]();g?(a.end(),
a.stroke()):(a.close(),a.fillAndStroke());a.setShadow(!1);a.setMiterLimit(4);p&&a.setLineJoin("flat");2<b.length&&(a.setMiterLimit(4),k&&!g&&(a.begin(),this.paintMarker(a,b[0].x,b[0].y,r,s,n,d,f,m,!0),a.stroke(),a.end()),l&&!g&&(a.begin(),this.paintMarker(a,q.x,q.y,-y,-v,c,e,f,m,!0),a.stroke(),a.end()))}};
mxArrowConnector.prototype.paintMarker=function(a,b,c,d,e,f,g,k,l,m){g=k/g;var n=k*e/2;k=-k*d/2;var p=(l+f)*d;f=(l+f)*e;m?a.moveTo(b-n+p,c-k+f):a.lineTo(b-n+p,c-k+f);a.lineTo(b-n/g+p,c-k/g+f);a.lineTo(b+l*d,c+l*e);a.lineTo(b+n/g+p,c+k/g+f);a.lineTo(b+n+p,c+k+f)};mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded};mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH};
mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3};mxArrowConnector.prototype.isOpenEnded=function(){return!1};mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE};mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE};
function mxText(a,b,c,d,e,f,g,k,l,m,n,p,q,s,r,t,y,v,z,x,u){mxShape.call(this);this.value=a;this.bounds=b;this.color=null!=e?e:"black";this.align=null!=c?c:"";this.valign=null!=d?d:"";this.family=null!=f?f:mxConstants.DEFAULT_FONTFAMILY;this.size=null!=g?g:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=null!=k?k:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(l||2);this.spacingTop=this.spacing+parseInt(m||0);this.spacingRight=this.spacing+parseInt(n||0);this.spacingBottom=this.spacing+parseInt(p||
0);this.spacingLeft=this.spacing+parseInt(q||0);this.horizontal=null!=s?s:!0;this.background=r;this.border=t;this.wrap=null!=y?y:!1;this.clipped=null!=v?v:!1;this.overflow=null!=z?z:"visible";this.labelPadding=null!=x?x:0;this.textDirection=u;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;mxText.prototype.baseSpacingRight=0;mxText.prototype.replaceLinefeeds=!0;
function mxText(a,b,c,d,e,f,g,k,l,m,n,p,q,s,r,t,y,x,z,v,u){mxShape.call(this);this.value=a;this.bounds=b;this.color=null!=e?e:"black";this.align=null!=c?c:"";this.valign=null!=d?d:"";this.family=null!=f?f:mxConstants.DEFAULT_FONTFAMILY;this.size=null!=g?g:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=null!=k?k:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(l||2);this.spacingTop=this.spacing+parseInt(m||0);this.spacingRight=this.spacing+parseInt(n||0);this.spacingBottom=this.spacing+parseInt(p||
0);this.spacingLeft=this.spacing+parseInt(q||0);this.horizontal=null!=s?s:!0;this.background=r;this.border=t;this.wrap=null!=y?y:!1;this.clipped=null!=x?x:!1;this.overflow=null!=z?z:"visible";this.labelPadding=null!=v?v:0;this.textDirection=u;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;mxText.prototype.baseSpacingRight=0;mxText.prototype.replaceLinefeeds=!0;
mxText.prototype.verticalTextRotation=-90;mxText.prototype.ignoreClippedStringSize=!0;mxText.prototype.ignoreStringSize=!1;mxText.prototype.textWidthPadding=8==document.documentMode&&!mxClient.IS_EM?4:3;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=!0;mxText.prototype.isParseVml=function(){return!1};mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM};mxText.prototype.getSvgScreenOffset=function(){return 0};
mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)};
mxText.prototype.paint=function(a,b){var c=this.scale,d=this.bounds.x/c,e=this.bounds.y/c,f=this.bounds.width/c,c=this.bounds.height/c;this.updateTransform(a,d,e,f,c);this.configureCanvas(a,d,e,f,c);if(b){var g=null!=this.state?this.state.unscaledWidth:null;null!=this.node.firstChild&&this.lastUnscaledWidth!=g&&a.invalidateCachedOffsetSize(this.node);a.updateText(d,e,f,c,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node)}else{var k=(g=mxUtils.isNode(this.value)||
@ -663,9 +663,9 @@ mxMedianHybridCrossingReduction.prototype.execute=function(a){a=this.layout.getM
k}}else{c++;for(e=0;e<this.nestedBestRanks.length;e++){f=a.ranks[e];for(g=0;g<f.length;g++)k=f[g],k.setGeneralPurposeVariable(e,g)}}if(0==d)break}c=[];d=[];for(b=0;b<a.maxRank+1;b++)d[b]=[],c[b]=d[b];for(b=0;b<this.nestedBestRanks.length;b++)for(e=0;e<this.nestedBestRanks[b].length;e++)d[b].push(this.nestedBestRanks[b][e]);a.ranks=c};mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(a){for(var b=a.ranks.length,c=0,d=1;d<b;d++)c+=this.calculateRankCrossing(d,a);return c};
mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(a,b){for(var c=0,d=b.ranks[a],e=b.ranks[a-1],f=[],g=0;g<d.length;g++){for(var k=d[g],l=k.getGeneralPurposeVariable(a),k=k.getPreviousLayerConnectedCells(a),m=[],n=0;n<k.length;n++){var p=k[n].getGeneralPurposeVariable(a-1);m.push(p)}m.sort(function(a,b){return a-b});f[l]=m}d=[];for(g=0;g<f.length;g++)d=d.concat(f[g]);for(f=1;f<e.length;)f<<=1;l=2*f-1;f-=1;e=[];for(g=0;g<l;++g)e[g]=0;for(g=0;g<d.length;g++){l=d[g]+f;for(++e[l];0<
l;)l%2&&(c+=e[l+1]),l=l-1>>1,++e[l]}return c};
mxMedianHybridCrossingReduction.prototype.transpose=function(a,b){for(var c=!0,d=0;c&&10>d++;)for(var e=1==a%2&&1==d%2,c=!1,f=0;f<b.ranks.length;f++){for(var g=b.ranks[f],k=[],l=0;l<g.length;l++){var m=g[l],n=m.getGeneralPurposeVariable(f);0>n&&(n=l);k[n]=m}for(var p=n=m=null,q=null,s=null,r=null,t=null,y=null,v=null,z=null,l=0;l<g.length-1;l++){if(0==l){for(var v=k[l],m=v.getNextLayerConnectedCells(f),n=v.getPreviousLayerConnectedCells(f),s=[],r=[],x=0;x<m.length;x++)s[x]=m[x].getGeneralPurposeVariable(f+
1);for(x=0;x<n.length;x++)r[x]=n[x].getGeneralPurposeVariable(f-1)}else m=p,n=q,s=t,r=y,v=z;z=k[l+1];p=z.getNextLayerConnectedCells(f);q=z.getPreviousLayerConnectedCells(f);t=[];y=[];for(x=0;x<p.length;x++)t[x]=p[x].getGeneralPurposeVariable(f+1);for(x=0;x<q.length;x++)y[x]=q[x].getGeneralPurposeVariable(f-1);for(var u=0,A=0,x=0;x<s.length;x++)for(var C=0;C<t.length;C++)s[x]>t[C]&&u++,s[x]<t[C]&&A++;for(x=0;x<r.length;x++)for(C=0;C<y.length;C++)r[x]>y[C]&&u++,r[x]<y[C]&&A++;if(A<u||A==u&&e)p=v.getGeneralPurposeVariable(f),
v.setGeneralPurposeVariable(f,z.getGeneralPurposeVariable(f)),z.setGeneralPurposeVariable(f,p),p=m,q=n,t=s,y=r,z=v,e||(c=!0)}}};mxMedianHybridCrossingReduction.prototype.weightedMedian=function(a,b){var c=0==a%2;if(c)for(var d=b.maxRank-1;0<=d;d--)this.medianRank(d,c);else for(d=1;d<b.maxRank;d++)this.medianRank(d,c)};
mxMedianHybridCrossingReduction.prototype.transpose=function(a,b){for(var c=!0,d=0;c&&10>d++;)for(var e=1==a%2&&1==d%2,c=!1,f=0;f<b.ranks.length;f++){for(var g=b.ranks[f],k=[],l=0;l<g.length;l++){var m=g[l],n=m.getGeneralPurposeVariable(f);0>n&&(n=l);k[n]=m}for(var p=n=m=null,q=null,s=null,r=null,t=null,y=null,x=null,z=null,l=0;l<g.length-1;l++){if(0==l){for(var x=k[l],m=x.getNextLayerConnectedCells(f),n=x.getPreviousLayerConnectedCells(f),s=[],r=[],v=0;v<m.length;v++)s[v]=m[v].getGeneralPurposeVariable(f+
1);for(v=0;v<n.length;v++)r[v]=n[v].getGeneralPurposeVariable(f-1)}else m=p,n=q,s=t,r=y,x=z;z=k[l+1];p=z.getNextLayerConnectedCells(f);q=z.getPreviousLayerConnectedCells(f);t=[];y=[];for(v=0;v<p.length;v++)t[v]=p[v].getGeneralPurposeVariable(f+1);for(v=0;v<q.length;v++)y[v]=q[v].getGeneralPurposeVariable(f-1);for(var u=0,A=0,v=0;v<s.length;v++)for(var C=0;C<t.length;C++)s[v]>t[C]&&u++,s[v]<t[C]&&A++;for(v=0;v<r.length;v++)for(C=0;C<y.length;C++)r[v]>y[C]&&u++,r[v]<y[C]&&A++;if(A<u||A==u&&e)p=x.getGeneralPurposeVariable(f),
x.setGeneralPurposeVariable(f,z.getGeneralPurposeVariable(f)),z.setGeneralPurposeVariable(f,p),p=m,q=n,t=s,y=r,z=x,e||(c=!0)}}};mxMedianHybridCrossingReduction.prototype.weightedMedian=function(a,b){var c=0==a%2;if(c)for(var d=b.maxRank-1;0<=d;d--)this.medianRank(d,c);else for(d=1;d<b.maxRank;d++)this.medianRank(d,c)};
mxMedianHybridCrossingReduction.prototype.medianRank=function(a,b){for(var c=this.nestedBestRanks[a].length,d=[],e=[],f=0;f<c;f++){var g=this.nestedBestRanks[a][f],k=new MedianCellSorter;k.cell=g;var l;l=b?g.getNextLayerConnectedCells(a):g.getPreviousLayerConnectedCells(a);var m;m=b?a+1:a-1;null!=l&&0!=l.length?(k.medianValue=this.medianValue(l,m),d.push(k)):e[g.getGeneralPurposeVariable(a)]=!0}d.sort(MedianCellSorter.prototype.compare);for(f=0;f<c;f++)null==e[f]&&(g=d.shift().cell,g.setGeneralPurposeVariable(a,
f))};mxMedianHybridCrossingReduction.prototype.medianValue=function(a,b){for(var c=[],d=0,e=0;e<a.length;e++){var f=a[e];c[d++]=f.getGeneralPurposeVariable(b)}c.sort(function(a,b){return a-b});if(1==d%2)return c[Math.floor(d/2)];if(2==d)return(c[0]+c[1])/2;e=d/2;f=c[e-1]-c[0];d=c[d-1]-c[e];return(c[e-1]*d+c[e]*f)/(f+d)};function MedianCellSorter(){}MedianCellSorter.prototype.medianValue=0;MedianCellSorter.prototype.cell=!1;
MedianCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.medianValue>a.medianValue?-1:b.medianValue<a.medianValue?1:0:0};function mxMinimumCycleRemover(a){this.layout=a}mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage;mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover;mxMinimumCycleRemover.prototype.layout=null;
@ -678,8 +678,8 @@ mxCoordinateAssignment.prototype.printStatus=function(){var a=this.layout.getMod
mxCoordinateAssignment.prototype.execute=function(a){this.jettyPositions={};a=this.layout.getModel();this.currentXDelta=0;this.initialCoords(this.layout.getGraph(),a);this.fineTuning&&this.minNode(a);var b=1E8;if(this.fineTuning)for(var c=0;c<this.maxIterations;c++){0!=c&&(this.medianPos(c,a),this.minNode(a));if(this.currentXDelta<b){for(var d=0;d<a.ranks.length;d++)for(var e=a.ranks[d],f=0;f<e.length;f++){var g=e[f];g.setX(d,g.getGeneralPurposeVariable(d))}b=this.currentXDelta}else for(d=0;d<a.ranks.length;d++){e=
a.ranks[d];for(f=0;f<e.length;f++)g=e[f],g.setGeneralPurposeVariable(d,g.getX(d))}this.minPath(this.layout.getGraph(),a);this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),a)};
mxCoordinateAssignment.prototype.minNode=function(a){for(var b=[],c=new mxDictionary,d=[],e=0;e<=a.maxRank;e++){d[e]=a.ranks[e];for(var f=0;f<d[e].length;f++){var g=d[e][f],k=new WeightedCellSorter(g,e);k.rankIndex=f;k.visited=!0;b.push(k);c.put(g,k)}}a=10*b.length;for(f=0;0<b.length&&f<=a;){var g=b.shift(),e=g.cell,l=g.weightedValue,m=parseInt(g.rankIndex),k=e.getNextLayerConnectedCells(l),n=e.getPreviousLayerConnectedCells(l),p=k.length,q=n.length,s=this.medianXValue(k,l+1),r=this.medianXValue(n,
l-1),t=p+q,y=e.getGeneralPurposeVariable(l),v=y;0<t&&(v=(s*p+r*q)/t);p=!1;v<y-1?0==m?(e.setGeneralPurposeVariable(l,v),p=!0):(m=d[l][m-1],y=m.getGeneralPurposeVariable(l),y=y+m.width/2+this.intraCellSpacing+e.width/2,y<v?(e.setGeneralPurposeVariable(l,v),p=!0):y<e.getGeneralPurposeVariable(l)-1&&(e.setGeneralPurposeVariable(l,y),p=!0)):v>y+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,v),p=!0):(m=d[l][m+1],y=m.getGeneralPurposeVariable(l),y=y-m.width/2-this.intraCellSpacing-e.width/2,y>v?(e.setGeneralPurposeVariable(l,
v),p=!0):y>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,y),p=!0)));if(p){for(e=0;e<k.length;e++)l=k[e],l=c.get(l),null!=l&&!1==l.visited&&(l.visited=!0,b.push(l));for(e=0;e<n.length;e++)l=n[e],l=c.get(l),null!=l&&!1==l.visited&&(l.visited=!0,b.push(l))}g.visited=!1;f++}};mxCoordinateAssignment.prototype.medianPos=function(a,b){if(0==a%2)for(var c=b.maxRank;0<c;c--)this.rankMedianPosition(c-1,b,c);else for(c=0;c<b.maxRank-1;c++)this.rankMedianPosition(c+1,b,c)};
l-1),t=p+q,y=e.getGeneralPurposeVariable(l),x=y;0<t&&(x=(s*p+r*q)/t);p=!1;x<y-1?0==m?(e.setGeneralPurposeVariable(l,x),p=!0):(m=d[l][m-1],y=m.getGeneralPurposeVariable(l),y=y+m.width/2+this.intraCellSpacing+e.width/2,y<x?(e.setGeneralPurposeVariable(l,x),p=!0):y<e.getGeneralPurposeVariable(l)-1&&(e.setGeneralPurposeVariable(l,y),p=!0)):x>y+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,x),p=!0):(m=d[l][m+1],y=m.getGeneralPurposeVariable(l),y=y-m.width/2-this.intraCellSpacing-e.width/2,y>x?(e.setGeneralPurposeVariable(l,
x),p=!0):y>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,y),p=!0)));if(p){for(e=0;e<k.length;e++)l=k[e],l=c.get(l),null!=l&&!1==l.visited&&(l.visited=!0,b.push(l));for(e=0;e<n.length;e++)l=n[e],l=c.get(l),null!=l&&!1==l.visited&&(l.visited=!0,b.push(l))}g.visited=!1;f++}};mxCoordinateAssignment.prototype.medianPos=function(a,b){if(0==a%2)for(var c=b.maxRank;0<c;c--)this.rankMedianPosition(c-1,b,c);else for(c=0;c<b.maxRank-1;c++)this.rankMedianPosition(c+1,b,c)};
mxCoordinateAssignment.prototype.rankMedianPosition=function(a,b,c){b=b.ranks[a];for(var d=[],e={},f=0;f<b.length;f++){var g=b[f];d[f]=new WeightedCellSorter;d[f].cell=g;d[f].rankIndex=f;e[g.id]=d[f];var k=null,k=c<a?g.getPreviousLayerConnectedCells(a):g.getNextLayerConnectedCells(a);d[f].weightedValue=this.calculatedWeightedValue(g,k)}d.sort(WeightedCellSorter.prototype.compare);for(f=0;f<d.length;f++){var l=0,g=d[f].cell,l=0,k=c<a?g.getPreviousLayerConnectedCells(a).slice():g.getNextLayerConnectedCells(a).slice();
null!=k&&(l=k.length,l=0<l?this.medianXValue(k,c):g.getGeneralPurposeVariable(a));for(var m=0,k=-1E8,n=d[f].rankIndex-1;0<=n;){var p=e[b[n].id];if(null!=p){var q=p.cell;p.visited?(k=q.getGeneralPurposeVariable(a)+q.width/2+this.intraCellSpacing+m+g.width/2,n=-1):(m+=q.width+this.intraCellSpacing,n--)}}m=0;q=1E8;for(n=d[f].rankIndex+1;n<d.length;)if(p=e[b[n].id],null!=p){var s=p.cell;p.visited?(q=s.getGeneralPurposeVariable(a)-s.width/2-this.intraCellSpacing-m-g.width/2,n=d.length):(m+=s.width+this.intraCellSpacing,
n++)}l>=k&&l<=q?g.setGeneralPurposeVariable(a,l):l<k?(g.setGeneralPurposeVariable(a,k),this.currentXDelta+=k-l):l>q&&(g.setGeneralPurposeVariable(a,q),this.currentXDelta+=l-q);d[f].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,b){for(var c=0,d=0;d<b.length;d++){var e=b[d];a.isVertex()&&e.isVertex()?c++:c=a.isEdge()&&e.isEdge()?c+8:c+2}return c};
@ -699,9 +699,9 @@ mxCoordinateAssignment.prototype.localEdgeProcessing=function(a){for(var b=0;b<a
r;if(s.isVertex()){r=0==k?e.connectsAsSource:e.connectsAsTarget;for(var t=0;t<r.length;t++)if(r[t].source==s||r[t].target==s)f+=r[t].edges.length,q++,g.push(r[t])}else f+=s.edges.length,q++,g.push(s)}e.width>(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);l=(p-n)/f;n+=l/2;p=this.minEdgeJetty-this.prefVertEdgeOff;for(m=q=0;m<g.length;m++){s=g[m].edges.length;r=this.jettyPositions[g[m].ids[0]];null==r&&(r=[],this.jettyPositions[g[m].ids[0]]=r);m<f/2?
p+=this.prefVertEdgeOff:m>f/2&&(p-=this.prefVertEdgeOff);for(t=0;t<s;t++)r[4*t+2*k]=n,n+=l,r[4*t+2*k+1]=p;q=Math.max(q,p)}}f=e.getNextLayerConnectedCells(b);g=b+1}}};
mxCoordinateAssignment.prototype.setEdgePosition=function(a){var b=0;if(101207!=a.temp[0]){var c=a.maxRank,d=a.minRank;c==d&&(c=a.source.maxRank,d=a.target.minRank);for(var e=0,f=this.jettyPositions[a.ids[0]],g=a.isReversed?a.target.cell:a.source.cell,k=this.layout.graph,l=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,m=0;m<a.edges.length;m++){var n=a.edges[m],p=this.layout.getVisibleTerminal(n,!0),q=[],s=a.isReversed;p!=g&&(s=!s);if(null!=f){var r=s?
2:0,t=s?l?this.rankBottomY[d]:this.rankTopY[d]:l?this.rankTopY[c]:this.rankBottomY[c],y=f[4*e+1+r];s!=l&&(y=-y);var t=t+y,r=f[4*e+r],v=k.model.getTerminal(n,!0);this.layout.isPort(v)&&k.model.getParent(v)==p&&(r=k.view.getState(v),r=null!=r?r.x:p.geometry.x+a.source.width*v.geometry.x);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(q.push(new mxPoint(r,t)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(r,t+y))):(q.push(new mxPoint(t,
r)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(t+y,r)))}r=a.x.length-1;t=y=-1;p=a.maxRank-1;s&&(r=0,y=a.x.length,t=1,p=a.minRank+1);for(;a.maxRank!=a.minRank&&r!=y;r+=t){var v=a.x[r]+b,z=(this.rankTopY[p]+this.rankBottomY[p+1])/2,x=(this.rankTopY[p-1]+this.rankBottomY[p])/2;if(s)var u=z,z=x,x=u;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(q.push(new mxPoint(v,z)),q.push(new mxPoint(v,x))):(q.push(new mxPoint(z,v)),q.push(new mxPoint(x,
v)));this.limitX=Math.max(this.limitX,v);p+=t}null!=f&&(r=s?2:0,t=s?l?this.rankTopY[c]:this.rankBottomY[c]:l?this.rankBottomY[d]:this.rankTopY[d],y=f[4*e+3-r],s!=l&&(y=-y),t-=y,r=f[4*e+2-r],s=k.model.getTerminal(n,!1),p=this.layout.getVisibleTerminal(n,!1),this.layout.isPort(s)&&k.model.getParent(s)==p&&(r=k.view.getState(s),r=null!=r?r.x:p.geometry.x+a.target.width*s.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&
2:0,t=s?l?this.rankBottomY[d]:this.rankTopY[d]:l?this.rankTopY[c]:this.rankBottomY[c],y=f[4*e+1+r];s!=l&&(y=-y);var t=t+y,r=f[4*e+r],x=k.model.getTerminal(n,!0);this.layout.isPort(x)&&k.model.getParent(x)==p&&(r=k.view.getState(x),r=null!=r?r.x:p.geometry.x+a.source.width*x.geometry.x);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(q.push(new mxPoint(r,t)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(r,t+y))):(q.push(new mxPoint(t,
r)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(t+y,r)))}r=a.x.length-1;t=y=-1;p=a.maxRank-1;s&&(r=0,y=a.x.length,t=1,p=a.minRank+1);for(;a.maxRank!=a.minRank&&r!=y;r+=t){var x=a.x[r]+b,z=(this.rankTopY[p]+this.rankBottomY[p+1])/2,v=(this.rankTopY[p-1]+this.rankBottomY[p])/2;if(s)var u=z,z=v,v=u;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(q.push(new mxPoint(x,z)),q.push(new mxPoint(x,v))):(q.push(new mxPoint(z,x)),q.push(new mxPoint(v,
x)));this.limitX=Math.max(this.limitX,x);p+=t}null!=f&&(r=s?2:0,t=s?l?this.rankTopY[c]:this.rankBottomY[c]:l?this.rankBottomY[d]:this.rankTopY[d],y=f[4*e+3-r],s!=l&&(y=-y),t-=y,r=f[4*e+2-r],s=k.model.getTerminal(n,!1),p=this.layout.getVisibleTerminal(n,!1),this.layout.isPort(s)&&k.model.getParent(s)==p&&(r=k.view.getState(s),r=null!=r?r.x:p.geometry.x+a.target.width*s.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&
q.push(new mxPoint(r,t-y)),q.push(new mxPoint(r,t))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(t-y,r)),q.push(new mxPoint(t,r))));a.isReversed&&this.processReversedEdge(a,n);this.layout.setEdgePoints(n,q);b=0==b?this.parallelEdgeSpacing:0<b?-b:-b+this.parallelEdgeSpacing;e++}a.temp[0]=101207}};
mxCoordinateAssignment.prototype.setVertexLocation=function(a){var b=a.cell,c=a.x[0]-a.width/2,d=a.y[0]-a.height/2;this.rankTopY[a.minRank]=Math.min(this.rankTopY[a.minRank],d);this.rankBottomY[a.minRank]=Math.max(this.rankBottomY[a.minRank],d+a.height);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(b,c,d):this.layout.setVertexLocation(b,d,c);this.limitX=Math.max(this.limitX,c+a.width)};
mxCoordinateAssignment.prototype.processReversedEdge=function(a,b){};function WeightedCellSorter(a,b){this.cell=a;this.weightedValue=b}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=!1;WeightedCellSorter.prototype.visited=!1;WeightedCellSorter.prototype.rankIndex=null;WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.weightedValue>a.weightedValue?-1:b.weightedValue<a.weightedValue?1:b.nudge?-1:1:0};
@ -817,17 +817,18 @@ l;p=a;m>=e&&m<=e+g?(d=m,p=n<a?f+k:f):n>=f&&n<=f+k&&(p=n,d=m<l?e+g:e);r=mxUtils.i
r=new mxPoint(e+g,f+k)):p>m&&p<s?(b=new mxPoint(e,f-Math.floor(0.25*k)),r=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k))):p>s&&p<q-m?(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),r=new mxPoint(e+g,f-Math.floor(0.25*k))):p>q-m&&p<=q||p<-q+m&&p>=-q?(b=new mxPoint(e,f),r=new mxPoint(e,f+k)):p<-m&&p>-s?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*k)),r=new mxPoint(e,f+Math.floor(1.25*k))):p<-s&&p>-q+m&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*k)),r=new mxPoint(e+g,f+
Math.floor(1.25*k)))}else{m=Math.atan2(k/2,g/4);if(p==m)return new mxPoint(e+Math.floor(0.75*g),f);if(p==q-m)return new mxPoint(e+Math.floor(0.25*g),f);if(p==q||p==-q)return new mxPoint(e,f+Math.floor(0.5*k));if(0==p)return new mxPoint(e+g,f+Math.floor(0.5*k));if(p==-m)return new mxPoint(e+Math.floor(0.75*g),f+k);if(p==-q+m)return new mxPoint(e+Math.floor(0.25*g),f+k);0<p&&p<m?(b=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*k)),r=new mxPoint(e+Math.floor(1.25*g),f+k)):p>m&&p<q-m?(b=new mxPoint(e,
f),r=new mxPoint(e+g,f)):p>q-m&&p<q?(b=new mxPoint(e-Math.floor(0.25*g),f+k),r=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*k))):0>p&&p>-m?(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)),r=new mxPoint(e+Math.floor(1.25*g),f)):p<-m&&p>-q+m?(b=new mxPoint(e,f+k),r=new mxPoint(e+g,f+k)):p<-q+m&&p>-q&&(b=new mxPoint(e-Math.floor(0.25*g),f),r=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*k)))}r=mxUtils.intersection(l,a,c.x,c.y,b.x,b.y,r.x,r.y)}return null==r?new mxPoint(l,a):r}};
function mxPrintPreview(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=null!=c?c:a.pageFormat;this.title=null!=k?k:"Printer-friendly version";this.x0=null!=e?e:0;this.y0=null!=f?f:0;this.borderColor=g;this.pageSelector=null!=l?l:!0}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0;mxPrintPreview.prototype.marginTop=0;
mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=!0;mxPrintPreview.prototype.printOverlays=!1;mxPrintPreview.prototype.printControls=!1;mxPrintPreview.prototype.printBackgroundImage=!1;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null;mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null;mxPrintPreview.prototype.wnd=null;
mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=!0;mxPrintPreview.prototype.getWindow=function(){return this.wnd};
function mxPrintPreview(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=mxRectangle.fromRectangle(null!=c?c:a.pageFormat);this.title=null!=k?k:"Printer-friendly version";this.x0=null!=e?e:0;this.y0=null!=f?f:0;this.borderColor=g;this.pageSelector=null!=l?l:!0}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0;
mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=!0;mxPrintPreview.prototype.printOverlays=!1;mxPrintPreview.prototype.printControls=!1;mxPrintPreview.prototype.printBackgroundImage=!1;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null;mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null;
mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=!0;mxPrintPreview.prototype.getWindow=function(){return this.wnd};
mxPrintPreview.prototype.getDoctype=function(){var a="";5==document.documentMode?a='\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3d5"\x3e':8==document.documentMode?a='\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3d8"\x3e':8<document.documentMode&&(a='\x3c!--[if IE]\x3e\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3dedge"\x3e\x3c![endif]--\x3e');return a};
mxPrintPreview.prototype.open=function(a,b){var c=this.graph.cellRenderer.initializeOverlay,d=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(a,b){b.init(a.view.getDrawPane())});this.printControls&&(this.graph.cellRenderer.initControl=function(a,b,c,d){b.dialect=a.view.graph.dialect;b.init(a.view.getDrawPane())});if(null==this.wnd){this.wnd=null!=b?b:window.open();var e=this.wnd.document;if(null==b){var f=this.getDoctype();null!=f&&0<f.length&&e.writeln(f);mxClient.IS_VML?
e.writeln('\x3chtml xmlns:v\x3d"urn:schemas-microsoft-com:vml" xmlns:o\x3d"urn:schemas-microsoft-com:office:office"\x3e'):("CSS1Compat"===document.compatMode&&e.writeln("\x3c!DOCTYPE html\x3e"),e.writeln("\x3chtml\x3e"));e.writeln("\x3chead\x3e");this.writeHead(e,a);e.writeln("\x3c/head\x3e");e.writeln('\x3cbody class\x3d"mxPage"\x3e')}var g=this.graph.getGraphBounds().clone(),k=this.graph.getView().getScale(),l=k/this.scale,m=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=m.x*this.scale,
this.y0-=m.y*this.scale,g.width+=g.x,g.height+=g.y,g.x=0,this.border=g.y=0);var n=this.pageFormat.width-2*this.border,p=this.pageFormat.height-2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom;g.width/=l;g.height/=l;var q=Math.max(1,Math.ceil((g.width+this.x0)/n)),s=Math.max(1,Math.ceil((g.height+this.y0)/p));this.pageCount=q*s;var r=mxUtils.bind(this,function(){if(this.pageSelector&&(1<s||1<q)){var a=this.createPageSelector(s,q);e.body.appendChild(a);if(mxClient.IS_IE&&null==
e.documentMode||5==e.documentMode||8==e.documentMode||7==e.documentMode){a.style.position="absolute";var b=function(){a.style.top=(e.body.scrollTop||e.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(a){b()});mxEvent.addListener(this.wnd,"resize",function(a){b()})}}}),t=mxUtils.bind(this,function(a,c){null!=this.borderColor&&(a.style.borderColor=this.borderColor,a.style.borderStyle="solid",a.style.borderWidth="1px");a.style.background=this.backgroundColor;c&&(a.style.pageBreakAfter=
"always");mxClient.IS_IE||11<=document.documentMode||mxClient.IS_EDGE?(e.writeln(a.outerHTML),a.parentNode.removeChild(a)):(a.parentNode.removeChild(a),e.body.appendChild(a));if(c&&null==b){var d=e.createElement("hr");d.className="mxPageBreak";e.body.appendChild(d)}}),y=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=y)for(var v=0;v<y.length;v++)t(y[v],!0);for(var z=this.getAppendices(this.pageFormat.width,this.pageFormat.height),v=0;v<s;v++)for(var x=v*p/this.scale-this.y0/
this.scale+(g.y-m.y*k)/k,f=0;f<q;f++){if(null==this.wnd)return null;var u=f*n/this.scale-this.x0/this.scale+(g.x-m.x*k)/k,A=v*q+f+1,C=new mxRectangle(u,x,n,p),d=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,function(a){this.addGraphFragment(-u,-x,this.scale,A,a,C);this.printBackgroundImage&&this.insertBackgroundImage(a,-u,-x)}),A);d.setAttribute("id","mxPage-"+A);t(d,null!=z||v<s-1||f<q-1)}if(null!=z)for(v=0;v<z.length;v++)t(z[v],v<z.length);null==b&&(this.writePostfix(e),
e.writeln("\x3c/body\x3e"),e.writeln("\x3c/html\x3e"),e.close(),r(),mxEvent.release(e.body))}this.wnd.focus()}catch(B){null!=d&&null!=d.parentNode&&d.parentNode.removeChild(d),console.log("e",B)}finally{this.graph.cellRenderer.initializeOverlay=c}return this.wnd};
mxPrintPreview.prototype.appendGraph=function(a,b,c,d,e,f){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.x0=c;this.y0=d;this.open(null,null,e,f)};
mxPrintPreview.prototype.open=function(a,b,c,d){var e=this.graph.cellRenderer.initializeOverlay,f=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(a,b){b.init(a.view.getDrawPane())});this.printControls&&(this.graph.cellRenderer.initControl=function(a,b,c,d){b.dialect=a.view.graph.dialect;b.init(a.view.getDrawPane())});this.wnd=null!=b?b:this.wnd;b=!1;null==this.wnd&&(b=!0,this.wnd=window.open());var g=this.wnd.document;if(b){var k=this.getDoctype();null!=k&&0<k.length&&
g.writeln(k);mxClient.IS_VML?g.writeln('\x3chtml xmlns:v\x3d"urn:schemas-microsoft-com:vml" xmlns:o\x3d"urn:schemas-microsoft-com:office:office"\x3e'):("CSS1Compat"===document.compatMode&&g.writeln("\x3c!DOCTYPE html\x3e"),g.writeln("\x3chtml\x3e"));g.writeln("\x3chead\x3e");this.writeHead(g,a);g.writeln("\x3c/head\x3e");g.writeln('\x3cbody class\x3d"mxPage"\x3e')}var l=this.graph.getGraphBounds().clone(),m=this.graph.getView().getScale(),n=m/this.scale,p=this.graph.getView().getTranslate();this.autoOrigin||
(this.x0-=p.x*this.scale,this.y0-=p.y*this.scale,l.width+=l.x,l.height+=l.y,l.x=0,this.border=l.y=0);var q=this.pageFormat.width-2*this.border,s=this.pageFormat.height-2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom;l.width/=n;l.height/=n;var r=Math.max(1,Math.ceil((l.width+this.x0)/q)),t=Math.max(1,Math.ceil((l.height+this.y0)/s));this.pageCount=r*t;var y=mxUtils.bind(this,function(){if(this.pageSelector&&(1<t||1<r)){var a=this.createPageSelector(t,r);g.body.appendChild(a);
if(mxClient.IS_IE&&null==g.documentMode||5==g.documentMode||8==g.documentMode||7==g.documentMode){a.style.position="absolute";var b=function(){a.style.top=(g.body.scrollTop||g.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(a){b()});mxEvent.addListener(this.wnd,"resize",function(a){b()})}}}),x=mxUtils.bind(this,function(a,b){null!=this.borderColor&&(a.style.borderColor=this.borderColor,a.style.borderStyle="solid",a.style.borderWidth="1px");a.style.background=this.backgroundColor;
if(c||b)a.style.pageBreakAfter="always";mxClient.IS_IE||11<=document.documentMode||mxClient.IS_EDGE?(g.writeln(a.outerHTML),a.parentNode.removeChild(a)):(a.parentNode.removeChild(a),g.body.appendChild(a));(c||b)&&this.addPageBreak(g)}),z=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=z)for(var v=0;v<z.length;v++)x(z[v],!0);for(var u=this.getAppendices(this.pageFormat.width,this.pageFormat.height),v=0;v<t;v++){var A=v*s/this.scale-this.y0/this.scale+(l.y-p.y*m)/m;for(a=0;a<
r;a++){if(null==this.wnd)return null;var C=a*q/this.scale-this.x0/this.scale+(l.x-p.x*m)/m,B=v*r+a+1,G=new mxRectangle(C,A,q,s),f=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,function(a){this.addGraphFragment(-C,-A,this.scale,B,a,G);this.printBackgroundImage&&this.insertBackgroundImage(a,-C,-A)}),B);f.setAttribute("id","mxPage-"+B);x(f,null!=u||v<t-1||a<r-1)}}if(null!=u)for(v=0;v<u.length;v++)x(u[v],v<u.length);b&&!d&&(this.closeDocument(),y());this.wnd.focus()}catch(H){null!=
f&&null!=f.parentNode&&f.parentNode.removeChild(f)}finally{this.graph.cellRenderer.initializeOverlay=e}return this.wnd};mxPrintPreview.prototype.addPageBreak=function(a){var b=a.createElement("hr");b.className="mxPageBreak";a.body.appendChild(b)};mxPrintPreview.prototype.closeDocument=function(){if(null!=this.wnd){var a=this.wnd.document;this.writePostfix(a);a.writeln("\x3c/body\x3e");a.writeln("\x3c/html\x3e");a.close();mxEvent.release(a.body)}};
mxPrintPreview.prototype.writeHead=function(a,b){null!=this.title&&a.writeln("\x3ctitle\x3e"+this.title+"\x3c/title\x3e");mxClient.IS_VML&&a.writeln('\x3cstyle type\x3d"text/css"\x3ev\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}\x3c/style\x3e');mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a);a.writeln('\x3cstyle type\x3d"text/css"\x3e');a.writeln("@media print {");a.writeln(" table.mxPageSelector { display: none; }");a.writeln(" hr.mxPageBreak { display: none; }");
a.writeln("}");a.writeln("@media screen {");a.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }");a.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }");a.writeln(" body.mxPage { background: gray; }");a.writeln("}");null!=b&&a.writeln(b);a.writeln("\x3c/style\x3e")};mxPrintPreview.prototype.writePostfix=function(a){};
mxPrintPreview.prototype.createPageSelector=function(a,b){var c=this.wnd.document,d=c.createElement("table");d.className="mxPageSelector";d.setAttribute("border","0");for(var e=c.createElement("tbody"),f=0;f<a;f++){for(var g=c.createElement("tr"),k=0;k<b;k++){var l=f*b+k+1,m=c.createElement("td"),n=c.createElement("a");n.setAttribute("href","#mxPage-"+l);mxClient.IS_NS&&(!mxClient.IS_SF&&!mxClient.IS_GC)&&n.setAttribute("onclick","var page \x3d document.getElementById('mxPage-"+l+"');page.scrollIntoView(true);event.preventDefault();");
@ -837,8 +838,8 @@ mxPrintPreview.prototype.renderPage=function(a,b,c,d,e,f){f=this.wnd.document;va
b-2*this.border+"px",l.style.overflow="hidden",mxClient.IS_IE&&(null==f.documentMode||5==f.documentMode||8==f.documentMode||7==f.documentMode)?(l.style.marginTop=this.border+"px",l.style.marginLeft=this.border+"px"):(l.style.top=this.border+"px",l.style.left=this.border+"px"),this.graph.dialect==mxConstants.DIALECT_VML&&(l.style.position="absolute"),g.appendChild(l),document.body.appendChild(g),k=l}catch(n){throw g.parentNode.removeChild(g),n;}e(k);return g};
mxPrintPreview.prototype.getRoot=function(){var a=this.graph.view.currentRoot;null==a&&(a=this.graph.getModel().getRoot());return a};
mxPrintPreview.prototype.addGraphFragment=function(a,b,c,d,e,f){var g=this.graph.getView();d=this.graph.container;this.graph.container=e;var k=g.getCanvas(),l=g.getBackgroundPane(),m=g.getDrawPane(),n=g.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?g.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?g.createVml():g.createHtml();var p=g.isEventsEnabled();g.setEventsEnabled(!1);var q=this.graph.isEnabled();this.graph.setEnabled(!1);var s=g.getTranslate();g.translate=new mxPoint(a,
b);var r=this.graph.cellRenderer.redraw,t=g.states;a=g.scale;if(this.clipping){var y=new mxRectangle((f.x+s.x)*a,(f.y+s.y)*a,f.width*a/c,f.height*a/c);this.graph.cellRenderer.redraw=function(a,b,c){if(null!=a){var d=t.get(a.cell);if(null!=d&&(d=g.getBoundingBox(d,!1),null!=d&&!mxUtils.intersects(y,d)))return}r.apply(this,arguments)}}a=null;try{var v=[this.getRoot()];a=new mxTemporaryCellStates(g,c,v)}finally{if(mxClient.IS_IE)g.overlayPane.innerHTML="",g.canvas.style.overflow="hidden",g.canvas.style.position=
"relative",g.canvas.style.top=this.marginTop+"px",g.canvas.style.width=f.width+"px",g.canvas.style.height=f.height+"px";else for(c=e.firstChild;null!=c;)v=c.nextSibling,b=c.nodeName.toLowerCase(),"svg"==b?(c.style.overflow="hidden",c.style.position="relative",c.style.top=this.marginTop+"px",c.setAttribute("width",f.width),c.setAttribute("height",f.height),c.style.width="",c.style.height=""):"default"!=c.style.cursor&&"div"!=b&&c.parentNode.removeChild(c),c=v;this.printBackgroundImage&&(e=e.getElementsByTagName("svg"),
b);var r=this.graph.cellRenderer.redraw,t=g.states;a=g.scale;if(this.clipping){var y=new mxRectangle((f.x+s.x)*a,(f.y+s.y)*a,f.width*a/c,f.height*a/c);this.graph.cellRenderer.redraw=function(a,b,c){if(null!=a){var d=t.get(a.cell);if(null!=d&&(d=g.getBoundingBox(d,!1),null!=d&&!mxUtils.intersects(y,d)))return}r.apply(this,arguments)}}a=null;try{var x=[this.getRoot()];a=new mxTemporaryCellStates(g,c,x)}finally{if(mxClient.IS_IE)g.overlayPane.innerHTML="",g.canvas.style.overflow="hidden",g.canvas.style.position=
"relative",g.canvas.style.top=this.marginTop+"px",g.canvas.style.width=f.width+"px",g.canvas.style.height=f.height+"px";else for(c=e.firstChild;null!=c;)x=c.nextSibling,b=c.nodeName.toLowerCase(),"svg"==b?(c.style.overflow="hidden",c.style.position="relative",c.style.top=this.marginTop+"px",c.setAttribute("width",f.width),c.setAttribute("height",f.height),c.style.width="",c.style.height=""):"default"!=c.style.cursor&&"div"!=b&&c.parentNode.removeChild(c),c=x;this.printBackgroundImage&&(e=e.getElementsByTagName("svg"),
0<e.length&&(e[0].style.position="absolute"));g.overlayPane.parentNode.removeChild(g.overlayPane);this.graph.setEnabled(q);this.graph.container=d;this.graph.cellRenderer.redraw=r;g.canvas=k;g.backgroundPane=l;g.drawPane=m;g.overlayPane=n;g.translate=s;a.destroy();g.setEventsEnabled(p)}};
mxPrintPreview.prototype.insertBackgroundImage=function(a,b,c){var d=this.graph.backgroundImage;if(null!=d){var e=document.createElement("img");e.style.position="absolute";e.style.marginLeft=Math.round(b*this.scale)+"px";e.style.marginTop=Math.round(c*this.scale)+"px";e.setAttribute("width",Math.round(this.scale*d.width));e.setAttribute("height",Math.round(this.scale*d.height));e.src=d.src;a.insertBefore(e,a.firstChild)}};mxPrintPreview.prototype.getCoverPages=function(){return null};
mxPrintPreview.prototype.getAppendices=function(){return null};mxPrintPreview.prototype.print=function(a){a=this.open(a);null!=a&&a.print()};mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)};function mxStylesheet(){this.styles={};this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}
@ -953,24 +954,24 @@ b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&
a,d.y)&&!mxUtils.contains(b,a,d.y)&&e.push(new mxPoint(a,d.y)):(f=Math.max(b.y,c.y),b=Math.min(b.y+b.height,c.y+c.height),e.push(new mxPoint(a,f+(b-f)/2)))))},TopToBottom:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,k=g[0],g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=k&&(b=new mxCellState,b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(k=Math.max(b.y,c.y),g=Math.min(b.y+b.height,c.y+c.height),a=f.getRoutingCenterX(b),
null!=d&&(d.x>=b.x&&d.x<=b.x+b.width)&&(a=d.x),k=null!=d?d.y:Math.round(g+(k-g)/2),!mxUtils.contains(c,a,k)&&!mxUtils.contains(b,a,k)&&e.push(new mxPoint(a,k)),a=null!=d&&d.x>=c.x&&d.x<=c.x+c.width?d.x:f.getRoutingCenterX(c),!mxUtils.contains(c,a,k)&&!mxUtils.contains(b,a,k)&&e.push(new mxPoint(a,k)),1==e.length&&(null!=d&&1==e.length?!mxUtils.contains(c,d.x,k)&&!mxUtils.contains(b,d.x,k)&&e.push(new mxPoint(d.x,k)):(f=Math.max(b.x,c.x),b=Math.min(b.x+b.width,c.x+c.width),e.push(new mxPoint(f+(b-
f)/2,k)))))},SegmentConnector:function(a,b,c,d,e){function f(a){if(null==l||Math.abs(l.x-a.x)>=k||Math.abs(l.y-a.y)>=k)e.push(a),l=a;return l}var g=a.absolutePoints,k=Math.max(1,a.view.scale),l=0<e.length?e[0]:null,m=!0,n=null,p=g[0];null==p&&null!=b?p=new mxPoint(a.view.getRoutingCenterX(b),a.view.getRoutingCenterY(b)):null!=p&&(p=p.clone());p.x=Math.round(p.x);p.y=Math.round(p.y);var q=g.length-1;if(null!=d&&0<d.length){for(var n=[],s=0;s<d.length;s++){var r=a.view.transformControlPoint(a,d[s]);
null!=r&&(r.x=Math.round(r.x),r.y=Math.round(r.y),n.push(r))}if(0==n.length)return;d=n;null!=p&&null!=d[0]&&(Math.abs(d[0].x-p.x)<k&&(d[0].x=p.x),Math.abs(d[0].y-p.y)<k&&(d[0].y=p.y));r=g[q];null!=r&&null!=d[d.length-1]&&(Math.abs(d[d.length-1].x-r.x)<k&&(d[d.length-1].x=r.x),Math.abs(d[d.length-1].y-r.y)<k&&(d[d.length-1].y=r.y));var n=d[0],t=b,y=g[0],v=!1,z=!1,v=n;null!=y&&(y.x=Math.round(y.x),y.y=Math.round(y.y),t=null);for(s=0;2>s;s++){var x=null!=y&&y.x==v.x,u=null!=y&&y.y==v.y,A=null!=t&&v.y>=
t.y&&v.y<=t.y+t.height,t=null!=t&&v.x>=t.x&&v.x<=t.x+t.width,v=u||null==y&&A,z=x||null==y&&t;if(!(0==s&&(v&&z||x&&u))){if(null!=y&&!u&&!x&&(A||t)){m=A?!1:!0;break}if(z||v){m=v;1==s&&(m=0==d.length%2?v:z);break}}t=c;y=g[q];null!=y&&(y.x=Math.round(y.x),y.y=Math.round(y.y),t=null);v=d[d.length-1];x&&u&&(d=d.slice(1))}m&&(null!=g[0]&&g[0].y!=n.y||null==g[0]&&null!=b&&(n.y<b.y||n.y>b.y+b.height))?f(new mxPoint(p.x,n.y)):!m&&(null!=g[0]&&g[0].x!=n.x||null==g[0]&&null!=b&&(n.x<b.x||n.x>b.x+b.width))&&f(new mxPoint(n.x,
null!=r&&(r.x=Math.round(r.x),r.y=Math.round(r.y),n.push(r))}if(0==n.length)return;d=n;null!=p&&null!=d[0]&&(Math.abs(d[0].x-p.x)<k&&(d[0].x=p.x),Math.abs(d[0].y-p.y)<k&&(d[0].y=p.y));r=g[q];null!=r&&null!=d[d.length-1]&&(Math.abs(d[d.length-1].x-r.x)<k&&(d[d.length-1].x=r.x),Math.abs(d[d.length-1].y-r.y)<k&&(d[d.length-1].y=r.y));var n=d[0],t=b,y=g[0],x=!1,z=!1,x=n;null!=y&&(y.x=Math.round(y.x),y.y=Math.round(y.y),t=null);for(s=0;2>s;s++){var v=null!=y&&y.x==x.x,u=null!=y&&y.y==x.y,A=null!=t&&x.y>=
t.y&&x.y<=t.y+t.height,t=null!=t&&x.x>=t.x&&x.x<=t.x+t.width,x=u||null==y&&A,z=v||null==y&&t;if(!(0==s&&(x&&z||v&&u))){if(null!=y&&!u&&!v&&(A||t)){m=A?!1:!0;break}if(z||x){m=x;1==s&&(m=0==d.length%2?x:z);break}}t=c;y=g[q];null!=y&&(y.x=Math.round(y.x),y.y=Math.round(y.y),t=null);x=d[d.length-1];v&&u&&(d=d.slice(1))}m&&(null!=g[0]&&g[0].y!=n.y||null==g[0]&&null!=b&&(n.y<b.y||n.y>b.y+b.height))?f(new mxPoint(p.x,n.y)):!m&&(null!=g[0]&&g[0].x!=n.x||null==g[0]&&null!=b&&(n.x<b.x||n.x>b.x+b.width))&&f(new mxPoint(n.x,
p.y));m?p.y=n.y:p.x=n.x;for(s=0;s<d.length;s++)m=!m,n=d[s],m?p.y=n.y:p.x=n.x,f(p.clone())}else n=p,m=!0;p=g[q];null==p&&null!=c&&(p=new mxPoint(a.view.getRoutingCenterX(c),a.view.getRoutingCenterY(c)));null!=p&&(p.x=Math.round(p.x),p.y=Math.round(p.y),null!=n&&(m&&(null!=g[q]&&g[q].y!=n.y||null==g[q]&&null!=c&&(n.y<c.y||n.y>c.y+c.height))?f(new mxPoint(p.x,n.y)):!m&&(null!=g[q]&&g[q].x!=n.x||null==g[q]&&null!=c&&(n.x<c.x||n.x>c.x+c.width))&&f(new mxPoint(n.x,p.y))));if(null==g[0]&&null!=b)for(;1<
e.length&&null!=e[1]&&mxUtils.contains(b,e[1].x,e[1].y);)e.splice(1,1);if(null==g[q]&&null!=c)for(;1<e.length&&null!=e[e.length-1]&&mxUtils.contains(c,e[e.length-1].x,e[e.length-1].y);)e.splice(e.length-1,1);null!=r&&(null!=e[e.length-1]&&Math.abs(r.x-e[e.length-1].x)<k&&Math.abs(r.y-e[e.length-1].y)<k)&&(e.splice(e.length-1,1),null!=e[e.length-1]&&(Math.abs(e[e.length-1].x-r.x)<k&&(e[e.length-1].x=r.x),Math.abs(e[e.length-1].y-r.y)<k&&(e[e.length-1].y=r.y)))},orthBuffer:10,orthPointsFallback:!0,
dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,
2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,
VERTEX_MASK:3072,getJettySize:function(a,b,c,d,e){b=mxUtils.getValue(a.style,e?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(a.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));"auto"==b&&(mxUtils.getValue(a.style,e?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE?(a=mxUtils.getNumber(a.style,e?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),b=Math.max(2,Math.ceil((a+
mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):b=2*mxEdgeStyle.orthBuffer);return b},OrthConnector:function(a,b,c,d,e){var f=a.view.graph,g=null==b?!1:f.getModel().isEdge(b.cell),k=null==c?!1:f.getModel().isEdge(c.cell),f=a.absolutePoints,l=f[0],m=f[f.length-1],n=null!=b?b.x:l.x,p=null!=b?b.y:l.y,q=null!=b?b.width:0,s=null!=b?b.height:0,r=null!=c?c.x:m.x,t=null!=c?c.y:m.y,y=null!=c?c.width:0,v=null!=c?c.height:0,f=a.view.scale*mxEdgeStyle.getJettySize(a,b,c,d,!0),z=a.view.scale*
mxEdgeStyle.getJettySize(a,b,c,d,!1);null!=b&&c==b&&(f=z=Math.max(f,z));var x=z+f,u=!1;if(null!=l&&null!=m)var u=m.x-l.x,A=m.y-l.y,u=u*u+A*A<x*x;if(u||mxEdgeStyle.orthPointsFallback&&null!=d&&0<d.length||g||k)mxEdgeStyle.SegmentConnector(a,b,c,d,e);else{d=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL];u=0;null!=b&&(d[0]=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_ALL),u=mxUtils.getValue(b.style,mxConstants.STYLE_ROTATION,0),0!=u&&(u=mxUtils.getBoundingBox(new mxRectangle(n,
p,q,s),u),n=u.x,p=u.y,q=u.width,s=u.height));null!=c&&(d[1]=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_ALL),u=mxUtils.getValue(c.style,mxConstants.STYLE_ROTATION,0),0!=u&&(u=mxUtils.getBoundingBox(new mxRectangle(r,t,y,v),u),r=u.x,t=u.y,y=u.width,v=u.height));n=Math.round(10*n)/10;p=Math.round(10*p)/10;q=Math.round(10*q)/10;s=Math.round(10*s)/10;r=Math.round(10*r)/10;t=Math.round(10*t)/10;y=Math.round(10*y)/10;v=Math.round(10*v)/10;a=[0,0];n=[[n,p,q,s],[r,t,y,v]];z=[f,z];for(u=0;2>
mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):b=2*mxEdgeStyle.orthBuffer);return b},OrthConnector:function(a,b,c,d,e){var f=a.view.graph,g=null==b?!1:f.getModel().isEdge(b.cell),k=null==c?!1:f.getModel().isEdge(c.cell),f=a.absolutePoints,l=f[0],m=f[f.length-1],n=null!=b?b.x:l.x,p=null!=b?b.y:l.y,q=null!=b?b.width:0,s=null!=b?b.height:0,r=null!=c?c.x:m.x,t=null!=c?c.y:m.y,y=null!=c?c.width:0,x=null!=c?c.height:0,f=a.view.scale*mxEdgeStyle.getJettySize(a,b,c,d,!0),z=a.view.scale*
mxEdgeStyle.getJettySize(a,b,c,d,!1);null!=b&&c==b&&(f=z=Math.max(f,z));var v=z+f,u=!1;if(null!=l&&null!=m)var u=m.x-l.x,A=m.y-l.y,u=u*u+A*A<v*v;if(u||mxEdgeStyle.orthPointsFallback&&null!=d&&0<d.length||g||k)mxEdgeStyle.SegmentConnector(a,b,c,d,e);else{d=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL];u=0;null!=b&&(d[0]=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_ALL),u=mxUtils.getValue(b.style,mxConstants.STYLE_ROTATION,0),0!=u&&(u=mxUtils.getBoundingBox(new mxRectangle(n,
p,q,s),u),n=u.x,p=u.y,q=u.width,s=u.height));null!=c&&(d[1]=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_ALL),u=mxUtils.getValue(c.style,mxConstants.STYLE_ROTATION,0),0!=u&&(u=mxUtils.getBoundingBox(new mxRectangle(r,t,y,x),u),r=u.x,t=u.y,y=u.width,x=u.height));n=Math.round(10*n)/10;p=Math.round(10*p)/10;q=Math.round(10*q)/10;s=Math.round(10*s)/10;r=Math.round(10*r)/10;t=Math.round(10*t)/10;y=Math.round(10*y)/10;x=Math.round(10*x)/10;a=[0,0];n=[[n,p,q,s],[r,t,y,x]];z=[f,z];for(u=0;2>
u;u++)mxEdgeStyle.limits[u][1]=n[u][0]-z[u],mxEdgeStyle.limits[u][2]=n[u][1]-z[u],mxEdgeStyle.limits[u][4]=n[u][0]+n[u][2]+z[u],mxEdgeStyle.limits[u][8]=n[u][1]+n[u][3]+z[u];z=n[0][1]+n[0][3]/2;p=n[1][1]+n[1][3]/2;u=n[0][0]+n[0][2]/2-(n[1][0]+n[1][2]/2);A=z-p;z=0;0>u?z=0>A?2:1:0>=A&&(z=3,0==u&&(z=2));p=null;null!=b&&(p=l);b=[[0.5,0.5],[0.5,0.5]];for(u=0;2>u;u++)null!=p&&(b[u][0]=(p.x-n[u][0])/n[u][2],1>=Math.abs(p.x-n[u][0])?a[u]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(p.x-n[u][0]-n[u][2])&&(a[u]=
mxConstants.DIRECTION_MASK_EAST),b[u][1]=(p.y-n[u][1])/n[u][3],1>=Math.abs(p.y-n[u][1])?a[u]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(p.y-n[u][1]-n[u][3])&&(a[u]=mxConstants.DIRECTION_MASK_SOUTH)),p=null,null!=c&&(p=m);u=n[0][1]-(n[1][1]+n[1][3]);m=n[0][0]-(n[1][0]+n[1][2]);p=n[1][1]-(n[0][1]+n[0][3]);q=n[1][0]-(n[0][0]+n[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-x,0);mxEdgeStyle.vertexSeperations[2]=Math.max(u-x,0);mxEdgeStyle.vertexSeperations[4]=Math.max(p-x,0);mxEdgeStyle.vertexSeperations[3]=
Math.max(q-x,0);x=[];c=[];l=[];c[0]=m>=q?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;l[0]=u>=p?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;c[1]=mxUtils.reversePortConstraints(c[0]);l[1]=mxUtils.reversePortConstraints(l[0]);m=m>=q?m:q;p=u>=p?u:p;q=[[0,0],[0,0]];s=!1;for(u=0;2>u;u++)0==a[u]&&(0==(c[u]&d[u])&&(c[u]=mxUtils.reversePortConstraints(c[u])),0==(l[u]&d[u])&&(l[u]=mxUtils.reversePortConstraints(l[u])),q[u][0]=l[u],q[u][1]=c[u]);0<p&&0<m&&(0<(c[0]&d[0])&&
0<(l[1]&d[1])?(q[0][0]=c[0],q[0][1]=l[0],q[1][0]=l[1],q[1][1]=c[1],s=!0):0<(l[0]&d[0])&&0<(c[1]&d[1])&&(q[0][0]=l[0],q[0][1]=c[0],q[1][0]=c[1],q[1][1]=l[1],s=!0));0<p&&!s&&(q[0][0]=l[0],q[0][1]=c[0],q[1][0]=l[1],q[1][1]=c[1],s=!0);0<m&&!s&&(q[0][0]=c[0],q[0][1]=l[0],q[1][0]=c[1],q[1][1]=l[1]);for(u=0;2>u;u++)if(0==a[u]&&(0==(q[u][0]&d[u])&&(q[u][0]=q[u][1]),x[u]=q[u][0]&d[u],x[u]|=(q[u][1]&d[u])<<8,x[u]|=(q[1-u][u]&d[u])<<16,x[u]|=(q[1-u][1-u]&d[u])<<24,0==(x[u]&15)&&(x[u]<<=8),0==(x[u]&3840)&&(x[u]=
x[u]&15|x[u]>>8),0==(x[u]&983040)&&(x[u]=x[u]&65535|(x[u]&251658240)>>8),a[u]=x[u]&15,d[u]==mxConstants.DIRECTION_MASK_WEST||d[u]==mxConstants.DIRECTION_MASK_NORTH||d[u]==mxConstants.DIRECTION_MASK_EAST||d[u]==mxConstants.DIRECTION_MASK_SOUTH))a[u]=d[u];d=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];x=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];d-=z;x-=z;1>d&&(d+=4);1>x&&(x+=4);d=mxEdgeStyle.routePatterns[d-1][x-1];mxEdgeStyle.wayPoints1[0][0]=n[0][0];mxEdgeStyle.wayPoints1[0][1]=n[0][1];switch(a[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=
f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*n[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*n[0][2];mxEdgeStyle.wayPoints1[0][1]+=n[0][3]+f;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=n[0][2]+f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*n[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*n[0][2],mxEdgeStyle.wayPoints1[0][1]-=f}f=0;c=x=0<(a[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?
0:1;for(u=l=0;u<d.length;u++)l=d[u]&15,r=l==mxConstants.DIRECTION_MASK_EAST?3:l,r+=z,4<r&&(r-=4),m=mxEdgeStyle.dirVectors[r-1],l=0<r%2?0:1,l!=x&&(f++,mxEdgeStyle.wayPoints1[f][0]=mxEdgeStyle.wayPoints1[f-1][0],mxEdgeStyle.wayPoints1[f][1]=mxEdgeStyle.wayPoints1[f-1][1]),t=0<(d[u]&mxEdgeStyle.TARGET_MASK),s=0<(d[u]&mxEdgeStyle.SOURCE_MASK),p=(d[u]&mxEdgeStyle.SIDE_MASK)>>5,p<<=z,15<p&&(p>>=4),q=0<(d[u]&mxEdgeStyle.CENTER_MASK),(s||t)&&9>p?(r=0,s=s?0:1,r=q&&0==l?n[s][0]+b[s][0]*n[s][2]:q?n[s][1]+b[s][1]*
n[s][3]:mxEdgeStyle.limits[s][p],0==l?(p=(r-mxEdgeStyle.wayPoints1[f][0])*m[0],0<p&&(mxEdgeStyle.wayPoints1[f][0]+=m[0]*p)):(p=(r-mxEdgeStyle.wayPoints1[f][1])*m[1],0<p&&(mxEdgeStyle.wayPoints1[f][1]+=m[1]*p))):q&&(mxEdgeStyle.wayPoints1[f][0]+=m[0]*Math.abs(mxEdgeStyle.vertexSeperations[r]/2),mxEdgeStyle.wayPoints1[f][1]+=m[1]*Math.abs(mxEdgeStyle.vertexSeperations[r]/2)),0<f&&mxEdgeStyle.wayPoints1[f][l]==mxEdgeStyle.wayPoints1[f-1][l]?f--:x=l;for(u=0;u<=f&&!(u==f&&((0<(a[1]&(mxConstants.DIRECTION_MASK_EAST|
mxConstants.DIRECTION_MASK_EAST),b[u][1]=(p.y-n[u][1])/n[u][3],1>=Math.abs(p.y-n[u][1])?a[u]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(p.y-n[u][1]-n[u][3])&&(a[u]=mxConstants.DIRECTION_MASK_SOUTH)),p=null,null!=c&&(p=m);u=n[0][1]-(n[1][1]+n[1][3]);m=n[0][0]-(n[1][0]+n[1][2]);p=n[1][1]-(n[0][1]+n[0][3]);q=n[1][0]-(n[0][0]+n[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-v,0);mxEdgeStyle.vertexSeperations[2]=Math.max(u-v,0);mxEdgeStyle.vertexSeperations[4]=Math.max(p-v,0);mxEdgeStyle.vertexSeperations[3]=
Math.max(q-v,0);v=[];c=[];l=[];c[0]=m>=q?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;l[0]=u>=p?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;c[1]=mxUtils.reversePortConstraints(c[0]);l[1]=mxUtils.reversePortConstraints(l[0]);m=m>=q?m:q;p=u>=p?u:p;q=[[0,0],[0,0]];s=!1;for(u=0;2>u;u++)0==a[u]&&(0==(c[u]&d[u])&&(c[u]=mxUtils.reversePortConstraints(c[u])),0==(l[u]&d[u])&&(l[u]=mxUtils.reversePortConstraints(l[u])),q[u][0]=l[u],q[u][1]=c[u]);0<p&&0<m&&(0<(c[0]&d[0])&&
0<(l[1]&d[1])?(q[0][0]=c[0],q[0][1]=l[0],q[1][0]=l[1],q[1][1]=c[1],s=!0):0<(l[0]&d[0])&&0<(c[1]&d[1])&&(q[0][0]=l[0],q[0][1]=c[0],q[1][0]=c[1],q[1][1]=l[1],s=!0));0<p&&!s&&(q[0][0]=l[0],q[0][1]=c[0],q[1][0]=l[1],q[1][1]=c[1],s=!0);0<m&&!s&&(q[0][0]=c[0],q[0][1]=l[0],q[1][0]=c[1],q[1][1]=l[1]);for(u=0;2>u;u++)if(0==a[u]&&(0==(q[u][0]&d[u])&&(q[u][0]=q[u][1]),v[u]=q[u][0]&d[u],v[u]|=(q[u][1]&d[u])<<8,v[u]|=(q[1-u][u]&d[u])<<16,v[u]|=(q[1-u][1-u]&d[u])<<24,0==(v[u]&15)&&(v[u]<<=8),0==(v[u]&3840)&&(v[u]=
v[u]&15|v[u]>>8),0==(v[u]&983040)&&(v[u]=v[u]&65535|(v[u]&251658240)>>8),a[u]=v[u]&15,d[u]==mxConstants.DIRECTION_MASK_WEST||d[u]==mxConstants.DIRECTION_MASK_NORTH||d[u]==mxConstants.DIRECTION_MASK_EAST||d[u]==mxConstants.DIRECTION_MASK_SOUTH))a[u]=d[u];d=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];v=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];d-=z;v-=z;1>d&&(d+=4);1>v&&(v+=4);d=mxEdgeStyle.routePatterns[d-1][v-1];mxEdgeStyle.wayPoints1[0][0]=n[0][0];mxEdgeStyle.wayPoints1[0][1]=n[0][1];switch(a[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=
f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*n[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*n[0][2];mxEdgeStyle.wayPoints1[0][1]+=n[0][3]+f;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=n[0][2]+f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*n[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*n[0][2],mxEdgeStyle.wayPoints1[0][1]-=f}f=0;c=v=0<(a[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?
0:1;for(u=l=0;u<d.length;u++)l=d[u]&15,r=l==mxConstants.DIRECTION_MASK_EAST?3:l,r+=z,4<r&&(r-=4),m=mxEdgeStyle.dirVectors[r-1],l=0<r%2?0:1,l!=v&&(f++,mxEdgeStyle.wayPoints1[f][0]=mxEdgeStyle.wayPoints1[f-1][0],mxEdgeStyle.wayPoints1[f][1]=mxEdgeStyle.wayPoints1[f-1][1]),t=0<(d[u]&mxEdgeStyle.TARGET_MASK),s=0<(d[u]&mxEdgeStyle.SOURCE_MASK),p=(d[u]&mxEdgeStyle.SIDE_MASK)>>5,p<<=z,15<p&&(p>>=4),q=0<(d[u]&mxEdgeStyle.CENTER_MASK),(s||t)&&9>p?(r=0,s=s?0:1,r=q&&0==l?n[s][0]+b[s][0]*n[s][2]:q?n[s][1]+b[s][1]*
n[s][3]:mxEdgeStyle.limits[s][p],0==l?(p=(r-mxEdgeStyle.wayPoints1[f][0])*m[0],0<p&&(mxEdgeStyle.wayPoints1[f][0]+=m[0]*p)):(p=(r-mxEdgeStyle.wayPoints1[f][1])*m[1],0<p&&(mxEdgeStyle.wayPoints1[f][1]+=m[1]*p))):q&&(mxEdgeStyle.wayPoints1[f][0]+=m[0]*Math.abs(mxEdgeStyle.vertexSeperations[r]/2),mxEdgeStyle.wayPoints1[f][1]+=m[1]*Math.abs(mxEdgeStyle.vertexSeperations[r]/2)),0<f&&mxEdgeStyle.wayPoints1[f][l]==mxEdgeStyle.wayPoints1[f-1][l]?f--:v=l;for(u=0;u<=f&&!(u==f&&((0<(a[1]&(mxConstants.DIRECTION_MASK_EAST|
mxConstants.DIRECTION_MASK_WEST))?0:1)==c?0:1)!=(f+1)%2);u++)e.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[u][0]),Math.round(mxEdgeStyle.wayPoints1[u][1])));for(a=1;a<e.length;)null==e[a-1]||null==e[a]||e[a-1].x!=e[a].x||e[a-1].y!=e[a].y?a++:e.splice(a,1)}},getRoutePattern:function(a,b,c,d){var e=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];a=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];e-=b;a-=b;1>e&&(e+=4);1>a&&(a+=4);b=routePatterns[e-1][a-1];if(0==c||0==d)null!=inlineRoutePatterns[e-1][a-
1]&&(b=inlineRoutePatterns[e-1][a-1]);return b}},mxStyleRegistry={values:[],putValue:function(a,b){mxStyleRegistry.values[a]=b},getValue:function(a){return mxStyleRegistry.values[a]},getName:function(a){for(var b in mxStyleRegistry.values)if(mxStyleRegistry.values[b]==a)return b;return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation);
mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter);
@ -1470,8 +1471,8 @@ mxRubberband.prototype.currentX=0;mxRubberband.prototype.currentY=0;mxRubberband
mxRubberband.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null==b.getState()&&!mxEvent.isMultiTouchEvent(b.getEvent())){var c=mxUtils.getOffset(this.graph.container),d=mxUtils.getScrollOrigin(this.graph.container);d.x-=c.x;d.y-=c.y;this.start(b.getX()+d.x,b.getY()+d.y);b.consume(!1)}};
mxRubberband.prototype.start=function(a,b){function c(a){a=new mxMouseEvent(a);var b=mxUtils.convertPoint(d,a.getX(),a.getY());a.graphX=b.x;a.graphY=b.y;return a}this.first=new mxPoint(a,b);var d=this.graph.container;this.dragHandler=mxUtils.bind(this,function(a){this.mouseMove(this.graph,c(a))});this.dropHandler=mxUtils.bind(this,function(a){this.mouseUp(this.graph,c(a))});mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)};
mxRubberband.prototype.mouseMove=function(a,b){if(!b.isConsumed()&&null!=this.first){var c=mxUtils.getScrollOrigin(this.graph.container),d=mxUtils.getOffset(this.graph.container);c.x-=d.x;c.y-=d.y;var d=b.getX()+c.x,c=b.getY()+c.y,e=this.first.x-d,f=this.first.y-c,g=this.graph.tolerance;if(null!=this.div||Math.abs(e)>g||Math.abs(f)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(d,c),b.consume()}};
mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity));this.graph.container.appendChild(this.sharedDiv);return this.sharedDiv};mxRubberband.prototype.mouseUp=function(a,b){var c=null!=this.div&&"none"!=this.div.style.display;this.reset();c&&(c=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(c,b.getEvent()),b.consume())};
mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dropHandler=this.dragHandler=null;this.currentY=this.currentX=0;this.div=this.first=null};mxRubberband.prototype.update=function(a,b){this.currentX=a;this.currentY=b;this.repaint()};
mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity));this.graph.container.appendChild(this.sharedDiv);return this.sharedDiv};mxRubberband.prototype.isActive=function(a,b){return null!=this.div&&"none"!=this.div.style.display};mxRubberband.prototype.mouseUp=function(a,b){this.isActive()&&(this.execute(b.getEvent()),b.consume())};
mxRubberband.prototype.execute=function(a){this.reset();var b=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(b,a)};mxRubberband.prototype.reset=function(){null!=this.div&&this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dropHandler=this.dragHandler=null;this.currentY=this.currentX=0;this.div=this.first=null};mxRubberband.prototype.update=function(a,b){this.currentX=a;this.currentY=b;this.repaint()};
mxRubberband.prototype.repaint=function(){if(null!=this.div){var a=this.currentX-this.graph.panDx,b=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,a);this.y=Math.min(this.first.y,b);this.width=Math.max(this.first.x,a)-this.x;this.height=Math.max(this.first.y,b)-this.y;a=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+(mxClient.IS_VML?this.graph.panDx:0)+"px";this.div.style.top=this.y+a+"px";this.div.style.width=Math.max(1,this.width)+"px";this.div.style.height=Math.max(1,
this.height)+"px"}};mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))};function mxHandle(a,b,c){this.graph=a.view.graph;this.state=a;this.cursor=null!=b?b:this.cursor;this.image=null!=c?c:this.image;this.init()}mxHandle.prototype.cursor="default";mxHandle.prototype.image=null;
mxHandle.prototype.ignoreGrid=!1;mxHandle.prototype.getPosition=function(a){};mxHandle.prototype.setPosition=function(a,b,c){};mxHandle.prototype.execute=function(){};mxHandle.prototype.copyStyle=function(a){this.graph.setCellStyles(a,this.state.style[a],[this.state.cell])};

View file

@ -5,14 +5,14 @@ SANDSTORM_CAPNP_DIR=/opt/sandstorm/latest/usr/include
.PHONEY: all clean dev
package.spk: server sandstorm-pkgdef.capnp empty
package.spk: server sandstorm-pkgdef.capnp
spk pack --keyring="drawio.key" package.spk
dev: server sandstorm-pkgdef.capnp empty
dev: server sandstorm-pkgdef.capnp
spk dev
clean:
rm -rf tmp server package.spk empty
rm -rf tmp server package.spk
tmp/genfiles:
@mkdir -p tmp
@ -20,7 +20,4 @@ tmp/genfiles:
@touch tmp/genfiles
server: tmp/genfiles server.c++
$(CXX) -static server.c++ tmp/sandstorm/*.capnp.c++ -o server $(CXXFLAGS2) `pkg-config capnp-rpc --cflags --libs`
empty:
mkdir -p empty
$(CXX) -static server.c++ tmp/sandstorm/*.capnp.c++ -o server $(CXXFLAGS2) `pkg-config capnp-rpc --cflags --libs`

View file

@ -86,8 +86,6 @@ const pkgdef :Spk.PackageDefinition = (
( packagePath = "client", sourcePath = "client" ),
# Map client directory at "/client".
( sourcePath = "." )
]
),

View file

@ -133,9 +133,7 @@ public class GliffyDiagramConverter {
sortObjectsByOrder(obj.children);
for (Object child : obj.children) {
//do not import text as a child object, use inline text
if(!child.isText())
importObject(child, obj);
importObject(child, obj);
}
}
} else {
@ -244,7 +242,7 @@ public class GliffyDiagramConverter {
vertices.put(object.id, object);
// don't collect for swimlanes and mindmaps, their children are treated differently
if (object.hasChildren() && !object.isSwimlane() && !object.isMindmap())
if (object.isGroup())
collectVerticesAndConvert(vertices, object.children, object);
}
}
@ -284,6 +282,10 @@ public class GliffyDiagramConverter {
mxGeometry geometry = new mxGeometry((int) gliffyObject.x, (int) gliffyObject.y, (int) gliffyObject.width, (int) gliffyObject.height);
cell.setGeometry(geometry);
String text;
Object textObject = null;
String link = null;
Graphic graphic = null;
if (gliffyObject.isGroup()) {
@ -292,17 +294,11 @@ public class GliffyDiagramConverter {
} else {
// groups don't have graphic
graphic = gliffyObject.getGraphic();
textObject = gliffyObject.getTextObject();
}
String text;
Object textObject = gliffyObject.getTextObject();
String link = null;
if (graphic != null) {
link = gliffyObject.getLink();
if (gliffyObject.isShape()) {
GliffyShape shape = graphic.Shape;

View file

@ -8,6 +8,8 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@ -23,6 +25,8 @@ public class mxVsdxUtils
private static final double CENTIMETERS_PER_INCHES = 2.54;
public static final double conversionFactor = screenCoordinatesPerCm * CENTIMETERS_PER_INCHES;
private static final Logger log = Logger.getLogger(mxVsdxUtils.class.getName());
/**
* Checks if the NodeList has a Node with name = tag.
@ -163,7 +167,15 @@ public class mxVsdxUtils
if(!key.equals(mxConstants.STYLE_SHAPE) || (!styleMap.get(key).startsWith("image") && !styleMap.get(key).startsWith("rounded=")))
{
style = style + key + asig;
try
{
style = style + key + asig;
}
catch (Exception e)
{
log.log(Level.SEVERE, "mxVsdxUtils.getStyleString," + e.toString() + ",style.length=" + style.length() +
",key.length=" + key.length() + ",asig.length=" + asig.length());
}
}
style = style + value + ";";

View file

@ -85,7 +85,7 @@ public class EmbedServlet2 extends HttpServlet
}
/**
* @see HttpServlet#HttpServlet()
* Sets up collection of stencils
*/
public static void initLibraries(HashMap<String, String[]> libraries)
{

View file

@ -10,4 +10,4 @@
#
# Set the default logging level for all loggers to WARNING
.level = CONFIG
.level = SEVERE

View file

@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 10/18/2016 03:18 PM
# 10/27/2016 03:59 PM
/app.html
/index.html?offline=1

2180
war/js/app.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1530
war/js/atlas.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -148,7 +148,7 @@ App.pluginRegistry = {'4xAKTrabTpTzahoLthkwPNUn': '/plugins/explore.js',
'acj': '/plugins/connectJira.js', 'voice': '/plugins/voice.js',
'tips': '/plugins/tooltips.js', 'svgdata': '/plugins/svgdata.js',
'doors': '/plugins/doors.js', 'electron': 'plugins/electron.js',
'tags': '/plugins/tags.js', 'sql': '/plugins/sql.js'};
'tags': '/plugins/tags.js', 'sql': '/plugins/sql.js', 'find': '/plugins/find.js'};
/**
* Function: authorize
@ -391,7 +391,8 @@ App.main = function(callback)
var severity = (message.indexOf('NetworkError') >= 0 || message.indexOf('SecurityError') >= 0 ||
message.indexOf('NS_ERROR_FAILURE') >= 0 || message.indexOf('out of memory') >= 0) ?
'CONFIG' : 'SEVERE';
img.src = 'https://log.draw.io/log?severity=' + severity + '&v=' + encodeURIComponent(EditorUi.VERSION) +
var logDomain = window.DRAWIO_LOG_URL != null ? window.DRAWIO_LOG_URL : '';
img.src = logDomain + '/log?severity=' + severity + '&v=' + encodeURIComponent(EditorUi.VERSION) +
'&msg=clientError:' + encodeURIComponent(message) + ':url:' + encodeURIComponent(window.location.href) +
':lnum:' + encodeURIComponent(linenumber) +
((colno != null) ? ':colno:' + encodeURIComponent(colno) : '') +
@ -680,6 +681,9 @@ App.prototype.init = function()
{
EditorUi.prototype.init.apply(this, arguments);
var host = window.location.host;
/**
* Overrides export dialog for using cloud storage save.
*/
@ -2284,7 +2288,8 @@ App.prototype.start = function()
try
{
var img = new Image();
img.src = 'https://log.draw.io/log?v=' + encodeURIComponent(EditorUi.VERSION) +
var logDomain = window.DRAWIO_LOG_URL != null ? window.DRAWIO_LOG_URL : '';
img.src = logDomain + '/log?v=' + encodeURIComponent(EditorUi.VERSION) +
'&msg=errorLoadingFile:url:' + encodeURIComponent(window.location.href) +
((e != null && e.message != null) ? ':err:' + encodeURIComponent(e.message) : '') +
((e != null && e.stack != null) ? '&stack=' + encodeURIComponent(e.stack) : '');
@ -3858,6 +3863,10 @@ App.prototype.libraryLoaded = function(file, images)
addCells(cells, bounds);
}
else if (graph.getRubberband().isActive())
{
graph.getRubberband().execute(evt);
}
else
{
this.showError(mxResources.get('error'), mxResources.get('nothingIsSelected'), mxResources.get('ok'));
@ -4228,7 +4237,8 @@ App.prototype.fileLoaded = function(file)
// if (!this.isOffline())
// {
// var img = new Image();
// img.src = 'https://log.draw.io/log?msg=storageMode:' + encodeURIComponent(file.getMode()) +
var logDomain = window.DRAWIO_LOG_URL != null ? window.DRAWIO_LOG_URL : '';
// img.src = logDomain + '/log?msg=storageMode:' + encodeURIComponent(file.getMode()) +
// '&v=' + encodeURIComponent(EditorUi.VERSION);
// }
// }

View file

@ -2873,94 +2873,156 @@ var BackgroundImageDialog = function(editorUi, applyFn)
*/
var ParseDialog = function(editorUi, title)
{
function parse(text)
function parse(text, asList)
{
var lines = text.split('\n');
var vertices = new Object();
var cells = [];
function getOrCreateVertex(id)
if (asList)
{
var vertex = vertices[id];
if (vertex == null)
if (lines.length > 0)
{
vertex = new mxCell(id, new mxGeometry(0, 0, 80, 30));
vertex.vertex = true;
vertices[id] = vertex;
cells.push(vertex);
}
return vertex;
};
for (var i = 0; i < lines.length; i++)
{
if (lines[i].charAt(0) != ';')
{
var values = lines[i].split('->');
var graph = editorUi.editor.graph;
if (values.length == 2)
{
var source = getOrCreateVertex(values[0]);
var target = getOrCreateVertex(values[1]);
var edge = new mxCell('', new mxGeometry());
edge.edge = true;
source.insertEdge(edge, true);
target.insertEdge(edge, false);
cells.push(edge);
}
}
}
if (cells.length > 0)
{
var container = document.createElement('div');
container.style.visibility = 'hidden';
document.body.appendChild(container);
var graph = new Graph(container);
graph.getModel().beginUpdate();
try
{
cells = graph.importCells(cells);
var listCell = new mxCell(lines[0], new mxGeometry(0, 0, 160, 26 + 4),
'swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;');
listCell.vertex = true;
for (var i = 0; i < cells.length; i++)
var size = graph.getPreferredSizeForCell(listCell);
if (size != null && listCell.geometry.width < size.width + 10)
{
listCell.geometry.width = size.width + 10;
}
if (lines.length > 1)
{
if (graph.getModel().isVertex(cells[i]))
for (var i = 1; i < lines.length; i++)
{
var size = graph.getPreferredSizeForCell(cells[i]);
cells[i].geometry.width = Math.max(cells[i].geometry.width, size.width);
cells[i].geometry.height = Math.max(cells[i].geometry.height, size.height);
if (lines[i] == '--')
{
var divider = new mxCell('', new mxGeometry(0, 0, 40, 8), 'line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;');
divider.vertex = true;
listCell.geometry.height += divider.geometry.height;
listCell.insert(divider);
}
else if (lines[i].length > 0 && lines[i].charAt(0) != ';')
{
var field = new mxCell(lines[i], new mxGeometry(0, 0, 60, 26), 'text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;');
field.vertex = true;
var size = graph.getPreferredSizeForCell(field);
if (size != null && field.geometry.width < size.width)
{
field.geometry.width = size.width;
}
listCell.geometry.width = Math.max(listCell.geometry.width, field.geometry.width);
listCell.geometry.height += field.geometry.height;
listCell.insert(field);
}
}
}
var layout = new mxFastOrganicLayout(graph);
layout.disableEdgeStyle = false;
layout.forceConstant = 120;
layout.execute(graph.getDefaultParent());
graph.moveCells(cells, 20, 20);
var view = graph.view;
var bds = graph.getGraphBounds();
// Computes unscaled, untranslated graph bounds
var x = Math.ceil(Math.max(0, bds.x / view.scale - view.translate.x) + 4 * graph.gridSize);
var y = Math.ceil(Math.max(0, (bds.y + bds.height) / view.scale - view.translate.y) + 4 * graph.gridSize);
graph.setSelectionCells(graph.importCells([listCell], x, y));
graph.scrollCellToVisible(graph.getSelectionCell());
}
finally
}
else
{
var vertices = new Object();
var cells = [];
function getOrCreateVertex(id)
{
graph.getModel().endUpdate();
var vertex = vertices[id];
if (vertex == null)
{
vertex = new mxCell(id, new mxGeometry(0, 0, 80, 30));
vertex.vertex = true;
vertices[id] = vertex;
cells.push(vertex);
}
return vertex;
};
for (var i = 0; i < lines.length; i++)
{
if (lines[i].charAt(0) != ';')
{
var values = lines[i].split('->');
if (values.length == 2)
{
var source = getOrCreateVertex(values[0]);
var target = getOrCreateVertex(values[1]);
var edge = new mxCell('', new mxGeometry());
edge.edge = true;
source.insertEdge(edge, true);
target.insertEdge(edge, false);
cells.push(edge);
}
}
}
graph.clearCellOverlays();
var view = editorUi.editor.graph.view;
var bds = editorUi.editor.graph.getGraphBounds();
// Computes unscaled, untranslated graph bounds
var x = Math.ceil(Math.max(0, bds.x / view.scale - view.translate.x) + graph.gridSize);
var y = Math.ceil(Math.max(0, (bds.y + bds.height) / view.scale - view.translate.y) + 4 * graph.gridSize);
editorUi.editor.graph.setSelectionCells(editorUi.editor.graph.importCells(
graph.getModel().getChildren(graph.getDefaultParent()), x, y));
editorUi.editor.graph.scrollCellToVisible(editorUi.editor.graph.getSelectionCell());
graph.destroy();
container.parentNode.removeChild(container);
if (cells.length > 0)
{
var container = document.createElement('div');
container.style.visibility = 'hidden';
document.body.appendChild(container);
var graph = new Graph(container);
graph.getModel().beginUpdate();
try
{
cells = graph.importCells(cells);
for (var i = 0; i < cells.length; i++)
{
if (graph.getModel().isVertex(cells[i]))
{
var size = graph.getPreferredSizeForCell(cells[i]);
cells[i].geometry.width = Math.max(cells[i].geometry.width, size.width);
cells[i].geometry.height = Math.max(cells[i].geometry.height, size.height);
}
}
var layout = new mxFastOrganicLayout(graph);
layout.disableEdgeStyle = false;
layout.forceConstant = 120;
layout.execute(graph.getDefaultParent());
graph.moveCells(cells, 20, 20);
}
finally
{
graph.getModel().endUpdate();
}
graph.clearCellOverlays();
var view = editorUi.editor.graph.view;
var bds = editorUi.editor.graph.getGraphBounds();
// Computes unscaled, untranslated graph bounds
var x = Math.ceil(Math.max(0, bds.x / view.scale - view.translate.x) + graph.gridSize);
var y = Math.ceil(Math.max(0, (bds.y + bds.height) / view.scale - view.translate.y) + 4 * graph.gridSize);
editorUi.editor.graph.setSelectionCells(editorUi.editor.graph.importCells(
graph.getModel().getChildren(graph.getDefaultParent()), x, y));
editorUi.editor.graph.scrollCellToVisible(editorUi.editor.graph.getSelectionCell());
graph.destroy();
container.parentNode.removeChild(container);
}
}
};
@ -2972,8 +3034,20 @@ var ParseDialog = function(editorUi, title)
textarea.style.width = '100%';
textarea.style.height = '354px';
textarea.style.marginBottom = '16px';
var diagramCheckBox = document.createElement('input');
diagramCheckBox.setAttribute('type', 'checkbox');
textarea.value = ';example\na->b\nb->c\nc->a\n';
function getDefaultValue()
{
return (!diagramCheckBox.checked) ?
'Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean' :
';Example:\na->b\nb->c\nc->a\n';
};
var defaultValue = getDefaultValue();
textarea.value = defaultValue;
div.appendChild(textarea);
this.init = function()
@ -3009,13 +3083,38 @@ var ParseDialog = function(editorUi, title)
textarea.addEventListener('dragover', handleDragOver, false);
textarea.addEventListener('drop', handleDrop, false);
}
div.appendChild(diagramCheckBox);
mxEvent.addListener(diagramCheckBox, 'change', function()
{
var newDefaultValue = getDefaultValue();
if (textarea.value.length == 0 || textarea.value == defaultValue)
{
defaultValue = newDefaultValue;
textarea.value = defaultValue;
}
});
var span = document.createElement('span');
mxUtils.write(span, ' ' + mxResources.get('diagram'));
span.style.marginRight = '10px';
div.appendChild(span);
var cancelBtn = mxUtils.button(mxResources.get('close'), function()
{
editorUi.confirm(mxResources.get('areYouSure'), function()
if (textarea.value == defaultValue)
{
editorUi.hideDialog();
});
}
else
{
editorUi.confirm(mxResources.get('areYouSure'), function()
{
editorUi.hideDialog();
});
}
});
cancelBtn.className = 'geBtn';
@ -3028,7 +3127,7 @@ var ParseDialog = function(editorUi, title)
var okBtn = mxUtils.button(mxResources.get('insert'), function()
{
editorUi.hideDialog();
parse(textarea.value);
parse(textarea.value, !diagramCheckBox.checked);
});
div.appendChild(okBtn);
@ -4358,22 +4457,23 @@ PrintDialog.prototype.create = function(editorUi)
var allPagesRadio = document.createElement('input');
allPagesRadio.style.cssText = 'margin-right:8px;margin-bottom:8px;';
allPagesRadio.setAttribute('value', 'all');
allPagesRadio.setAttribute('type', 'radio');
allPagesRadio.setAttribute('name', 'pages');
allPagesRadio.setAttribute('name', 'pages-printdialog');
pagesSection.appendChild(allPagesRadio);
var span = document.createElement('span');
mxUtils.write(span, mxResources.get('printAllPages'));
pagesSection.appendChild(span);
mxUtils.br(pagesSection);
// Pages ... to ...
var pagesRadio = allPagesRadio.cloneNode(true);
pagesRadio.setAttribute('value', 'range');pagesSection.appendChild(pagesRadio);
allPagesRadio.setAttribute('checked', 'checked');
pagesRadio.setAttribute('value', 'range');
pagesSection.appendChild(pagesRadio);
var span = document.createElement('span');
mxUtils.write(span, mxResources.get('pages') + ':');
@ -4393,7 +4493,7 @@ PrintDialog.prototype.create = function(editorUi)
var pagesToInput = pagesFromInput.cloneNode(true);
pagesSection.appendChild(pagesToInput);
mxEvent.addListener(pagesFromInput, 'focus', function()
{
pagesRadio.checked = true;
@ -4406,14 +4506,14 @@ PrintDialog.prototype.create = function(editorUi)
function validatePageRange()
{
pagesToInput.value = Math.min(pageCount, Math.max(parseInt(pagesToInput.value), parseInt(pagesFromInput.value)));
pagesFromInput.value = Math.min(pageCount, Math.min(parseInt(pagesToInput.value), parseInt(pagesFromInput.value)));
pagesToInput.value = Math.max(1, Math.min(pageCount, Math.max(parseInt(pagesToInput.value), parseInt(pagesFromInput.value))));
pagesFromInput.value = Math.max(1, Math.min(pageCount, Math.min(parseInt(pagesToInput.value), parseInt(pagesFromInput.value))));
};
mxEvent.addListener(pagesFromInput, 'change', validatePageRange);
mxEvent.addListener(pagesToInput, 'change', validatePageRange);
if (false && editorUi.pages != null)
if (editorUi.pages != null)
{
pageCount = editorUi.pages.length;
@ -4550,10 +4650,23 @@ PrintDialog.prototype.create = function(editorUi)
// Page scale ...
var pageScaleSection = document.createElement('div');
var span = document.createElement('span');
var span = document.createElement('div');
span.style.fontWeight = 'bold';
span.style.marginBottom = '12px';
mxUtils.write(span, mxResources.get('paperSize'));
pageScaleSection.appendChild(span);
var span = document.createElement('div');
span.style.marginBottom = '12px';
var accessor = PageSetupDialog.addPageFormatPanel(span, 'printdialog',
editorUi.editor.graph.pageFormat || mxConstants.PAGE_FORMAT_A4_PORTRAIT);
pageScaleSection.appendChild(span);
var span = document.createElement('span');
mxUtils.write(span, mxResources.get('pageScale'));
pageScaleSection.appendChild(span);
var pageScaleInput = document.createElement('input');
pageScaleInput.style.cssText = 'margin:0 8px 0 8px;';
pageScaleInput.setAttribute('value', '100 %');
@ -4564,7 +4677,7 @@ PrintDialog.prototype.create = function(editorUi)
// Buttons
var buttons = document.createElement('div');
buttons.style.cssText = 'text-align:right;margin:36px 0 0 0;';
buttons.style.cssText = 'text-align:right;margin:42px 0 0 0;';
// Overall scale for print-out to account for print borders in dialogs etc
function preview(print)
@ -4579,55 +4692,246 @@ PrintDialog.prototype.create = function(editorUi)
// Workaround to match available paper size in actual print output
printScale *= 0.75;
// Negative coordinates are cropped or shifted if page visible
var gb = graph.getGraphBounds();
var border = 0;
var x0 = 0;
var y0 = 0;
var pf = graph.pageFormat || mxConstants.PAGE_FORMAT_A4_PORTRAIT;
var scale = 1 / graph.pageScale;
var autoOrigin = fitRadio.checked;
if (autoOrigin)
function printGraph(thisGraph, pv, forcePageBreaks)
{
var h = parseInt(sheetsAcrossInput.value);
var v = parseInt(sheetsDownInput.value);
scale = Math.min((pf.height * v) / (gb.height / graph.view.scale),
(pf.width * h) / (gb.width / graph.view.scale));
}
else
{
scale = parseInt(zoomInput.value) / (100 * graph.pageScale);
if (isNaN(scale))
// Negative coordinates are cropped or shifted if page visible
var gb = thisGraph.getGraphBounds();
var border = 0;
var x0 = 0;
var y0 = 0;
var pf = accessor.get();
var scale = 1 / thisGraph.pageScale;
var autoOrigin = fitRadio.checked;
if (autoOrigin)
{
printScale = 1 / graph.pageScale;
zoomInput.value = '100 %';
var h = parseInt(sheetsAcrossInput.value);
var v = parseInt(sheetsDownInput.value);
scale = Math.min((pf.height * v) / (gb.height / thisGraph.view.scale),
(pf.width * h) / (gb.width / thisGraph.view.scale));
}
else
{
scale = parseInt(zoomInput.value) / (100 * thisGraph.pageScale);
if (isNaN(scale))
{
printScale = 1 / thisGraph.pageScale;
zoomInput.value = '100 %';
}
}
// Applies print scale
pf = mxRectangle.fromRectangle(pf);
pf.width = Math.ceil(pf.width * printScale);
pf.height = Math.ceil(pf.height * printScale);
scale *= printScale;
// Starts at first visible page
if (!autoOrigin && thisGraph.pageVisible)
{
var layout = thisGraph.getPageLayout();
x0 -= layout.x * pf.width;
y0 -= layout.y * pf.height;
}
else
{
autoOrigin = true;
}
if (pv == null)
{
pv = PrintDialog.createPrintPreview(thisGraph, scale, pf, border, x0, y0, autoOrigin);
pv.pageSelector = false;
pv.mathEnabled = false;
if (typeof(MathJax) !== 'undefined')
{
// Adds class to ignore if math is disabled
var printPreviewRenderPage = pv.renderPage;
pv.renderPage = function(w, h, dx, dy, content, pageNumber)
{
var result = printPreviewRenderPage.apply(this, arguments);
if (this.graph.mathEnabled)
{
this.mathEnabled = true;
}
else
{
result.className = 'geDisableMathJax';
}
return result;
};
}
pv.open(null, null, forcePageBreaks, true);
}
else
{
var bg = thisGraph.background;
if (bg == null || bg == '' || bg == mxConstants.NONE)
{
bg = '#ffffff';
}
pv.backgroundColor = bg;
pv.autoOrigin = autoOrigin;
pv.appendGraph(thisGraph, scale, x0, y0, forcePageBreaks, true);
}
return pv;
};
var pagesFrom = pagesFromInput.value;
var pagesTo = pagesToInput.value;
var ignorePages = !allPagesRadio.checked;
var pv = null;
if (ignorePages)
{
ignorePages = pagesFrom == currentPage && pagesTo == currentPage;
}
if (!ignorePages && editorUi.pages != null && editorUi.pages.length)
{
var i0 = 0;
var imax = editorUi.pages.length - 1;
if (!allPagesRadio.checked)
{
i0 = parseInt(pagesFrom) - 1;
imax = parseInt(pagesTo) - 1;
}
for (var i = i0; i <= imax; i++)
{
var page = editorUi.pages[i];
var tempGraph = (page == editorUi.currentPage) ? graph : null;
if (tempGraph == null)
{
tempGraph = editorUi.createTemporaryGraph(graph.getStylesheet());
// Restores graph settings that are relevant for printing
var pageVisible = true;
var mathEnabled = false;
var bg = null;
var bgImage = null;
if (page.viewState == null && page.mapping == null)
{
// Workaround to extract view state from XML node
// This changes the state of the page and parses
// the XML for the graph model even if not needed.
if (page.root == null)
{
editorUi.updatePageRoot(page);
}
}
if (page.viewState != null)
{
pageVisible = page.viewState.pageVisible;
mathEnabled = page.viewState.mathEnabled;
bg = page.viewState.background;
bgImage = page.viewState.backgroundImage;
}
else if (page.mapping != null && page.mapping.diagramMap != null)
{
// Default pageVisible in realtime is true
mathEnabled = page.mapping.diagramMap.get('mathEnabled') != '0';
bg = page.mapping.diagramMap.get('background');
var temp = page.mapping.diagramMap.get('backgroundImage');
bgImage = (temp != null && temp.length > 0) ? JSON.parse(temp) : null;
}
tempGraph.background = bg;
tempGraph.backgroundImage = (bgImage != null) ? new mxImage(bgImage.src, bgImage.width, bgImage.height) : null;
tempGraph.pageVisible = pageVisible;
tempGraph.mathEnabled = mathEnabled;
// Redirects placeholders to current page
var graphGetGlobalVariable = tempGraph.getGlobalVariable;
tempGraph.getGlobalVariable = function(name)
{
if (name == 'page')
{
return page.getName();
}
else if (name == 'pagenumber')
{
return i + 1;
}
return graphGetGlobalVariable.apply(this, arguments);
};
document.body.appendChild(tempGraph.container);
editorUi.updatePageRoot(page);
tempGraph.model.setRoot(page.root);
}
pv = printGraph(tempGraph, pv, i != imax);
if (tempGraph != graph)
{
tempGraph.container.parentNode.removeChild(tempGraph.container);
}
}
}
// Applies print scale
pf = mxRectangle.fromRectangle(pf);
pf.width = Math.ceil(pf.width * printScale);
pf.height = Math.ceil(pf.height * printScale);
scale *= printScale;
// Starts at first visible page
if (!autoOrigin && graph.pageVisible)
{
var layout = graph.getPageLayout();
x0 -= layout.x * pf.width;
y0 -= layout.y * pf.height;
}
else
{
autoOrigin = true;
pv = printGraph(graph);
}
return PrintDialog.showPreview(PrintDialog.createPrintPreview(graph, scale, pf, border, x0, y0, autoOrigin, print), print);
if (pv.mathEnabled)
{
var doc = pv.wnd.document;
doc.writeln('<script type="text/x-mathjax-config">');
doc.writeln('MathJax.Hub.Config({');
doc.writeln('messageStyle: "none",');
doc.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],');
doc.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],');
doc.writeln('TeX: {');
doc.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]');
doc.writeln('},');
// Ignores math in in-place editor
doc.writeln('tex2jax: {');
doc.writeln(' ignoreClass: "geDisableMathJax"');
doc.writeln('},');
doc.writeln('asciimath2jax: {');
doc.writeln(' ignoreClass: "geDisableMathJax"');
doc.writeln('}');
doc.writeln('});');
// Adds asynchronous printing when MathJax finished rendering
if (print)
{
doc.writeln('MathJax.Hub.Queue(function () {');
doc.writeln('window.print();');
doc.writeln('});');
}
doc.writeln('</script>');
doc.writeln('<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js"></script>');
}
pv.closeDocument();
if (!pv.mathEnabled && print)
{
PrintDialog.printPreview(pv);
}
};
var cancelBtn = mxUtils.button(mxResources.get('cancel'), function()

View file

@ -636,6 +636,26 @@ DriveRealtime.prototype.installUiChangeListeners = function()
});
this.ui.addListener('foldingEnabledChanged', this.foldingEnabledListener);
this.graph.addListener('shadowVisibleChanged', this.shadowVisibleListener);
this.pageVisibleListener = mxUtils.bind(this, function(sender, evt)
{
if (!this.ignorePageVisibleChanged)
{
try
{
this.setFileModified();
this.getDiagramMap().set('pageVisible', (this.graph.pageVisible) ? '1' : '0');
}
catch (e)
{
this.ui.handleError(e);
}
}
});
this.ui.addListener('pageViewChanged', this.pageVisibleListener);
this.backgroundImageListener = mxUtils.bind(this, function(sender, evt)
{
@ -1676,6 +1696,12 @@ DriveRealtime.prototype.destroy = function(unloading)
this.foldingEnabledListener = null;
}
if (this.pageVisibleListener != null)
{
this.ui.removeListener(this.pageVisibleListener);
this.pageVisibleListener = null;
}
if (this.backgroundImageListener != null)
{
this.ui.removeListener(this.backgroundImageListener);
@ -1717,6 +1743,12 @@ DriveRealtime.prototype.destroy = function(unloading)
this.model.removeListener(this.graphModelChangeListener);
this.graphModelChangeListener = null;
}
if (this.pageChangeListener != null)
{
this.ui.editor.removeListener(this.pageChangeListener);
this.pageChangeListener = null;
}
if (this.viewStateListener != null)
{

View file

@ -79,7 +79,7 @@
Editor.doMathJaxRender = function(container)
{
MathJax.Hub.Queue(['Typeset', MathJax.Hub, container]);
}
};
// Disables global typesetting and messages on startup, adds queue for
// asynchronous rendering while MathJax is loading
@ -319,63 +319,6 @@
}
}
};
// Overrides to call print asynchronously after (disables immediate print here)
if (window.PrintDialog)
{
var printDialogShowPrintPreview = PrintDialog.showPreview;
PrintDialog.showPreview = function(preview, print)
{
if (typeof(MathJax) !== 'undefined' && preview.graph.mathEnabled)
{
print = false;
}
return printDialogShowPrintPreview.apply(this, arguments);
};
// Adds MathJax to print preview
var printDialogCreatePrintPreview = PrintDialog.createPrintPreview;
PrintDialog.createPrintPreview = function(graph, scale, pf, border, x0, y0, autoOrigin, print)
{
var preview = printDialogCreatePrintPreview.apply(this, arguments);
if (typeof(MathJax) !== 'undefined' && graph.mathEnabled)
{
// Using writePostfix is workaround for blocking of DOM processing
// in Chrome if using writeHead for injecting async script tag
var writePostfix = preview.writePostfix;
preview.writePostfix = function(doc, css)
{
writePostfix.apply(this, arguments);
// Disables status message in print output
doc.writeln('<script type="text/x-mathjax-config">');
doc.writeln('MathJax.Hub.Config({');
doc.writeln('messageStyle: "none",');
doc.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],');
doc.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],');
doc.writeln('TeX: {');
doc.writeln(' extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]');
doc.writeln('}');
doc.writeln('});');
// Adds asynchronous printing when MathJax finished rendering
if (print)
{
doc.writeln('MathJax.Hub.Queue(function () {');
doc.writeln('window.print();');
doc.writeln('});');
}
doc.writeln('</script>');
doc.writeln('<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js"></script>');
};
}
return preview;
};
}
/**
* Global switches for the export dialog.
@ -1768,7 +1711,8 @@
var img = new Image();
// Timestamp is added to bypass client-side cache
img.src = 'https://log.draw.io/log?severity=CONFIG&msg=imgur-published:' + res.data.id + '&v=' +
var logDomain = window.DRAWIO_LOG_URL != null ? window.DRAWIO_LOG_URL : '';
img.src = logDomain + '/log?severity=CONFIG&msg=imgur-published:' + res.data.id + '&v=' +
encodeURIComponent(EditorUi.VERSION) + '&ts=' + new Date().getTime();
}
catch (e)

View file

@ -21,6 +21,9 @@ window.TEMPLATE_PATH = window.TEMPLATE_PATH || '/templates';
window.RESOURCES_PATH = window.RESOURCES_PATH || 'resources';
window.RESOURCE_BASE = window.RESOURCE_BASE || RESOURCES_PATH + '/dia';
// URL for logging
window.DRAWIO_LOG_URL = window.DRAWIO_LOG_URL || '';
// Sets the base path, the UI language via URL param and configures the
// supported languages to avoid 404s. The loading of all core language
// resources is disabled as all required resources are in grapheditor.
@ -231,3 +234,15 @@ if (urlParams['offline'] == '1' || urlParams['local'] == '1')
{
urlParams['math'] = '0';
}
// Adds hard-coded logging domain for draw.io domains
var host = window.location.host;
var searchString = 'draw.io';
var position = host.length - searchString.length;
var lastIndex = host.lastIndexOf(searchString, position);
if (lastIndex !== -1 && lastIndex === position && host != 'test.draw.io')
{
// endsWith polyfill
window.DRAWIO_LOG_URL = 'https://log.draw.io';
}

View file

@ -84,8 +84,8 @@
editorUi.actions.get('print').funct = function()
{
editorUi.showDialog(new PrintDialog(editorUi).container, 320,
(false && editorUi.pages != null && editorUi.pages.length > 1) ?
300 : 220, true, true);
(editorUi.pages != null && editorUi.pages.length > 1) ?
400 : 340, true, true);
};
editorUi.actions.addAction('open...', function()
@ -560,7 +560,8 @@
if (editorUi.enableLogging)
{
var img = new Image();
img.src = 'https://log.draw.io/log?severity=CONFIG&msg=helpsearch:' + encodeURIComponent(input.value) + '&v=' + encodeURIComponent(EditorUi.VERSION);
var logDomain = window.DRAWIO_LOG_URL != null ? window.DRAWIO_LOG_URL : '';
img.src = logDomain + '/log?severity=CONFIG&msg=helpsearch:' + encodeURIComponent(input.value) + '&v=' + encodeURIComponent(EditorUi.VERSION);
}
// Workaround for blocked submit on iOS/IE11

View file

@ -228,8 +228,8 @@ EditorUi.prototype.initPages = function()
this.selectNextPage(true);
}));
this.keyHandler.bindAction(33, true, 'previousPage'); // Ctrl+PageUp
this.keyHandler.bindAction(34, true, 'nextPage'); // Ctrl+PageDown
this.keyHandler.bindAction(33, true, 'previousPage', true); // Ctrl+Shift+PageUp
this.keyHandler.bindAction(34, true, 'nextPage', true); // Ctrl+Shift+PageDown
// Updates the tabs after loading the diagram
var graph = this.editor.graph;
@ -276,8 +276,8 @@ EditorUi.prototype.initPages = function()
if (p.viewState == null || p.viewState.scrollLeft == null)
{
this.resetScrollbars();
if (this.editor.graph.lightbox)
if (graph.lightbox)
{
this.lightboxFit();
}
@ -291,12 +291,8 @@ EditorUi.prototype.initPages = function()
}
else
{
// Takes into account resized window
var dx = (p.viewState.translate != null) ? p.viewState.translate.x - graph.view.translate.x : 0;
var dy = (p.viewState.translate != null) ? p.viewState.translate.y - graph.view.translate.y : 0;
graph.container.scrollLeft = p.viewState.scrollLeft - dx * graph.view.scale;
graph.container.scrollTop = p.viewState.scrollTop - dy * graph.view.scale;
graph.container.scrollLeft = graph.view.translate.x * graph.view.scale + p.viewState.scrollLeft;
graph.container.scrollTop = graph.view.translate.y * graph.view.scale + p.viewState.scrollTop;
}
lastPage = p;
@ -425,8 +421,8 @@ Graph.prototype.getViewState = function()
connect: this.connectionHandler.isEnabled(),
arrows: this.connectionArrowsEnabled,
scale: this.view.scale,
scrollLeft: this.container.scrollLeft,
scrollTop: this.container.scrollTop,
scrollLeft: this.container.scrollLeft - this.view.translate.x * this.view.scale,
scrollTop: this.container.scrollTop - this.view.translate.y * this.view.scale,
translate: this.view.translate.clone(),
lastPasteXml: this.lastPasteXml,
pasteCounter: this.pasteCounter,
@ -688,9 +684,15 @@ EditorUi.prototype.duplicatePage = function(page, name)
if (graph.isEnabled())
{
// Clones the current page and takes a snapshot of the graph model
// Clones the current page and takes a snapshot of the graph model and view state
var newPage = new DiagramPage(page.node.cloneNode(false));
newPage.root = graph.cloneCells([graph.model.root])[0];
newPage.viewState = graph.getViewState();
// Resets zoom and scrollbar positions
newPage.viewState.scale = 1;
newPage.viewState.scrollLeft = null;
newPage.viewState.scrollRight = null;
newPage.setName(name);
newPage = this.insertPage(newPage, mxUtils.indexOf(this.pages, page) + 1);

View file

@ -99,6 +99,10 @@ RealtimeMapping.prototype.init = function()
{
this.realtimeFoldingEnabledChanged(evt.newValue);
}
else if (evt.property == 'pageVisible')
{
this.realtimePageVisibleChanged(evt.newValue);
}
else if (evt.property == 'backgroundImage')
{
this.realtimeBackgroundImageChanged(evt.newValue);
@ -113,7 +117,8 @@ RealtimeMapping.prototype.init = function()
if (evt.newValue != null && (evt.property == 'pageFormat' ||
evt.property == 'pageScale' || evt.property == 'shadowVisible' ||
evt.property == 'backgroundColor' || evt.property == 'foldingEnabled' ||
evt.property == 'backgroundImage' || evt.property == 'mathEnabled'))
evt.property == 'backgroundImage' || evt.property == 'mathEnabled' ||
evt.property == 'pageVisible'))
{
this.needsUpdate = true;
}
@ -280,6 +285,7 @@ RealtimeMapping.prototype.writeNodeToRealtime = function(node)
this.diagramMap.set('foldingEnabled', node.getAttribute('fold'));
this.diagramMap.set('mathEnabled', node.getAttribute('math'));
this.diagramMap.set('pageScale', node.getAttribute('pageScale'));
this.diagramMap.set('pageVisible', node.getAttribute('pageVisible'));
var img = node.getAttribute('backgroundImage');
@ -310,6 +316,7 @@ RealtimeMapping.prototype.activate = function(quiet)
this.realtimeBackgroundColorChanged(this.diagramMap.get('backgroundColor'), quiet);
this.realtimeShadowVisibleChanged(this.diagramMap.get('shadowVisible'), quiet);
this.realtimeFoldingEnabledChanged(this.diagramMap.get('foldingEnabled'), quiet);
this.realtimePageVisibleChanged(this.diagramMap.get('pageVisible'), quiet);
this.realtimeBackgroundImageChanged(this.diagramMap.get('backgroundImage'), quiet);
};
@ -332,13 +339,19 @@ RealtimeMapping.prototype.initRealtime = function()
}
else
{
this.diagramMap.set('shadowVisible', (this.graph.shadowVisible) ? '1' : '0');
this.diagramMap.set('foldingEnabled', (this.graph.foldingEnabled) ? '1' : '0');
this.diagramMap.set('mathEnabled', (this.graph.mathEnabled) ? '1' : '0');
var vs = this.page.viewState;
var pf = (vs != null) ? vs.pageFormat : mxSettings.getPageFormat();
this.diagramMap.set('shadowVisible', (vs != null && vs.shadowVisible) ? '1' : '0');
this.diagramMap.set('foldingEnabled', (vs != null && !vs.foldingEnabled) ? '0' : '1');
this.diagramMap.set('mathEnabled', (vs != null && vs.mathEnabled) ? '1' : '0');
this.diagramMap.set('pageScale', this.graph.pageScale);
this.diagramMap.set('backgroundImage', (this.graph.backgroundImage != null) ? JSON.stringify(this.graph.backgroundImage) : '');
this.diagramMap.set('backgroundColor', (this.graph.background != null) ? this.graph.background : '');
this.diagramMap.set('pageFormat', this.graph.pageFormat.width + ',' + this.graph.pageFormat.height);
this.diagramMap.set('pageVisible', (vs != null && !vs.pageVisible) ? '0' : '1');
this.diagramMap.set('pageFormat', pf.width + ',' + pf.height);
this.diagramMap.set('backgroundImage', (vs != null && vs.backgroundImage != null) ?
JSON.stringify(vs.backgroundImage) : '');
this.diagramMap.set('backgroundColor', (vs != null && vs.background != null) ?
this.graph.background : '');
}
this.root.set('modifiedDate', new Date().getTime());
@ -968,6 +981,32 @@ RealtimeMapping.prototype.realtimeFoldingEnabledChanged = function(value, quiet)
}
};
/**
* Syncs initial state from collab model to graph model.
*/
RealtimeMapping.prototype.realtimePageVisibleChanged = function(value, quiet)
{
if (!this.isActive())
{
if (this.page.viewState != null)
{
this.page.viewState.pageVisible = value != '0';
}
}
else if (quiet)
{
this.graph.pageVisible = value != '0';
this.graph.pageBreaksVisible = this.graph.pageVisible;
this.graph.preferPageSize = this.graph.pageVisible;
}
else
{
this.driveRealtime.ignorePageVisibleChanged = true;
this.ui.setPageVisible(value != '0');
this.driveRealtime.ignorePageVisibleChanged = false;
}
};
/**
* Syncs initial state from collab model to graph model.
*/

View file

@ -12,6 +12,10 @@
this.addPaletteFunctions('basic', mxResources.get('basic'), false,
[
this.createVertexTemplateEntry('whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Square', null, null, 'square'),
this.createVertexTemplateEntry('ellipse;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Circle', null, null, 'circle'),
this.createVertexTemplateEntry('shape=ext;double=1;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Double Square', null, null, 'double square'),
this.createVertexTemplateEntry('ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Double Circle', null, null, 'double circle'),
this.createVertexTemplateEntry(s2 + '4_point_star', w, h, '', '4 Point Star', null, null, this.getTagsForStencil(gn, '4_point_star', dt).join(' ')),
this.createVertexTemplateEntry(s2 + '6_point_star', w, h * 0.9, '', '6 Point Star', null, null, this.getTagsForStencil(gn, '6_point_star', dt).join(' ')),
this.createVertexTemplateEntry(s2 + '8_point_star', w, h, '', '8 Point Star', null, null, this.getTagsForStencil(gn, '8_point_star', dt).join(' ')),

View file

@ -983,7 +983,8 @@
if (this.editorUi.enableLogging && !this.editorUi.isOffline() && page == 0)
{
var img = new Image();
img.src = 'https://log.draw.io/log?severity=CONFIG&msg=shapesearch:' + encodeURIComponent(searchTerms) + '&v=' + encodeURIComponent(EditorUi.VERSION);
var logDomain = window.DRAWIO_LOG_URL != null ? window.DRAWIO_LOG_URL : '';
img.src = logDomain + '/log?severity=CONFIG&msg=shapesearch:' + encodeURIComponent(searchTerms) + '&v=' + encodeURIComponent(EditorUi.VERSION);
}
success = mxUtils.bind(this, function(results, len, more, terms)

File diff suppressed because one or more lines are too long

View file

@ -156,9 +156,9 @@ Actions.prototype.init = function()
}
};
this.addAction('delete', function()
this.addAction('delete', function(evt)
{
deleteCells(false);
deleteCells(evt != null && mxEvent.isShiftDown(evt));
}, null, null, 'Delete');
this.addAction('deleteAll', function()
{
@ -680,39 +680,7 @@ Actions.prototype.init = function()
action.setSelectedCallback(function() { return graph.scrollbars; });
action = this.addAction('pageView', mxUtils.bind(this, function()
{
var hasScrollbars = mxUtils.hasScrollbars(graph.container);
var tx = 0;
var ty = 0;
if (hasScrollbars)
{
tx = graph.view.translate.x * graph.view.scale - graph.container.scrollLeft;
ty = graph.view.translate.y * graph.view.scale - graph.container.scrollTop;
}
graph.pageVisible = !graph.pageVisible;
graph.pageBreaksVisible = graph.pageVisible;
graph.preferPageSize = graph.pageBreaksVisible;
graph.view.validateBackground();
// Workaround for possible handle offset
if (hasScrollbars)
{
var cells = graph.getSelectionCells();
graph.clearSelection();
graph.setSelectionCells(cells);
}
// Calls updatePageBreaks
graph.sizeDidChange();
if (hasScrollbars)
{
graph.container.scrollLeft = graph.view.translate.x * graph.view.scale - tx;
graph.container.scrollTop = graph.view.translate.y * graph.view.scale - ty;
}
ui.fireEvent(new mxEventObject('pageViewChanged'));
ui.setPageVisible(!graph.pageVisible);
}));
action.setToggleAction(true);
action.setSelectedCallback(function() { return graph.pageVisible; });

View file

@ -475,157 +475,21 @@ var PageSetupDialog = function(editorUi)
row = document.createElement('tr');
td = document.createElement('td');
td.style.verticalAlign = 'top';
td.style.fontSize = '10pt';
mxUtils.write(td, mxResources.get('paperSize') + ':');
row.appendChild(td);
var portraitCheckBox = document.createElement('input');
portraitCheckBox.setAttribute('name', 'format');
portraitCheckBox.setAttribute('type', 'radio');
portraitCheckBox.setAttribute('value', 'portrait');
var landscapeCheckBox = document.createElement('input');
landscapeCheckBox.setAttribute('name', 'format');
landscapeCheckBox.setAttribute('type', 'radio');
landscapeCheckBox.setAttribute('value', 'landscape');
var formatRow = document.createElement('tr');
formatRow.style.display = 'none';
var customRow = document.createElement('tr');
customRow.style.display = 'none';
// Adds all papersize options
var paperSizeSelect = document.createElement('select');
var detected = false;
var pf = new Object();
var formats = PageSetupDialog.getFormats();
for (var i = 0; i < formats.length; i++)
{
var f = formats[i];
pf[f.key] = f;
var paperSizeOption = document.createElement('option');
paperSizeOption.setAttribute('value', f.key);
mxUtils.write(paperSizeOption, f.title);
paperSizeSelect.appendChild(paperSizeOption);
if (f.format != null)
{
if (graph.pageFormat.width == f.format.width && graph.pageFormat.height == f.format.height)
{
paperSizeOption.setAttribute('selected', 'selected');
portraitCheckBox.setAttribute('checked', 'checked');
portraitCheckBox.defaultChecked = true;
formatRow.style.display = '';
detected = true;
}
else if (graph.pageFormat.width == f.format.height && graph.pageFormat.height == f.format.width)
{
paperSizeOption.setAttribute('selected', 'selected');
landscapeCheckBox.setAttribute('checked', 'checked');
portraitCheckBox.defaultChecked = true;
formatRow.style.display = '';
detected = true;
}
}
// Selects custom format which is last in list
else if (!detected)
{
paperSizeOption.setAttribute('selected', 'selected');
customRow.style.display = '';
}
}
td = document.createElement('td');
td.style.verticalAlign = 'top';
td.style.fontSize = '10pt';
td.appendChild(paperSizeSelect);
var accessor = PageSetupDialog.addPageFormatPanel(td, 'pagesetupdialog', graph.pageFormat);
row.appendChild(td);
tbody.appendChild(row);
formatRow = document.createElement('tr');
formatRow.style.height = '40px';
td = document.createElement('td');
formatRow.appendChild(td);
td = document.createElement('td');
td.style.fontSize = '10pt';
td.appendChild(portraitCheckBox);
var span = document.createElement('span');
mxUtils.write(span, ' ' + mxResources.get('portrait'));
td.appendChild(span);
mxEvent.addListener(span, 'click', function(evt)
{
portraitCheckBox.checked = true;
mxEvent.consume(evt);
});
landscapeCheckBox.style.marginLeft = '10px';
td.appendChild(landscapeCheckBox);
var span = document.createElement('span');
mxUtils.write(span, ' ' + mxResources.get('landscape'));
td.appendChild(span);
mxEvent.addListener(span, 'click', function(evt)
{
landscapeCheckBox.checked = true;
mxEvent.consume(evt);
});
formatRow.appendChild(td);
tbody.appendChild(formatRow);
row = document.createElement('tr');
td = document.createElement('td');
customRow.appendChild(td);
td = document.createElement('td');
td.style.fontSize = '10pt';
var widthInput = document.createElement('input');
widthInput.setAttribute('size', '6');
widthInput.setAttribute('value', graph.pageFormat.width);
td.appendChild(widthInput);
mxUtils.write(td, ' x ');
var heightInput = document.createElement('input');
heightInput.setAttribute('size', '6');
heightInput.setAttribute('value', graph.pageFormat.height);
td.appendChild(heightInput);
mxUtils.write(td, ' pt');
customRow.appendChild(td);
customRow.style.height = formatRow.style.height;
tbody.appendChild(customRow);
var updateInputs = function()
{
var f = pf[paperSizeSelect.value];
if (f.format != null)
{
widthInput.value = f.format.width;
heightInput.value = f.format.height;
customRow.style.display = 'none';
formatRow.style.display = '';
}
else
{
formatRow.style.display = 'none';
customRow.style.display = '';
}
};
mxEvent.addListener(paperSizeSelect, 'change', updateInputs);
updateInputs();
row = document.createElement('tr');
td = document.createElement('td');
@ -765,21 +629,7 @@ var PageSetupDialog = function(editorUi)
var applyBtn = mxUtils.button(mxResources.get('apply'), function()
{
editorUi.hideDialog();
var ls = landscapeCheckBox.checked;
var f = pf[paperSizeSelect.value];
var size = f.format;
if (size == null)
{
size = new mxRectangle(0, 0, parseInt(widthInput.value), parseInt(heightInput.value));
}
if (ls)
{
size = new mxRectangle(0, 0, size.height, size.width);
}
editorUi.setPageFormat(size);
editorUi.setPageFormat(accessor.get());
if (graph.background != newBackgroundColor)
{
@ -811,6 +661,234 @@ var PageSetupDialog = function(editorUi)
this.container = table;
};
/**
*
*/
PageSetupDialog.addPageFormatPanel = function(div, namePostfix, pageFormat, pageFormatListener)
{
var formatName = 'format-' + namePostfix;
var portraitCheckBox = document.createElement('input');
portraitCheckBox.setAttribute('name', formatName);
portraitCheckBox.setAttribute('type', 'radio');
portraitCheckBox.setAttribute('value', 'portrait');
var landscapeCheckBox = document.createElement('input');
landscapeCheckBox.setAttribute('name', formatName);
landscapeCheckBox.setAttribute('type', 'radio');
landscapeCheckBox.setAttribute('value', 'landscape');
var paperSizeSelect = document.createElement('select');
paperSizeSelect.style.marginBottom = '8px';
paperSizeSelect.style.width = '202px';
var formatDiv = document.createElement('div');
formatDiv.style.marginLeft = '4px';
formatDiv.style.width = '210px';
formatDiv.style.height = '24px';
portraitCheckBox.style.marginRight = '6px';
formatDiv.appendChild(portraitCheckBox);
var portraitSpan = document.createElement('span');
portraitSpan.style.maxWidth = '100px';
mxUtils.write(portraitSpan, mxResources.get('portrait'));
formatDiv.appendChild(portraitSpan);
landscapeCheckBox.style.marginLeft = '10px';
landscapeCheckBox.style.marginRight = '6px';
formatDiv.appendChild(landscapeCheckBox);
var landscapeSpan = document.createElement('span');
landscapeSpan.style.width = '100px';
mxUtils.write(landscapeSpan, mxResources.get('landscape'));
formatDiv.appendChild(landscapeSpan)
var customDiv = document.createElement('div');
customDiv.style.marginLeft = '4px';
customDiv.style.width = '210px';
customDiv.style.height = '24px';
var widthInput = document.createElement('input');
widthInput.setAttribute('size', '6');
widthInput.setAttribute('value', pageFormat.width);
customDiv.appendChild(widthInput);
mxUtils.write(customDiv, ' x ');
var heightInput = document.createElement('input');
heightInput.setAttribute('size', '6');
heightInput.setAttribute('value', pageFormat.height);
customDiv.appendChild(heightInput);
mxUtils.write(customDiv, ' pt');
formatDiv.style.display = 'none';
customDiv.style.display = 'none';
var pf = new Object();
var formats = PageSetupDialog.getFormats();
for (var i = 0; i < formats.length; i++)
{
var f = formats[i];
pf[f.key] = f;
var paperSizeOption = document.createElement('option');
paperSizeOption.setAttribute('value', f.key);
mxUtils.write(paperSizeOption, f.title);
paperSizeSelect.appendChild(paperSizeOption);
}
var customSize = false;
function listener(sender, evt, force)
{
if (force || (widthInput != document.activeElement && heightInput != document.activeElement))
{
var detected = false;
for (var i = 0; i < formats.length; i++)
{
var f = formats[i];
// Special case where custom was chosen
if (customSize)
{
if (f.key == 'custom')
{
paperSizeSelect.value = f.key;
customSize = false;
}
}
else if (f.format != null)
{
if (pageFormat.width == f.format.width && pageFormat.height == f.format.height)
{
paperSizeSelect.value = f.key;
portraitCheckBox.setAttribute('checked', 'checked');
portraitCheckBox.defaultChecked = true;
portraitCheckBox.checked = true;
landscapeCheckBox.removeAttribute('checked');
landscapeCheckBox.defaultChecked = false;
landscapeCheckBox.checked = false;
detected = true;
}
else if (pageFormat.width == f.format.height && pageFormat.height == f.format.width)
{
paperSizeSelect.value = f.key;
portraitCheckBox.removeAttribute('checked');
portraitCheckBox.defaultChecked = false;
portraitCheckBox.checked = false;
landscapeCheckBox.setAttribute('checked', 'checked');
landscapeCheckBox.defaultChecked = true;
landscapeCheckBox.checked = true;
detected = true;
}
}
}
// Selects custom format which is last in list
if (!detected)
{
widthInput.value = pageFormat.width;
heightInput.value = pageFormat.height;
paperSizeOption.setAttribute('selected', 'selected');
portraitCheckBox.setAttribute('checked', 'checked');
portraitCheckBox.defaultChecked = true;
formatDiv.style.display = 'none';
customDiv.style.display = '';
}
else
{
formatDiv.style.display = '';
customDiv.style.display = 'none';
}
}
};
listener();
div.appendChild(paperSizeSelect);
mxUtils.br(div);
div.appendChild(formatDiv);
div.appendChild(customDiv);
var currentPageFormat = pageFormat;
var update = function()
{
var f = pf[paperSizeSelect.value];
if (f.format != null)
{
widthInput.value = f.format.width;
heightInput.value = f.format.height;
customDiv.style.display = 'none';
formatDiv.style.display = '';
}
else
{
formatDiv.style.display = 'none';
customDiv.style.display = '';
}
var newPageFormat = new mxRectangle(0, 0, parseInt(widthInput.value), parseInt(heightInput.value));
if (paperSizeSelect.value != 'custom' && landscapeCheckBox.checked)
{
newPageFormat = new mxRectangle(0, 0, newPageFormat.height, newPageFormat.width);
}
if (newPageFormat.width != currentPageFormat.width || newPageFormat.height != currentPageFormat.height)
{
currentPageFormat = newPageFormat;
if (pageFormatListener != null)
{
pageFormatListener(currentPageFormat);
}
}
};
mxEvent.addListener(portraitSpan, 'click', function(evt)
{
portraitCheckBox.checked = true;
update();
mxEvent.consume(evt);
});
mxEvent.addListener(landscapeSpan, 'click', function(evt)
{
landscapeCheckBox.checked = true;
update();
mxEvent.consume(evt);
});
mxEvent.addListener(widthInput, 'blur', update);
mxEvent.addListener(widthInput, 'click', update);
mxEvent.addListener(heightInput, 'blur', update);
mxEvent.addListener(heightInput, 'click', update);
mxEvent.addListener(landscapeCheckBox, 'change', update);
mxEvent.addListener(portraitCheckBox, 'change', update);
mxEvent.addListener(paperSizeSelect, 'change', function()
{
// Handles special case where custom was chosen
customSize = paperSizeSelect.value == 'custom';
update();
});
update();
return {set: function(value)
{
pageFormat = value;
listener(null, null, true);
},get: function()
{
return currentPageFormat;
}, widthInput: widthInput,
heightInput: heightInput};
};
/**
*
*/
@ -998,7 +1076,13 @@ PrintDialog.prototype.create = function(editorUi)
autoOrigin = true;
}
return PrintDialog.showPreview(PrintDialog.createPrintPreview(graph, scale, pf, border, x0, y0, autoOrigin, print), print);
var preview = PrintDialog.createPrintPreview(graph, scale, pf, border, x0, y0, autoOrigin);
preview.open();
if (print)
{
PrintDialog.printPreview(preview);
}
};
var cancelBtn = mxUtils.button(mxResources.get('cancel'), function()
@ -1046,17 +1130,15 @@ PrintDialog.prototype.create = function(editorUi)
/**
* Constructs a new print dialog.
*/
PrintDialog.showPreview = function(preview, print)
PrintDialog.printPreview = function(preview)
{
var result = preview.open();
if (print && result != null)
if (preview.wnd != null)
{
var print = function()
var printFn = function()
{
result.focus();
result.print();
result.close();
preview.wnd.focus();
preview.wnd.print();
preview.wnd.close();
};
// Workaround for Google Chrome which needs a bit of a
@ -1064,15 +1146,13 @@ PrintDialog.showPreview = function(preview, print)
// Needs testing in production
if (mxClient.IS_GC)
{
window.setTimeout(print, 500);
window.setTimeout(printFn, 500);
}
else
{
print();
printFn();
}
}
return result;
};
/**

View file

@ -1278,16 +1278,7 @@ EditorUi.prototype.initCanvas = function()
// Initial page layout view, scrollBuffer and timer-based scrolling
var graph = this.editor.graph;
graph.timerAutoScroll = true;
/**
* Specifies the size of the size for "tiles" to be used for a graph with
* scrollbars but no visible background page. A good value is large
* enough to reduce the number of repaints that is caused for auto-
* translation, which depends on this value, and small enough to give
* a small empty buffer around the graph. Default is 400x400.
*/
graph.scrollTileSize = new mxRectangle(0, 0, 400, 400);
/**
* Returns the padding for pages in page view with scrollbars.
*/
@ -1296,47 +1287,6 @@ EditorUi.prototype.initCanvas = function()
return new mxPoint(Math.max(0, Math.round((graph.container.offsetWidth - 34) / graph.view.scale)),
Math.max(0, Math.round((graph.container.offsetHeight - 34) / graph.view.scale)));
};
/**
* Returns the size of the page format scaled with the page size.
*/
graph.getPageSize = function()
{
return (this.pageVisible) ? new mxRectangle(0, 0, this.pageFormat.width * this.pageScale,
this.pageFormat.height * this.pageScale) : this.scrollTileSize;
};
/**
* Returns a rectangle describing the position and count of the
* background pages, where x and y are the position of the top,
* left page and width and height are the vertical and horizontal
* page count.
*/
graph.getPageLayout = function()
{
var size = (this.pageVisible) ? this.getPageSize() : this.scrollTileSize;
var bounds = this.getGraphBounds();
if (bounds.width == 0 || bounds.height == 0)
{
return new mxRectangle(0, 0, 1, 1);
}
else
{
// Computes untransformed graph bounds
var x = Math.ceil(bounds.x / this.view.scale - this.view.translate.x);
var y = Math.ceil(bounds.y / this.view.scale - this.view.translate.y);
var w = Math.floor(bounds.width / this.view.scale);
var h = Math.floor(bounds.height / this.view.scale);
var x0 = Math.floor(x / size.width);
var y0 = Math.floor(y / size.height);
var w0 = Math.ceil((x + w) / size.width) - x0;
var h0 = Math.ceil((y + h) / size.height) - y0;
return new mxRectangle(x0, y0, w0, h0);
}
};
// Fits the number of background pages to the graph
graph.view.getBackgroundPageBounds = function()
@ -2356,6 +2306,22 @@ EditorUi.prototype.resetScrollbars = function()
var pad = graph.getPagePadding();
graph.container.scrollTop = Math.floor(pad.y - this.editor.initialTopSpacing);
graph.container.scrollLeft = Math.floor(Math.min(pad.x, (graph.container.scrollWidth - graph.container.clientWidth) / 2));
// Scrolls graph to visible area
var bounds = graph.getGraphBounds();
if (bounds.width > 0 && bounds.height > 0)
{
if (bounds.x > graph.container.scrollLeft + graph.container.clientWidth * 0.9)
{
graph.container.scrollLeft = Math.min(bounds.x + bounds.width - graph.container.clientWidth, bounds.x - 10);
}
if (bounds.y > graph.container.scrollTop + graph.container.clientHeight * 0.9)
{
graph.container.scrollTop = Math.min(bounds.y + bounds.height - graph.container.clientHeight, bounds.y - 10);
}
}
}
else
{
@ -2385,6 +2351,47 @@ EditorUi.prototype.resetScrollbars = function()
}
};
/**
* Loads the stylesheet for this graph.
*/
EditorUi.prototype.setPageVisible = function(value)
{
var graph = this.editor.graph;
var hasScrollbars = mxUtils.hasScrollbars(graph.container);
var tx = 0;
var ty = 0;
if (hasScrollbars)
{
tx = graph.view.translate.x * graph.view.scale - graph.container.scrollLeft;
ty = graph.view.translate.y * graph.view.scale - graph.container.scrollTop;
}
graph.pageVisible = value;
graph.pageBreaksVisible = value;
graph.preferPageSize = value;
graph.view.validateBackground();
// Workaround for possible handle offset
if (hasScrollbars)
{
var cells = graph.getSelectionCells();
graph.clearSelection();
graph.setSelectionCells(cells);
}
// Calls updatePageBreaks
graph.sizeDidChange();
if (hasScrollbars)
{
graph.container.scrollLeft = graph.view.translate.x * graph.view.scale - tx;
graph.container.scrollTop = graph.view.translate.y * graph.view.scale - ty;
}
this.fireEvent(new mxEventObject('pageViewChanged'));
};
/**
* Loads the stylesheet for this graph.
*/

View file

@ -4623,210 +4623,29 @@ DiagramFormatPanel.prototype.addPaperSize = function(div)
var graph = editor.graph;
div.appendChild(this.createTitle(mxResources.get('paperSize')));
var portraitCheckBox = document.createElement('input');
portraitCheckBox.setAttribute('name', 'format');
portraitCheckBox.setAttribute('type', 'radio');
portraitCheckBox.setAttribute('value', 'portrait');
var landscapeCheckBox = document.createElement('input');
landscapeCheckBox.setAttribute('name', 'format');
landscapeCheckBox.setAttribute('type', 'radio');
landscapeCheckBox.setAttribute('value', 'landscape');
var paperSizeSelect = document.createElement('select');
paperSizeSelect.style.marginBottom = '8px';
paperSizeSelect.style.width = '202px';
var formatDiv = document.createElement('div');
formatDiv.style.marginLeft = '4px';
formatDiv.style.width = '210px';
formatDiv.style.height = '24px';
portraitCheckBox.style.marginRight = '6px';
formatDiv.appendChild(portraitCheckBox);
var portraitSpan = document.createElement('span');
portraitSpan.style.maxWidth = '100px';
mxUtils.write(portraitSpan, mxResources.get('portrait'));
formatDiv.appendChild(portraitSpan);
landscapeCheckBox.style.marginLeft = '10px';
landscapeCheckBox.style.marginRight = '6px';
formatDiv.appendChild(landscapeCheckBox);
var landscapeSpan = document.createElement('span');
landscapeSpan.style.width = '100px';
mxUtils.write(landscapeSpan, mxResources.get('landscape'));
formatDiv.appendChild(landscapeSpan)
var customDiv = document.createElement('div');
customDiv.style.marginLeft = '4px';
customDiv.style.width = '210px';
customDiv.style.height = '24px';
var widthInput = document.createElement('input');
widthInput.setAttribute('size', '6');
widthInput.setAttribute('value', graph.pageFormat.width);
customDiv.appendChild(widthInput);
mxUtils.write(customDiv, ' x ');
var heightInput = document.createElement('input');
heightInput.setAttribute('size', '6');
heightInput.setAttribute('value', graph.pageFormat.height);
customDiv.appendChild(heightInput);
mxUtils.write(customDiv, ' pt');
formatDiv.style.display = 'none';
customDiv.style.display = 'none';
var pf = new Object();
var formats = PageSetupDialog.getFormats();
for (var i = 0; i < formats.length; i++)
var accessor = PageSetupDialog.addPageFormatPanel(div, 'formatpanel', graph.pageFormat, function(pageFormat)
{
var f = formats[i];
pf[f.key] = f;
var paperSizeOption = document.createElement('option');
paperSizeOption.setAttribute('value', f.key);
mxUtils.write(paperSizeOption, f.title);
paperSizeSelect.appendChild(paperSizeOption);
}
var customSize = false;
function listener(sender, evt, force)
{
if (force || (widthInput != document.activeElement && heightInput != document.activeElement))
if (graph.pageFormat == null || graph.pageFormat.width != pageFormat.width || graph.pageFormat.height != pageFormat.height)
{
var detected = false;
for (var i = 0; i < formats.length; i++)
{
var f = formats[i];
// Special case where custom was chosen
if (customSize)
{
if (f.key == 'custom')
{
paperSizeSelect.value = f.key;
customSize = false;
}
}
else if (f.format != null)
{
if (graph.pageFormat.width == f.format.width && graph.pageFormat.height == f.format.height)
{
paperSizeSelect.value = f.key;
portraitCheckBox.setAttribute('checked', 'checked');
portraitCheckBox.defaultChecked = true;
portraitCheckBox.checked = true;
landscapeCheckBox.removeAttribute('checked');
landscapeCheckBox.defaultChecked = false;
landscapeCheckBox.checked = false;
detected = true;
}
else if (graph.pageFormat.width == f.format.height && graph.pageFormat.height == f.format.width)
{
paperSizeSelect.value = f.key;
portraitCheckBox.removeAttribute('checked');
portraitCheckBox.defaultChecked = false;
portraitCheckBox.checked = false;
landscapeCheckBox.setAttribute('checked', 'checked');
landscapeCheckBox.defaultChecked = true;
landscapeCheckBox.checked = true;
detected = true;
}
}
}
// Selects custom format which is last in list
if (!detected)
{
widthInput.value = graph.pageFormat.width;
heightInput.value = graph.pageFormat.height;
paperSizeOption.setAttribute('selected', 'selected');
portraitCheckBox.setAttribute('checked', 'checked');
portraitCheckBox.defaultChecked = true;
formatDiv.style.display = 'none';
customDiv.style.display = '';
}
else
{
formatDiv.style.display = '';
customDiv.style.display = 'none';
}
ui.setPageFormat(pageFormat);
}
});
this.addKeyHandler(accessor.widthInput, function()
{
console.log('here', graph.pageFormat);
accessor.set(graph.pageFormat);
});
- this.addKeyHandler(accessor.heightInput, function()
{
accessor.set(graph.pageFormat);
});
var listener = function()
{
accessor.set(graph.pageFormat);
};
listener();
div.appendChild(paperSizeSelect);
mxUtils.br(div);
div.appendChild(formatDiv);
div.appendChild(customDiv);
var update = function()
{
var f = pf[paperSizeSelect.value];
if (f.format != null)
{
widthInput.value = f.format.width;
heightInput.value = f.format.height;
customDiv.style.display = 'none';
formatDiv.style.display = '';
}
else
{
formatDiv.style.display = 'none';
customDiv.style.display = '';
}
var size = new mxRectangle(0, 0, parseInt(widthInput.value), parseInt(heightInput.value));
if (paperSizeSelect.value != 'custom' && landscapeCheckBox.checked)
{
size = new mxRectangle(0, 0, size.height, size.width);
}
if (graph.pageFormat == null || graph.pageFormat.width != size.width || graph.pageFormat.height != size.height)
{
ui.setPageFormat(size);
}
};
this.addKeyHandler(widthInput, listener);
this.addKeyHandler(heightInput, listener);
mxEvent.addListener(portraitSpan, 'click', function(evt)
{
portraitCheckBox.checked = true;
update();
mxEvent.consume(evt);
});
mxEvent.addListener(landscapeSpan, 'click', function(evt)
{
landscapeCheckBox.checked = true;
update();
mxEvent.consume(evt);
});
mxEvent.addListener(widthInput, 'blur', update);
mxEvent.addListener(widthInput, 'click', update);
mxEvent.addListener(heightInput, 'blur', update);
mxEvent.addListener(heightInput, 'click', update);
mxEvent.addListener(landscapeCheckBox, 'change', update);
mxEvent.addListener(portraitCheckBox, 'change', update);
mxEvent.addListener(paperSizeSelect, 'change', function()
{
// Handles special case where custom was chosen
customSize = paperSizeSelect.value == 'custom';
update();
});
ui.addListener('pageFormatChanged', listener);
this.listeners.push({destroy: function() { ui.removeListener(listener); }});
@ -4834,8 +4653,6 @@ DiagramFormatPanel.prototype.addPaperSize = function(div)
graph.getModel().addListener(mxEvent.CHANGE, listener);
this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
update();
return div;
};

File diff suppressed because one or more lines are too long

View file

@ -94,8 +94,7 @@ Sidebar.prototype.init = function()
this.addGeneralPalette(true);
this.addMiscPalette(false);
this.addAdvancedPalette(false);
this.addStencilPalette('basic', mxResources.get('basic'), dir + '/basic.xml',
';whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2');
this.addBasicPalette(dir);
this.addStencilPalette('arrows', mxResources.get('arrows'), dir + '/arrows.xml',
';whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2');
this.addUmlPalette(false);
@ -358,7 +357,7 @@ Sidebar.prototype.showTooltip = function(elt, cells, w, h, title, showLabel)
var b = document.body;
var d = document.documentElement;
var bottom = b.clientHeight || d.clientHeight;
var bottom = Math.max(b.clientHeight || 0, d.clientHeight);
var left = this.container.clientWidth + this.editorUi.splitSize + 3 + this.editorUi.container.offsetLeft;
var top = Math.min(bottom - height - 20 /*status bar*/, Math.max(0, (this.editorUi.container.offsetTop +
@ -380,7 +379,7 @@ Sidebar.prototype.showTooltip = function(elt, cells, w, h, title, showLabel)
this.graph2.view.drawPane.style.left = x0 + 'px';
this.graph2.view.drawPane.style.top = y0 + 'px';
}
// Workaround for ignored position CSS style in IE9
// (changes to relative without the following line)
this.tooltip.style.position = 'absolute';
@ -898,6 +897,21 @@ Sidebar.prototype.addGeneralPalette = function(expand)
this.addPaletteFunctions('general', mxResources.get('general'), (expand != null) ? expand : true, fns);
};
/**
* Adds the general palette to the sidebar.
*/
Sidebar.prototype.addBasicPalette = function(dir)
{
this.addStencilPalette('basic', mxResources.get('basic'), dir + '/basic.xml',
';whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2',
null, null, null, null, [
this.createVertexTemplateEntry('whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Square', null, null, 'square'),
this.createVertexTemplateEntry('ellipse;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Circle', null, null, 'circle'),
this.createVertexTemplateEntry('shape=ext;double=1;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Double Square', null, null, 'double square'),
this.createVertexTemplateEntry('ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Double Circle', null, null, 'double circle')
]);
};
/**
* Adds the general palette to the sidebar.
*/
@ -960,12 +974,6 @@ Sidebar.prototype.addMiscPalette = function(expand)
return this.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Variable');
})),
this.createVertexTemplateEntry('shape=umlActor;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;html=1;', 30, 60, 'Actor', 'Actor', false, null, 'user person human stickman'),
// Entries for top searches
this.createVertexTemplateEntry('whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Square', null, null, 'square'),
this.createVertexTemplateEntry('ellipse;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Circle', null, null, 'circle'),
this.createVertexTemplateEntry('shape=ext;double=1;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Double Square', null, null, 'double square'),
this.createVertexTemplateEntry('ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Double Circle', null, null, 'double circle'),
// End of entries for top searches
this.createVertexTemplateEntry('html=1;whiteSpace=wrap;comic=1;strokeWidth=2;fontFamily=Comic Sans MS;fontStyle=1;', 120, 60, 'RECTANGLE', 'Comic Rectangle', true, null, 'comic rectangle rect box text retro'),
this.createVertexTemplateEntry('rhombus;html=1;align=center;whiteSpace=wrap;comic=1;strokeWidth=2;fontFamily=Comic Sans MS;fontStyle=1;', 100, 100, 'DIAMOND', 'Comic Diamond', true, null, 'comic diamond rhombus if condition decision conditional question test retro'),
this.createEdgeTemplateEntry('edgeStyle=segmentEdgeStyle;rounded=0;comic=1;strokeWidth=2;endArrow=blockThin;html=1;fontFamily=Comic Sans MS;fontStyle=1;', 50, 50, '', 'Comic Arrow 1'),
@ -3347,14 +3355,22 @@ Sidebar.prototype.getTagsForStencil = function(packageName, stencilName, moreTag
/**
* Adds the given stencil palette.
*/
Sidebar.prototype.addStencilPalette = function(id, title, stencilFile, style, ignore, onInit, scale, tags)
Sidebar.prototype.addStencilPalette = function(id, title, stencilFile, style, ignore, onInit, scale, tags, customFns)
{
scale = (scale != null) ? scale : 1;
if (this.addStencilsToIndex)
{
// LATER: Handle asynchronous loading dependency
var fns = [];
if (customFns != null)
{
for (var i = 0; i < customFns.length; i++)
{
fns.push(customFns[i]);
}
}
mxStencilRegistry.loadStencilSet(stencilFile, mxUtils.bind(this, function(packageName, stencilName, displayName, w, h)
{
@ -3389,7 +3405,15 @@ Sidebar.prototype.addStencilPalette = function(id, title, stencilFile, style, ig
{
onInit.call(this, content);
}
if (customFns != null)
{
for (var i = 0; i < customFns.length; i++)
{
customFns[i](content);
}
}
mxStencilRegistry.loadStencilSet(stencilFile, mxUtils.bind(this, function(packageName, stencilName, displayName, w, h)
{
if (ignore == null || mxUtils.indexOf(ignore, stencilName) < 0)

597
war/js/reader.min.js vendored

File diff suppressed because one or more lines are too long

1602
war/js/viewer.min.js vendored

File diff suppressed because one or more lines are too long

175
war/plugins/find.js Normal file
View file

@ -0,0 +1,175 @@
/**
* Explore plugin.
*/
Draw.loadPlugin(function(ui)
{
var div = document.createElement('div');
div.style.userSelect = 'none';
div.style.overflow = 'hidden';
div.style.padding = '10px';
div.style.height = '100%';
var graph = ui.editor.graph;
var lastFound = null;
mxUtils.write(div, 'Find:');
mxUtils.br(div);
var searchInput = document.createElement('input');
searchInput.setAttribute('type', 'text');
searchInput.style.marginTop = '4px';
searchInput.style.width = '170px';
div.appendChild(searchInput);
var tmp = document.createElement('div');
function search(next)
{
var cells = graph.model.getDescendants(graph.model.getRoot());
var search = searchInput.value.toLowerCase();
var active = !next || lastFound == null;
var firstMatch = null;
if (search.length > 0)
{
for (var i = 0; i < cells.length; i++)
{
var state = graph.view.getState(cells[i]);
if (state != null && (active || firstMatch == null) &&
graph.model.isVertex(state.cell) || graph.model.isEdge(state.cell))
{
if (graph.isHtmlLabel(state.cell))
{
tmp.innerHTML = graph.getLabel(state.cell);
label = mxUtils.extractTextWithWhitespace([tmp]);
}
else
{
label = graph.getLabel(state.cell);
}
label = mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g, ' ')).toLowerCase();
if (label.substring(0, search.length) == search)
{
if (active)
{
firstMatch = state;
break;
}
else if (firstMatch == null)
{
firstMatch = state;
}
}
}
active = active || state == lastFound;
}
}
if (firstMatch != null)
{
lastFound = firstMatch;
graph.setSelectionCell(lastFound.cell);
graph.scrollCellToVisible(lastFound.cell);
}
else
{
graph.clearSelection();
}
return search.length == 0 || firstMatch != null;
};
mxUtils.br(div);
var resetBtn = mxUtils.button(mxResources.get('reset'), function()
{
searchInput.value = '';
searchInput.style.backgroundColor = '';
lastFound = null;
searchInput.focus();
});
resetBtn.style.marginTop = '8px';
resetBtn.style.marginRight = '4px';
resetBtn.style.padding = '4px';
div.appendChild(resetBtn);
var btn = mxUtils.button('Find Again', function()
{
searchInput.style.backgroundColor = search(true) ? '' : '#ffcfcf';
});
btn.style.marginTop = '8px';
btn.style.padding = '4px';
div.appendChild(btn);
mxEvent.addListener(searchInput, 'keyup', function(evt)
{
searchInput.style.backgroundColor = search(evt.keyCode == 13) ? '' : '#ffcfcf';
});
var wnd = new mxWindow('Find', div, document.body.offsetWidth - 300, 140, 200, 120, true, true);
wnd.destroyOnClose = false;
wnd.setMaximizable(false);
wnd.setResizable(false);
wnd.setClosable(true);
// Extends Extras menu
mxResources.parse('find=Find');
// Adds action
ui.actions.addAction('find...', function()
{
wnd.setVisible(!wnd.isVisible());
if (wnd.isVisible())
{
searchInput.focus();
if (mxClient.IS_FF || document.documentMode >= 5 || mxClient.IS_QUIRKS)
{
searchInput.select();
}
else
{
document.execCommand('selectAll', false, null);
}
}
else
{
graph.container.focus();
}
}, null, null, 'Ctrl+Space');
var menu = ui.menus.get('edit');
var oldFunct = menu.funct;
menu.funct = function(menu, parent)
{
oldFunct.apply(this, arguments);
ui.menus.addMenuItems(menu, ['-', 'find'], parent);
};
var findAction = ui.actions.get('find');
var keyHandlerKeyDown = ui.keyHandler.keyDown;
ui.keyHandler.keyDown = function(evt)
{
if (evt.keyCode == 32 && mxEvent.isControlDown(evt))
{
findAction.funct();
mxEvent.consume(evt);
}
else
{
return keyHandlerKeyDown.apply(this, arguments);
}
};
});

View file

@ -22,7 +22,10 @@ Draw.loadPlugin(function(ui)
var graph = ui.editor.graph;
var wnd = new mxWindow(mxResources.get('insertTable'), div, document.body.offsetWidth - 480, 140,
// Extends Extras menu
mxResources.parse('fromSql=From SQL');
var wnd = new mxWindow(mxResources.get('fromSql'), div, document.body.offsetWidth - 480, 140,
320, 300, true, true);
wnd.destroyOnClose = false;
wnd.setMaximizable(false);
@ -131,7 +134,7 @@ Draw.loadPlugin(function(ui)
resetBtn.style.padding = '4px';
div.appendChild(resetBtn);
var btn = mxUtils.button(mxResources.get('close'), function()
var btn = mxUtils.button(mxResources.get('cancel'), function()
{
wnd.setVisible(false);
});
@ -150,9 +153,6 @@ Draw.loadPlugin(function(ui)
btn.style.padding = '4px';
div.appendChild(btn);
// Extends Extras menu
mxResources.parse('fromSql=From SQL');
// Adds action
ui.actions.addAction('fromSql', function()
{

View file

@ -15,7 +15,7 @@ advanced=Расширенные
align=Выровнять
alignment=Выравнивание
allChangesLost=Все изменения будут потеряны!
allPages=All Pages
allPages=Все страницы
android=Android
angle=Угол
areYouSure=Вы уверены?
@ -461,7 +461,7 @@ position=Положение
posterPrint=Печать постера
preferences=Предпочтения
preview=Просмотр
previousPage=Previous Page
previousPage=Предыдущая страница
print=Печать
printAllPages=Пачать всех страниц
procEng=Техн. процессы
@ -536,7 +536,7 @@ sendMessage=Отправить
sendYourFeedbackToDrawIo=Отправьте ваш отзыв о draw.io
serviceUnavailableOrBlocked=Служба недоступна или заблокирована
sessionExpired=Время вашей сессии истекло. Пожалуйста, обновите окно браузера.
sessionTimeoutOnSave=Ваша сессия истекла и вы были отключены от Google Drive. Нажмите ОК для того чтобы войти снова и сохранить изменения.
sessionTimeoutOnSave=Время вашей сессии истекло и вы были отключены от Google Drive. Нажмите ОК для того чтобы войти снова и сохранить изменения.
setAsDefaultStyle=Установить как стиль по умолчанию
shadow=Тень
shape=Фигура
@ -544,9 +544,9 @@ shapes=Фигуры
share=Общий доступ
shareLink=Ссылка для совместного редактирования
sharp=Без скругления
show=Show
showStartScreen=Show Start Screen
sidebarTooltip=Click to expand. Drag and drop shapes into the diagram. Shift+click to change selection. Alt+click to insert and connect.
show=Показать
showStartScreen=Начальный экран
sidebarTooltip=Нажмите чтобы развернуть. Переместите фигуры на диаграмму. Нажмите, удерживая нажатым Shift, чтобы изменить выделение. Нажмите, удерживая нажатым Alt, чтобы вставить фигуру и нарисовать связь
signs=Знаки и символы
signOut=Выйти
simple=Simple

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB