/**
* Joint 0.4 - JavaScript diagramming library.
* Copyright (c) David Durman 2009 - 2011
* Licensed under the MIT license: (http://www.opensource.org/licenses/mit-license.php)
*/(function(c){var d=c.Joint;c=d.dia.Element;var e=d.dia.pn={};e.arrow={startArrow:{type:"none"},endArrow:{type:"basic",size:5},attrs:{"stroke-dasharray":"none"}};e.Place=c.extend({object:"Place",module:"pn",init:function(a){a=d.DeepSupplement(this.properties,a,{radius:20,tokenRadius:3,tokens:0,attrs:{fill:"white"},tokenAttrs:{fill:"black"}});var b=this.paper;this.setWrapper(b.circle(a.position.x,a.position.y,a.radius).attr(a.attrs));switch(a.tokens){case 0:break;case 1:this.addInner(b.circle(a.position.x, a.position.y,a.tokenRadius).attr(a.tokenAttrs));break;case 2:this.addInner(b.circle(a.position.x-a.tokenRadius*2,a.position.y,a.tokenRadius).attr(a.tokenAttrs));this.addInner(b.circle(a.position.x+a.tokenRadius*2,a.position.y,a.tokenRadius).attr(a.tokenAttrs));break;case 3:this.addInner(b.circle(a.position.x-a.tokenRadius*2-2,a.position.y,a.tokenRadius).attr(a.tokenAttrs));this.addInner(b.circle(a.position.x+a.tokenRadius*2+2,a.position.y,a.tokenRadius).attr(a.tokenAttrs));this.addInner(b.circle(a.position.x, a.position.y,a.tokenRadius).attr(a.tokenAttrs));break;default:this.addInner(b.text(a.position.x,a.position.y,a.tokens.toString()))}if(a.label){this.addInner(b.text(a.position.x,a.position.y-a.radius,a.label));this.inner[this.inner.length-1].translate(0,-this.inner[this.inner.length-1].getBBox().height)}},zoom:function(){for(var a=0,b=this.inner.length;a<b;a++)this.inner[a].scale.apply(this.inner[a],arguments);if(this.label){this.inner[this.inner.length-1].remove();a=this.wrapper.getBBox();this.inner[this.inner.length- 1]=this.paper.text(a.x,a.y,this.properties.label);this.inner[this.inner.length-1].translate(0,-this.inner[this.inner.length-1].getBBox().height)}}});e.Event=c.extend({object:"Event",module:"pn",init:function(a){a=d.DeepSupplement(this.properties,a,{attrs:{fill:"black",stroke:"black"}});var b=this.paper;this.setWrapper(b.rect(a.rect.x,a.rect.y,a.rect.width,a.rect.height).attr(a.attrs));if(a.label){this.addInner(b.text(a.rect.x,a.rect.y,a.label));this.inner[0].translate(0,-this.inner[0].getBBox().height)}}, zoom:function(){if(this.properties.label){this.inner[0].remove();var a=this.wrapper.getBBox();this.inner[0]=this.paper.text(a.x,a.y,this.properties.label);this.inner[0].translate(0,-this.inner[0].getBBox().height)}}})})(this);