@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
1 lines • 28.8 kB
JavaScript
var mxIOS7C={MAIN_TEXT:"mainText",SUB_TEXT:"subText",TEXT_COLOR:"textColor",TEXT_SIZE:"textSize",BAR_POS:"barPos",BUTTON_TEXT:"buttonText",BUTTON_STATE:"buttonState",SELECTED:"+",STATE_ON:"on",STATE_OFF:"off",GRID_SIZE:"gridSize",SHAPE_IOS7_APP_BAR:"mxgraph.ios7ui.appBar",SHAPE_IOS7_ON_OFF_BUTTON:"mxgraph.ios7ui.onOffButton",SHAPE_IOS7_SLIDER:"mxgraph.ios7ui.slider",SHAPE_IOS7_DOWNLOAD_BAR:"mxgraph.ios7ui.downloadBar",SHAPE_IOS7_ICON:"mxgraph.ios7ui.icon",SHAPE_IOS7_HOR_BUTTON_BAR:"mxgraph.ios7ui.horButtonBar",SHAPE_IOS7_PAGE_CONTROL:"mxgraph.ios7ui.pageControl",SHAPE_IOS7_EXPAND:"mxgraph.ios7ui.expand",SHAPE_IOS7_ICON_GRID:"mxgraph.ios7ui.iconGrid",SHAPE_IOS7_PHONE:"mxgraph.ios7ui.phone",SHAPE_IOS7_SEARCH_BOX:"mxgraph.ios7ui.searchBox",SHAPE_IOS7_URL:"mxgraph.ios7ui.url",SHAPE_IOS7_ACTION_DIALOG:"mxgraph.ios7ui.actionDialog",STYLE_FILLCOLOR2:"fillColor2",STYLE_FILLCOLOR3:"fillColor3",STYLE_TEXTCOLOR:"textColor",STYLE_TEXTCOLOR2:"textColor2",STYLE_STROKECOLOR2:"strokeColor2",STYLE_STROKECOLOR3:"strokeColor3",STYLE_TEXTSIZE:"textSize"};function mxShapeIOS7AppBar(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7OnOffButton(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7Slider(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1,this.barPos=80}function mxShapeIOS7DownloadBar(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1,this.barPos=80}function mxShapeIOS7Icon(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7horButtonBar(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7pageControl(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7iconGrid(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7phone(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7searchBox(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7URL(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7Actiondialog(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7Anchor(t,e,o,a){mxShape.call(this),this.bounds=t}function mxShapeIOS7RRect(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7LeftButton(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7RightButton(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7TopButton(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7BottomButton(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7HorLines(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7MarginRect(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7Callout(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}function mxShapeIOS7SelectBar(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1,this.dy=.5,this.dx=.5,this.dx2=70,this.size=10}function mxShapeIOS7Slider2(t,e,o,a){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=o,this.strokewidth=null!=a?a:1}mxUtils.extend(mxShapeIOS7AppBar,mxShape),mxShapeIOS7AppBar.prototype.customProperties=[{name:"fillColor2",dispName:"Fill Color 2",type:"color"}],mxShapeIOS7AppBar.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),this.background(t,e,o,a,i),t.setShadow(!1),this.foreground(t,e,o,a,i)},mxShapeIOS7AppBar.prototype.background=function(t,e,o,a,i){t.rect(0,0,a,i),t.fill()},mxShapeIOS7AppBar.prototype.foreground=function(t,e,o,a,i){t.setFillColor(mxUtils.getValue(this.style,mxIOS7C.STYLE_FILLCOLOR2,"#222222")),t.ellipse(5,.5*i-1.5,3,3),t.fill(),t.ellipse(9,.5*i-1.5,3,3),t.fill(),t.ellipse(13,.5*i-1.5,3,3),t.fill(),t.ellipse(17,.5*i-1.5,3,3),t.fill(),t.ellipse(21,.5*i-1.5,3,3),t.fill(),t.ellipse(54,.5*i+2,2,2),t.fillAndStroke(),t.setStrokeWidth(2),t.begin(),t.moveTo(52,.5*i+1),t.arcTo(3.5,3.5,0,0,1,58,.5*i+1),t.stroke(),t.begin(),t.moveTo(50,.5*i-1),t.arcTo(6,6,0,0,1,60,.5*i-1),t.stroke(),t.begin(),t.moveTo(a-19,.5*i-2),t.lineTo(a-6,.5*i-2),t.lineTo(a-6,.5*i+2),t.lineTo(a-19,.5*i+2),t.close(),t.fill(),t.setStrokeWidth(1),t.begin(),t.moveTo(a-44,.5*i-2.5),t.lineTo(a-36,.5*i+2.5),t.lineTo(a-40,.5*i+5),t.lineTo(a-40,.5*i-5),t.lineTo(a-36,.5*i-2.5),t.lineTo(a-44,.5*i+2.5),t.stroke(),t.begin(),t.moveTo(a-20,.5*i-3),t.lineTo(a-5,.5*i-3),t.lineTo(a-5,.5*i-1),t.lineTo(a-3.5,.5*i-1),t.lineTo(a-3.5,.5*i+1),t.lineTo(a-5,.5*i+1),t.lineTo(a-5,.5*i+3),t.lineTo(a-20,.5*i+3),t.close(),t.stroke()},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_APP_BAR,mxShapeIOS7AppBar),mxUtils.extend(mxShapeIOS7OnOffButton,mxShape),mxShapeIOS7OnOffButton.prototype.customProperties=[{name:"buttonState",dispName:"Button State",type:"enum",enumList:[{val:"on",dispName:"On"},{val:"off",dispName:"Off"}]},{name:"strokeColor2",dispName:"Stroke Color 2",type:"color"},{name:"fillColor2",dispName:"Fill Color 2",type:"color"}],mxShapeIOS7OnOffButton.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),a=Math.max(a,2*i);var l=mxUtils.getValue(this.style,mxIOS7C.BUTTON_STATE,mxIOS7C.STATE_ON);this.background(t,e,o,a,i,l),t.setShadow(!1),this.foreground(t,e,o,a,i,l)},mxShapeIOS7OnOffButton.prototype.background=function(t,e,o,a,i,l){l===mxIOS7C.STATE_ON?(t.roundrect(0,0,a,i,.5*i,.5*i),t.fillAndStroke()):l===mxIOS7C.STATE_OFF&&(t.setStrokeColor(mxUtils.getValue(this.style,mxIOS7C.STYLE_STROKECOLOR2,"#aaaaaa")),t.setFillColor(mxUtils.getValue(this.style,mxIOS7C.STYLE_FILLCOLOR2,"#ffffff")),t.roundrect(0,0,a,i,.5*i,.5*i),t.fillAndStroke())},mxShapeIOS7OnOffButton.prototype.foreground=function(t,e,o,a,i,l){t.setFillColor("#ffffff"),l===mxIOS7C.STATE_ON?(t.ellipse(a-i+1,1,i-2,i-2),t.fill()):(t.ellipse(0,0,i,i),t.stroke())},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_ON_OFF_BUTTON,mxShapeIOS7OnOffButton),mxUtils.extend(mxShapeIOS7Slider,mxShape),mxShapeIOS7Slider.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),t.setShadow(!1),this.foreground(t,a,i)},mxShapeIOS7Slider.prototype.foreground=function(t,e,o){t.setStrokeWidth(2),t.begin(),t.moveTo(0,.5*o),t.lineTo(e,.5*o),t.stroke();var a=mxUtils.getValue(this.style,mxIOS7C.BAR_POS,"80");a=Math.min(a,100);var i=0+(e-0)*(a=Math.max(a,0))/100;t.setStrokeColor(mxUtils.getValue(this.style,mxIOS7C.STYLE_STROKECOLOR2,"#a0a0a0")),t.ellipse(i-5,.5*o-5,10,10),t.fillAndStroke()},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_SLIDER,mxShapeIOS7Slider),Graph.handleFactory[mxIOS7C.SHAPE_IOS7_SLIDER]=function(t){return[Graph.createHandle(t,["barPos"],(function(t){var e=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"barPos",this.barPos))));return new mxPoint(t.x+e/100*t.width,t.y+t.height/2)}),(function(t,e){this.state.style.barPos=Math.round(1e3*Math.max(0,Math.min(100,100*(e.x-t.x)/t.width)))/1e3}))]},mxUtils.extend(mxShapeIOS7DownloadBar,mxShape),mxShapeIOS7DownloadBar.prototype.customProperties=[{name:"barPos",dispName:"Handle Position",type:"float",min:0,max:1,defVal:30},{name:"strokeColor2",dispName:"Stroke Color 2",type:"color"}],mxShapeIOS7DownloadBar.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),this.foreground(t,a,i)},mxShapeIOS7DownloadBar.prototype.foreground=function(t,e,o){var a=mxUtils.getValue(this.style,mxIOS7C.BUTTON_TEXT,"");t.setFontStyle(mxConstants.FONT_BOLD),t.text(.5*e,.2*o,0,0,a,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0);var i=mxUtils.getValue(this.style,mxIOS7C.BAR_POS,"80");i=Math.min(i,100);var l=e*(i=Math.max(i,0))/100;t.setStrokeWidth(2),t.setStrokeColor(mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"")),t.begin(),t.moveTo(0,.5*o),t.lineTo(e,.5*o),t.stroke(),t.setStrokeColor(mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"")),t.begin(),t.moveTo(0,.5*o),t.lineTo(l,.5*o),t.stroke()},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_DOWNLOAD_BAR,mxShapeIOS7DownloadBar),Graph.handleFactory[mxIOS7C.SHAPE_IOS7_DOWNLOAD_BAR]=function(t){return[Graph.createHandle(t,["barPos"],(function(t){var e=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"barPos",this.barPos))));return new mxPoint(t.x+e/100*t.width,t.y+t.height/2)}),(function(t,e){this.state.style.barPos=Math.round(1e3*Math.max(0,Math.min(100,100*(e.x-t.x)/t.width)))/1e3}))]},mxUtils.extend(mxShapeIOS7Icon,mxShape),mxShapeIOS7Icon.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),this.foreground(t,a,i)},mxShapeIOS7Icon.prototype.foreground=function(t,e,o){t.setGradient("#00D0F0","#0080F0",.325*e,0,.675*e,.5*o,mxConstants.DIRECTION_SOUTH,1,1),t.roundrect(0,0,e,o,.1*e,.1*o),t.fill();var a=mxUtils.getValue(this.style,mxIOS7C.BUTTON_TEXT,"");t.setFontColor("#ffffff"),t.setFontStyle(mxConstants.FONT_BOLD),t.setFontSize(8),t.text(.5*e,.5*o,0,0,a,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_ICON,mxShapeIOS7Icon),mxUtils.extend(mxShapeIOS7horButtonBar,mxShape),mxShapeIOS7horButtonBar.prototype.paintVertexShape=function(t,e,o,a,i){for(var l=mxUtils.getValue(this.style,mxIOS7C.BUTTON_TEXT,"+Button 1, Button 2, Button 3").toString().split(","),r=mxUtils.getValue(this.style,mxIOS7C.STYLE_TEXTCOLOR,"#666666"),s=mxUtils.getValue(this.style,mxIOS7C.STYLE_TEXTCOLOR2,"#ffffff"),n=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"8.5").toString(),S=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#666666"),h=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),p=mxUtils.getValue(this.style,mxIOS7C.STYLE_FILLCOLOR2,"#008cff"),m=l.length,x=new Array(m),O=0,u=-1,c=0;c<m;c++){var T=l[c];T.charAt(0)===mxIOS7C.SELECTED&&(T=l[c].substring(1),u=c),x[c]=mxUtils.getSizeForString(T,n,mxConstants.DEFAULT_FONTFAMILY).width,O+=x[c]}var I=Math.max(i,1.5*n,10),d=5*m+O,f=Math.max(a,d);t.translate(e,o),this.background(t,f,I,2.5,m,x,2.5,d,S,h,p,u),t.setShadow(!1);var g=0;for(c=0;c<m;c++)c===u?t.setFontColor(s):t.setFontColor(r),g+=2.5,this.buttonText(t,g,I,l[c],x[c],n,d,f),g=g+x[c]+2.5},mxShapeIOS7horButtonBar.prototype.background=function(t,e,o,a,i,l,r,s,n,S,h,p){t.begin(),t.setStrokeColor(n),t.setFillColor(S),t.moveTo(0,a),t.arcTo(a,a,0,0,1,a,0),t.lineTo(e-a,0),t.arcTo(a,a,0,0,1,e,a),t.lineTo(e,o-a),t.arcTo(a,a,0,0,1,e-a,o),t.lineTo(a,o),t.arcTo(a,a,0,0,1,0,o-a),t.close(),t.fillAndStroke(),t.setStrokeColor(n),t.begin();for(var m=1;m<i;m++)if(m!==p&&m!==p+1){for(var x=0,O=0;O<m;O++)x+=l[O]+2*r;x=x*e/s,t.moveTo(x,0),t.lineTo(x,o)}t.stroke();var u=0;for(t.setStrokeColor(mxConstants.NONE),m=0;m<p;m++)u+=l[m]+2*r;u=u*e/s;var c=(l[p]+2*r)*e/s;c+=u,t.setFillColor("#0080F0"),0===p?(t.begin(),t.moveTo(0,a),t.arcTo(a,a,0,0,1,a,0),t.lineTo(c,0),t.lineTo(c,o),t.lineTo(a,o),t.arcTo(a,a,0,0,1,0,o-a),t.close(),t.fill()):p===i-1?(t.begin(),t.moveTo(u,0),t.lineTo(c-a,0),t.arcTo(a,a,0,0,1,c,a),t.lineTo(c,o-a),t.arcTo(a,a,0,0,1,c-a,o),t.lineTo(u,o),t.close(),t.fill()):-1!==p&&(t.begin(),t.moveTo(u,0),t.lineTo(c,0),t.lineTo(c,o),t.lineTo(u,o),t.close(),t.fill()),t.setStrokeColor(n),t.setFillColor(S),t.begin(),t.moveTo(0,a),t.arcTo(a,a,0,0,1,a,0),t.lineTo(e-a,0),t.arcTo(a,a,0,0,1,e,a),t.lineTo(e,o-a),t.arcTo(a,a,0,0,1,e-a,o),t.lineTo(a,o),t.arcTo(a,a,0,0,1,0,o-a),t.close(),t.stroke()},mxShapeIOS7horButtonBar.prototype.buttonText=function(t,e,o,a,i,l,r,s){a.charAt(0)===mxIOS7C.SELECTED&&(a=a.substring(1)),t.begin(),t.setFontSize(l),t.text((e+.5*i)*s/r,.5*o,0,0,a,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_HOR_BUTTON_BAR,mxShapeIOS7horButtonBar),mxUtils.extend(mxShapeIOS7pageControl,mxShape),mxShapeIOS7pageControl.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o);var l=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#000000"),r=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000"),s=Math.min(.5*i,.05*a);t.setFillColor(r),t.ellipse(0,.5*i-s,2*s,2*s),t.fill(),t.ellipse(.25*a-.5*s,.5*i-s,2*s,2*s),t.fill(),t.ellipse(.5*a-s,.5*i-s,2*s,2*s),t.fill(),t.ellipse(.75*a-1.5*s,.5*i-s,2*s,2*s),t.fill(),t.setFillColor(l),t.ellipse(a-2*s,.5*i-s,2*s,2*s),t.fill()},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_PAGE_CONTROL,mxShapeIOS7pageControl),mxUtils.extend(mxShapeIOS7iconGrid,mxShape),mxShapeIOS7iconGrid.prototype.customProperties=[{name:"gridSize",dispName:"Grid Size",type:"String"}],mxShapeIOS7iconGrid.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o);for(var l=mxUtils.getValue(this.style,mxIOS7C.GRID_SIZE,"4,7").toString().split(","),r=a/(parseInt(l[0],10)+.1*(l[0]-1)),s=i/(parseInt(l[1],10)+.1*(l[1]-1)),n=0;n<l[0];n++)for(var S=0;S<l[1];S++)t.rect(1.1*r*n,1.1*s*S,r,s),t.fill()},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_ICON_GRID,mxShapeIOS7iconGrid),mxUtils.extend(mxShapeIOS7phone,mxShape),mxShapeIOS7phone.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),t.roundrect(0,0,a,i,25,25),t.fillAndStroke(),t.setShadow(!1),this.foreground(t,e,o,a,i,25)},mxShapeIOS7phone.prototype.foreground=function(t,e,o,a,i,l){t.rect(.0625*a,.15*i,.875*a,.7*i),t.stroke(),t.ellipse(.4875*a,.04125*i,.025*a,.0125*i),t.stroke(),t.roundrect(.375*a,.075*i,.25*a,.01875*i,.02*a,.01*i),t.stroke(),t.ellipse(.4*a,.875*i,.2*a,.1*i),t.stroke(),t.roundrect(.4575*a,.905*i,.085*a,.04375*i,.00625*i,.00625*i),t.stroke()},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_PHONE,mxShapeIOS7phone),mxUtils.extend(mxShapeIOS7searchBox,mxShape),mxShapeIOS7searchBox.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),this.background(t,a,i),t.setShadow(!1),this.foreground(t,a,i)},mxShapeIOS7searchBox.prototype.background=function(t,e,o){t.rect(0,0,e,o),t.fill()},mxShapeIOS7searchBox.prototype.foreground=function(t,e,o){var a=mxUtils.getValue(this.style,mxIOS7C.BUTTON_TEXT,"Search"),i=mxUtils.getValue(this.style,mxIOS7C.STYLE_TEXTCOLOR,"#666666"),l=mxUtils.getValue(this.style,mxIOS7C.STYLE_STROKECOLOR2,"#008cff"),r=(mxUtils.getValue(this.style,mxIOS7C.STYLE_TEXTSIZE,"17"),.1*Math.min(e,o));t.setFillColor("#ffffff"),t.roundrect(.05*e,.15*o,.5*e,.7*o,r,r),t.fillAndStroke(),t.setFontColor(i),t.setFontSize(Math.min(.7*o,.1*e)),t.text(5,.5*o,0,0,a,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),t.setStrokeColor(l),t.ellipse(.05*e+3,.5*o-3,4,4),t.stroke(),t.begin(),t.moveTo(.05*e+8,.5*o+3.5),t.lineTo(.05*e+6,.5*o+.5),t.stroke()},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_SEARCH_BOX,mxShapeIOS7searchBox),mxUtils.extend(mxShapeIOS7URL,mxShape),mxShapeIOS7URL.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),this.background(t,a,i),t.setShadow(!1),this.foreground(t,a,i)},mxShapeIOS7URL.prototype.background=function(t,e,o){t.rect(0,0,e,o),t.fill()},mxShapeIOS7URL.prototype.foreground=function(t,e,o){var a=mxUtils.getValue(this.style,mxIOS7C.BUTTON_TEXT,"draw.io"),i=mxUtils.getValue(this.style,mxIOS7C.STYLE_TEXTCOLOR,"#666666"),l=mxUtils.getValue(this.style,mxIOS7C.STYLE_STROKECOLOR2,"#008cff"),r=(mxUtils.getValue(this.style,mxIOS7C.STYLE_TEXTSIZE,"17"),.1*Math.min(e,o));t.setFillColor("#d8d8d8"),t.roundrect(.05*e,.15*o,.9*e,.7*o,r,r),t.fill(),t.setFontColor(i),t.setFontSize(Math.min(.7*o,.1*e)),t.text(.5*e,.5*o,0,0,a,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),t.setStrokeColor(l),t.begin(),t.moveTo(.95*e-5,.5*o),t.arcTo(3,3,0,1,1,.95*e-8,.5*o-3),t.stroke(),t.setFillColor(l),t.begin(),t.moveTo(.95*e-8,.5*o-4),t.lineTo(.95*e-6,.5*o-3),t.lineTo(.95*e-8,.5*o-2),t.close(),t.fillAndStroke()},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_URL,mxShapeIOS7URL),mxUtils.extend(mxShapeIOS7Actiondialog,mxShape),mxShapeIOS7Actiondialog.prototype.paintVertexShape=function(t,e,o,a,i){var l=mxUtils.getValue(this.style,mxIOS7C.MAIN_TEXT,"Main Text"),r=mxUtils.getValue(this.style,mxIOS7C.SUB_TEXT,"Sub Text"),s=mxUtils.getValue(this.style,mxIOS7C.STYLE_TEXTCOLOR,"#666666"),n=mxUtils.getValue(this.style,mxIOS7C.STYLE_TEXTSIZE,"17");t.translate(e,o),this.background(t,e,o,a,i),t.setShadow(!1),t.setFillColor("#e0e0e0"),t.roundrect(.05*a,.1*i,.9*a,.35*i,.025*a,.05*i),t.fill(),t.roundrect(.05*a,.55*i,.9*a,.35*i,.025*a,.05*i),t.fill(),t.setFontStyle(mxConstants.FONT_BOLD),this.mainText(t,e,o,a,i,l,n,s),this.subText(t,e,o,a,i,r,n/1.4,s)},mxShapeIOS7Actiondialog.prototype.background=function(t,e,o,a,i){t.rect(0,0,a,i),t.fill()},mxShapeIOS7Actiondialog.prototype.mainText=function(t,e,o,a,i,l,r,s){t.begin(),t.setFontSize(r),t.setFontColor(s),t.text(.5*a,.4*i,0,0,l,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxShapeIOS7Actiondialog.prototype.subText=function(t,e,o,a,i,l,r,s){t.begin(),t.setFontSize(r),t.text(.5*a,.7*i,0,0,l,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape(mxIOS7C.SHAPE_IOS7_ACTION_DIALOG,mxShapeIOS7Actiondialog),mxUtils.extend(mxShapeIOS7Anchor,mxShape),mxShapeIOS7Anchor.prototype.cst={ANCHOR:"mxgraph.ios7ui.anchor"},mxShapeIOS7Anchor.prototype.paintVertexShape=function(t,e,o,a,i){},mxCellRenderer.registerShape(mxShapeIOS7Anchor.prototype.cst.ANCHOR,mxShapeIOS7Anchor),mxUtils.extend(mxShapeIOS7RRect,mxShape),mxShapeIOS7RRect.prototype.cst={RRECT:"mxgraph.ios7ui.rrect",R_SIZE:"rSize"},mxShapeIOS7RRect.prototype.customProperties=[{name:"rSize",dispName:"Arc Size",type:"float",min:0,defVal:3}],mxShapeIOS7RRect.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o);var l=parseInt(mxUtils.getValue(this.style,mxShapeIOS7RRect.prototype.cst.R_SIZE,"10"));t.roundrect(0,0,a,i,l),t.fillAndStroke()},mxCellRenderer.registerShape(mxShapeIOS7RRect.prototype.cst.RRECT,mxShapeIOS7RRect),mxUtils.extend(mxShapeIOS7LeftButton,mxShape),mxShapeIOS7LeftButton.prototype.cst={LEFT_BUTTON:"mxgraph.ios7ui.leftButton",R_SIZE:"rSize"},mxShapeIOS7LeftButton.prototype.customProperties=[{name:"rSize",dispName:"Arc Size",type:"float",min:0,defVal:3}],mxShapeIOS7LeftButton.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o);var l=parseInt(mxUtils.getValue(this.style,mxShapeIOS7LeftButton.prototype.cst.R_SIZE,"10"));t.begin(),t.moveTo(a,0),t.lineTo(a,i),t.lineTo(l,i),t.arcTo(l,l,0,0,1,0,i-l),t.lineTo(0,l),t.arcTo(l,l,0,0,1,l,0),t.close(),t.fillAndStroke()},mxCellRenderer.registerShape(mxShapeIOS7LeftButton.prototype.cst.LEFT_BUTTON,mxShapeIOS7LeftButton),mxUtils.extend(mxShapeIOS7RightButton,mxShape),mxShapeIOS7RightButton.prototype.cst={RIGHT_BUTTON:"mxgraph.ios7ui.rightButton",R_SIZE:"rSize"},mxShapeIOS7RightButton.prototype.customProperties=[{name:"rSize",dispName:"Arc Size",type:"float",min:0,defVal:3}],mxShapeIOS7RightButton.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o);var l=parseInt(mxUtils.getValue(this.style,mxShapeIOS7RightButton.prototype.cst.R_SIZE,"10"));t.begin(),t.moveTo(0,0),t.lineTo(a-l,0),t.arcTo(l,l,0,0,1,a,l),t.lineTo(a,i-l),t.arcTo(l,l,0,0,1,a-l,i),t.lineTo(0,i),t.close(),t.fillAndStroke()},mxCellRenderer.registerShape(mxShapeIOS7RightButton.prototype.cst.RIGHT_BUTTON,mxShapeIOS7RightButton),mxUtils.extend(mxShapeIOS7TopButton,mxShape),mxShapeIOS7TopButton.prototype.cst={TOP_BUTTON:"mxgraph.ios7ui.topButton",R_SIZE:"rSize"},mxShapeIOS7TopButton.prototype.customProperties=[{name:"rSize",dispName:"Arc Size",type:"float",min:0,defVal:3}],mxShapeIOS7TopButton.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o);var l=parseInt(mxUtils.getValue(this.style,mxShapeIOS7TopButton.prototype.cst.R_SIZE,"10"));t.begin(),t.moveTo(a,i),t.lineTo(0,i),t.lineTo(0,l),t.arcTo(l,l,0,0,1,l,0),t.lineTo(a-l,0),t.arcTo(l,l,0,0,1,a,l),t.close(),t.fillAndStroke()},mxCellRenderer.registerShape(mxShapeIOS7TopButton.prototype.cst.TOP_BUTTON,mxShapeIOS7TopButton),mxUtils.extend(mxShapeIOS7BottomButton,mxShape),mxShapeIOS7BottomButton.prototype.cst={BOTTOM_BUTTON:"mxgraph.ios7ui.bottomButton",R_SIZE:"rSize"},mxShapeIOS7BottomButton.prototype.customProperties=[{name:"rSize",dispName:"Arc Size",type:"float",min:0,defVal:3}],mxShapeIOS7BottomButton.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o);var l=parseInt(mxUtils.getValue(this.style,mxShapeIOS7BottomButton.prototype.cst.R_SIZE,"10"));t.begin(),t.moveTo(a,0),t.lineTo(0,0),t.lineTo(0,i-l),t.arcTo(l,l,0,0,0,l,i),t.lineTo(a-l,i),t.arcTo(l,l,0,0,0,a,i-l),t.close(),t.fillAndStroke()},mxCellRenderer.registerShape(mxShapeIOS7BottomButton.prototype.cst.BOTTOM_BUTTON,mxShapeIOS7BottomButton),mxUtils.extend(mxShapeIOS7HorLines,mxShape),mxShapeIOS7HorLines.prototype.cst={HOR_LINES:"mxgraph.ios7ui.horLines"},mxShapeIOS7HorLines.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),t.rect(0,0,a,i),t.fill(),t.begin(),t.moveTo(0,0),t.lineTo(a,0),t.moveTo(0,i),t.lineTo(a,i),t.stroke()},mxCellRenderer.registerShape(mxShapeIOS7HorLines.prototype.cst.HOR_LINES,mxShapeIOS7HorLines),mxUtils.extend(mxShapeIOS7MarginRect,mxShape),mxShapeIOS7MarginRect.prototype.customProperties=[{name:"rx",dispName:"Hor. Rounding Size",type:"float",min:0,defVal:3},{name:"ry",dispName:"Ver. Rounding Size",type:"float",min:0,defVal:3},{name:"rectMargin",dispName:"Global Margin",type:"float",min:0,defVal:5},{name:"rectMarginTop",dispName:"Top Margin",type:"float",min:0,defVal:0},{name:"rectMarginLeft",dispName:"Left Margin",type:"float",min:0,defVal:0},{name:"rectMarginBottom",dispName:"Bottom Margin",type:"float",min:0,defVal:0},{name:"rectMarginRight",dispName:"Right Margin",type:"float",min:0,defVal:0}],mxShapeIOS7MarginRect.prototype.cst={SHAPE_MARGIN_RECT:"mxgraph.ios7ui.marginRect",MARGIN:"rectMargin",RX:"rx",RY:"ry",MARGIN_TOP:"rectMarginTop",MARGIN_LEFT:"rectMarginLeft",MARGIN_BOTTOM:"rectMarginBottom",MARGIN_RIGHT:"rectMarginRight"},mxShapeIOS7MarginRect.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),this.background(t,e,o,a,i)},mxShapeIOS7MarginRect.prototype.background=function(t,e,o,a,i,l){var r=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7MarginRect.prototype.cst.MARGIN,"0")),s=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7MarginRect.prototype.cst.MARGIN_TOP,"0")),n=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7MarginRect.prototype.cst.MARGIN_LEFT,"0")),S=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7MarginRect.prototype.cst.MARGIN_BOTTOM,"0")),h=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7MarginRect.prototype.cst.MARGIN_RIGHT,"0")),p=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7MarginRect.prototype.cst.RX,"0")),m=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7MarginRect.prototype.cst.RY,"0")),x=r+n,O=r+s,u=a-h-x-r,c=i-S-O-r;u>0&&c>0&&(t.begin(),t.roundrect(x,O,u,c,p,m),t.fillAndStroke())},mxCellRenderer.registerShape(mxShapeIOS7MarginRect.prototype.cst.SHAPE_MARGIN_RECT,mxShapeIOS7MarginRect),mxUtils.extend(mxShapeIOS7Callout,mxShape),mxShapeIOS7Callout.prototype.cst={SHAPE_CALLOUT:"mxgraph.ios7ui.callout"},mxShapeIOS7Callout.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),this.background(t,e,o,a,i)},mxShapeIOS7Callout.prototype.background=function(t,e,o,a,i,l){var r=10;a>=30&&i>=20&&(t.begin(),t.moveTo(15,i-3),t.arcTo(20,r,0,0,1,0,i),t.arcTo(15,15,0,0,0,10,i-10),t.lineTo(r,r),t.arcTo(r,r,0,0,1,20,0),t.lineTo(a-r,0),t.arcTo(r,r,0,0,1,a,r),t.lineTo(a,i-r),t.arcTo(r,r,0,0,1,a-r,i),t.lineTo(20,i),t.arcTo(r,r,0,0,1,15,i-3),t.close(),t.fillAndStroke())},mxCellRenderer.registerShape(mxShapeIOS7Callout.prototype.cst.SHAPE_CALLOUT,mxShapeIOS7Callout),mxUtils.extend(mxShapeIOS7SelectBar,mxActor),mxShapeIOS7SelectBar.prototype.cst={SELECT_BAR:"mxgraph.ios7ui.selectBar"},mxShapeIOS7SelectBar.prototype.customProperties=[{name:"dx",dispName:"Callout Position",type:"float",min:0,defVal:120},{name:"dx2",dispName:"Field Size",type:"float",min:0,defVal:75},{name:"size",dispName:"Rounding size",type:"float",min:0,defVal:5},{name:"dy",dispName:"Callout Size",type:"float",min:0,defVal:5}],mxShapeIOS7SelectBar.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o);var l=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),r=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.style,"dx2",this.dx2)))),s=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),n=Math.max(0,Math.min(i,(a-Math.max(20,s)-s)/2,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));s=Math.min(i/2,a/2,s),l=Math.max(s+n,l),l=Math.min(a-s-n,a-20-n,l),t.begin(),t.moveTo(l-n,i),t.lineTo(s,i),t.arcTo(s,s,0,0,1,0,i-s),t.lineTo(0,s),t.arcTo(s,s,0,0,1,s,0),t.lineTo(a-s,0),t.arcTo(s,s,0,0,1,a,s),t.lineTo(a,i-s),t.arcTo(s,s,0,0,1,a-s,i),t.lineTo(l+n,i),t.lineTo(l,i+n),t.close(),t.fillAndStroke(),t.setShadow(!1),t.begin(),t.moveTo(a-Math.max(20,s),0),t.lineTo(a-Math.max(20,s),i),t.stroke();var S=r;for(t.begin();S<a-Math.max(20,s);)t.moveTo(S,0),t.lineTo(S,i),S+=r;t.stroke();var h=Math.min(Math.max(20,s),i),p=a-.5*h,m=.5*i;t.setFillColor(mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"")),t.begin(),t.moveTo(p-.15*h,m-.225*h),t.lineTo(p+.25*h,m),t.lineTo(p-.15*h,m+.225*h),t.close(),t.fill()},mxCellRenderer.registerShape(mxShapeIOS7SelectBar.prototype.cst.SELECT_BAR,mxShapeIOS7SelectBar),mxShapeIOS7SelectBar.prototype.constraints=null,Graph.handleFactory[mxShapeIOS7SelectBar.prototype.cst.SELECT_BAR]=function(t){var e=[Graph.createHandle(t,["dx"],(function(t){var e=Math.max(0,Math.min(t.width,parseFloat(mxUtils.getValue(this.state.style,"dx",this.dx))));return new mxPoint(t.x+e,t.y+t.height)}),(function(t,e){var o=.6*parseFloat(mxUtils.getValue(this.state.style,"dy",this.dy));this.state.style.dx=Math.round(100*Math.max(o,Math.min(t.width-o,e.x-t.x)))/100}))],o=Graph.createHandle(t,["dy"],(function(t){var e=Math.max(0,Math.min(t.height,parseFloat(mxUtils.getValue(this.state.style,"dy",this.dy))));return new mxPoint(t.x+parseFloat(mxUtils.getValue(this.state.style,"dx",this.dx)),t.y+t.height+e)}),(function(t,e){this.state.style.dy=Math.round(100*Math.max(0,Math.min(t.height,e.y-t.y-t.height)))/100}));e.push(o);var a=Graph.createHandle(t,["size"],(function(t){var e=Math.max(0,Math.min(t.width,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(t.x+t.width-e,t.y+10)}),(function(t,e){this.state.style.size=Math.round(100*Math.max(0,Math.min(t.width/2,t.height/2,t.x+t.width-e.x)))/100}));e.push(a);var i=Graph.createHandle(t,["dx2"],(function(t){var e=Math.max(0,Math.min(t.width,parseFloat(mxUtils.getValue(this.state.style,"dx2",this.dx2))));return new mxPoint(t.x+e,t.y+t.height/2)}),(function(t,e){this.state.style.dx2=Math.round(100*Math.max(0,Math.min(t.width,e.x-t.x)))/100}));return e.push(i),e},mxUtils.extend(mxShapeIOS7Slider2,mxShape),mxShapeIOS7Slider2.prototype.cst={SHAPE_SLIDER:"mxgraph.ios7ui.slider",BAR_POS:"barPos",HANDLE_SIZE:"handleSize"},mxShapeIOS7Slider2.prototype.customProperties=[{name:"barPos",dispName:"Handle Position",type:"float",min:0,max:1,defVal:20},{name:"handleSize",dispName:"Handle Size",type:"float",min:0,defVal:10}],mxShapeIOS7Slider2.prototype.paintVertexShape=function(t,e,o,a,i){t.translate(e,o),this.background(t,e,o,a,i),t.setShadow(!0)},mxShapeIOS7Slider2.prototype.background=function(t,e,o,a,i){var l=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7Slider2.prototype.cst.HANDLE_SIZE,"10")),r=parseFloat(mxUtils.getValue(this.style,mxShapeIOS7Slider2.prototype.cst.BAR_POS,"40"))/100;r=Math.max(0,Math.min(1,r)),t.save(),t.setStrokeColor("#bbbbbb"),t.begin(),t.moveTo(0,.5*i),t.lineTo(a,.5*i),t.fillAndStroke(),t.restore(),t.begin(),t.moveTo(0,.5*i),t.lineTo(r*a,.5*i),t.fillAndStroke(),t.setStrokeColor("#bbbbbb"),t.begin(),t.ellipse(r*a-.5*l,.5*i-.5*l,l,l),t.fillAndStroke()},mxCellRenderer.registerShape(mxShapeIOS7Slider2.prototype.cst.SHAPE_SLIDER,mxShapeIOS7Slider2),mxShapeIOS7Slider2.prototype.constraints=null,Graph.handleFactory[mxShapeIOS7Slider2.prototype.cst.SHAPE_SLIDER]=function(t){return[Graph.createHandle(t,["barPos"],(function(t){var e=Math.max(0,Math.min(t.width,parseFloat(mxUtils.getValue(this.state.style,"barPos",.4))));return new mxPoint(t.x+e*t.width/100,t.y+t.height/2)}),(function(t,e){this.state.style.barPos=Math.round(100*Math.max(0,Math.min(100,100*(e.x-t.x)/t.width)))/100}))]};