From e720f22ce59894feb1deabcaeede98ed3dee41b9 Mon Sep 17 00:00:00 2001 From: SeungpilPark Date: Thu, 24 Aug 2017 07:48:17 +0900 Subject: [PATCH] #27 pool and lane drop event --- src/main/webapp/examples/develope.html | 1 + .../opengraph/OpenGraph-0.1.3-SNAPSHOT-All.js | 4 ++-- .../opengraph/OpenGraph-0.1.3-SNAPSHOT-min.js | 4 ++-- .../opengraph/OpenGraph-0.1.3-SNAPSHOT.js | 23 +++++++++++++------ src/main/webapp/src/graph/Canvas.js | 9 ++++++-- .../webapp/src/renderer/RaphaelRenderer.js | 18 ++++++--------- 6 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/main/webapp/examples/develope.html b/src/main/webapp/examples/develope.html index 08a269e..1b55846 100644 --- a/src/main/webapp/examples/develope.html +++ b/src/main/webapp/examples/develope.html @@ -232,6 +232,7 @@ canvas._CONFIG.WHEEL_SCALABLE = true; canvas._CONFIG.DRAG_PAGE_MOVABLE = true; canvas._CONFIG.AUTOMATIC_GUIDANCE = false; + canvas._CONFIG.POOL_DROP_EVENT = true; canvas.initConfig({ selectable: true, diff --git a/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT-All.js b/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT-All.js index 7cbc84a..3c79b68 100644 --- a/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT-All.js +++ b/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT-All.js @@ -138,5 +138,5 @@ jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array * GPL v3 http://opensource.org/licenses/GPL-3.0 * */ -(function(k,f){k.support.htmlMenuitem=("HTMLMenuItemElement" in window);k.support.htmlCommand=("HTMLCommandElement" in window);k.support.eventSelectstart=("onselectstart" in document.documentElement);var i=null,g=false,d=k(window),a=0,b={},j={},n={},h={selector:null,appendTo:null,trigger:"right",autoHide:false,delay:200,determinePosition:function(r){if(k.ui&&k.ui.position){r.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none")}else{var s=this.offset();s.top+=this.outerHeight();s.left+=this.outerWidth()/2-r.outerWidth()/2;r.css(s)}},position:function(t,A,w){var v=this,u;if(!A&&!w){t.determinePosition.call(this,t.$menu);return}else{if(A==="maintain"&&w==="maintain"){u=t.$menu.position()}else{var z=t.$trigger.parents().andSelf().filter(function(){return k(this).css("position")=="fixed"}).length;if(z){w-=d.scrollTop();A-=d.scrollLeft()}u={top:w,left:A}}}var r=d.scrollTop()+d.height(),B=d.scrollLeft()+d.width(),C=t.$menu.height(),s=t.$menu.width();if(u.top+C>r){u.top-=C}if(u.left+s>B){u.left-=s}t.$menu.css(u)},positionSubmenu:function(r){if(k.ui&&k.ui.position){r.css("display","block").position({my:"left top",at:"right top",of:this,collision:"fit"}).css("display","")}else{var s={top:0,left:this.outerWidth()};r.css(s)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:k.noop,hide:k.noop},callback:null,items:{}},o={timer:null,pageX:null,pageY:null},q=function(t){var s=0,r=t;while(true){s=Math.max(s,parseInt(r.css("z-index"),10)||0);r=r.parent();if(!r||!r.length||"html body".indexOf(r.prop("nodeName").toLowerCase())>-1){break}}return s},m={abortevent:function(r){r.preventDefault();r.stopImmediatePropagation()},contextmenu:function(t){var s=k(this);t.preventDefault();t.stopImmediatePropagation();if(t.data.trigger!="right"&&t.originalEvent){return}if(!s.hasClass("context-menu-disabled")){i=s;if(t.data.build){var r=t.data.build(i,t);if(r===false){return}t.data=k.extend(true,{},h,t.data,r||{});if(!t.data.items||k.isEmptyObject(t.data.items)){if(window.console){(console.error||console.log)("No items specified to show in contextMenu")}throw new Error("No Items sepcified")}t.data.$trigger=i;l.create(t.data)}l.show.call(s,t.data,t.pageX,t.pageY)}},click:function(r){r.preventDefault();r.stopImmediatePropagation();k(this).trigger(k.Event("contextmenu",{data:r.data,pageX:r.pageX,pageY:r.pageY}))},mousedown:function(s){var r=k(this);if(i&&i.length&&!i.is(r)){i.data("contextMenu").$menu.trigger("contextmenu:hide")}if(s.button==2){i=r.data("contextMenuActive",true)}},mouseup:function(s){var r=k(this);if(r.data("contextMenuActive")&&i&&i.length&&i.is(r)&&!r.hasClass("context-menu-disabled")){s.preventDefault();s.stopImmediatePropagation();i=r;r.trigger(k.Event("contextmenu",{data:s.data,pageX:s.pageX,pageY:s.pageY}))}r.removeData("contextMenuActive")},mouseenter:function(t){var s=k(this),r=k(t.relatedTarget),u=k(document);if(r.is(".context-menu-list")||r.closest(".context-menu-list").length){return}if(i&&i.length){return}o.pageX=t.pageX;o.pageY=t.pageY;o.data=t.data;u.on("mousemove.contextMenuShow",m.mousemove);o.timer=setTimeout(function(){o.timer=null;u.off("mousemove.contextMenuShow");i=s;s.trigger(k.Event("contextmenu",{data:o.data,pageX:o.pageX,pageY:o.pageY}))},t.data.delay)},mousemove:function(r){o.pageX=r.pageX;o.pageY=r.pageY},mouseleave:function(s){var r=k(s.relatedTarget);if(r.is(".context-menu-list")||r.closest(".context-menu-list").length){return}try{clearTimeout(o.timer)}catch(s){}o.timer=null},layerClick:function(u){var w=k(this),A=w.data("contextMenuRoot"),s=false,t=u.button,B=u.pageX,z=u.pageY,v,r,C;u.preventDefault();u.stopImmediatePropagation();w.on("mouseup",function(){s=true});setTimeout(function(){var D,y;if((A.trigger=="left"&&t==0)||(A.trigger=="right"&&t==2)){if(document.elementFromPoint){A.$layer.hide();v=document.elementFromPoint(B-d.scrollLeft(),z-d.scrollTop());A.$layer.show();C=[];for(var x in b){C.push(x)}v=k(v).closest(C.join(", "));if(v.length){if(v.is(A.$trigger[0])){A.position.call(A.$trigger,A,B,z);return}}}else{r=A.$trigger.offset();D=k(window);r.top+=D.scrollTop();if(r.top<=u.pageY){r.left+=D.scrollLeft();if(r.left<=u.pageX){r.bottom=r.top+A.$trigger.outerHeight();if(r.bottom>=u.pageY){r.right=r.left+A.$trigger.outerWidth();if(r.right>=u.pageX){A.position.call(A.$trigger,A,B,z);return}}}}}}y=function(E){if(E){E.preventDefault();E.stopImmediatePropagation()}A.$menu.trigger("contextmenu:hide");if(v&&v.length){setTimeout(function(){v.contextMenu({x:B,y:z})},50)}};if(s){y()}else{w.on("mouseup",y)}},50)},keyStop:function(s,r){if(!r.isInput){s.preventDefault()}s.stopPropagation()},key:function(w){var u=i.data("contextMenu")||{},s=u.$menu.children(),x;switch(w.keyCode){case 9:case 38:m.keyStop(w,u);if(u.isInput){if(w.keyCode==9&&w.shiftKey){w.preventDefault();u.$selected&&u.$selected.find("input, textarea, select").blur();u.$menu.trigger("prevcommand");return}else{if(w.keyCode==38&&u.$selected.find("input, textarea, select").prop("type")=="checkbox"){w.preventDefault();return}}}else{if(w.keyCode!=9||w.shiftKey){u.$menu.trigger("prevcommand");return}}case 40:m.keyStop(w,u);if(u.isInput){if(w.keyCode==9){w.preventDefault();u.$selected&&u.$selected.find("input, textarea, select").blur();u.$menu.trigger("nextcommand");return}else{if(w.keyCode==40&&u.$selected.find("input, textarea, select").prop("type")=="checkbox"){w.preventDefault();return}}}else{u.$menu.trigger("nextcommand");return}break;case 37:m.keyStop(w,u);if(u.isInput||!u.$selected||!u.$selected.length){break}if(!u.$selected.parent().hasClass("context-menu-root")){var v=u.$selected.parent().parent();u.$selected.trigger("contextmenu:blur");u.$selected=v;return}break;case 39:m.keyStop(w,u);if(u.isInput||!u.$selected||!u.$selected.length){break}var t=u.$selected.data("contextMenu")||{};if(t.$menu&&u.$selected.hasClass("context-menu-submenu")){u.$selected=null;t.$selected=null;t.$menu.trigger("nextcommand");return}break;case 35:case 36:if(u.$selected&&u.$selected.find("input, textarea, select").length){return}else{(u.$selected&&u.$selected.parent()||u.$menu).children(":not(.disabled, .not-selectable)")[w.keyCode==36?"first":"last"]().trigger("contextmenu:focus");w.preventDefault();return}break;case 13:m.keyStop(w,u);if(u.isInput){if(u.$selected&&!u.$selected.is("textarea, select")){w.preventDefault();return}break}u.$selected&&u.$selected.trigger("mouseup");return;case 32:case 33:case 34:m.keyStop(w,u);return;case 27:m.keyStop(w,u);u.$menu.trigger("contextmenu:hide");return;default:var r=(String.fromCharCode(w.keyCode)).toUpperCase();if(u.accesskeys[r]){u.accesskeys[r].$node.trigger(u.accesskeys[r].$menu?"contextmenu:focus":"mouseup");return}break}w.stopPropagation();u.$selected&&u.$selected.trigger(w)},prevItem:function(v){v.stopPropagation();var u=k(this).data("contextMenu")||{};if(u.$selected){var r=u.$selected;u=u.$selected.parent().data("contextMenu")||{};u.$selected=r}var t=u.$menu.children(),s=!u.$selected||!u.$selected.prev().length?t.last():u.$selected.prev(),x=s;while(s.hasClass("disabled")||s.hasClass("not-selectable")){if(s.prev().length){s=s.prev()}else{s=t.last()}if(s.is(x)){return}}if(u.$selected){m.itemMouseleave.call(u.$selected.get(0),v)}m.itemMouseenter.call(s.get(0),v);var w=s.find("input, textarea, select");if(w.length){w.focus()}},nextItem:function(v){v.stopPropagation();var u=k(this).data("contextMenu")||{};if(u.$selected){var r=u.$selected;u=u.$selected.parent().data("contextMenu")||{};u.$selected=r}var t=u.$menu.children(),s=!u.$selected||!u.$selected.next().length?t.first():u.$selected.next(),x=s;while(s.hasClass("disabled")||s.hasClass("not-selectable")){if(s.next().length){s=s.next()}else{s=t.first()}if(s.is(x)){return}}if(u.$selected){m.itemMouseleave.call(u.$selected.get(0),v)}m.itemMouseenter.call(s.get(0),v);var w=s.find("input, textarea, select");if(w.length){w.focus()}},focusInput:function(v){var u=k(this).closest(".context-menu-item"),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;r.$selected=s.$selected=u;r.isInput=s.isInput=true},blurInput:function(v){var u=k(this).closest(".context-menu-item"),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;r.isInput=s.isInput=false},menuMouseenter:function(s){var r=k(this).data().contextMenuRoot;r.hovering=true},menuMouseleave:function(s){var r=k(this).data().contextMenuRoot;if(r.$layer&&r.$layer.is(s.relatedTarget)){r.hovering=false}},itemMouseenter:function(v){var u=k(this),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;r.hovering=true;if(v&&r.$layer&&r.$layer.is(v.relatedTarget)){v.preventDefault();v.stopImmediatePropagation()}(s.$menu?s:r).$menu.children(".hover").trigger("contextmenu:blur");if(u.hasClass("disabled")||u.hasClass("not-selectable")){s.$selected=null;return}u.trigger("contextmenu:focus")},itemMouseleave:function(v){var u=k(this),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;if(r!==s&&r.$layer&&r.$layer.is(v.relatedTarget)){r.$selected&&r.$selected.trigger("contextmenu:blur");v.preventDefault();v.stopImmediatePropagation();r.$selected=s.$selected=s.$node;return}u.trigger("contextmenu:blur")},itemClick:function(w){var v=k(this),u=v.data(),t=u.contextMenu,r=u.contextMenuRoot,s=u.contextMenuKey,x;if(!t.items[s]||v.hasClass("disabled")||v.hasClass("context-menu-submenu")){return}w.preventDefault();w.stopImmediatePropagation();if(k.isFunction(r.callbacks[s])){x=r.callbacks[s]}else{if(k.isFunction(r.callback)){x=r.callback}else{return}}if(x.call(r.$trigger,s,r)!==false){r.$menu.trigger("contextmenu:hide")}else{if(r.$menu.parent().length){l.update.call(r.$trigger,r)}}},inputClick:function(r){r.stopImmediatePropagation()},hideMenu:function(t,s){var r=k(this).data("contextMenuRoot");l.hide.call(r.$trigger,r,s&&s.force)},focusItem:function(v){v.stopPropagation();var u=k(this),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;u.addClass("hover").siblings(".hover").trigger("contextmenu:blur");s.$selected=r.$selected=u;if(s.$node){r.positionSubmenu.call(s.$node,s.$menu)}},blurItem:function(v){v.stopPropagation();var u=k(this),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;u.removeClass("hover");s.$selected=null}},l={show:function(t,r,z){var u=k(this),v,s={};k("#context-menu-layer").trigger("mousedown");t.$trigger=u;if(t.events.show.call(u,t)===false){i=null;return}l.update.call(u,t);t.position.call(u,t,r,z);if(t.zIndex){s.zIndex=q(u)+t.zIndex}l.layer.call(t.$menu,t,s.zIndex);t.$menu.find("ul").css("zIndex",s.zIndex+1);t.$menu.css(s)[t.animation.show](t.animation.duration);u.data("contextMenu",t);k(document).off("keydown.contextMenu").on("keydown.contextMenu",m.key);if(t.autoHide){var w=u.position();w.right=w.left+u.outerWidth();w.bottom=w.top+this.outerHeight();k(document).on("mousemove.contextMenuAutoHide",function(x){if(t.$layer&&!t.hovering&&(!(x.pageX>=w.left&&x.pageX<=w.right)||!(x.pageY>=w.top&&x.pageY<=w.bottom))){t.$menu.trigger("contextmenu:hide")}})}},hide:function(r,s){var u=k(this);if(!r){r=u.data("contextMenu")||{}}if(!s&&r.events&&r.events.hide.call(u,r)===false){return}if(r.$layer){setTimeout((function(v){return function(){v.remove()}})(r.$layer),10);try{delete r.$layer}catch(t){r.$layer=null}}i=null;r.$menu.find(".hover").trigger("contextmenu:blur");r.$selected=null;k(document).off(".contextMenuAutoHide").off("keydown.contextMenu");r.$menu&&r.$menu[r.animation.hide](r.animation.duration,function(){if(r.build){r.$menu.remove();k.each(r,function(v,w){switch(v){case"ns":case"selector":case"build":case"trigger":return true;default:r[v]=f;try{delete r[v]}catch(x){}return true}})}})},create:function(s,r){if(r===f){r=s}s.$menu=k('').data({contextMenu:s,contextMenuRoot:r});k.each(["callbacks","commands","inputs"],function(u,t){s[t]={};if(!r[t]){r[t]={}}});r.accesskeys||(r.accesskeys={});k.each(s.items,function(v,w){var A=k('
  • '),t=null,z=null;w.$node=A.data({contextMenu:s,contextMenuRoot:r,contextMenuKey:v});if(w.accesskey){var x=c(w.accesskey);for(var u=0,y;y=x[u];u++){if(!r.accesskeys[y]){r.accesskeys[y]=w;w._name=w.name.replace(new RegExp("("+y+")","i"),'$1');break}}}if(typeof w=="string"){A.addClass("context-menu-separator not-selectable")}else{if(w.type&&n[w.type]){n[w.type].call(A,w,s,r);k.each([s,r],function(C,B){B.commands[v]=w;if(k.isFunction(w.callback)){B.callbacks[v]=w.callback}})}else{if(w.type=="html"){A.addClass("context-menu-html not-selectable")}else{if(w.type){t=k("").appendTo(A);k("").html(w._name||w.name).appendTo(t);A.addClass("context-menu-input");s.hasTypes=true;k.each([s,r],function(C,B){B.commands[v]=w;B.inputs[v]=w})}else{if(w.items){w.type="sub"}}}switch(w.type){case"text":z=k('').val(w.value||"").appendTo(t);break;case"textarea":z=k('').val(w.value||"").appendTo(t);if(w.height){z.height(w.height)}break;case"checkbox":z=k('').val(w.value||"").prop("checked",!!w.selected).prependTo(t);break;case"radio":z=k('').val(w.value||"").prop("checked",!!w.selected).prependTo(t);break;case"select":z=k('");o=$("#"+p);switch(a.shape.geom.style.get("text-anchor")){case"start":g="left";break;case"middle":g="center";break;case"end":g="right";break;default:g="center";break}if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.HTML){$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":"left",overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.html);u=a.shape.html;$(o).bind({focusout:function(){a.shape.html=this.value;i=this.value;if(a.shape.html){c.redrawShape(a);this.parentNode.removeChild(this)}else{c.removeShape(a);this.parentNode.removeChild(this)}if(u!==i){c.addHistory()}}})}else{if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.TEXT){$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":g,overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.text);u=a.shape.text;$(o).bind({focusout:function(){a.shape.text=this.value;i=this.value;if(a.shape.text){c.redrawShape(a);this.parentNode.removeChild(this)}else{c.removeShape(a);this.parentNode.removeChild(this)}if(u!==i){c.addHistory()}}})}else{if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){if(a.shape.label&&c.isSVG()){$(a).children("[id$=_LABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height})})}else{v=t(a);f=v.x-b._CONFIG.LABEL_EDITOR_WIDTH/2;l=v.y-b._CONFIG.LABEL_EDITOR_HEIGHT/2;n=b._CONFIG.LABEL_EDITOR_WIDTH;m=b._CONFIG.LABEL_EDITOR_HEIGHT}$(q.srcElement).parents("[id$=_FROMLABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height;h=a.shape.fromLabel})});$(q.srcElement).parents("[id$=_TOLABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height;r=a.shape.toLabel})});$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f*b._CONFIG.SCALE,top:l*b._CONFIG.SCALE,width:n*b._CONFIG.SCALE,height:m*b._CONFIG.SCALE,overflow:"hidden",resize:"none"}));$(o).focus();if(h||r){$(o).val(h?a.shape.fromLabel:a.shape.toLabel)}else{$(o).val(a.shape.label);u=a.shape.label}$(o).bind({focusout:function(){if(h){c.drawEdgeLabel(a,this.value,"FROM")}else{if(r){c.drawEdgeLabel(a,this.value,"TO")}else{c.drawLabel(a,this.value);i=this.value;if(u!==i){c.addHistory()}}}this.parentNode.removeChild(this)}})}else{$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":g,overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.label);u=a.shape.label;$(o).bind({focusout:function(){c.drawLabel(a,this.value);this.parentNode.removeChild(this);i=this.value;if(u!==i){c.addHistory()}}})}}}}}})},setMovable:function(f,g){var i=this,c;var h=i._RENDERER;var k=h.getRootGroup();if(!f){return}var j=$(f).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var m=h.isLane(f);if(j){return}var b=function(x){var u=i._CONFIG.EDGE_MOVE_DELAY_SIZE;var p=[];if(!i._CONFIG.AUTOMATIC_GUIDANCE){return p}if(!x){return p}if(x.length!==1){return p}var r=h.getBoundary(f);var w=r.getCentroid();var v=r.getHeight();var o=r.getWidth();var t=h.getAllShapes();$.each(t,function(z,A){if(h.isEdge(A)){return}if(A.id===f.id){return}var D=h.getBoundary(A);var y=D.getCentroid();var B=D.getUpperLeft();var C=D.getLowerRight();p.push({condition:{minY:(B.y-v/2)-u,maxY:(B.y-v/2)+u},fixedPosition:{y:(B.y-v/2)},guidePosition:{y:B.y},id:z});p.push({condition:{minY:(B.y+v/2)-u,maxY:(B.y+v/2)+u},fixedPosition:{y:(B.y+v/2)},guidePosition:{y:B.y},id:z});p.push({condition:{minY:(C.y+v/2)-u,maxY:(C.y+v/2)+u},fixedPosition:{y:(C.y+v/2)},guidePosition:{y:C.y},id:z});p.push({condition:{minY:(C.y-v/2)-u,maxY:(C.y-v/2)+u},fixedPosition:{y:(C.y-v/2)},guidePosition:{y:C.y},id:z});p.push({condition:{minX:(B.x-o/2)-u,maxX:(B.x-o/2)+u},fixedPosition:{x:(B.x-o/2)},guidePosition:{x:B.x},id:z});p.push({condition:{minX:(B.x+o/2)-u,maxX:(B.x+o/2)+u},fixedPosition:{x:(B.x+o/2)},guidePosition:{x:B.x},id:z});p.push({condition:{minX:(C.x+o/2)-u,maxX:(C.x+o/2)+u},fixedPosition:{x:(C.x+o/2)},guidePosition:{x:C.x},id:z});p.push({condition:{minX:(C.x-o/2)-u,maxX:(C.x-o/2)+u},fixedPosition:{x:(C.x-o/2)},guidePosition:{x:C.x},id:z});p.push({condition:{minX:y.x-u,maxX:y.x+u},fixedPosition:{x:y.x},guidePosition:{x:y.x},id:z});p.push({condition:{minY:y.y-u,maxY:y.y+u,},fixedPosition:{y:y.y},guidePosition:{y:y.y},id:z})});var s=[];var n=h.getPrevEdges(f);var q=h.getNextEdges(f);$.each(n,function(y,z){s.push({edge:z,type:"prev"})});$.each(q,function(y,z){s.push({edge:z,type:"next"})});$.each(s,function(G,D){var z=D.edge;var C=D.type;var E=$(z).attr("_from");var F=$(z).attr("_to");if(!E||!F){return}var J;var I;if(C==="prev"){J=F;I=E}else{J=E;I=F}var H=h._getPositionFromTerminal(J);var y=h._getPositionFromTerminal(I);var B=w.x-H.x;var A=w.y-H.y;p.push({condition:{minX:y.x+B-u,maxX:y.x+B+u},fixedPosition:{x:y.x+B},guidePosition:{x:y.x},id:G});p.push({condition:{minY:y.y+A-u,maxY:y.y+A+u},fixedPosition:{y:y.y+A},guidePosition:{y:y.y},id:G})});return p};var l=function(v,u){var s={dx:v,dy:u};if(!i._CONFIG.AUTOMATIC_GUIDANCE){return s}var o=h.getBoundary(f);var p=o.getCentroid();var n={x:p.x+v,y:p.y+u};var t=function(w){if(!w){return s}if(w.x&&!w.y){return{dx:w.x-p.x,dy:s.dy}}if(w.y&&!w.x){return{dx:s.dx,dy:w.y-p.y}}if(w.x&&w.y){return{dx:w.x-p.x,dy:w.y-p.y}}return s};var q=$(f).data("correctionConditions");if(!q){return s}var r=[];$.each(q,function(x,w){var z=w.condition;var y=true;if(z.minX){if(n.xz.maxX){y=false}}if(z.minY){if(n.yz.maxY){y=false}}if(y){r.push(w)}});$.each(r,function(w,x){s=t(x.fixedPosition);var y=x.guidePosition;h.drawStickGuide(y)});if(!r.length){h.removeAllStickGuide()}return s};var e=function(){var n=$("[id$="+OG.Constants.DROP_OVER_BBOX_SUFFIX+"]");$.each(n,function(o,p){h.remove(p.id)});$(k).removeData("groupTarget")};var d=function(){e();var w=$(k).data("bBoxArray");if(!w){return}var r=[];var o=[];$.each(w,function(x,y){o=h.getAttr(y.box,"transform")[0];r.push(h.getElementById(y.id))});if(!o.length){return}var p=h.getBoundaryOfElements(r);var q=p.getUpperCenter().y+o[2];var t=p.getLeftCenter().x+o[1];var v=new OG.geometry.Envelope([t,q],p.getWidth(),p.getHeight());var n=h.getFrontForBoundary(v);if(!n){return}if(!i._CONFIG.GROUP_DROPABLE||!n.shape.GROUP_DROPABLE){return}if(h.isLane(n)){n=h.getRootLane(n)}if(n.shape instanceof OG.shape.bpmn.A_Task){return}if(n.shape.isCollapsed===true){return}var s=false;$.each(w,function(x,y){if(n.id===y.id){s=true}});if(s){return}var u=false;$.each(w,function(x,y){if(h.isLane(y.id)){u=true}});if(u){return}$(k).data("groupTarget",n);h.drawDropOverGuide(n)};if(g===true){$(f).draggable({start:function(n){var q=i._getOffset(n),p;if(!i._isSelectedElement(f)){$.each(i._getSelectedElement(),function(w,x){if(OG.Util.isElement(x)&&x.id){h.removeGuide(x)}})}h.removeAllEdgeGuide();h.removeGuide(f);p=h.drawGuide(f);if(m){h.drawGuide(h.getRootLane(f))}var o=[];$(i._RENDERER.getRootElement()).find("[id$="+OG.Constants.GUIDE_SUFFIX.BBOX+"]").each(function(x,y){if(y.id&&y.id.indexOf(OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX)==-1){var w=y.id.replace(OG.Constants.GUIDE_SUFFIX.BBOX,"");o.push({id:w})}});var s=false;var t;var r=function(x){if(x.id===f.id){s=true}var w=h.getChilds(x);$.each(w,function(y,z){h.removeGuide(z);if(x.id===f.id){s=true}if(h.isGroup(z)){r(z)}})};var u=function(w){if(!w){return}$.each(o,function(x,y){if(y.id===w.id){t=w}});u(h.getParent(w))};$.each(o,function(w,y){var x=h.getElementById(y.id);if(h.isGroup(x)){r(x)}});if(s){u(f);if(t){h.removeGuide(t);p=h.drawGuide(t)}}$(this).data("start",{x:q.x,y:q.y});$(this).data("offset",{x:q.x-i._num(h.getAttr(p.bBox,"x")),y:q.y-i._num(h.getAttr(p.bBox,"y"))});var v=i._getMoveTargets();$(k).data("bBoxArray",v);$(f).data("correctionConditions",b(v));h.removeRubberBand(h.getRootElement())},drag:function(q){var r=i._getOffset(q),u=$(this).data("start"),t=$(k).data("bBoxArray"),p=r.x-u.x,o=r.y-u.y,s=$(this).data("offset");var n=l(p,o);if("Y"==f.shape.AXIS){n.dx=0}else{if("X"==f.shape.AXIS){n.dy=0}}p=i._grid(n.dx,"move");o=i._grid(n.dy,"move");i._autoExtend(r.x,r.y,f);$(this).css({position:"",left:"",top:""});$.each(t,function(v,w){h.setAttr(w.box,{transform:"t"+p+","+o,"stroke-width":1})});d();h.removeAllConnectGuide()},stop:function(o){var r=i._getOffset(o),p=$(this).data("start"),v=$(k).data("bBoxArray"),x=r.x-p.x,w=r.y-p.y,t=$(k).data("groupTarget"),s=$(this).data("offset"),u;var q=l(x,w);if("Y"==f.shape.AXIS){q.dx=0}else{if("X"==f.shape.AXIS){q.dy=0}}x=i._grid(q.dx,"move");w=i._grid(q.dy,"move");$(this).css({position:"",left:"",top:""});u=i._moveElements(v,x,w);$(k).removeData("bBoxArray");h.removeAllGuide();if(t&&OG.Util.isElement(t)){h.addToGroup(t,u,r);h.remove(t.id+OG.Constants.DROP_OVER_BBOX_SUFFIX);$(k).removeData("groupTarget")}else{var n=[];$.each(u,function(z,A){var y=A.parentElement;if(!y){y=A.parentNode}if(y&&y.id!==k.id){n.push(A)}});h.addToGroup(k,n,r)}$.each(i._getSelectedElement(),function(y,z){c=h.drawGuide(z);if(c){i.setResizable(z,c,i._isResizable(z.shape));i.setConnectable(z,c,i._isConnectable(z.shape));h.toFront(c.group)}});h.removeAllConnectGuide();h.toFrontEdges();h.checkAllBridgeEdge();h.addHistory()}});h.setAttr(f,{cursor:"move"});OG.Util.apply(f.shape.geom.style.map,{cursor:"move"})}else{h.setAttr(f,{cursor:i._isSelectable(f.shape)?"pointer":i._CONFIG.DEFAULT_STYLE.SHAPE.cursor});OG.Util.apply(f.shape.geom.style.map,{cursor:i._isSelectable(f.shape)?"pointer":i._CONFIG.DEFAULT_STYLE.SHAPE.cursor});if(i._CONFIG.DRAG_PAGE_MOVABLE){var a=i._RENDERER._CANVAS._CONTAINER;$(f).bind("mousedown",function(o){if(o.button!=0){return}k=h.getRootGroup();var n=$(k).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);var p=$(k).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE);if(n==="active"||p==="active"){return}$(k).data("dragPageMove",{x:o.pageX,y:o.pageY});$(k).data("dragPageScroll",{x:a.scrollLeft,y:a.scrollTop})})}}},setConnectable:function(d,b,h){var e=this,c=e._RENDERER.getRootGroup(),a,g;var f=$(d).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE?true:false;if(!d||!b){return}if(h){if(!f){$.each(b.line,function(k,j){$(j.node).bind({click:function(i){g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);if(a){$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE,"created");$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_TEXT,j.text);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_LABEL,j.label);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_SHAPE,j.shape)}}});$(j.node).draggable({start:function(i){e.deselectAll();e._RENDERER.removeAllConnectGuide();e._RENDERER.removeAllVirtualEdge();g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE,"active");$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_TEXT,j.text);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_LABEL,j.label);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_SHAPE,j.shape)}})});$(b.rect).bind({click:function(i){g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);if(a){$(c).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE,"created")}}});$(b.rect).draggable({start:function(i){e.deselectAll();e._RENDERER.removeAllConnectGuide();e._RENDERER.removeAllVirtualEdge();g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);$(c).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE,"active")}})}}},setResizable:function(j,y,k){var x=this;var s=x._RENDERER.getRootGroup();if(!j||!y){return}var o=$(j).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE?true:false;var r=x._RENDERER;var t=x._RENDERER.getBoundary(j);var m=t.getUpperCenter().y;var q=t.getLowerCenter().y;var g=t.getLeftCenter().x;var i=t.getRightCenter().x;var w=t.getWidth();var n=t.getHeight();var d=function(Q){var P=[];var z=x._CONFIG.GUIDE_MIN_SIZE;var N=x._CONFIG.LANE_MIN_SIZE;var C=x._CONFIG.GROUP_INNER_SAPCE;if(!x._CONFIG.AUTOMATIC_GUIDANCE){return P}var R=x._CONFIG.EDGE_MOVE_DELAY_SIZE;var J=r.getAllShapes();$.each(J,function(T,U){if(r.isEdge(U)){return}if(U.id===j.id){return}var X=r.getBoundary(U);var S=X.getCentroid();var V=X.getUpperLeft();var W=X.getLowerRight();P.push({condition:{maxY:V.y-R,minY:V.y+R},fixedPosition:{y:V.y},guidePosition:{y:V.y},id:T});P.push({condition:{maxY:W.y-R,minY:W.y+R},fixedPosition:{y:W.y},guidePosition:{y:W.y},id:T});P.push({condition:{maxX:V.x-R,minX:V.x+R},fixedPosition:{x:V.x},guidePosition:{x:V.x},id:T});P.push({condition:{maxX:W.x-R,minX:W.x+R},fixedPosition:{x:W.x},guidePosition:{x:W.x},id:T});P.push({condition:{maxX:S.x-R,minX:S.x+R},fixedPosition:{x:S.x},guidePosition:{x:S.x},id:T});P.push({condition:{maxY:S.y-R,minY:S.y+R,},fixedPosition:{y:S.y},guidePosition:{y:S.y},id:T})});function A(){P.push({condition:{minX:g+z},fixedPosition:{x:g+z}})}function I(){P.push({condition:{maxX:i-z},fixedPosition:{x:i-z}})}function F(){P.push({condition:{maxY:q-z},fixedPosition:{y:q-z}})}function B(){P.push({condition:{minY:m+z},fixedPosition:{y:m+z}})}function D(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var U=r.getNearestBaseLaneIndexAsDirection(j,"upper");if(U>0){var T=S[U-1];var V=r.getBoundary(T).getHeight()-N;P.push({condition:{minY:m-V},fixedPosition:{y:m-V}})}}}function H(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var W=r.getNearestBaseLaneIndexAsDirection(j,"upper");var T=S[W];var Y=r.getBoundary(T).getHeight()-N;P.push({condition:{maxY:m+Y},fixedPosition:{y:m+Y}});if(W===0){var V=r.getBoundaryOfInnerShapesGroup(j);if(V){P.push({condition:{maxY:V.getUpperCenter().y-C},fixedPosition:{y:V.getUpperCenter().y-C}})}}}if(r.isVerticalLane(j)){var X=r.getSmallestBaseLane(j);var Y=r.getExceptTitleLaneArea(X).getHeight()-N;P.push({condition:{maxY:m+Y},fixedPosition:{y:m+Y}});var V=r.getBoundaryOfInnerShapesGroup(j);if(V){var Z=r.getRootLane(j);var U=r.getBoundary(Z).getHeight()-r.getExceptTitleLaneArea(Z).getHeight();P.push({condition:{maxY:V.getUpperCenter().y-C-U},fixedPosition:{y:V.getUpperCenter().y-C-U}})}}}function O(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var V=r.getNearestBaseLaneIndexAsDirection(j,"low");var T=S[V];var X=r.getBoundary(T).getHeight()-N;P.push({condition:{minY:q-X},fixedPosition:{y:q-X}});if(V===S.length-1){var U=r.getBoundaryOfInnerShapesGroup(j);if(U){P.push({condition:{minY:U.getLowerCenter().y+C},fixedPosition:{y:U.getLowerCenter().y+C}})}}}if(r.isVerticalLane(j)){var W=r.getSmallestBaseLane(j);var X=r.getExceptTitleLaneArea(W).getHeight()-N;P.push({condition:{minY:q-X},fixedPosition:{y:q-X}});var U=r.getBoundaryOfInnerShapesGroup(j);if(U){P.push({condition:{minY:U.getLowerCenter().y+C},fixedPosition:{y:U.getLowerCenter().y+C}})}}}function E(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var U=r.getNearestBaseLaneIndexAsDirection(j,"low");if(U0){var T=S[U-1];var V=r.getBoundary(T).getWidth()-N;P.push({condition:{maxX:i+V},fixedPosition:{x:i+V}})}}}if(b(Q)){F()}if(a(Q)){B()}if(f(Q)){I()}if(l(Q)){A()}if(r.isLane(j)){if(b(Q)){D();H()}if(a(Q)){O();E()}if(f(Q)){M();G()}if(l(Q)){K();L()}}return P};var c=function(A,D){var B={x:D.x,y:D.y};if(!x._CONFIG.AUTOMATIC_GUIDANCE){return B}var z=function(F){if(!F){return B}if(F.x&&!F.y){return{x:F.x,y:B.y}}if(F.y&&!F.x){return{x:B.x,y:F.y}}if(F.x&&F.y){return F}return B};var C=$(A).data("correctionConditions");if(!C){return B}var E=[];$.each(C,function(G,F){var I=F.condition;var H=true;if(I.minX){if(D.x>I.minX){H=false}}if(I.maxX){if(D.xI.minY){H=false}}if(I.maxY){if(D.y4){p=4}var h=d._CANVAS._CONTAINER;var g=m.x;var e=m.y;d.setScale(p);m=c._getOffset(f);var q=m.x;var o=m.y;var l=(g-q)*p;var k=(e-o)*p;var i=h.scrollLeft;var n=h.scrollTop;$(h).scrollLeft(i+l);$(h).scrollTop(n+k);d._CANVAS.updateNavigatior()};$(b).bind("mousewheel DOMMouseScroll",function(e){if(c._CONFIG.WHEEL_SCALABLE){e.preventDefault();e.stopPropagation();if(e.originalEvent.wheelDelta>0||e.deltaY>0){a(e,true)}else{a(e,false)}}})},setDragSelectable:function(isSelectable){var renderer=this._RENDERER;var me=this,rootEle=renderer.getRootElement(),root=renderer.getRootGroup();var correctionConditionAnalysis=function(correctionConditions,offset){var fixedPosition={x:offset.x,y:offset.y};var calculateFixedPosition=function(expectedPosition){if(!expectedPosition){return fixedPosition}if(expectedPosition.x&&!expectedPosition.y){return{x:expectedPosition.x,y:fixedPosition.y}}if(expectedPosition.y&&!expectedPosition.x){return{x:fixedPosition.x,y:expectedPosition.y}}if(expectedPosition.x&&expectedPosition.y){return expectedPosition}return fixedPosition};if(!correctionConditions||!correctionConditions.length){return fixedPosition}var conditionsPassCandidates=[];$.each(correctionConditions,function(index,correctionCondition){var condition=correctionCondition.condition;var conditionsPassToFix=true;if(condition.minX){if(offset.x>condition.minX){conditionsPassToFix=false}}if(condition.maxX){if(offset.xcondition.minY){conditionsPassToFix=false}}if(condition.maxY){if(offset.yOG.Constants.RUBBER_BAND_TOLERANCE&&Math.abs(height)>OG.Constants.RUBBER_BAND_TOLERANCE){$(this).data("rubber_band_status","start");x=width<=0?first.x+width:first.x;y=height<=0?first.y+height:first.y;renderer.drawRubberBand([x,y],[Math.abs(width),Math.abs(height)])}}});$(rootEle).bind("mouseup",function(event){var isConnectMode=$(root).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);var isRectMode=$(root).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE);if(isConnectMode==="active"||isRectMode==="active"){return}if("start"==$(this).data("rubber_band_status")&&!me._CONFIG.DRAG_PAGE_MOVABLE){var first=$(this).data("dragBox_first"),eventOffset,width,height,x,y,envelope,guide,elements=[];renderer.removeRubberBand(rootEle);if(first){eventOffset=me._getOffset(event);width=eventOffset.x-first.x;height=eventOffset.y-first.y;x=width<=0?first.x+width:first.x;y=height<=0?first.y+height:first.y;envelope=new OG.Envelope([x,y],Math.abs(width),Math.abs(height));$.each(renderer.getAllShapes(),function(index,element){if(!element.shape.geom){return}if(!envelope.isContainsAll(element.shape.geom.getVertices())){return}if(renderer.isEdge(element)){return}elements.push(element)});me.selectShapes(elements);$(this).data("dragBox",{width:width,height:height,x:x,y:y})}$(this).data("rubber_band_status","none")}});$(rootEle).bind("contextmenu",function(event){renderer.removeRubberBand(rootEle)})}else{$(rootEle).unbind("mousedown");$(rootEle).unbind("mousemove");$(rootEle).unbind("mouseup");$(rootEle).unbind("contextmenu")}},setEnableHotKey:function(d){var b=this;var c=b._RENDERER;if(d===true){var a;if(b._CONFIG.FOCUS_CANVAS_ONSELECT){a=$(c.getContainer())}else{a=$(document)}a.bind("keydown",function(e){if(!/^textarea$/i.test(e.target.tagName)&&!/^input$/i.test(e.target.tagName)){if(b._CONFIG.ENABLE_HOTKEY_CTRL_Z&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_Z){if(e.shiftKey){e.preventDefault();c.redo()}else{e.preventDefault();c.undo()}}if(b._CONFIG.ENABLE_HOTKEY_DELETE&&(e.keyCode===KeyEvent.DOM_VK_DELETE||e.keyCode===KeyEvent.DOM_VK_BACK_SPACE)){e.preventDefault();b.deleteSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_A&&b._CONFIG.SELECTABLE&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_A){e.preventDefault();b.selectAll()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_C&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_C){e.preventDefault();b.copySelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_C&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_X){e.preventDefault();b.cutSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_V&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_V){e.preventDefault();b.pasteSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_D&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_D){e.preventDefault();b.duplicateSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_G&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_G){e.preventDefault();b.groupSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_U&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_U){e.preventDefault();b.ungroupSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_SHIFT_ARROW){if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_LEFT){e.preventDefault();b._moveElements(b._getMoveTargets(),-1*(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1),0);c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_RIGHT){e.preventDefault();b._moveElements(b._getMoveTargets(),(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1),0);c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_UP){e.preventDefault();b._moveElements(b._getMoveTargets(),0,-1*(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1));c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_DOWN){e.preventDefault();b._moveElements(b._getMoveTargets(),0,(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1));c.addHistory()}}if(b._CONFIG.ENABLE_HOTKEY_ARROW){if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_LEFT){e.preventDefault();b._moveElements(b._getMoveTargets(),-1*(b._CONFIG.MOVE_SNAP_SIZE/2),0);b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_RIGHT){e.preventDefault();b._moveElements(b._getMoveTargets(),(b._CONFIG.MOVE_SNAP_SIZE/2),0);b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_UP){e.preventDefault();b._moveElements(b._getMoveTargets(),0,-1*(b._CONFIG.MOVE_SNAP_SIZE/2));b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_DOWN){e.preventDefault();b._moveElements(b._getMoveTargets(),0,(b._CONFIG.MOVE_SNAP_SIZE/2));b.selectShapes(b._getSelectedElement());c.addHistory()}}}})}else{$(c.getContainer()).unbind("keydown")}},enableRootContextMenu:function(){var a=this;var b=a._RENDERER;$.contextMenu({position:function(d,c,e){d.$menu.css({top:e+10,left:c+10})},selector:"#"+a._RENDERER.getRootElement().id,build:function(c,g){var f=a._RENDERER.getRootGroup(),d=$(f).data("copied");if(a._CONFIG.FOCUS_CANVAS_ONSELECT){$(a._RENDERER.getContainer()).focus()}return{items:{selectAll:{name:"모두 선택",callback:function(){a.selectAll()}},sep1:"---------",paste:{name:"붙여넣기",callback:function(){a.pasteSelectedShape(g)},disabled:(d?false:true)},sep2:"---------",view:{name:"스케일",items:{view_actualSize:{name:"실제 사이즈",callback:function(){a._RENDERER.setScale(1);b.addHistory()}},sep2_1:"---------",view_fitWindow:{name:"윈도우에 맞추기",callback:function(){a.fitWindow()}},sep2_2:"---------",view_25:{name:"25%",callback:function(){a._RENDERER.setScale(0.25);b.addHistory()}},view_50:{name:"50%",callback:function(){a._RENDERER.setScale(0.5);b.addHistory()}},view_75:{name:"75%",callback:function(){a._RENDERER.setScale(0.75);b.addHistory()}},view_100:{name:"100%",callback:function(){a._RENDERER.setScale(1);b.addHistory()}},view_150:{name:"150%",callback:function(){a._RENDERER.setScale(1.5);b.addHistory()}},view_200:{name:"200%",callback:function(){a._RENDERER.setScale(2);b.addHistory()}},view_300:{name:"300%",callback:function(){a._RENDERER.setScale(3);b.addHistory()}},view_400:{name:"400%",callback:function(){a._RENDERER.setScale(4);b.addHistory()}},sep2_3:"---------",view_zoomin:{name:"확대",callback:function(){a.zoomIn()}},view_zoomout:{name:"축소",callback:function(){a.zoomOut()}}}}}}}})},makeRotate:function(){var a=this;return{rotate:{name:"회전",items:{rotate_select:{name:"선택",type:"select",options:{"0":"0","45":"45","90":"90","135":"135","180":"180","-45":"-45","-90":"-90","-135":"-135","-180":"-180"},selected:"0",events:{change:function(b){a.rotateSelectedShape(b.target.value)}}},sep8_8_1:"---------",rotate_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.rotateSelectedShape(b.target.value)}}}}}}}},makeFillColor:function(){var a=this;return{fillColor:{name:"색상",items:{fillColor_select:{name:"선택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFillColorSelectedShape(b.target.value)}}}},sep5_1_1:"---------",fillColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFillColorSelectedShape(b.target.value)}}}}}}}},makeFillOpacity:function(){var a=this;return{fillOpacity:{name:"투명도",items:{fillOpacity_select:{name:"선택",type:"select",options:{"":"","0.0":"0%","0.1":"10%","0.2":"20%","0.3":"30%","0.4":"40%","0.5":"50%","0.6":"60%","0.7":"70%","0.8":"80%","0.9":"90%","1.0":"100%"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFillOpacitySelectedShape(b.target.value)}}}}}}}},makeLineStyle:function(){var a=this;return{lineStyle:{name:"선 스타일",items:{lineStyle_1:{name:"──────",type:"radio",radio:"lineStyle",value:"",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_2:{name:"---------",type:"radio",radio:"lineStyle",value:"-",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_3:{name:"············",type:"radio",radio:"lineStyle",value:".",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_4:{name:"-·-·-·-·-·",type:"radio",radio:"lineStyle",value:"-.",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_5:{name:"-··-··-··-",type:"radio",radio:"lineStyle",value:"-..",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_6:{name:"· · · · · ·",type:"radio",radio:"lineStyle",value:". ",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_7:{name:"- - - - -",type:"radio",radio:"lineStyle",value:"- ",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_8:{name:"─ ─ ─ ─",type:"radio",radio:"lineStyle",value:"--",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_9:{name:"- ·- ·- ·-",type:"radio",radio:"lineStyle",value:"- .",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_10:{name:"--·--·--·-",type:"radio",radio:"lineStyle",value:"--.",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_11:{name:"--··--··--",type:"radio",radio:"lineStyle",value:"--..",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}}}}}},makeLineColor:function(){var a=this;return{lineColor:{name:"선 색상",items:{lineColor_select:{name:"석택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setLineColorSelectedShape(b.target.value)}}}},sep5_4_1:"---------",lineColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLineColorSelectedShape(b.target.value)}}}}}}}},makeLineWidth:function(){var a=this;return{lineWidth:{name:"선 두께",items:{lineWidth_select:{name:"선택",type:"select",options:{0:"",1:"1px",2:"2px",3:"3px",4:"4px",5:"5px",6:"6px",8:"8px",10:"10px",12:"12px",16:"16px",24:"24px"},selected:0,events:{change:function(b){if(b.target.value!==0){a.setLineWidthSelectedShape(b.target.value)}}}},sep5_5_1:"---------",lineWidth_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLineWidthSelectedShape(b.target.value)}}}}}}}},makeFont:function(){var a=this;return{text:{name:"글꼴",items:{fontFamily:{name:"폰트",items:{fontFamily_1:{name:'Arial',type:"radio",radio:"fontFamily",value:"Arial",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_2:{name:"Comic Sans MS",type:"radio",radio:"fontFamily",value:"Comic Sans MS",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_3:{name:"Courier New",type:"radio",radio:"fontFamily",value:"Courier New",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_4:{name:'Garamond',type:"radio",radio:"fontFamily",value:"Garamond",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_5:{name:'Georgia',type:"radio",radio:"fontFamily",value:"Georgia",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_6:{name:"Lucida Console",type:"radio",radio:"fontFamily",value:"Lucida Console",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_7:{name:"MS Gothic",type:"radio",radio:"fontFamily",value:"MS Gothic",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_8:{name:"MS Sans Serif",type:"radio",radio:"fontFamily",value:"MS Sans Serif",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_9:{name:'Verdana',type:"radio",radio:"fontFamily",value:"Verdana",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_10:{name:"Times New Roman",type:"radio",radio:"fontFamily",value:"Times New Roman",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},sep6_1_1:"---------",fontFamily_custom:{name:"Custom",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontFamilySelectedShape(b.target.value)}}}}}},fontColor:{name:"글 색상",items:{fontColor_select:{name:"선택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFontColorSelectedShape(b.target.value)}}}},sep6_1_2:"---------",fontColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontColorSelectedShape(b.target.value)}}}}}},fontSize:{name:"글 크기",items:{fontSize_select:{name:"선택",type:"select",options:{"":"","6":"6","8":"8","9":"9","10":"10","11":"11","12":"12","14":"14","18":"18","24":"24","36":"36","48":"48","72":"72"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFontSizeSelectedShape(b.target.value)}}}},sep6_1_3:"---------",fontSize_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontSizeSelectedShape(b.target.value)}}}}}},sep6_1:"---------",fontWeight_bold:{name:'굵게',type:"checkbox",events:{change:function(b){if(b.target.checked){a.setFontWeightSelectedShape("bold")}else{a.setFontWeightSelectedShape("normal")}}}},fontWeight_italic:{name:'이탤릭',type:"checkbox",events:{change:function(b){if(b.target.checked){a.setFontStyleSelectedShape("italic")}else{a.setFontStyleSelectedShape("normal")}}}},sep6_2:"---------",position:{name:"글 위치",items:{position_left:{name:"왼쪽",type:"radio",radio:"position",value:"left",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_center:{name:"가운데",type:"radio",radio:"position",value:"center",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_right:{name:"오른쪽",type:"radio",radio:"position",value:"right",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_top:{name:"위",type:"radio",radio:"position",value:"top",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_bottom:{name:"아래",type:"radio",radio:"position",value:"bottom",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}}}},vertical:{name:"수직 정렬",items:{vertical_top:{name:"위",type:"radio",radio:"vertical",value:"top",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}},vertical_middle:{name:"가운데",type:"radio",radio:"vertical",value:"middle",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}},vertical_bottom:{name:"아래",type:"radio",radio:"vertical",value:"bottom",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}}}},horizontal:{name:"수평 정렬",items:{vertical_start:{name:"왼쪽",type:"radio",radio:"horizontal",value:"start",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}},horizontal_middle:{name:"가운데",type:"radio",radio:"horizontal",value:"middle",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}},horizontal_end:{name:"오른쪽",type:"radio",radio:"horizontal",value:"end",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}}}},sep6_5:"---------",textRotate:{name:"글 회전각",items:{textRotate_select:{name:"선택",type:"select",options:{"0":"0","45":"45","90":"90","135":"135","180":"180","-45":"-45","-90":"-90","-135":"-135","-180":"-180"},selected:"0",events:{change:function(b){a.setLabelAngleSelectedShape(b.target.value)}}},sep6_6_1:"---------",textRotate_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLabelAngleSelectedShape(b.target.value)}}}}}}}}}},makeBring:function(){var a=this;return{bringToFront:{name:"맨 앞으로 가져오기",items:{bringToFront:{name:"맨 앞으로 가져오기",callback:function(){a.bringToFront()}},bringForward:{name:"앞으로 가져오기",callback:function(){a.bringForward()}}}}}},makeSend:function(){var a=this;return{sendToBack:{name:"맨 뒤로 보내기",items:{sendToBack:{name:"맨 뒤로 보내기",callback:function(){a.sendToBack()}},sendBackward:{name:"뒤로 보내기",callback:function(){a.sendBackward()}}}}}},makeDelete:function(){var a=this;return{"delete":{name:"삭제",callback:function(){a.deleteSelectedShape()}}}},makeCopy:function(){var a=this;return{copy:{name:"복사",callback:function(){a.copySelectedShape()}}}},makeAlign:function(){var a=this;return{align:{name:"도형 정렬",items:{Top:{name:"위로정렬",type:"radio",radio:"align",value:"Top",events:{change:function(b){a._RENDERER.alignTop();a._RENDERER.addHistory()}}},Left:{name:"왼쪽정렬",type:"radio",radio:"align",value:"Left",events:{change:function(b){a._RENDERER.alignLeft();a._RENDERER.addHistory()}}},Right:{name:"오른쪽정렬",type:"radio",radio:"align",value:"Right",events:{change:function(b){a._RENDERER.alignRight();a._RENDERER.addHistory()}}},Bottom:{name:"아래로정렬",type:"radio",radio:"align",value:"Bottom",events:{change:function(b){a._RENDERER.alignBottom();a._RENDERER.addHistory()}}}}}}},makeFormat:function(){return{format:{name:"형식",items:this.mergeContextMenu(this.makeFillColor(),this.makeFillOpacity(),this.makeRotate(),this.makeLineStyle(),this.makeLineColor(),this.makeLineWidth())}}},makeMultiContextMenu:function(){return this.mergeContextMenu(this.makeDelete(),this.makeCopy(),this.makeAlign())},mergeContextMenu:function(){var d={};for(var c=0,a=arguments.length;c=a._CONFIG.SCALE_MIN){a._RENDERER.setScale(a._CONFIG.SCALE-a._CONFIG.SCALE*0.1)}a._RENDERER.addHistory()},fitWindow:function(){var b=this,a=b._RENDERER.getContainer();b._RENDERER.fitCanvasSize([a.clientWidth,a.clientHeight],true);b._RENDERER.addHistory()},_isContainsConnectedShape:function(a,k){var g=this,e,l,h,b,f=false,d=false,c;e=$(a).attr("_from");l=$(a).attr("_to");if(e){h=g._getShapeFromTerminal(e)}if(l){b=g._getShapeFromTerminal(l)}for(var c=0,j=k.length;c0){c._copyChildren(h,i)}}})},_deselectChildren:function(b){var c=this,a=b.childNodes;$.each(a,function(d,e){if($(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE){if(e.childNodes.length>0){c._deselectChildren(e);c._delSelectedElement(e)}if($(e).attr("_selected")==="true"){c._RENDERER.removeGuide(e);$(e).draggable("destroy")}}})},_isParentSelected:function(b){var c=this,a=b.parentNode;if(a){if(c._isParentSelected(a)){return true}if($(a).attr("_type")===OG.Constants.NODE_TYPE.SHAPE&&$(a).attr("_selected")==="true"){return true}}return false},_num:function(a){return parseInt(a,10)},_grid:function(c,a){var b=this;if(a){return b._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(c,b._CONFIG.MOVE_SNAP_SIZE/2):c}else{return b._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(c,b._CONFIG.MOVE_SNAP_SIZE):c}},_isSelectable:function(a){var b=this;return b._CONFIG.SELECTABLE&&a.SELECTABLE},_isConnectable:function(a){var b=this;return b._CONFIG.CONNECTABLE&&a.CONNECTABLE},_isConnectableFrom:function(a){var b=this;return a.ENABLE_FROM},_isConnectableTo:function(a){var b=this;return a.ENABLE_TO},_isSelfConnectable:function(a){var b=this;return b._CONFIG.SELF_CONNECTABLE&&a.SELF_CONNECTABLE},_isConnectCloneable:function(a){var b=this;return b._CONFIG.CONNECT_CLONEABLE&&a.CONNECT_CLONEABLE},_isMovable:function(a){var b=this;return(b._CONFIG.SELECTABLE&&a.SELECTABLE)&&(b._CONFIG.MOVABLE&&b._CONFIG.MOVABLE_[a.TYPE]&&a.MOVABLE)},_isDeletable:function(a){var b=this;return(b._CONFIG.DELETABLE&&a.DELETABLE)&&(b._CONFIG.DELETABLE&&b._CONFIG.DELETABLE_[a.TYPE]&&a.DELETABLE)},_isConnectStyleChangable:function(a){var b=this;return(b._CONFIG.CONNECT_STYLE_CHANGE&&a.CONNECT_STYLE_CHANGE)&&(b._CONFIG.CONNECT_STYLE_CHANGE&&b._CONFIG.CONNECT_STYLE_CHANGE_[a.TYPE]&&a.CONNECT_STYLE_CHANGE)},_isResizable:function(a){var b=this;return(b._CONFIG.SELECTABLE&&a.SELECTABLE)&&(b._CONFIG.RESIZABLE&&b._CONFIG.RESIZABLE_[a.TYPE]&&a.RESIZABLE)},_isLabelEditable:function(a){var b=this;return b._CONFIG.LABEL_EDITABLE&&b._CONFIG.LABEL_EDITABLE_[a.TYPE]&&a.LABEL_EDITABLE},_addSelectedElement:function(a){if(undefined==this.selectedElements){this.selectedElements={}}this.selectedElements[a.attributes.id.value]=a;if(a.shape){a.shape.onSelectShape()}},_delSelectedElement:function(a){if(this.selectedElements){delete this.selectedElements[a.attributes.id.value];if(a.shape){a.shape.onDeSelectShape()}}},_getSelectedElement:function(){var a,b=[];for(a in this.selectedElements){b.push(this.selectedElements[a])}return b},_isSelectedElement:function(c){var a=false;if(c&&c.id){for(var b in this.selectedElements){if(b===c.id){a=true}}}return a},_removeAllSelectedElement:function(){var b;for(b in this.selectedElements){var a=this.selectedElements[b];delete this.selectedElements[b];if(a&&a.shape){a.shape.onDeSelectShape()}}},setConnectGuide:function(e,d){var h=this._RENDERER;var i=this,m,g,f,c,b,j=h.getRootGroup();var j=h.getRootGroup();var l=function(u){var r=i._CONFIG.EDGE_MOVE_DELAY_SIZE;var p=[];var o=[];var v=$(u).data("type");var t=e.shape.geom.getVertices();var n;if(!i._CONFIG.AUTOMATIC_GUIDANCE){n=e.shape.geom.getVertices();$.each(n,function(w,x){o.push(x)})}else{var q=h.getAllEdges();$.each(q,function(w,x){n=x.shape.geom.getVertices();$.each(n,function(y,z){o.push(z)})})}if(v===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var s=$(u).data("index");if(s===0||s===t.length-1){$.each(j.childNodes,function(x,z){if($(z).attr("_type")===OG.Constants.NODE_TYPE.SHAPE&&$(z).attr("_shape")!==OG.Constants.SHAPE_TYPE.EDGE){var B=h.getBoundary(z);if(B&&B._upperLeft){var y=B._upperLeft;var A=B._width;var w=B._height;p.push({condition:{minX:y.x+(A/2)-r,maxX:y.x+(A/2)+r,minY:y.y,maxY:y.y+w,},fixedPosition:{x:y.x+(A/2)},id:x});p.push({condition:{minX:y.x,maxX:y.x+A,minY:y.y+(w/2)-r,maxY:y.y+(w/2)+r,},fixedPosition:{y:y.y+(w/2)},id:x})}}})}}$.each(o,function(x,w){p.push({condition:{minX:w.x-r,maxX:w.x+r,},fixedPosition:{x:w.x},id:x});p.push({condition:{minY:w.y-r,maxY:w.y+r,},fixedPosition:{y:w.y},id:x})});$(u).data("correctionConditions",p)};var k=function(q,r){var o={x:r.x,y:r.y};var n=function(t){if(!t){return o}if(t.x&&!t.y){return{x:t.x,y:o.y}}if(t.y&&!t.x){return{x:o.x,y:t.y}}if(t.x&&t.y){return t}return o};var p=$(q).data("correctionConditions");if(!p){return o}var s=[];$.each(p,function(u,t){var w=t.condition;var v=true;if(w.minX){if(r.xw.maxX){v=false}}if(w.minY){if(r.yw.maxY){v=false}}if(v){s.push(t)}});$.each(s,function(t,u){o=n(u.fixedPosition)});return o};var a=function(p){var q;var o=e.shape.geom.getVertices();if($(p).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var n=$(p).data("index");if(n||n===0){if(n===0){q="from"}if(n===o.length-1){q="to"}}}return q};$(e).bind({mousemove:function(r){if(!i._isConnectable(e.shape)){return}var p=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var s=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var n=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER);var q=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);var o=$(j).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);if(!p||n||q||o){return}if(s){if(i._CONFIG.SPOT_ON_SELECT&&$(e).attr("_selected")!="true"){return}c=i._getOffset(r);var t=h.createVirtualSpot(c.x,c.y,e);if(t){$(t).bind({mousedown:function(){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,true)},mouseup:function(){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false)}});$(t).draggable({start:function(v){h.removeAllGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,true);var x=i._getOffset(v);var I=$(this).data("vertice");var E=e.shape.geom;$(this).data("offset",{x:x.x-I.x,y:x.y-I.y});var w=$(this).data("prev");var A=$(this).data("next");var C=E.getVertices();var y=$(this).data("offset");var u=x.x-y.x;var K=x.y-y.y;var J=E.convertCoordinate([u,K]);f=h.getCircleSpots(e);$.each(f,function(N,L){var M=$(L).data("index");if(M>=A){$(L).data("index",M+1)}});C.splice(A,0,J);E.setVertices(C);$(this).attr("name",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT);$(this).data("index",A);var D=true;if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var B=$(this).data("index");if(B===0&&B===C.length-1){D=false}}if(D){var G=$(e).attr("_from");var F=$(e).attr("_to");if(G){var z=h._getPositionFromTerminal(G);C[0]=E.convertCoordinate([z.x,z.y])}if(F){var H=h._getPositionFromTerminal(F);C[C.length-1]=E.convertCoordinate([H.x,H.y])}E.setVertices(C)}$(this).data("corrections",l(t));e=h.drawEdge(new OG.PolyLine(C),E.style,e.id);h.removeRubberBand(h.getRootElement());h.selectSpot(t)},drag:function(w){if(!h._getREleById(t.id)){h.removeAllConnectGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);return}var x=i._getOffset(w);var B=$(this).data("offset");var A=x.x-B.x;var z=x.y-B.y;var v=e.shape.geom.getVertices();var y=k(t,{x:A,y:z});A=y.x;z=y.y;h.setAttr(t,{cx:A});h.setAttr(t,{cy:z});var u=$(this).data("index");v[u].x=A;v[u].y=z;h.drawEdge(new OG.PolyLine(v),e.shape.geom.style,e.id);h.trimConnectIntersection(e)},stop:function(w){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);var x=i._getOffset(w);var B=$(this).data("offset");var v=$(this).data("index");var A=x.x-B.x;var z=x.y-B.y;var u=e.shape.geom.getVertices();var y=k(t,{x:A,y:z});y.x=i._grid(y.x,"move");y.y=i._grid(y.y,"move");A=y.x;z=y.y;u[v].x=A;u[v].y=z;h.drawEdge(new OG.PolyLine(u),e.shape.geom.style,e.id);h.removeConnectGuide(e);h.removeVirtualSpot(e);h.trimConnectInnerVertice(e);h.trimConnectIntersection(e);h.trimEdge(e);h.addHistory()}})}}},mouseout:function(p){if(!i._isConnectable(e.shape)){return}var n=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var q=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var o=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);if(!n){return}if(!q){if(o){return}h.removeConnectGuide(e)}if(q){if(o){return}b=false;c=i._getOffset(p);g=h.getSpots(e);$(g).each(function(s,t){m=h.getBBox(t);if(c.x>=m.x&&c.x<=m.x2&&c.y>=m.y&&c.y<=m.y2){b=true}});var r=h.getVirtualSpot(e);if(r){m=h.getBBox(r);if(c.x>=m.x&&c.x<=m.x2&&c.y>=m.y&&c.y<=m.y2){b=true}}if(!b){h.removeConnectGuide(e);h.removeVirtualSpot(e)}}p.stopImmediatePropagation()},mouseover:function(s){if(!i._isConnectable(e.shape)){return}var n;var o=i._CONFIG.DEFAULT_STYLE.CONNECTABLE_HIGHLIGHT;var q=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var t=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var r=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);var p=$(j).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);if(!q){return}if(!t){if(r){return}h.removeAllConnectGuide();h.drawConnectGuide(e)}if(t){if(i._CONFIG.SPOT_ON_SELECT&&$(e).attr("_selected")!="true"){return}if(p){return}if(r){return}h.removeOtherConnectGuide(e);n=h.drawConnectGuide(e);if(n&&n.spots){$(n.spots).each(function(u,v){$(v).bind({mouseover:function(){var w=false;if($(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG)){w=true}if(!w){h.selectSpot(v);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,true)}},mouseout:function(){var w=false;if($(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG)){w=true}if(!w){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false)}}});$(v).draggable({start:function(w){h.removeAllGuide();h.toFront(e);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,true);var z=i._getOffset(w);var K=$(this).data("vertice");var G=e.shape.geom;var E=G.getVertices();$(this).data("offset",{x:z.x-K.x,y:z.y-K.y});var F=true;if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var D=$(this).data("index");if(D===0||D===E.length-1){F=false}}$(this).data("needToRedrawVertices",F);if(F){var I=$(e).attr("_from");var H=$(e).attr("_to");if(I){var B=h._getPositionFromTerminal(I);E[0]=G.convertCoordinate([B.x,B.y])}if(H){var J=h._getPositionFromTerminal(H);E[E.length-1]=G.convertCoordinate([J.x,J.y])}G.setVertices(E)}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){$(this).data("corrections",l(v));h.remove(n.bBox);h.removeRubberBand(h.getRootElement())}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){E=G.getVertices();var y=$(this).data("prev");var A=$(this).data("next");if(y===0){var C=e.shape.geom.convertCoordinate([E[0].x,E[0].y]);E.splice(y,0,C);$(this).data("prev",y+1);$(this).data("next",A+1);A=A+1}if(A===E.length-1){var x=G.convertCoordinate([E[E.length-1].x,E[E.length-1].y]);E.splice(A,0,x)}G.setVertices(E);$(this).data("corrections",l(v));h.remove(n.bBox);h.removeRubberBand(h.getRootElement())}},drag:function(z){if(!h._getREleById(v.id)){h.removeAllConnectGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);return}var B=i._getOffset(z);var C=$(this).data("offset");var y=B.x-C.x;var K=B.y-C.y;var F=e.shape.geom.getVertices();var G=k(v,{x:y,y:K});if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){y=G.x;K=G.y;h.setAttr(v,{cx:y});h.setAttr(v,{cy:K});var E=$(this).data("index");F[E].x=y;F[E].y=K}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){y=G.x;K=G.y;var x=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var J=x.h;var H=$(this).data("direction");var A=$(this).data("prev");var D=$(this).data("next");if(H==="vertical"){F[A].x=y;F[D].x=y;h.setAttr(v,{x:y-(J/2)})}if(H==="horizontal"){F[A].y=K;F[D].y=K;h.setAttr(v,{y:K-(J/2)})}}h.drawEdge(new OG.PolyLine(F),e.shape.geom.style,e.id);if($(this).data("needToRedrawVertices")){h.trimConnectIntersection(e)}var w=a(v);var I=h.getFrontForCoordinate([B.x,B.y]);$.each(h.getAllNotEdges(),function(L,M){if(I&&w){if(M.id===I.id){h.setHighlight(M,o);h.drawConnectGuide(M)}else{h.removeHighlight(M,o);h.removeConnectGuide(M)}}else{h.removeHighlight(M,o);h.removeConnectGuide(M)}})},stop:function(H){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);var N=i._getOffset(H);var x=$(this).data("offset");var z=$(this).data("index");var L=N.x-x.x;var J=N.y-x.y;var y=e.shape.geom.getVertices();var B=k(v,{x:L,y:J});B.x=i._grid(B.x,"move");B.y=i._grid(B.y,"move");if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){L=B.x;J=B.y;h.setAttr(v,{cx:L});h.setAttr(v,{cy:J});var z=$(this).data("index");y[z].x=L;y[z].y=J}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){L=B.x;J=B.y;var w=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var C=w.h;var M=$(this).data("direction");var D=$(this).data("prev");var E=$(this).data("next");if(M==="vertical"){y[D].x=L;y[E].x=L;h.setAttr(v,{x:L-(C/2)})}if(M==="horizontal"){y[D].y=J;y[E].y=J;h.setAttr(v,{y:J-(C/2)})}}h.drawEdge(new OG.PolyLine(y),e.shape.geom.style,e.id);h.removeConnectGuide(e);h.removeVirtualSpot(e);var A=a(v);var I=h.getFrontForCoordinate([N.x,N.y]);if(I){h.removeHighlight(I,o)}if(A&&I){var F=[L,J];var K=h.createTerminalString(I,F);var G=i._isConnectable(I.shape);if(G){if(A==="from"){if(i._isConnectableFrom(I.shape)){h.connect(K,null,e,e.shape.geom.style)}}if(A==="to"){if(i._isConnectableTo(I.shape)){h.connect(null,K,e,e.shape.geom.style)}}}}if(A&&!I){h.disconnectOneWay(e,A)}h.trimConnectInnerVertice(e);h.trimConnectIntersection(e);h.trimEdge(e);h.addHistory()}})})}}s.stopImmediatePropagation()}})}};OG.handler.EventHandler.prototype.constructor=OG.handler.EventHandler;OG.EventHandler=OG.handler.EventHandler;OG.handler.RemoteUser=function(b,a,c){this.key=b;this.name=a;this.sessionId=c;this.isMaster=false;this.editable=false};OG.handler.RemoteUser.prototype={getKey:function(){return this.key},setKey:function(a){this.key=a},getName:function(){return this.name},setName:function(a){this.name=a},getSessionId:function(){return this.sessionId},setSessionId:function(a){this.sessionId=a},getIsMaster:function(){return this.isMaster},setIsMaster:function(a){this.isMaster=a},getEditable:function(){return this.editable},setEditable:function(a){this.editable=a}};OG.handler.RemoteUser.prototype.constructor=OG.handler.RemoteUser;OG.RemoteUser=OG.handler.RemoteUser();OG.handler.RemoteRepo={};OG.handler.RemoteHandler=function(){this._REPO=OG.handler.RemoteRepo;this._CLASSNAME="org.uengine.opengraph.RemoteService";this._SESSIONID=null;this._ENCODESUFFIX="_%$";this._SCHEDULER=null};OG.handler.RemoteHandler.prototype={encodeJson:function(a){return JSON.stringify(a).replace(/"/gi,this._ENCODESUFFIX)},getRepo:function(){return this._REPO},setCanvasForIdentifier:function(b,a){var c=this.getRepo();if(!c[a]){c[a]={canvas:null,users:[]}}c[a].canvas=b;return c[a]},getCanvasByIdentifier:function(a){var b=this.getRepo();if(!b[a]){return null}return b[a].canvas},getRemote:function(c){var b={__className:this._CLASSNAME};if(c){for(var a in c){b[a]=c[a]}}return new MetaworksObject(b,"body")},convertRemoteUser:function(b){var a=new OG.handler.RemoteUser();a.setKey(b.key);a.setName(b.name);a.setSessionId(b.sessionId);a.setIsMaster(b.isMaster);a.setEditable(b.editable);return a},closeRemote:function(b){var a=b.__objectId;$("#objDiv_"+a).remove();delete mw3.objects[a]},getCanvasId:function(a){return a._CONTAINER.id},startRemote:function(c,b,a,e){var d=this;if(!c||!b||!a){return}if(!a.key||!a.name){return}c.setRemotable(true);c.setIdentifier(b);d.setCanvasForIdentifier(c,b);d.registeToServer(b,a,function(f){e(f)})},getSelfSession:function(d){if(this._SESSIONID){d(this._SESSIONID);return}var b=this;var c=this.getRemote();var a=c.__objectId;c.selfSession(null,function(){var e=mw3.objects[a]["currentSessionId"];b.closeRemote(c);if(e){b._SESSIONID=e}d(e)})},registeToServer:function(d,c,g){var e=this,b;var f=this.getRemote({identifier:d,remoteUser:e.encodeJson(c)});var a=f.__objectId;f.registe(null,function(i){b=mw3.objects[a];e.closeRemote(f);var h=e.convertRemoteUser(JSON.parse(b.remoteUser));g(h)})},updateRemoteUser:function(e){var d=this;var g=JSON.parse(e);var b=g.identifier;var c=g.remoteUsers;if(!this.getRepo()[b]){return}var f=[];var a=this.getCanvasByIdentifier(b);this.getSelfSession(function(j){$.each(c,function(k,l){if(l.sessionId&&l.sessionId==j){a.setRemoteEditable(l.editable);a.setRemoteIsMaster(l.isMaster);$(a.getRootElement()).trigger("remoteStatusUpdated",[l])}if(l.isMaster){f.push(d.convertRemoteUser(l))}});$.each(c,function(k,l){if(!l.isMaster){f.push(d.convertRemoteUser(l))}});d.getRepo()[b]["users"]=f;var i=$("#"+d.getCanvasId(a));i.find(".userPanel").remove();var h=$('
    ');h.css({position:"absolute",top:"0px",left:"0px"});i.append(h);$.each(f,function(m,n){var l=$('
    ');if(n.isMaster){l.append(""+n.getName()+" (Master)")}else{l.append(""+n.getName()+" ");if(a.getRemoteIsMaster()){var k;if(!n.editable){k=$("");k.data("identifier",b);k.data("mode","readonly");k.data("user",n)}else{k=$("");k.data("identifier",b);k.data("mode","editable");k.data("user",n)}l.append(k);k.click(function(){var q=$(this).data("identifier");var p=$(this).data("mode");var o=$(this).data("user");if(p==="readonly"){o.setEditable(true)}else{o.setEditable(false)}d.updateUserState(q,o,function(){})})}}h.append(l)})})},updateUserState:function(d,c,g){var e=this,b;var f=this.getRemote({identifier:d,remoteUser:e.encodeJson(c)});var a=f.__objectId;f.updateUserState(null,function(){b=mw3.objects[a];e.closeRemote(f);var h=e.convertRemoteUser(JSON.parse(b.remoteUser));g(h)})},updateCanvas:function(d){var e=JSON.parse(d);var c=e.identifier;var b=e.canvasData;var a=this.getCanvasByIdentifier(c);if(!a||!a.getRemotable()){return}a.setRemoteDuring(true);a.loadJSON(b);a.setRemoteDuring(false);$(a.getRootElement()).trigger("updateCanvas",[b])},broadCastCanvas:function(d,g){if(!d.getRemotable()){g(null);return}if(!d.getRemoteEditable()){g(null);return}var c=d.getIdentifier();var e=this,b;var f=this.getRemote({identifier:c,canvasData:e.encodeJson(d.toJSON())});var a=f.__objectId;f.broadCastCanvas(null,function(){b=mw3.objects[a];e.closeRemote(f);g(d)})},remoteExit:function(c,f){var d=this,b;var e=this.getRemote({identifier:c});var a=e.__objectId;e.remoteUserExited(null,function(){b=mw3.objects[a];d.closeRemote(e);f(null)})},checkExpiredRemoteCanvas:function(){if(this._SCHEDULER){return}var d=this,c,b,a;this._SCHEDULER=setInterval(function(){c=d.getRepo();for(b in c){a=c[b].canvas;if(a&&d.getCanvasId(a)&&$("#"+d.getCanvasId(a)).length){return}delete c[b];d.remoteExit(b,function(){})}},1000)}};OG.handler.RemoteHandler.prototype.constructor=OG.handler.RemoteHandler;OG.RemoteHandler=new OG.handler.RemoteHandler();OG.RemoteHandler.checkExpiredRemoteCanvas();OG.graph.Canvas=function(a,d,b,c){this._CONFIG={AUTOMATIC_GUIDANCE:true,SPOT_ON_SELECT:false,BACKDOOR:{url:null,scale:100,opacity:1,width:null,height:null,container:null,container_updated:false},FAST_LOADING:false,AUTO_SLIDER_UPDATE:true,AUTO_HISTORY:false,WHEEL_SCALABLE:false,DRAG_PAGE_MOVABLE:false,FOCUS_CANVAS_ONSELECT:true,CHECK_BRIDGE_EDGE:true,STICK_GUIDE:true,SLIDER:null,REMOTE_PERFORMED_DURING:false,REMOTE_IDENTIFIER:null,REMOTEABLE:false,REMOTE_EDITABLE:false,REMOTE_ISMASTER:false,HISTORY_INDEX:0,HISTORY:[],HISTORY_SIZE:100,USE_SLIDER:true,SELECTABLE:true,DRAG_SELECTABLE:true,MOVABLE:true,MOVABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},RESIZE_CANVAS_MARGIN:5,RESIZABLE:true,RESIZABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},CONNECTABLE:true,SELF_CONNECTABLE:true,CONNECT_CLONEABLE:true,CONNECT_STYLE_CHANGE:true,CONNECT_STYLE_CHANGE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},DELETABLE:true,DELETABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},LABEL_EDITABLE:true,LABEL_EDITABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},GROUP_DROPABLE:true,DRAG_GRIDABLE:true,ENABLE_HOTKEY:true,ENABLE_HOTKEY_CTRL_Z:true,ENABLE_HOTKEY_DELETE:true,ENABLE_HOTKEY_CTRL_A:true,ENABLE_HOTKEY_CTRL_C:true,ENABLE_HOTKEY_CTRL_V:true,ENABLE_HOTKEY_CTRL_D:true,ENABLE_HOTKEY_CTRL_G:true,ENABLE_HOTKEY_CTRL_U:true,ENABLE_HOTKEY_ARROW:true,ENABLE_HOTKEY_SHIFT_ARROW:true,ENABLE_CONTEXTMENU:true,ENABLE_ROOT_CONTEXTMENU:true,SCALE:1,SCALE_MIN:0.1,SCALE_MAX:10,EDGE_PADDING:20,LABEL_PADDING:5,LABEL_EDITOR_WIDTH:500,LABEL_EDITOR_HEIGHT:16,FROMTO_LABEL_OFFSET_TOP:15,GUIDE_LINE_SIZE:20,GUIDE_LINE_MARGIN:10,GUIDE_RECT_SIZE:8,GUIDE_MIN_SIZE:18,GUIDE_CONTROL_LINE_NUM:2,COLLAPSE_SIZE:10,MOVE_SNAP_SIZE:8,TERMINAL_SIZE:5,COPY_PASTE_PADDING:20,FIT_CANVAS_PADDING:20,AUTO_EXTENSIONAL:true,AUTO_EXTENSION_SIZE:100,CANVAS_BACKGROUND:"#f9f9f9",IMAGE_BASE:"resources/images/symbol/",IMAGE_USER:"http://processcodi.com/images/opengraph/User.png",IMAGE_SEND:"http://processcodi.com/images/opengraph/Send.png",IMAGE_RECEIVE:"http://processcodi.com/images/opengraph/Receive.png",IMAGE_MANUAL:"http://processcodi.com/images/opengraph/Manual.png",IMAGE_SERVICE:"http://processcodi.com/images/opengraph/Service.png",IMAGE_RULE:"http://processcodi.com/images/opengraph/BusinessRule.png",IMAGE_SCRIPT:"http://processcodi.com/images/opengraph/Script.png",IMAGE_MAPPER:"http://processcodi.com/images/opengraph/mapper.png",IMAGE_WEB:"http://processcodi.com/images/opengraph/w_services.png",TRIM_EDGE_ANGLE_SIZE:170,EDGE_MOVE_DELAY_SIZE:14,LANE_MIN_SIZE:50,LANE_DEFAULT_SIZE:100,POOL_DEFAULT_SIZE:[300,200],GROUP_INNER_SAPCE:10,LABEL_MIN_SIZE:0,LABEL_MAX_SIZE:1000,DEFAULT_STYLE:{SHAPE:{cursor:"default"},GEOM:{stroke:"black","fill-r":".5","fill-cx":".5","fill-cy":".5",fill:"white","fill-opacity":0,"label-position":"center"},TEXT:{stroke:"none","text-anchor":"middle"},HTML:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},IMAGE:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},SVG:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},EDGE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.5,"stroke-opacity":1,"edge-type":"plain","arrow-start":"none","arrow-end":"block","stroke-dasharray":"","label-position":"center","stroke-linejoin":"round",cursor:"pointer"},EDGE_SHADOW:{stroke:"#00FF00",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,"arrow-start":"none","arrow-end":"none","stroke-dasharray":"- ","edge-type":"plain",cursor:"pointer"},EDGE_HIDDEN:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":10,"stroke-opacity":0,cursor:"pointer"},GROUP:{stroke:"black",fill:"none","fill-opacity":0,"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},GROUP_HIDDEN:{stroke:"black",fill:"white","fill-opacity":0,"stroke-opacity":0,cursor:"move"},GROUP_SHADOW:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":15,"stroke-opacity":0,cursor:"pointer"},GROUP_SHADOW_MAPPER:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":0,cursor:"pointer"},GUIDE_BBOX:{stroke:"#00FF00",fill:"white","fill-opacity":0,"stroke-dasharray":"- ","shape-rendering":"crispEdges",cursor:"move"},GUIDE_UL:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nwse-resize","shape-rendering":"crispEdges"},GUIDE_UR:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nesw-resize","shape-rendering":"crispEdges"},GUIDE_LL:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nesw-resize","shape-rendering":"crispEdges"},GUIDE_LR:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nwse-resize","shape-rendering":"crispEdges"},GUIDE_LC:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_UC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_RC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_LWC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_FROM:{stroke:"black",fill:"#00FF00",cursor:"move","shape-rendering":"crispEdges"},GUIDE_TO:{stroke:"black",fill:"#00FF00",cursor:"move","shape-rendering":"crispEdges"},GUIDE_CTL_H:{stroke:"black",fill:"#00FF00",cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_CTL_V:{stroke:"black",fill:"#00FF00",cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_SHADOW:{stroke:"black",fill:"none","stroke-dasharray":"- ","shape-rendering":"crispEdges"},GUIDE_LINE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.2,"stroke-opacity":1,"stroke-dasharray":"","arrow-end":"block","stroke-linejoin":"round",cursor:"pointer"},GUIDE_LINE_ESSENSIA:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.2,"stroke-opacity":1,"stroke-dasharray":"","arrow-start":"diamond","arrow-end":"none","stroke-linejoin":"round",cursor:"pointer"},GUIDE_VIRTUAL_EDGE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,"stroke-dasharray":"- ","stroke-linejoin":"round","arrow-start":"none","arrow-end":"none"},GUIDE_LINE_AREA:{stroke:"#ffffff",fill:"#ffffff","fill-opacity":0.1,"stroke-width":1,"stroke-opacity":0.2,cursor:"pointer"},GUIDE_RECT_AREA:{stroke:"black",fill:"#ffffff","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,cursor:"pointer"},RUBBER_BAND:{stroke:"#0000FF",opacity:0.2,fill:"#0077FF"},DROP_OVER_BBOX:{stroke:"#0077FF",fill:"none",opacity:0.3,"shape-rendering":"crispEdges"},LABEL:{"font-size":12,"font-color":"black",fill:"none"},LABEL_EDITOR:{position:"absolute",overflow:"visible",resize:"none","text-align":"center",display:"block",padding:0},COLLAPSE:{stroke:"black",fill:"none","fill-opacity":0,cursor:"pointer","shape-rendering":"crispEdges"},COLLAPSE_BBOX:{stroke:"none",fill:"none","fill-opacity":0},BUTTON:{stroke:"#9FD7FF",fill:"white","fill-opacity":0,cursor:"pointer","shape-rendering":"crispEdges"},CONNECT_GUIDE_EVENT_AREA:{stroke:"#ffffff",fill:"none","fill-opacity":0,"stroke-width":20,"stroke-opacity":0},CONNECT_GUIDE_BBOX:{stroke:"#00FF00",fill:"none","stroke-dasharray":"- ","shape-rendering":"crispEdges"},CONNECT_GUIDE_BBOX_EXPEND:10,CONNECT_GUIDE_SPOT_CIRCLE:{r:7,stroke:"#A6A6A6","stroke-width":1,fill:"#FFE400","fill-opacity":0.5,cursor:"pointer"},CONNECT_GUIDE_SPOT_RECT:{stroke:"#A6A6A6","stroke-width":1,fill:"#FFE400","fill-opacity":0.2,cursor:"ns-resize",w:20,h:10},CONNECTABLE_HIGHLIGHT:{"stroke-width":2},NOT_CONNECTABLE_HIGHLIGHT:{fill:"#FAAFBE","fill-opacity":0.5}}};this._RENDERER=a?new OG.RaphaelRenderer(a,d,b,c,this._CONFIG):null;this._RENDERER._CANVAS=this;this._HANDLER=new OG.EventHandler(this._RENDERER,this._CONFIG);this._CONTAINER=OG.Util.isElement(a)?a:document.getElementById(a)};OG.graph.Canvas.prototype={fastLoadingON:function(){this._CONFIG.FAST_LOADING=true},fastLoadingOFF:function(){this._CONFIG.FAST_LOADING=false;this.updateSlider()},getEventHandler:function(){return this._HANDLER},setRemoteDuring:function(a){this._CONFIG.REMOTE_PERFORMED_DURING=a},getRemoteDuring:function(){return this._CONFIG.REMOTE_PERFORMED_DURING},setIdentifier:function(a){this._CONFIG.REMOTE_IDENTIFIER=a},getIdentifier:function(){return this._CONFIG.REMOTE_IDENTIFIER},getRemotable:function(){return this._CONFIG.REMOTEABLE},setRemotable:function(a){this._CONFIG.REMOTEABLE=a},setRemoteEditable:function(a){this._CONFIG.REMOTE_EDITABLE=a},getRemoteEditable:function(){return this._CONFIG.REMOTE_EDITABLE},setRemoteIsMaster:function(a){this._CONFIG.REMOTE_ISMASTER=a},getRemoteIsMaster:function(){return this._CONFIG.REMOTE_ISMASTER},setCurrentCanvas:function(a){this._RENDERER.setCanvas(a)},initConfig:function(a){if(a){this._CONFIG.REMOTEABLE=a.remoteable===undefined?this._CONFIG.REMOTEABLE:a.remoteable;this._CONFIG.SELECTABLE=a.selectable===undefined?this._CONFIG.SELECTABLE:a.selectable;this._CONFIG.DRAG_SELECTABLE=a.dragSelectable===undefined?this._CONFIG.DRAG_SELECTABLE:a.dragSelectable;this._CONFIG.MOVABLE=a.movable===undefined?this._CONFIG.MOVABLE:a.movable;this._CONFIG.RESIZABLE=a.resizable===undefined?this._CONFIG.RESIZABLE:a.resizable;this._CONFIG.CONNECTABLE=a.connectable===undefined?this._CONFIG.CONNECTABLE:a.connectable;this._CONFIG.SELF_CONNECTABLE=a.selfConnectable===undefined?this._CONFIG.SELF_CONNECTABLE:a.selfConnectable;this._CONFIG.CONNECT_CLONEABLE=a.connectCloneable===undefined?this._CONFIG.CONNECT_CLONEABLE:a.connectCloneable;this._CONFIG.LABEL_EDITABLE=a.labelEditable===undefined?this._CONFIG.LABEL_EDITABLE:a.labelEditable;this._CONFIG.GROUP_DROPABLE=a.groupDropable===undefined?this._CONFIG.GROUP_DROPABLE:a.groupDropable;this._CONFIG.ENABLE_HOTKEY=a.enableHotKey===undefined?this._CONFIG.ENABLE_HOTKEY:a.enableHotKey;this._CONFIG.ENABLE_CONTEXTMENU=a.enableContextMenu===undefined?this._CONFIG.ENABLE_CONTEXTMENU:a.enableContextMenu;this._CONFIG.AUTO_EXTENSIONAL=a.autoExtensional===undefined?this._CONFIG.AUTO_EXTENSIONAL:a.autoExtensional;this._CONFIG.USE_SLIDER=a.useSlider===undefined?this._CONFIG.USE_SLIDER:a.useSlider;this._CONFIG.STICK_GUIDE=a.stickGuide===undefined?this._CONFIG.STICK_GUIDE:a.stickGuide;this._CONFIG.CHECK_BRIDGE_EDGE=a.checkBridgeEdge===undefined?this._CONFIG.CHECK_BRIDGE_EDGE:a.checkBridgeEdge;this._CONFIG.AUTO_HISTORY=a.autoHistory===undefined?this._CONFIG.AUTO_HISTORY:a.autoHistory;this._CONFIG.AUTO_SLIDER_UPDATE=a.autoSliderUpdate===undefined?this._CONFIG.AUTO_SLIDER_UPDATE:a.autoSliderUpdate}this._HANDLER.setDragSelectable(this._CONFIG.SELECTABLE&&this._CONFIG.DRAG_SELECTABLE);this._HANDLER.setWheelScale();this._HANDLER.setDragPageMovable();this._HANDLER.setEnableHotKey(this._CONFIG.ENABLE_HOTKEY);if(this._CONFIG.ENABLE_CONTEXTMENU){if(this._CONFIG.ENABLE_ROOT_CONTEXTMENU){this._HANDLER.enableRootContextMenu()}this._HANDLER.enableShapeContextMenu()}this.CONFIG_INITIALIZED=true},getRenderer:function(){return this._RENDERER},getContainer:function(){return this._CONTAINER},getEventHandler:function(){return this._HANDLER},addBackDoor:function(b,e,a){var c=this;var d=new Image();d.src=b;d.onload=function(){var j=d.naturalWidth;var m=d.naturalHeight;c._CONFIG.BACKDOOR.url=b;c._CONFIG.BACKDOOR.scale=e?e:c._CONFIG.BACKDOOR.scale;c._CONFIG.BACKDOOR.opacity=a?a:c._CONFIG.BACKDOOR.opacity;c._CONFIG.BACKDOOR.width=j;c._CONFIG.BACKDOOR.height=m;c._CONFIG.BACKDOOR.container_updated=true;var i=c._CONTAINER;var l=i.id+OG.Constants.BACKDOOR_SUFFIX;var g=$("#"+i.id).find("#"+l);if(!g||g.length<1){g=$("");g.attr("id",l);g.css({position:"absolute",top:"0px",left:"0px"});$(c._RENDERER.getRootElement()).before(g);g.attr("src",b)}else{g.attr("src",b)}c._CONFIG.BACKDOOR.container=g;var k=c.getScale();var f=c.getCanvasSize();if(f[0]');d.append();d.unbind("click");d.bind("click",function(){if($(this).data("collape")){var n=$(this).data("collape");k.height(n);c.show();$(this).data("collape",false)}else{$(this).data("collape",k.height());c.hide();k.height(40)}});j=$('
    ');j.css({position:"relative",width:"100%"});l=$('
    ');b=$('');b.bind("change",function(){m.updateSlider($(this).val())});b.bind("input",function(){m.updateSlider($(this).val())});b.css({position:"relative",width:"100%",height:"8px"});f=$('
    ');f.css({position:"absolute",top:"50px",bottom:"5px",left:"5px",right:"5px","overflow-x":"hidden","overflow-y":"auto",background:"white"});h=$('');h.css({position:"absolute",top:"0px",left:"0px"});h.attr("width","100%");h.attr("id",a.id+"sliderImage");e=$('
    ');e.css({position:"absolute",top:"0px",left:"0px",width:"100px",height:"100px",background:"transparent"});g=function(){var r,n,u,v,p,s,q,t,o,x,w;r=m._RENDERER.getRootElement();v=h.width();p=h.height();n=$(r).attr("width");u=$(r).attr("height");s=v/n;q=p/u;if(s>1){s=1}if(q>1){q=1}t=e.offset().left-h.offset().left;if(t<0){t=0}o=e.offset().top-h.offset().top;if(o<0){o=0}x=t*(1/s);w=o*(1/q);a.scrollLeft=x;a.scrollTop=w};$(a).unbind("scroll");$(a).bind("scroll",function(n){if(e.data("drag")){return}m.updateNavigatior()});h.click(function(p){var o,n,r,q;o=p.pageX-h.offset().left;n=p.pageY-h.offset().top;r=o-(e.width()/2);q=n-(e.height()/2);if(r<0){r=0}if(q<0){q=0}if((r+e.width())>h.width()){r=h.width()-e.width()}if((q+e.height())>h.height()){q=h.height()-e.height()}e.css({left:r+"px",top:q+"px"});g()});e.draggable({containment:"#"+a.id+"sliderImage",scroll:false,start:function(n){e.data("drag",true)},drag:function(n){g()},stop:function(n){g();e.data("drag",false)}});c.append(j);j.append(l);j.append(b);c.append(f);f.append(h);f.append(e);$(a).on("remove",function(){m.removeSlider()});if(this._CONFIG.SLIDER){m.removeSlider()}this._CONFIG.SLIDER=c;this.updateSlider(this._CONFIG.SCALE*100)},updateNavigatior:function(){var m=this;var h=m._RENDERER.getRootElement();var p,i,o,n,j,f,k,d;var c=this._CONFIG.SLIDER;if(!c){return}var g=c.find(".sliderImage");var e=c.find(".sliderNavigator");var b=m._CONTAINER;p=$(h).attr("width");i=$(h).attr("height");o=b.scrollLeft;n=b.scrollTop;j=$(b).width()/p;f=$(b).height()/i;if(j>1){j=1}if(f>1){f=1}k=g.width()/p;d=g.height()/i;e.width(g.width()*j);e.height(g.height()*f);e.css({left:(o*k)+"px",top:(n*d)+"px"});var l=c.find(".scaleSliderText");var a=c.find(".scaleSlider");l.html(Math.round(this._CONFIG.SCALE*100));a.val(Math.round(this._CONFIG.SCALE*100))},updateSlider:function(v){if(this._CONFIG.AUTO_SLIDER_UPDATE&&!this._CONFIG.FAST_LOADING){var q=this;if(!this._CONFIG.SLIDER){return}if(!v){v=this._CONFIG.SCALE*100}var m=this._CONFIG.SLIDER;var f=m.find(".scaleSliderText");var k=m.find(".scaleSlider");var u=m.find(".sliderImage");var g=m.find(".sliderNavigator");var s=m.find(".sliderImageWrapper");f.html(Math.round(v));k.val(Math.round(v));q._RENDERER.setScale(v/100);var i=q._RENDERER.getRootElement();var p=new XMLSerializer().serializeToString(i);var a=this.getCanvasSize();if(OG.Util.isIE()){p=''+p.replace('xmlns="http://www.w3.org/2000/svg"',"").replace('xmlns:NS1=""',"").replace("NS1:","");var b=window.btoa(unescape(encodeURIComponent(p)));var j=document.createElement("img");$(j).css({position:"absolute",top:"0px",left:"0px",opacity:0});document.body.appendChild(j);j.src="data:image/svg+xml;base64,"+b;j.onload=function(){var w=document.getElementById(u.attr("id"));w.width=s.width();w.height=s.width()*j.height/j.width;var x=w.getContext("2d");try{x.drawImage(j,0,0,s.width(),s.width()*j.height/j.width);$(j).remove();q.updateNavigatior()}catch(y){$(j).remove()}}}else{var j=new Image();j.src="data:image/svg+xml;utf-8,"+p;j.onload=function(){var w=document.getElementById(u.attr("id"));w.width=s.width();w.height=s.width()*j.height/j.width;var x=w.getContext("2d");try{x.drawImage(j,0,0,s.width(),s.width()*j.height/j.width);$(j).remove();q.updateNavigatior()}catch(y){$(j).remove()}}}if(q._CONFIG.BACKDOOR.container){var t=q._CONFIG.BACKDOOR.scale;var c=q._CONFIG.BACKDOOR.opacity;var l=q._CONFIG.BACKDOOR.width;var h=q._CONFIG.BACKDOOR.height;var d=q.getScale();var r=s.width();var n=(l*(t/100)/a[0]*d)*r;var o=n*h/l;var e=s.find(".sliderBackDoorWrapper");if(!e||e.length<1){e=$('
    ');e.css({position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%"});s.data("backdoor",true);e.css({"background-image":"url("+q._CONFIG.BACKDOOR.url+")","background-repeat":"no-repeat","background-size":n+"px "+o+"px",opacity:c});u.before(e)}else{if(q._CONFIG.BACKDOOR.container_updated){q._CONFIG.BACKDOOR.container_updated=false;e.css({"background-image":"url("+q._CONFIG.BACKDOOR.url+")","background-repeat":"no-repeat","background-size":n+"px "+o+"px",opacity:c})}else{e.css({"background-size":n+"px "+o+"px",opacity:c})}}}}},removeSlider:function(){if(this._CONFIG.SLIDER){this._CONFIG.SLIDER.dialog("destroy");this._CONFIG.SLIDER.remove()}},drawShape:function(a,c,e,f,h,g,b){var d=this._RENDERER.drawShape(a,c,e,f,h,b);if(a&&(c.TYPE===OG.Constants.SHAPE_TYPE.EDGE)){d=this._RENDERER.move(d,a)}if(g&&this._RENDERER.getElementById(g)){this._RENDERER.appendChild(d,g)}if(!this.CONFIG_INITIALIZED){this.initConfig()}this._HANDLER.setClickSelectable(d,this._HANDLER._isSelectable(d.shape));this._HANDLER.setMovable(d,this._HANDLER._isMovable(d.shape));this._HANDLER.setGroupDropable(d);this._HANDLER.setConnectGuide(d,this._HANDLER._isConnectable(d.shape));if(this._HANDLER._isLabelEditable(d.shape)){this._HANDLER.enableEditLabel(d)}if(!h){this._RENDERER.addHistory()}this.updateSlider();return d},drawTransformer:function(s,j,f,g,b,n){var r=this,c,e,p,d,o,l,t,k,h,m,q;c=new OG.shape.Transformer(j);if(!Array.isArray(f)||!Array.isArray(g)){return null}var a=Math.max(f.length,g.length);e=r.drawShape(s,c,[120,30+(a*25)],p,n);d=e.shape.geom.getBoundary();$.each(f,function(i,u){m=new OG.shape.bpmn.M_Text(u);m.MOVABLE=false;m.SELECTABLE=false;m.CONNECTABLE=false;m.DELETABLE=false;q=r.drawShape([d.getUpperLeft().x+35,d.getUpperLeft().y+(i*25)+40],m,[50,20]);e.appendChild(q);l=new OG.shape.To();k=r.drawShape([d.getUpperLeft().x+15,d.getUpperLeft().y+(i*25)+40],l,[5,5],{r:5});e.appendChild(k);var v=JSON.parse(JSON.stringify(b));v.type="input";v.name=u;v.parentId=e.id;r.setCustomData(k,v)});$.each(g,function(i,u){m=new OG.shape.bpmn.M_Text(u);m.MOVABLE=false;m.SELECTABLE=false;m.CONNECTABLE=false;m.DELETABLE=false;q=r.drawShape([d.getUpperRight().x-35,d.getUpperRight().y+(i*25)+40],m,[50,20]);e.appendChild(q);t=new OG.shape.From();h=r.drawShape([d.getUpperRight().x-15,d.getUpperRight().y+(i*25)+40],t,[5,5],{r:5});e.appendChild(h);var v=JSON.parse(JSON.stringify(b));v.type="output";v.name=u;v.parentId=e.id;r.setCustomData(h,v)});if(!n){this._RENDERER.addHistory()}},setExceptionType:function(a,b){this._HANDLER.setExceptionType(a,b)},setInclusion:function(a,b){this._HANDLER.setInclusion(a,b)},setShapeStyle:function(a,b){this._RENDERER.setShapeStyle(a,b)},setTextListInController:function(a,b){this._RENDERER.setTextListInController(a,b)},getTextListInController:function(a){this._RENDERER.getTextListInController(a)},drawLabel:function(a,c,b){return this._RENDERER.drawLabel(a,c,b)},redrawConnectedEdge:function(a){this._RENDERER.redrawConnectedEdge(a)},reconnect:function(a){return this._RENDERER.reconnect(a)},connect:function(j,g,b,l,d,e,k,c,a){var i,n,f,h,m;if(d){i=this._RENDERER.createTerminalString(j,d)}else{i=this._RENDERER.createDefaultTerminalString(j)}if(e){n=this._RENDERER.createTerminalString(g,e)}else{n=this._RENDERER.createDefaultTerminalString(g)}h=this._RENDERER._getPositionFromTerminal(i);h=[h.x,h.y];m=this._RENDERER._getPositionFromTerminal(n);m=[m.x,m.y];a=a?a:new OG.EdgeShape();a.from=h;a.to=m;f=this._RENDERER.drawShape(null,a,null,b,c);f=this._RENDERER.trimEdgeDirection(f,j,g);l=l?l:undefined;f=this._RENDERER.connect(i,n,f,b,l,k);if(f){this._HANDLER.setClickSelectable(f,f.shape.SELECTABLE);this._HANDLER.setMovable(f,f.shape.SELECTABLE&&f.shape.MOVABLE);this._HANDLER.setConnectGuide(f,this._HANDLER._isConnectable(f.shape));if(f.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(f)}}this.updateSlider();return f},connectWithTerminalId:function(fromTerminal,toTerminal,style,label,id,shapeId,geom){var vertices,edge,fromPosition,toPosition,fromto,shape;fromPosition=this._RENDERER._getPositionFromTerminal(fromTerminal);fromPosition=[fromPosition.x,fromPosition.y];toPosition=this._RENDERER._getPositionFromTerminal(toTerminal);toPosition=[toPosition.x,toPosition.y];if(!geom){vertices=[fromPosition,toPosition]}else{vertices=geom.vertices}fromto=JSON.stringify(vertices[0])+","+JSON.stringify(vertices[vertices.length-1]);shape=eval("new "+shapeId+"("+fromto+")");label=label?label:undefined;if(label){shape.label=label}if(geom){if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.POLYLINE]){geom=new OG.geometry.PolyLine(geom.vertices);shape.geom=geom}else{if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.CURVE]){geom=new OG.geometry.Curve(geom.controlPoints);shape.geom=geom}}}edge=this.drawShape(null,shape,null,style,id,null);edge=this._RENDERER.connect(fromTerminal,toTerminal,edge,style,label,true);if(edge){this._HANDLER.setClickSelectable(edge,edge.shape.SELECTABLE);this._HANDLER.setMovable(edge,edge.shape.SELECTABLE&&edge.shape.MOVABLE);this._HANDLER.setConnectGuide(edge,this._HANDLER._isConnectable(edge.shape));if(edge.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(edge)}}this.updateSlider();return edge},disconnect:function(a){this._RENDERER.disconnect(a)},group:function(a){var b=this._RENDERER.group(a);this._HANDLER.setClickSelectable(b,b.shape.SELECTABLE);this._HANDLER.setMovable(b,b.shape.SELECTABLE&&b.shape.MOVABLE);if(b.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(b)}return b},ungroup:function(a){return this._RENDERER.ungroup(a)},addToGroup:function(a,b){this._RENDERER.addToGroup(a,b)},collapse:function(a){this._RENDERER.collapse(a)},expand:function(a){this._RENDERER.expand(a)},clear:function(){this._RENDERER.clear()},removeShape:function(b,a){this._RENDERER.removeShape(b,a)},removeChild:function(a){this._RENDERER.removeChild(a)},removeGuide:function(a){this._RENDERER.removeGuide(a)},removeAllGuide:function(){this._RENDERER.removeAllGuide()},getRootElement:function(){return this._RENDERER.getRootElement()},getRootGroup:function(){return this._RENDERER.getRootGroup()},getElementByPoint:function(a){return this._RENDERER.getElementByPoint(a)},getElementsByBBox:function(a){return this._RENDERER.getElementsByBBox(a)},setAttr:function(a,b){this._RENDERER.setAttr(a,b)},getAttr:function(b,a){return this._RENDERER.getAttr(b,a)},toFront:function(a){this._RENDERER.toFront(a)},toBack:function(a){this._RENDERER.toBack(a)},bringForward:function(a){this._RENDERER.bringForward(a)},sendBackward:function(a){this._RENDERER.sendBackward(a)},getCanvasSize:function(){return this._RENDERER.getCanvasSize()},setCanvasSize:function(a){this._RENDERER.setCanvasSize(a)},fitCanvasSize:function(b,a){this._RENDERER.fitCanvasSize(b,a)},setViewBox:function(a,b,c){this._RENDERER.setViewBox(a,b,c)},getScale:function(){return this._RENDERER.getScale()},setScale:function(a){this._RENDERER.setScale(a)},show:function(a){this._RENDERER.show(a)},hide:function(a){this._RENDERER.hide(a)},appendChild:function(a,b){return this._RENDERER.appendChild(a,b)},insertAfter:function(a,b){return this._RENDERER.insertAfter(a,b)},insertBefore:function(a,b){return this._RENDERER.insertBefore(a,b)},move:function(a,b){return this._RENDERER.move(a,b)},moveCentroid:function(b,a){return this._RENDERER.moveCentroid(b,a)},rotate:function(a,b){return this._RENDERER.rotate(a,b)},resize:function(b,c,a){return this._RENDERER.resize(b,c,a)},resizeBox:function(c,b,a){return this._RENDERER.resizeBox(c,b,a)},clone:function(a){return this._RENDERER.clone(a)},getBoundary:function(a){return this._RENDERER.getBoundary(a)},getElementById:function(a){return this._RENDERER.getElementById(a)},getElementsByType:function(b,a){return this._RENDERER.getElementsByType(b,a)},getElementsByShapeId:function(b){var a=this.getRootGroup();return $(a).find("[_type=SHAPE][_shape_id='"+b+"']")},getRelatedEdgeFromShapes:function(a){return this._RENDERER.getRelatedEdgeFromShapes(a)},getRelatedElementsFromEdge:function(b){var d=this,c=OG.Util.isElement(b)?b:this.getElementById(b),a=function(e){if(e){return d._RENDERER.getElementById(e.substring(0,e.indexOf(OG.Constants.TERMINAL)))}else{return null}};if($(c).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){return{from:a($(b).attr("_from")),to:a($(b).attr("_to"))}}else{return{from:null,to:null}}},getParent:function(a){return this._RENDERER.getParent(a)},getChilds:function(a){return this._RENDERER.getChilds(a)},getAllShapes:function(){return this._RENDERER.getAllShapes()},getAllEdges:function(){return this._RENDERER.getAllEdges()},getBBox:function(a){return this._RENDERER.getBBox(a)},getRootBBox:function(){return this._RENDERER.getRootBBox()},getRealRootBBox:function(){return this._RENDERER.getRealRootBBox()},isSVG:function(){return this._RENDERER.isSVG()},isVML:function(){return this._RENDERER.isVML()},setCustomData:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.data=c;a.shape.data=c},getCustomData:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);if(!a.data){a.data=a.shape.data}return a.data},setExtCustomData:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.dataExt=c},getExtCustomData:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);return a.dataExt},setCustomContextMenu:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.shape.customContextMenu=c},getCustomContextMenu:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);return a.shape.customContextMenu},toXML:function(){return OG.Util.jsonToXml(this.toJSON())},toJSON:function(){var j=this,k=this._RENDERER.getRootBBox(),h=this._RENDERER.getRootGroup(),c=this.getScale(),a=this.getCanvasSize()[0],g=this.getCanvasSize()[1],f=this._CONFIG.BACKDOOR,l={opengraph:{"@width":a,"@height":g,"@scale":c,cell:[],backdoor:[{"@url":f.url,"@scale":f.scale,"@opacity":f.opacity,"@width":f.width,"@height":f.height}]}},e,d,b;b={};e=function(i){$(i).find("[_type=SHAPE]").each(function(w,z){var q=z.shape,m=z.shape.geom.style.map,s=q.geom,r=s.getBoundary(),x={},p,v,u,n,t;if(q.ignoreExport){return}x["@id"]=$(z).attr("id");if($(z).parent().attr("id")===$(i).attr("id")){x["@parent"]=$(i).attr("id")}else{x["@parent"]=$(z).parent().attr("id")}x["@shapeType"]=q.TYPE;x["@shapeId"]=q.SHAPE_ID;x["@x"]=r.getCentroid().x;x["@y"]=r.getCentroid().y;x["@width"]=r.getWidth();x["@height"]=r.getHeight();if(m){x["@style"]=escape(OG.JSON.encode(m))}if(q.TYPE===OG.Constants.SHAPE_TYPE.EDGE){if($(z).attr("_from")){x["@from"]=$(z).attr("_from")}if($(z).attr("_to")){x["@to"]=$(z).attr("_to")}}else{n=j.getPrevShapeIds(z);t=j.getNextShapeIds(z);if(n.length>0){x["@from"]=n.toString()}if(t.length>0){x["@to"]=t.toString()}}if($(z).attr("_fromedge")){x["@fromEdge"]=$(z).attr("_fromedge")}if($(z).attr("_toedge")){x["@toEdge"]=$(z).attr("_toedge")}if(q.label){x["@label"]=escape(q.label)}if(q.fromLabel){x["@fromLabel"]=escape(q.fromLabel)}if(q.toLabel){x["@toLabel"]=escape(q.toLabel)}if(q.angle&&q.angle!==0){x["@angle"]=q.angle}if(q instanceof OG.shape.ImageShape){x["@value"]=q.image}else{if(q instanceof OG.shape.HtmlShape){x["@value"]=escape(q.html)}else{if(q instanceof OG.shape.TextShape){x["@value"]=escape(q.text)}else{if(q instanceof OG.shape.EdgeShape){p=s.getVertices();x["@value"]="";for(var o=0,y=p.length;o(x-width/2))?(x-width/2):minX;minY=(minY>(y-height/2))?(y-height/2):minY;maxX=(maxX<(x+width/2))?(x+width/2):maxX;maxY=(maxY<(y+height/2))?(y+height/2):maxY;switch(shapeType){case OG.Constants.SHAPE_TYPE.GEOM:case OG.Constants.SHAPE_TYPE.GROUP:shape=eval("new "+shapeId+"()");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height],OG.JSON.decode(style),id,parent);if(element.shape instanceof OG.shape.bpmn.A_Task){element.shape.LoopType=loopType;element.shape.TaskType=taskType}break;case OG.Constants.SHAPE_TYPE.EDGE:var list=JSON.parse("["+value+"]");var fromto=JSON.stringify(list[0])+","+JSON.stringify(list[list.length-1]);shape=eval("new "+shapeId+"("+fromto+")");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}if(fromLabel){shape.fromLabel=unescape(fromLabel)}if(toLabel){shape.toLabel=unescape(toLabel)}if(geom){geom=OG.JSON.decode(geom);if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.POLYLINE]){geom=new OG.geometry.PolyLine(geom.vertices);shape.geom=geom}else{if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.CURVE]){geom=new OG.geometry.Curve(geom.controlPoints);shape.geom=geom}}}element=this.drawShape(null,shape,null,OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.HTML:shape=eval("new "+shapeId+"()");if(value){shape.html=unescape(value)}if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.IMAGE:shape=eval("new "+shapeId+"('"+value+"')");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.TEXT:shape=eval("new "+shapeId+"()");if(value){shape.text=unescape(value)}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break}if(from){$(element).attr("_from",from)}if(to){$(element).attr("_to",to)}if(fromEdge){$(element).attr("_fromedge",fromEdge)}if(toEdge){$(element).attr("_toedge",toEdge)}if(data){element.data=OG.JSON.decode(unescape(data))}if(dataExt){element.dataExt=OG.JSON.decode(unescape(dataExt))}cellCount++;$(renderer._PAPER.canvas).trigger("loading",[Math.round((cellCount/totalCount)*100)])}if(json.opengraph.backdoor&&OG.Util.isArray(json.opengraph.backdoor)&&json.opengraph.backdoor.length){var backdoor=json.opengraph.backdoor[0];if(backdoor["@url"]){this.addBackDoor(backdoor["@url"],backdoor["@scale"],backdoor["@opacity"])}}this.fastLoadingOFF();$(renderer._PAPER.canvas).trigger("loading",["end"]);return{width:maxX-minX,height:maxY-minY,x:minX,y:minY,x2:maxX,y2:maxY}}this.fastLoadingOFF();$(renderer._PAPER.canvas).trigger("loading",["end"]);return{width:0,height:0,x:0,y:0,x2:0,y2:0}},undo:function(){this._RENDERER.undo()},redo:function(){this._RENDERER.redo()},getPrevEdges:function(a){return this._RENDERER.getPrevEdges(a)},getNextEdges:function(a){return this._RENDERER.getNextEdges(a)},getPrevShapes:function(a){return this._RENDERER.getPrevShapes(a)},getPrevShapeIds:function(a){return this._RENDERER.getPrevShapeIds(a)},getNextShapes:function(a){return this._RENDERER.getNextShapes(a)},getNextShapeIds:function(a){return this._RENDERER.getNextShapeIds(a)},onDrawShape:function(a){$(this.getRootElement()).bind("drawShape",function(c,b){a(c,b)})},onUndo:function(a){$(this.getRootElement()).bind("undo",function(b){a(b)})},onRedo:function(a){$(this.getRootElement()).bind("redo",function(b){a(b)})},onDivideLane:function(a){$(this.getRootElement()).bind("divideLane",function(c,b){a(c,b)})},onDrawLabel:function(a){$(this.getRootElement()).bind("drawLabel",function(d,b,c){a(d,b,c)})},onLabelChanged:function(a){$(this.getRootElement()).bind("labelChanged",function(e,c,b,d){a(e,c,b,d)})},onBeforeLabelChange:function(a){$(this.getRootElement()).bind("beforeLabelChange",function(b){if(a(b,b.element,b.afterText,b.beforeText)===false){b.stopPropagation()}})},onRedrawShape:function(a){$(this.getRootElement()).bind("redrawShape",function(c,b){a(c,b)})},onRemoveShape:function(a){$(this.getRootElement()).bind("removeShape",function(c,b){a(c,b)})},onRotateShape:function(a){$(this.getRootElement()).bind("rotateShape",function(c,b,d){a(c,b,d)})},onMoveShape:function(a){$(this.getRootElement()).bind("moveShape",function(c,b,d){a(c,b,d)})},onResizeShape:function(a){$(this.getRootElement()).bind("resizeShape",function(c,b,d){a(c,b,d)})},onBeforeConnectShape:function(a){$(this.getRootElement()).bind("beforeConnectShape",function(b){if(a(b,b.edge,b.fromShape,b.toShape)===false){b.stopPropagation()}})},onBeforeRemoveShape:function(a){$(this.getRootElement()).bind("beforeRemoveShape",function(b){if(a(b,b.element)===false){b.stopPropagation()}})},onConnectShape:function(a){$(this.getRootElement()).bind("connectShape",function(d,c,e,b){a(d,c,e,b)})},onDisconnectShape:function(a){$(this.getRootElement()).bind("disconnectShape",function(d,c,e,b){a(d,c,e,b)})},onGroup:function(a){$(this.getRootElement()).bind("group",function(c,b){a(c,b)})},onUnGroup:function(a){$(this.getRootElement()).bind("ungroup",function(b,c){a(b,c)})},onCollapsed:function(a){$(this.getRootElement()).bind("collapsed",function(c,b){a(c,b)})},onExpanded:function(a){$(this.getRootElement()).bind("expanded",function(c,b){a(c,b)})},onLoading:function(a){$(this.getRootElement()).bind("loading",function(c,b){a(c,b)})}};OG.graph.Canvas.prototype.constructor=OG.graph.Canvas;OG.Canvas=OG.graph.Canvas; \ No newline at end of file +(function(k,f){k.support.htmlMenuitem=("HTMLMenuItemElement" in window);k.support.htmlCommand=("HTMLCommandElement" in window);k.support.eventSelectstart=("onselectstart" in document.documentElement);var i=null,g=false,d=k(window),a=0,b={},j={},n={},h={selector:null,appendTo:null,trigger:"right",autoHide:false,delay:200,determinePosition:function(r){if(k.ui&&k.ui.position){r.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none")}else{var s=this.offset();s.top+=this.outerHeight();s.left+=this.outerWidth()/2-r.outerWidth()/2;r.css(s)}},position:function(t,A,w){var v=this,u;if(!A&&!w){t.determinePosition.call(this,t.$menu);return}else{if(A==="maintain"&&w==="maintain"){u=t.$menu.position()}else{var z=t.$trigger.parents().andSelf().filter(function(){return k(this).css("position")=="fixed"}).length;if(z){w-=d.scrollTop();A-=d.scrollLeft()}u={top:w,left:A}}}var r=d.scrollTop()+d.height(),B=d.scrollLeft()+d.width(),C=t.$menu.height(),s=t.$menu.width();if(u.top+C>r){u.top-=C}if(u.left+s>B){u.left-=s}t.$menu.css(u)},positionSubmenu:function(r){if(k.ui&&k.ui.position){r.css("display","block").position({my:"left top",at:"right top",of:this,collision:"fit"}).css("display","")}else{var s={top:0,left:this.outerWidth()};r.css(s)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:k.noop,hide:k.noop},callback:null,items:{}},o={timer:null,pageX:null,pageY:null},q=function(t){var s=0,r=t;while(true){s=Math.max(s,parseInt(r.css("z-index"),10)||0);r=r.parent();if(!r||!r.length||"html body".indexOf(r.prop("nodeName").toLowerCase())>-1){break}}return s},m={abortevent:function(r){r.preventDefault();r.stopImmediatePropagation()},contextmenu:function(t){var s=k(this);t.preventDefault();t.stopImmediatePropagation();if(t.data.trigger!="right"&&t.originalEvent){return}if(!s.hasClass("context-menu-disabled")){i=s;if(t.data.build){var r=t.data.build(i,t);if(r===false){return}t.data=k.extend(true,{},h,t.data,r||{});if(!t.data.items||k.isEmptyObject(t.data.items)){if(window.console){(console.error||console.log)("No items specified to show in contextMenu")}throw new Error("No Items sepcified")}t.data.$trigger=i;l.create(t.data)}l.show.call(s,t.data,t.pageX,t.pageY)}},click:function(r){r.preventDefault();r.stopImmediatePropagation();k(this).trigger(k.Event("contextmenu",{data:r.data,pageX:r.pageX,pageY:r.pageY}))},mousedown:function(s){var r=k(this);if(i&&i.length&&!i.is(r)){i.data("contextMenu").$menu.trigger("contextmenu:hide")}if(s.button==2){i=r.data("contextMenuActive",true)}},mouseup:function(s){var r=k(this);if(r.data("contextMenuActive")&&i&&i.length&&i.is(r)&&!r.hasClass("context-menu-disabled")){s.preventDefault();s.stopImmediatePropagation();i=r;r.trigger(k.Event("contextmenu",{data:s.data,pageX:s.pageX,pageY:s.pageY}))}r.removeData("contextMenuActive")},mouseenter:function(t){var s=k(this),r=k(t.relatedTarget),u=k(document);if(r.is(".context-menu-list")||r.closest(".context-menu-list").length){return}if(i&&i.length){return}o.pageX=t.pageX;o.pageY=t.pageY;o.data=t.data;u.on("mousemove.contextMenuShow",m.mousemove);o.timer=setTimeout(function(){o.timer=null;u.off("mousemove.contextMenuShow");i=s;s.trigger(k.Event("contextmenu",{data:o.data,pageX:o.pageX,pageY:o.pageY}))},t.data.delay)},mousemove:function(r){o.pageX=r.pageX;o.pageY=r.pageY},mouseleave:function(s){var r=k(s.relatedTarget);if(r.is(".context-menu-list")||r.closest(".context-menu-list").length){return}try{clearTimeout(o.timer)}catch(s){}o.timer=null},layerClick:function(u){var w=k(this),A=w.data("contextMenuRoot"),s=false,t=u.button,B=u.pageX,z=u.pageY,v,r,C;u.preventDefault();u.stopImmediatePropagation();w.on("mouseup",function(){s=true});setTimeout(function(){var D,y;if((A.trigger=="left"&&t==0)||(A.trigger=="right"&&t==2)){if(document.elementFromPoint){A.$layer.hide();v=document.elementFromPoint(B-d.scrollLeft(),z-d.scrollTop());A.$layer.show();C=[];for(var x in b){C.push(x)}v=k(v).closest(C.join(", "));if(v.length){if(v.is(A.$trigger[0])){A.position.call(A.$trigger,A,B,z);return}}}else{r=A.$trigger.offset();D=k(window);r.top+=D.scrollTop();if(r.top<=u.pageY){r.left+=D.scrollLeft();if(r.left<=u.pageX){r.bottom=r.top+A.$trigger.outerHeight();if(r.bottom>=u.pageY){r.right=r.left+A.$trigger.outerWidth();if(r.right>=u.pageX){A.position.call(A.$trigger,A,B,z);return}}}}}}y=function(E){if(E){E.preventDefault();E.stopImmediatePropagation()}A.$menu.trigger("contextmenu:hide");if(v&&v.length){setTimeout(function(){v.contextMenu({x:B,y:z})},50)}};if(s){y()}else{w.on("mouseup",y)}},50)},keyStop:function(s,r){if(!r.isInput){s.preventDefault()}s.stopPropagation()},key:function(w){var u=i.data("contextMenu")||{},s=u.$menu.children(),x;switch(w.keyCode){case 9:case 38:m.keyStop(w,u);if(u.isInput){if(w.keyCode==9&&w.shiftKey){w.preventDefault();u.$selected&&u.$selected.find("input, textarea, select").blur();u.$menu.trigger("prevcommand");return}else{if(w.keyCode==38&&u.$selected.find("input, textarea, select").prop("type")=="checkbox"){w.preventDefault();return}}}else{if(w.keyCode!=9||w.shiftKey){u.$menu.trigger("prevcommand");return}}case 40:m.keyStop(w,u);if(u.isInput){if(w.keyCode==9){w.preventDefault();u.$selected&&u.$selected.find("input, textarea, select").blur();u.$menu.trigger("nextcommand");return}else{if(w.keyCode==40&&u.$selected.find("input, textarea, select").prop("type")=="checkbox"){w.preventDefault();return}}}else{u.$menu.trigger("nextcommand");return}break;case 37:m.keyStop(w,u);if(u.isInput||!u.$selected||!u.$selected.length){break}if(!u.$selected.parent().hasClass("context-menu-root")){var v=u.$selected.parent().parent();u.$selected.trigger("contextmenu:blur");u.$selected=v;return}break;case 39:m.keyStop(w,u);if(u.isInput||!u.$selected||!u.$selected.length){break}var t=u.$selected.data("contextMenu")||{};if(t.$menu&&u.$selected.hasClass("context-menu-submenu")){u.$selected=null;t.$selected=null;t.$menu.trigger("nextcommand");return}break;case 35:case 36:if(u.$selected&&u.$selected.find("input, textarea, select").length){return}else{(u.$selected&&u.$selected.parent()||u.$menu).children(":not(.disabled, .not-selectable)")[w.keyCode==36?"first":"last"]().trigger("contextmenu:focus");w.preventDefault();return}break;case 13:m.keyStop(w,u);if(u.isInput){if(u.$selected&&!u.$selected.is("textarea, select")){w.preventDefault();return}break}u.$selected&&u.$selected.trigger("mouseup");return;case 32:case 33:case 34:m.keyStop(w,u);return;case 27:m.keyStop(w,u);u.$menu.trigger("contextmenu:hide");return;default:var r=(String.fromCharCode(w.keyCode)).toUpperCase();if(u.accesskeys[r]){u.accesskeys[r].$node.trigger(u.accesskeys[r].$menu?"contextmenu:focus":"mouseup");return}break}w.stopPropagation();u.$selected&&u.$selected.trigger(w)},prevItem:function(v){v.stopPropagation();var u=k(this).data("contextMenu")||{};if(u.$selected){var r=u.$selected;u=u.$selected.parent().data("contextMenu")||{};u.$selected=r}var t=u.$menu.children(),s=!u.$selected||!u.$selected.prev().length?t.last():u.$selected.prev(),x=s;while(s.hasClass("disabled")||s.hasClass("not-selectable")){if(s.prev().length){s=s.prev()}else{s=t.last()}if(s.is(x)){return}}if(u.$selected){m.itemMouseleave.call(u.$selected.get(0),v)}m.itemMouseenter.call(s.get(0),v);var w=s.find("input, textarea, select");if(w.length){w.focus()}},nextItem:function(v){v.stopPropagation();var u=k(this).data("contextMenu")||{};if(u.$selected){var r=u.$selected;u=u.$selected.parent().data("contextMenu")||{};u.$selected=r}var t=u.$menu.children(),s=!u.$selected||!u.$selected.next().length?t.first():u.$selected.next(),x=s;while(s.hasClass("disabled")||s.hasClass("not-selectable")){if(s.next().length){s=s.next()}else{s=t.first()}if(s.is(x)){return}}if(u.$selected){m.itemMouseleave.call(u.$selected.get(0),v)}m.itemMouseenter.call(s.get(0),v);var w=s.find("input, textarea, select");if(w.length){w.focus()}},focusInput:function(v){var u=k(this).closest(".context-menu-item"),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;r.$selected=s.$selected=u;r.isInput=s.isInput=true},blurInput:function(v){var u=k(this).closest(".context-menu-item"),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;r.isInput=s.isInput=false},menuMouseenter:function(s){var r=k(this).data().contextMenuRoot;r.hovering=true},menuMouseleave:function(s){var r=k(this).data().contextMenuRoot;if(r.$layer&&r.$layer.is(s.relatedTarget)){r.hovering=false}},itemMouseenter:function(v){var u=k(this),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;r.hovering=true;if(v&&r.$layer&&r.$layer.is(v.relatedTarget)){v.preventDefault();v.stopImmediatePropagation()}(s.$menu?s:r).$menu.children(".hover").trigger("contextmenu:blur");if(u.hasClass("disabled")||u.hasClass("not-selectable")){s.$selected=null;return}u.trigger("contextmenu:focus")},itemMouseleave:function(v){var u=k(this),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;if(r!==s&&r.$layer&&r.$layer.is(v.relatedTarget)){r.$selected&&r.$selected.trigger("contextmenu:blur");v.preventDefault();v.stopImmediatePropagation();r.$selected=s.$selected=s.$node;return}u.trigger("contextmenu:blur")},itemClick:function(w){var v=k(this),u=v.data(),t=u.contextMenu,r=u.contextMenuRoot,s=u.contextMenuKey,x;if(!t.items[s]||v.hasClass("disabled")||v.hasClass("context-menu-submenu")){return}w.preventDefault();w.stopImmediatePropagation();if(k.isFunction(r.callbacks[s])){x=r.callbacks[s]}else{if(k.isFunction(r.callback)){x=r.callback}else{return}}if(x.call(r.$trigger,s,r)!==false){r.$menu.trigger("contextmenu:hide")}else{if(r.$menu.parent().length){l.update.call(r.$trigger,r)}}},inputClick:function(r){r.stopImmediatePropagation()},hideMenu:function(t,s){var r=k(this).data("contextMenuRoot");l.hide.call(r.$trigger,r,s&&s.force)},focusItem:function(v){v.stopPropagation();var u=k(this),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;u.addClass("hover").siblings(".hover").trigger("contextmenu:blur");s.$selected=r.$selected=u;if(s.$node){r.positionSubmenu.call(s.$node,s.$menu)}},blurItem:function(v){v.stopPropagation();var u=k(this),t=u.data(),s=t.contextMenu,r=t.contextMenuRoot;u.removeClass("hover");s.$selected=null}},l={show:function(t,r,z){var u=k(this),v,s={};k("#context-menu-layer").trigger("mousedown");t.$trigger=u;if(t.events.show.call(u,t)===false){i=null;return}l.update.call(u,t);t.position.call(u,t,r,z);if(t.zIndex){s.zIndex=q(u)+t.zIndex}l.layer.call(t.$menu,t,s.zIndex);t.$menu.find("ul").css("zIndex",s.zIndex+1);t.$menu.css(s)[t.animation.show](t.animation.duration);u.data("contextMenu",t);k(document).off("keydown.contextMenu").on("keydown.contextMenu",m.key);if(t.autoHide){var w=u.position();w.right=w.left+u.outerWidth();w.bottom=w.top+this.outerHeight();k(document).on("mousemove.contextMenuAutoHide",function(x){if(t.$layer&&!t.hovering&&(!(x.pageX>=w.left&&x.pageX<=w.right)||!(x.pageY>=w.top&&x.pageY<=w.bottom))){t.$menu.trigger("contextmenu:hide")}})}},hide:function(r,s){var u=k(this);if(!r){r=u.data("contextMenu")||{}}if(!s&&r.events&&r.events.hide.call(u,r)===false){return}if(r.$layer){setTimeout((function(v){return function(){v.remove()}})(r.$layer),10);try{delete r.$layer}catch(t){r.$layer=null}}i=null;r.$menu.find(".hover").trigger("contextmenu:blur");r.$selected=null;k(document).off(".contextMenuAutoHide").off("keydown.contextMenu");r.$menu&&r.$menu[r.animation.hide](r.animation.duration,function(){if(r.build){r.$menu.remove();k.each(r,function(v,w){switch(v){case"ns":case"selector":case"build":case"trigger":return true;default:r[v]=f;try{delete r[v]}catch(x){}return true}})}})},create:function(s,r){if(r===f){r=s}s.$menu=k('
      ').data({contextMenu:s,contextMenuRoot:r});k.each(["callbacks","commands","inputs"],function(u,t){s[t]={};if(!r[t]){r[t]={}}});r.accesskeys||(r.accesskeys={});k.each(s.items,function(v,w){var A=k('
    • '),t=null,z=null;w.$node=A.data({contextMenu:s,contextMenuRoot:r,contextMenuKey:v});if(w.accesskey){var x=c(w.accesskey);for(var u=0,y;y=x[u];u++){if(!r.accesskeys[y]){r.accesskeys[y]=w;w._name=w.name.replace(new RegExp("("+y+")","i"),'$1');break}}}if(typeof w=="string"){A.addClass("context-menu-separator not-selectable")}else{if(w.type&&n[w.type]){n[w.type].call(A,w,s,r);k.each([s,r],function(C,B){B.commands[v]=w;if(k.isFunction(w.callback)){B.callbacks[v]=w.callback}})}else{if(w.type=="html"){A.addClass("context-menu-html not-selectable")}else{if(w.type){t=k("").appendTo(A);k("").html(w._name||w.name).appendTo(t);A.addClass("context-menu-input");s.hasTypes=true;k.each([s,r],function(C,B){B.commands[v]=w;B.inputs[v]=w})}else{if(w.items){w.type="sub"}}}switch(w.type){case"text":z=k('').val(w.value||"").appendTo(t);break;case"textarea":z=k('').val(w.value||"").appendTo(t);if(w.height){z.height(w.height)}break;case"checkbox":z=k('').val(w.value||"").prop("checked",!!w.selected).prependTo(t);break;case"radio":z=k('').val(w.value||"").prop("checked",!!w.selected).prependTo(t);break;case"select":z=k('");o=$("#"+p);switch(a.shape.geom.style.get("text-anchor")){case"start":g="left";break;case"middle":g="center";break;case"end":g="right";break;default:g="center";break}if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.HTML){$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":"left",overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.html);u=a.shape.html;$(o).bind({focusout:function(){a.shape.html=this.value;i=this.value;if(a.shape.html){c.redrawShape(a);this.parentNode.removeChild(this)}else{c.removeShape(a);this.parentNode.removeChild(this)}if(u!==i){c.addHistory()}}})}else{if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.TEXT){$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":g,overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.text);u=a.shape.text;$(o).bind({focusout:function(){a.shape.text=this.value;i=this.value;if(a.shape.text){c.redrawShape(a);this.parentNode.removeChild(this)}else{c.removeShape(a);this.parentNode.removeChild(this)}if(u!==i){c.addHistory()}}})}else{if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){if(a.shape.label&&c.isSVG()){$(a).children("[id$=_LABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height})})}else{v=t(a);f=v.x-b._CONFIG.LABEL_EDITOR_WIDTH/2;l=v.y-b._CONFIG.LABEL_EDITOR_HEIGHT/2;n=b._CONFIG.LABEL_EDITOR_WIDTH;m=b._CONFIG.LABEL_EDITOR_HEIGHT}$(q.srcElement).parents("[id$=_FROMLABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height;h=a.shape.fromLabel})});$(q.srcElement).parents("[id$=_TOLABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height;r=a.shape.toLabel})});$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f*b._CONFIG.SCALE,top:l*b._CONFIG.SCALE,width:n*b._CONFIG.SCALE,height:m*b._CONFIG.SCALE,overflow:"hidden",resize:"none"}));$(o).focus();if(h||r){$(o).val(h?a.shape.fromLabel:a.shape.toLabel)}else{$(o).val(a.shape.label);u=a.shape.label}$(o).bind({focusout:function(){if(h){c.drawEdgeLabel(a,this.value,"FROM")}else{if(r){c.drawEdgeLabel(a,this.value,"TO")}else{c.drawLabel(a,this.value);i=this.value;if(u!==i){c.addHistory()}}}this.parentNode.removeChild(this)}})}else{$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":g,overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.label);u=a.shape.label;$(o).bind({focusout:function(){c.drawLabel(a,this.value);this.parentNode.removeChild(this);i=this.value;if(u!==i){c.addHistory()}}})}}}}}})},setMovable:function(f,g){var i=this,c;var h=i._RENDERER;var k=h.getRootGroup();if(!f){return}var j=$(f).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var m=h.isLane(f);if(j){return}var b=function(x){var u=i._CONFIG.EDGE_MOVE_DELAY_SIZE;var p=[];if(!i._CONFIG.AUTOMATIC_GUIDANCE){return p}if(!x){return p}if(x.length!==1){return p}var r=h.getBoundary(f);var w=r.getCentroid();var v=r.getHeight();var o=r.getWidth();var t=h.getAllShapes();$.each(t,function(z,A){if(h.isEdge(A)){return}if(A.id===f.id){return}var D=h.getBoundary(A);var y=D.getCentroid();var B=D.getUpperLeft();var C=D.getLowerRight();p.push({condition:{minY:(B.y-v/2)-u,maxY:(B.y-v/2)+u},fixedPosition:{y:(B.y-v/2)},guidePosition:{y:B.y},id:z});p.push({condition:{minY:(B.y+v/2)-u,maxY:(B.y+v/2)+u},fixedPosition:{y:(B.y+v/2)},guidePosition:{y:B.y},id:z});p.push({condition:{minY:(C.y+v/2)-u,maxY:(C.y+v/2)+u},fixedPosition:{y:(C.y+v/2)},guidePosition:{y:C.y},id:z});p.push({condition:{minY:(C.y-v/2)-u,maxY:(C.y-v/2)+u},fixedPosition:{y:(C.y-v/2)},guidePosition:{y:C.y},id:z});p.push({condition:{minX:(B.x-o/2)-u,maxX:(B.x-o/2)+u},fixedPosition:{x:(B.x-o/2)},guidePosition:{x:B.x},id:z});p.push({condition:{minX:(B.x+o/2)-u,maxX:(B.x+o/2)+u},fixedPosition:{x:(B.x+o/2)},guidePosition:{x:B.x},id:z});p.push({condition:{minX:(C.x+o/2)-u,maxX:(C.x+o/2)+u},fixedPosition:{x:(C.x+o/2)},guidePosition:{x:C.x},id:z});p.push({condition:{minX:(C.x-o/2)-u,maxX:(C.x-o/2)+u},fixedPosition:{x:(C.x-o/2)},guidePosition:{x:C.x},id:z});p.push({condition:{minX:y.x-u,maxX:y.x+u},fixedPosition:{x:y.x},guidePosition:{x:y.x},id:z});p.push({condition:{minY:y.y-u,maxY:y.y+u,},fixedPosition:{y:y.y},guidePosition:{y:y.y},id:z})});var s=[];var n=h.getPrevEdges(f);var q=h.getNextEdges(f);$.each(n,function(y,z){s.push({edge:z,type:"prev"})});$.each(q,function(y,z){s.push({edge:z,type:"next"})});$.each(s,function(G,D){var z=D.edge;var C=D.type;var E=$(z).attr("_from");var F=$(z).attr("_to");if(!E||!F){return}var J;var I;if(C==="prev"){J=F;I=E}else{J=E;I=F}var H=h._getPositionFromTerminal(J);var y=h._getPositionFromTerminal(I);var B=w.x-H.x;var A=w.y-H.y;p.push({condition:{minX:y.x+B-u,maxX:y.x+B+u},fixedPosition:{x:y.x+B},guidePosition:{x:y.x},id:G});p.push({condition:{minY:y.y+A-u,maxY:y.y+A+u},fixedPosition:{y:y.y+A},guidePosition:{y:y.y},id:G})});return p};var l=function(v,u){var s={dx:v,dy:u};if(!i._CONFIG.AUTOMATIC_GUIDANCE){return s}var o=h.getBoundary(f);var p=o.getCentroid();var n={x:p.x+v,y:p.y+u};var t=function(w){if(!w){return s}if(w.x&&!w.y){return{dx:w.x-p.x,dy:s.dy}}if(w.y&&!w.x){return{dx:s.dx,dy:w.y-p.y}}if(w.x&&w.y){return{dx:w.x-p.x,dy:w.y-p.y}}return s};var q=$(f).data("correctionConditions");if(!q){return s}var r=[];$.each(q,function(x,w){var z=w.condition;var y=true;if(z.minX){if(n.xz.maxX){y=false}}if(z.minY){if(n.yz.maxY){y=false}}if(y){r.push(w)}});$.each(r,function(w,x){s=t(x.fixedPosition);var y=x.guidePosition;h.drawStickGuide(y)});if(!r.length){h.removeAllStickGuide()}return s};var e=function(){var n=$("[id$="+OG.Constants.DROP_OVER_BBOX_SUFFIX+"]");$.each(n,function(o,p){h.remove(p.id)});$(k).removeData("groupTarget")};var d=function(){e();var w=$(k).data("bBoxArray");if(!w){return}var r=[];var o=[];$.each(w,function(x,y){o=h.getAttr(y.box,"transform")[0];r.push(h.getElementById(y.id))});if(!o.length){return}var p=h.getBoundaryOfElements(r);var q=p.getUpperCenter().y+o[2];var t=p.getLeftCenter().x+o[1];var v=new OG.geometry.Envelope([t,q],p.getWidth(),p.getHeight());var n=h.getFrontForBoundary(v);if(!n){return}if(!i._CONFIG.GROUP_DROPABLE||!n.shape.GROUP_DROPABLE){return}if(h.isLane(n)){n=h.getRootLane(n)}if(n.shape instanceof OG.shape.bpmn.A_Task){return}if(n.shape.isCollapsed===true){return}var s=false;$.each(w,function(x,y){if(n.id===y.id){s=true}});if(s){return}var u=false;$.each(w,function(x,y){if(h.isLane(y.id)){u=true}});if(u){return}$(k).data("groupTarget",n);h.drawDropOverGuide(n)};if(g===true){$(f).draggable({start:function(n){var q=i._getOffset(n),p;if(!i._isSelectedElement(f)){$.each(i._getSelectedElement(),function(w,x){if(OG.Util.isElement(x)&&x.id){h.removeGuide(x)}})}h.removeAllEdgeGuide();h.removeGuide(f);p=h.drawGuide(f);if(m){h.drawGuide(h.getRootLane(f))}var o=[];$(i._RENDERER.getRootElement()).find("[id$="+OG.Constants.GUIDE_SUFFIX.BBOX+"]").each(function(x,y){if(y.id&&y.id.indexOf(OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX)==-1){var w=y.id.replace(OG.Constants.GUIDE_SUFFIX.BBOX,"");o.push({id:w})}});var s=false;var t;var r=function(x){if(x.id===f.id){s=true}var w=h.getChilds(x);$.each(w,function(y,z){h.removeGuide(z);if(x.id===f.id){s=true}if(h.isGroup(z)){r(z)}})};var u=function(w){if(!w){return}$.each(o,function(x,y){if(y.id===w.id){t=w}});u(h.getParent(w))};$.each(o,function(w,y){var x=h.getElementById(y.id);if(h.isGroup(x)){r(x)}});if(s){u(f);if(t){h.removeGuide(t);p=h.drawGuide(t)}}$(this).data("start",{x:q.x,y:q.y});$(this).data("offset",{x:q.x-i._num(h.getAttr(p.bBox,"x")),y:q.y-i._num(h.getAttr(p.bBox,"y"))});var v=i._getMoveTargets();$(k).data("bBoxArray",v);$(f).data("correctionConditions",b(v));h.removeRubberBand(h.getRootElement())},drag:function(q){var r=i._getOffset(q),u=$(this).data("start"),t=$(k).data("bBoxArray"),p=r.x-u.x,o=r.y-u.y,s=$(this).data("offset");var n=l(p,o);if("Y"==f.shape.AXIS){n.dx=0}else{if("X"==f.shape.AXIS){n.dy=0}}p=i._grid(n.dx,"move");o=i._grid(n.dy,"move");i._autoExtend(r.x,r.y,f);$(this).css({position:"",left:"",top:""});$.each(t,function(v,w){h.setAttr(w.box,{transform:"t"+p+","+o,"stroke-width":1})});d();h.removeAllConnectGuide()},stop:function(o){var r=i._getOffset(o),p=$(this).data("start"),v=$(k).data("bBoxArray"),x=r.x-p.x,w=r.y-p.y,t=$(k).data("groupTarget"),s=$(this).data("offset"),u;var q=l(x,w);if("Y"==f.shape.AXIS){q.dx=0}else{if("X"==f.shape.AXIS){q.dy=0}}x=i._grid(q.dx,"move");w=i._grid(q.dy,"move");$(this).css({position:"",left:"",top:""});u=i._moveElements(v,x,w);$(k).removeData("bBoxArray");h.removeAllGuide();if(t&&OG.Util.isElement(t)){h.addToGroup(t,u,r);h.remove(t.id+OG.Constants.DROP_OVER_BBOX_SUFFIX);$(k).removeData("groupTarget")}else{var n=[];$.each(u,function(z,A){var y=A.parentElement;if(!y){y=A.parentNode}if(y&&y.id!==k.id){n.push(A)}});h.addToGroup(k,n,r)}$.each(i._getSelectedElement(),function(y,z){c=h.drawGuide(z);if(c){i.setResizable(z,c,i._isResizable(z.shape));i.setConnectable(z,c,i._isConnectable(z.shape));h.toFront(c.group)}});h.removeAllConnectGuide();h.toFrontEdges();h.checkAllBridgeEdge();h.addHistory()}});h.setAttr(f,{cursor:"move"});OG.Util.apply(f.shape.geom.style.map,{cursor:"move"})}else{h.setAttr(f,{cursor:i._isSelectable(f.shape)?"pointer":i._CONFIG.DEFAULT_STYLE.SHAPE.cursor});OG.Util.apply(f.shape.geom.style.map,{cursor:i._isSelectable(f.shape)?"pointer":i._CONFIG.DEFAULT_STYLE.SHAPE.cursor});if(i._CONFIG.DRAG_PAGE_MOVABLE){var a=i._RENDERER._CANVAS._CONTAINER;$(f).bind("mousedown",function(o){if(o.button!=0){return}k=h.getRootGroup();var n=$(k).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);var p=$(k).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE);if(n==="active"||p==="active"){return}$(k).data("dragPageMove",{x:o.pageX,y:o.pageY});$(k).data("dragPageScroll",{x:a.scrollLeft,y:a.scrollTop})})}}},setConnectable:function(d,b,h){var e=this,c=e._RENDERER.getRootGroup(),a,g;var f=$(d).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE?true:false;if(!d||!b){return}if(h){if(!f){$.each(b.line,function(k,j){$(j.node).bind({click:function(i){g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);if(a){$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE,"created");$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_TEXT,j.text);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_LABEL,j.label);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_SHAPE,j.shape)}}});$(j.node).draggable({start:function(i){e.deselectAll();e._RENDERER.removeAllConnectGuide();e._RENDERER.removeAllVirtualEdge();g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE,"active");$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_TEXT,j.text);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_LABEL,j.label);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_SHAPE,j.shape)}})});$(b.rect).bind({click:function(i){g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);if(a){$(c).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE,"created")}}});$(b.rect).draggable({start:function(i){e.deselectAll();e._RENDERER.removeAllConnectGuide();e._RENDERER.removeAllVirtualEdge();g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);$(c).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE,"active")}})}}},setResizable:function(j,y,k){var x=this;var s=x._RENDERER.getRootGroup();if(!j||!y){return}var o=$(j).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE?true:false;var r=x._RENDERER;var t=x._RENDERER.getBoundary(j);var m=t.getUpperCenter().y;var q=t.getLowerCenter().y;var g=t.getLeftCenter().x;var i=t.getRightCenter().x;var w=t.getWidth();var n=t.getHeight();var d=function(Q){var P=[];var z=x._CONFIG.GUIDE_MIN_SIZE;var N=x._CONFIG.LANE_MIN_SIZE;var C=x._CONFIG.GROUP_INNER_SAPCE;if(!x._CONFIG.AUTOMATIC_GUIDANCE){return P}var R=x._CONFIG.EDGE_MOVE_DELAY_SIZE;var J=r.getAllShapes();$.each(J,function(T,U){if(r.isEdge(U)){return}if(U.id===j.id){return}var X=r.getBoundary(U);var S=X.getCentroid();var V=X.getUpperLeft();var W=X.getLowerRight();P.push({condition:{maxY:V.y-R,minY:V.y+R},fixedPosition:{y:V.y},guidePosition:{y:V.y},id:T});P.push({condition:{maxY:W.y-R,minY:W.y+R},fixedPosition:{y:W.y},guidePosition:{y:W.y},id:T});P.push({condition:{maxX:V.x-R,minX:V.x+R},fixedPosition:{x:V.x},guidePosition:{x:V.x},id:T});P.push({condition:{maxX:W.x-R,minX:W.x+R},fixedPosition:{x:W.x},guidePosition:{x:W.x},id:T});P.push({condition:{maxX:S.x-R,minX:S.x+R},fixedPosition:{x:S.x},guidePosition:{x:S.x},id:T});P.push({condition:{maxY:S.y-R,minY:S.y+R,},fixedPosition:{y:S.y},guidePosition:{y:S.y},id:T})});function A(){P.push({condition:{minX:g+z},fixedPosition:{x:g+z}})}function I(){P.push({condition:{maxX:i-z},fixedPosition:{x:i-z}})}function F(){P.push({condition:{maxY:q-z},fixedPosition:{y:q-z}})}function B(){P.push({condition:{minY:m+z},fixedPosition:{y:m+z}})}function D(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var U=r.getNearestBaseLaneIndexAsDirection(j,"upper");if(U>0){var T=S[U-1];var V=r.getBoundary(T).getHeight()-N;P.push({condition:{minY:m-V},fixedPosition:{y:m-V}})}}}function H(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var W=r.getNearestBaseLaneIndexAsDirection(j,"upper");var T=S[W];var Y=r.getBoundary(T).getHeight()-N;P.push({condition:{maxY:m+Y},fixedPosition:{y:m+Y}});if(W===0){var V=r.getBoundaryOfInnerShapesGroup(j);if(V){P.push({condition:{maxY:V.getUpperCenter().y-C},fixedPosition:{y:V.getUpperCenter().y-C}})}}}if(r.isVerticalLane(j)){var X=r.getSmallestBaseLane(j);var Y=r.getExceptTitleLaneArea(X).getHeight()-N;P.push({condition:{maxY:m+Y},fixedPosition:{y:m+Y}});var V=r.getBoundaryOfInnerShapesGroup(j);if(V){var Z=r.getRootLane(j);var U=r.getBoundary(Z).getHeight()-r.getExceptTitleLaneArea(Z).getHeight();P.push({condition:{maxY:V.getUpperCenter().y-C-U},fixedPosition:{y:V.getUpperCenter().y-C-U}})}}}function O(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var V=r.getNearestBaseLaneIndexAsDirection(j,"low");var T=S[V];var X=r.getBoundary(T).getHeight()-N;P.push({condition:{minY:q-X},fixedPosition:{y:q-X}});if(V===S.length-1){var U=r.getBoundaryOfInnerShapesGroup(j);if(U){P.push({condition:{minY:U.getLowerCenter().y+C},fixedPosition:{y:U.getLowerCenter().y+C}})}}}if(r.isVerticalLane(j)){var W=r.getSmallestBaseLane(j);var X=r.getExceptTitleLaneArea(W).getHeight()-N;P.push({condition:{minY:q-X},fixedPosition:{y:q-X}});var U=r.getBoundaryOfInnerShapesGroup(j);if(U){P.push({condition:{minY:U.getLowerCenter().y+C},fixedPosition:{y:U.getLowerCenter().y+C}})}}}function E(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var U=r.getNearestBaseLaneIndexAsDirection(j,"low");if(U0){var T=S[U-1];var V=r.getBoundary(T).getWidth()-N;P.push({condition:{maxX:i+V},fixedPosition:{x:i+V}})}}}if(b(Q)){F()}if(a(Q)){B()}if(f(Q)){I()}if(l(Q)){A()}if(r.isLane(j)){if(b(Q)){D();H()}if(a(Q)){O();E()}if(f(Q)){M();G()}if(l(Q)){K();L()}}return P};var c=function(A,D){var B={x:D.x,y:D.y};if(!x._CONFIG.AUTOMATIC_GUIDANCE){return B}var z=function(F){if(!F){return B}if(F.x&&!F.y){return{x:F.x,y:B.y}}if(F.y&&!F.x){return{x:B.x,y:F.y}}if(F.x&&F.y){return F}return B};var C=$(A).data("correctionConditions");if(!C){return B}var E=[];$.each(C,function(G,F){var I=F.condition;var H=true;if(I.minX){if(D.x>I.minX){H=false}}if(I.maxX){if(D.xI.minY){H=false}}if(I.maxY){if(D.y4){p=4}var h=d._CANVAS._CONTAINER;var g=m.x;var e=m.y;d.setScale(p);m=c._getOffset(f);var q=m.x;var o=m.y;var l=(g-q)*p;var k=(e-o)*p;var i=h.scrollLeft;var n=h.scrollTop;$(h).scrollLeft(i+l);$(h).scrollTop(n+k);d._CANVAS.updateNavigatior()};$(b).bind("mousewheel DOMMouseScroll",function(e){if(c._CONFIG.WHEEL_SCALABLE){e.preventDefault();e.stopPropagation();if(e.originalEvent.wheelDelta>0||e.deltaY>0){a(e,true)}else{a(e,false)}}})},setDragSelectable:function(isSelectable){var renderer=this._RENDERER;var me=this,rootEle=renderer.getRootElement(),root=renderer.getRootGroup();var correctionConditionAnalysis=function(correctionConditions,offset){var fixedPosition={x:offset.x,y:offset.y};var calculateFixedPosition=function(expectedPosition){if(!expectedPosition){return fixedPosition}if(expectedPosition.x&&!expectedPosition.y){return{x:expectedPosition.x,y:fixedPosition.y}}if(expectedPosition.y&&!expectedPosition.x){return{x:fixedPosition.x,y:expectedPosition.y}}if(expectedPosition.x&&expectedPosition.y){return expectedPosition}return fixedPosition};if(!correctionConditions||!correctionConditions.length){return fixedPosition}var conditionsPassCandidates=[];$.each(correctionConditions,function(index,correctionCondition){var condition=correctionCondition.condition;var conditionsPassToFix=true;if(condition.minX){if(offset.x>condition.minX){conditionsPassToFix=false}}if(condition.maxX){if(offset.xcondition.minY){conditionsPassToFix=false}}if(condition.maxY){if(offset.yOG.Constants.RUBBER_BAND_TOLERANCE&&Math.abs(height)>OG.Constants.RUBBER_BAND_TOLERANCE){$(this).data("rubber_band_status","start");x=width<=0?first.x+width:first.x;y=height<=0?first.y+height:first.y;renderer.drawRubberBand([x,y],[Math.abs(width),Math.abs(height)])}}});$(rootEle).bind("mouseup",function(event){var isConnectMode=$(root).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);var isRectMode=$(root).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE);if(isConnectMode==="active"||isRectMode==="active"){return}if("start"==$(this).data("rubber_band_status")&&!me._CONFIG.DRAG_PAGE_MOVABLE){var first=$(this).data("dragBox_first"),eventOffset,width,height,x,y,envelope,guide,elements=[];renderer.removeRubberBand(rootEle);if(first){eventOffset=me._getOffset(event);width=eventOffset.x-first.x;height=eventOffset.y-first.y;x=width<=0?first.x+width:first.x;y=height<=0?first.y+height:first.y;envelope=new OG.Envelope([x,y],Math.abs(width),Math.abs(height));$.each(renderer.getAllShapes(),function(index,element){if(!element.shape.geom){return}if(!envelope.isContainsAll(element.shape.geom.getVertices())){return}if(renderer.isEdge(element)){return}elements.push(element)});me.selectShapes(elements);$(this).data("dragBox",{width:width,height:height,x:x,y:y})}$(this).data("rubber_band_status","none")}});$(rootEle).bind("contextmenu",function(event){renderer.removeRubberBand(rootEle)})}else{$(rootEle).unbind("mousedown");$(rootEle).unbind("mousemove");$(rootEle).unbind("mouseup");$(rootEle).unbind("contextmenu")}},setEnableHotKey:function(d){var b=this;var c=b._RENDERER;if(d===true){var a;if(b._CONFIG.FOCUS_CANVAS_ONSELECT){a=$(c.getContainer())}else{a=$(document)}a.bind("keydown",function(e){if(!/^textarea$/i.test(e.target.tagName)&&!/^input$/i.test(e.target.tagName)){if(b._CONFIG.ENABLE_HOTKEY_CTRL_Z&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_Z){if(e.shiftKey){e.preventDefault();c.redo()}else{e.preventDefault();c.undo()}}if(b._CONFIG.ENABLE_HOTKEY_DELETE&&(e.keyCode===KeyEvent.DOM_VK_DELETE||e.keyCode===KeyEvent.DOM_VK_BACK_SPACE)){e.preventDefault();b.deleteSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_A&&b._CONFIG.SELECTABLE&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_A){e.preventDefault();b.selectAll()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_C&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_C){e.preventDefault();b.copySelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_C&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_X){e.preventDefault();b.cutSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_V&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_V){e.preventDefault();b.pasteSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_D&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_D){e.preventDefault();b.duplicateSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_G&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_G){e.preventDefault();b.groupSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_U&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_U){e.preventDefault();b.ungroupSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_SHIFT_ARROW){if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_LEFT){e.preventDefault();b._moveElements(b._getMoveTargets(),-1*(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1),0);c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_RIGHT){e.preventDefault();b._moveElements(b._getMoveTargets(),(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1),0);c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_UP){e.preventDefault();b._moveElements(b._getMoveTargets(),0,-1*(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1));c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_DOWN){e.preventDefault();b._moveElements(b._getMoveTargets(),0,(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1));c.addHistory()}}if(b._CONFIG.ENABLE_HOTKEY_ARROW){if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_LEFT){e.preventDefault();b._moveElements(b._getMoveTargets(),-1*(b._CONFIG.MOVE_SNAP_SIZE/2),0);b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_RIGHT){e.preventDefault();b._moveElements(b._getMoveTargets(),(b._CONFIG.MOVE_SNAP_SIZE/2),0);b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_UP){e.preventDefault();b._moveElements(b._getMoveTargets(),0,-1*(b._CONFIG.MOVE_SNAP_SIZE/2));b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_DOWN){e.preventDefault();b._moveElements(b._getMoveTargets(),0,(b._CONFIG.MOVE_SNAP_SIZE/2));b.selectShapes(b._getSelectedElement());c.addHistory()}}}})}else{$(c.getContainer()).unbind("keydown")}},enableRootContextMenu:function(){var a=this;var b=a._RENDERER;$.contextMenu({position:function(d,c,e){d.$menu.css({top:e+10,left:c+10})},selector:"#"+a._RENDERER.getRootElement().id,build:function(c,g){var f=a._RENDERER.getRootGroup(),d=$(f).data("copied");if(a._CONFIG.FOCUS_CANVAS_ONSELECT){$(a._RENDERER.getContainer()).focus()}return{items:{selectAll:{name:"모두 선택",callback:function(){a.selectAll()}},sep1:"---------",paste:{name:"붙여넣기",callback:function(){a.pasteSelectedShape(g)},disabled:(d?false:true)},sep2:"---------",view:{name:"스케일",items:{view_actualSize:{name:"실제 사이즈",callback:function(){a._RENDERER.setScale(1);b.addHistory()}},sep2_1:"---------",view_fitWindow:{name:"윈도우에 맞추기",callback:function(){a.fitWindow()}},sep2_2:"---------",view_25:{name:"25%",callback:function(){a._RENDERER.setScale(0.25);b.addHistory()}},view_50:{name:"50%",callback:function(){a._RENDERER.setScale(0.5);b.addHistory()}},view_75:{name:"75%",callback:function(){a._RENDERER.setScale(0.75);b.addHistory()}},view_100:{name:"100%",callback:function(){a._RENDERER.setScale(1);b.addHistory()}},view_150:{name:"150%",callback:function(){a._RENDERER.setScale(1.5);b.addHistory()}},view_200:{name:"200%",callback:function(){a._RENDERER.setScale(2);b.addHistory()}},view_300:{name:"300%",callback:function(){a._RENDERER.setScale(3);b.addHistory()}},view_400:{name:"400%",callback:function(){a._RENDERER.setScale(4);b.addHistory()}},sep2_3:"---------",view_zoomin:{name:"확대",callback:function(){a.zoomIn()}},view_zoomout:{name:"축소",callback:function(){a.zoomOut()}}}}}}}})},makeRotate:function(){var a=this;return{rotate:{name:"회전",items:{rotate_select:{name:"선택",type:"select",options:{"0":"0","45":"45","90":"90","135":"135","180":"180","-45":"-45","-90":"-90","-135":"-135","-180":"-180"},selected:"0",events:{change:function(b){a.rotateSelectedShape(b.target.value)}}},sep8_8_1:"---------",rotate_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.rotateSelectedShape(b.target.value)}}}}}}}},makeFillColor:function(){var a=this;return{fillColor:{name:"색상",items:{fillColor_select:{name:"선택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFillColorSelectedShape(b.target.value)}}}},sep5_1_1:"---------",fillColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFillColorSelectedShape(b.target.value)}}}}}}}},makeFillOpacity:function(){var a=this;return{fillOpacity:{name:"투명도",items:{fillOpacity_select:{name:"선택",type:"select",options:{"":"","0.0":"0%","0.1":"10%","0.2":"20%","0.3":"30%","0.4":"40%","0.5":"50%","0.6":"60%","0.7":"70%","0.8":"80%","0.9":"90%","1.0":"100%"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFillOpacitySelectedShape(b.target.value)}}}}}}}},makeLineStyle:function(){var a=this;return{lineStyle:{name:"선 스타일",items:{lineStyle_1:{name:"──────",type:"radio",radio:"lineStyle",value:"",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_2:{name:"---------",type:"radio",radio:"lineStyle",value:"-",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_3:{name:"············",type:"radio",radio:"lineStyle",value:".",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_4:{name:"-·-·-·-·-·",type:"radio",radio:"lineStyle",value:"-.",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_5:{name:"-··-··-··-",type:"radio",radio:"lineStyle",value:"-..",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_6:{name:"· · · · · ·",type:"radio",radio:"lineStyle",value:". ",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_7:{name:"- - - - -",type:"radio",radio:"lineStyle",value:"- ",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_8:{name:"─ ─ ─ ─",type:"radio",radio:"lineStyle",value:"--",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_9:{name:"- ·- ·- ·-",type:"radio",radio:"lineStyle",value:"- .",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_10:{name:"--·--·--·-",type:"radio",radio:"lineStyle",value:"--.",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_11:{name:"--··--··--",type:"radio",radio:"lineStyle",value:"--..",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}}}}}},makeLineColor:function(){var a=this;return{lineColor:{name:"선 색상",items:{lineColor_select:{name:"석택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setLineColorSelectedShape(b.target.value)}}}},sep5_4_1:"---------",lineColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLineColorSelectedShape(b.target.value)}}}}}}}},makeLineWidth:function(){var a=this;return{lineWidth:{name:"선 두께",items:{lineWidth_select:{name:"선택",type:"select",options:{0:"",1:"1px",2:"2px",3:"3px",4:"4px",5:"5px",6:"6px",8:"8px",10:"10px",12:"12px",16:"16px",24:"24px"},selected:0,events:{change:function(b){if(b.target.value!==0){a.setLineWidthSelectedShape(b.target.value)}}}},sep5_5_1:"---------",lineWidth_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLineWidthSelectedShape(b.target.value)}}}}}}}},makeFont:function(){var a=this;return{text:{name:"글꼴",items:{fontFamily:{name:"폰트",items:{fontFamily_1:{name:'Arial',type:"radio",radio:"fontFamily",value:"Arial",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_2:{name:"Comic Sans MS",type:"radio",radio:"fontFamily",value:"Comic Sans MS",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_3:{name:"Courier New",type:"radio",radio:"fontFamily",value:"Courier New",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_4:{name:'Garamond',type:"radio",radio:"fontFamily",value:"Garamond",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_5:{name:'Georgia',type:"radio",radio:"fontFamily",value:"Georgia",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_6:{name:"Lucida Console",type:"radio",radio:"fontFamily",value:"Lucida Console",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_7:{name:"MS Gothic",type:"radio",radio:"fontFamily",value:"MS Gothic",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_8:{name:"MS Sans Serif",type:"radio",radio:"fontFamily",value:"MS Sans Serif",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_9:{name:'Verdana',type:"radio",radio:"fontFamily",value:"Verdana",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_10:{name:"Times New Roman",type:"radio",radio:"fontFamily",value:"Times New Roman",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},sep6_1_1:"---------",fontFamily_custom:{name:"Custom",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontFamilySelectedShape(b.target.value)}}}}}},fontColor:{name:"글 색상",items:{fontColor_select:{name:"선택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFontColorSelectedShape(b.target.value)}}}},sep6_1_2:"---------",fontColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontColorSelectedShape(b.target.value)}}}}}},fontSize:{name:"글 크기",items:{fontSize_select:{name:"선택",type:"select",options:{"":"","6":"6","8":"8","9":"9","10":"10","11":"11","12":"12","14":"14","18":"18","24":"24","36":"36","48":"48","72":"72"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFontSizeSelectedShape(b.target.value)}}}},sep6_1_3:"---------",fontSize_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontSizeSelectedShape(b.target.value)}}}}}},sep6_1:"---------",fontWeight_bold:{name:'굵게',type:"checkbox",events:{change:function(b){if(b.target.checked){a.setFontWeightSelectedShape("bold")}else{a.setFontWeightSelectedShape("normal")}}}},fontWeight_italic:{name:'이탤릭',type:"checkbox",events:{change:function(b){if(b.target.checked){a.setFontStyleSelectedShape("italic")}else{a.setFontStyleSelectedShape("normal")}}}},sep6_2:"---------",position:{name:"글 위치",items:{position_left:{name:"왼쪽",type:"radio",radio:"position",value:"left",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_center:{name:"가운데",type:"radio",radio:"position",value:"center",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_right:{name:"오른쪽",type:"radio",radio:"position",value:"right",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_top:{name:"위",type:"radio",radio:"position",value:"top",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_bottom:{name:"아래",type:"radio",radio:"position",value:"bottom",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}}}},vertical:{name:"수직 정렬",items:{vertical_top:{name:"위",type:"radio",radio:"vertical",value:"top",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}},vertical_middle:{name:"가운데",type:"radio",radio:"vertical",value:"middle",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}},vertical_bottom:{name:"아래",type:"radio",radio:"vertical",value:"bottom",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}}}},horizontal:{name:"수평 정렬",items:{vertical_start:{name:"왼쪽",type:"radio",radio:"horizontal",value:"start",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}},horizontal_middle:{name:"가운데",type:"radio",radio:"horizontal",value:"middle",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}},horizontal_end:{name:"오른쪽",type:"radio",radio:"horizontal",value:"end",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}}}},sep6_5:"---------",textRotate:{name:"글 회전각",items:{textRotate_select:{name:"선택",type:"select",options:{"0":"0","45":"45","90":"90","135":"135","180":"180","-45":"-45","-90":"-90","-135":"-135","-180":"-180"},selected:"0",events:{change:function(b){a.setLabelAngleSelectedShape(b.target.value)}}},sep6_6_1:"---------",textRotate_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLabelAngleSelectedShape(b.target.value)}}}}}}}}}},makeBring:function(){var a=this;return{bringToFront:{name:"맨 앞으로 가져오기",items:{bringToFront:{name:"맨 앞으로 가져오기",callback:function(){a.bringToFront()}},bringForward:{name:"앞으로 가져오기",callback:function(){a.bringForward()}}}}}},makeSend:function(){var a=this;return{sendToBack:{name:"맨 뒤로 보내기",items:{sendToBack:{name:"맨 뒤로 보내기",callback:function(){a.sendToBack()}},sendBackward:{name:"뒤로 보내기",callback:function(){a.sendBackward()}}}}}},makeDelete:function(){var a=this;return{"delete":{name:"삭제",callback:function(){a.deleteSelectedShape()}}}},makeCopy:function(){var a=this;return{copy:{name:"복사",callback:function(){a.copySelectedShape()}}}},makeAlign:function(){var a=this;return{align:{name:"도형 정렬",items:{Top:{name:"위로정렬",type:"radio",radio:"align",value:"Top",events:{change:function(b){a._RENDERER.alignTop();a._RENDERER.addHistory()}}},Left:{name:"왼쪽정렬",type:"radio",radio:"align",value:"Left",events:{change:function(b){a._RENDERER.alignLeft();a._RENDERER.addHistory()}}},Right:{name:"오른쪽정렬",type:"radio",radio:"align",value:"Right",events:{change:function(b){a._RENDERER.alignRight();a._RENDERER.addHistory()}}},Bottom:{name:"아래로정렬",type:"radio",radio:"align",value:"Bottom",events:{change:function(b){a._RENDERER.alignBottom();a._RENDERER.addHistory()}}}}}}},makeFormat:function(){return{format:{name:"형식",items:this.mergeContextMenu(this.makeFillColor(),this.makeFillOpacity(),this.makeRotate(),this.makeLineStyle(),this.makeLineColor(),this.makeLineWidth())}}},makeMultiContextMenu:function(){return this.mergeContextMenu(this.makeDelete(),this.makeCopy(),this.makeAlign())},mergeContextMenu:function(){var d={};for(var c=0,a=arguments.length;c=a._CONFIG.SCALE_MIN){a._RENDERER.setScale(a._CONFIG.SCALE-a._CONFIG.SCALE*0.1)}a._RENDERER.addHistory()},fitWindow:function(){var b=this,a=b._RENDERER.getContainer();b._RENDERER.fitCanvasSize([a.clientWidth,a.clientHeight],true);b._RENDERER.addHistory()},_isContainsConnectedShape:function(a,k){var g=this,e,l,h,b,f=false,d=false,c;e=$(a).attr("_from");l=$(a).attr("_to");if(e){h=g._getShapeFromTerminal(e)}if(l){b=g._getShapeFromTerminal(l)}for(var c=0,j=k.length;c0){c._copyChildren(h,i)}}})},_deselectChildren:function(b){var c=this,a=b.childNodes;$.each(a,function(d,e){if($(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE){if(e.childNodes.length>0){c._deselectChildren(e);c._delSelectedElement(e)}if($(e).attr("_selected")==="true"){c._RENDERER.removeGuide(e);$(e).draggable("destroy")}}})},_isParentSelected:function(b){var c=this,a=b.parentNode;if(a){if(c._isParentSelected(a)){return true}if($(a).attr("_type")===OG.Constants.NODE_TYPE.SHAPE&&$(a).attr("_selected")==="true"){return true}}return false},_num:function(a){return parseInt(a,10)},_grid:function(c,a){var b=this;if(a){return b._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(c,b._CONFIG.MOVE_SNAP_SIZE/2):c}else{return b._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(c,b._CONFIG.MOVE_SNAP_SIZE):c}},_isSelectable:function(a){var b=this;return b._CONFIG.SELECTABLE&&a.SELECTABLE},_isConnectable:function(a){var b=this;return b._CONFIG.CONNECTABLE&&a.CONNECTABLE},_isConnectableFrom:function(a){var b=this;return a.ENABLE_FROM},_isConnectableTo:function(a){var b=this;return a.ENABLE_TO},_isSelfConnectable:function(a){var b=this;return b._CONFIG.SELF_CONNECTABLE&&a.SELF_CONNECTABLE},_isConnectCloneable:function(a){var b=this;return b._CONFIG.CONNECT_CLONEABLE&&a.CONNECT_CLONEABLE},_isMovable:function(a){var b=this;return(b._CONFIG.SELECTABLE&&a.SELECTABLE)&&(b._CONFIG.MOVABLE&&b._CONFIG.MOVABLE_[a.TYPE]&&a.MOVABLE)},_isDeletable:function(a){var b=this;return(b._CONFIG.DELETABLE&&a.DELETABLE)&&(b._CONFIG.DELETABLE&&b._CONFIG.DELETABLE_[a.TYPE]&&a.DELETABLE)},_isConnectStyleChangable:function(a){var b=this;return(b._CONFIG.CONNECT_STYLE_CHANGE&&a.CONNECT_STYLE_CHANGE)&&(b._CONFIG.CONNECT_STYLE_CHANGE&&b._CONFIG.CONNECT_STYLE_CHANGE_[a.TYPE]&&a.CONNECT_STYLE_CHANGE)},_isResizable:function(a){var b=this;return(b._CONFIG.SELECTABLE&&a.SELECTABLE)&&(b._CONFIG.RESIZABLE&&b._CONFIG.RESIZABLE_[a.TYPE]&&a.RESIZABLE)},_isLabelEditable:function(a){var b=this;return b._CONFIG.LABEL_EDITABLE&&b._CONFIG.LABEL_EDITABLE_[a.TYPE]&&a.LABEL_EDITABLE},_addSelectedElement:function(a){if(undefined==this.selectedElements){this.selectedElements={}}this.selectedElements[a.attributes.id.value]=a;if(a.shape){a.shape.onSelectShape()}},_delSelectedElement:function(a){if(this.selectedElements){delete this.selectedElements[a.attributes.id.value];if(a.shape){a.shape.onDeSelectShape()}}},_getSelectedElement:function(){var a,b=[];for(a in this.selectedElements){b.push(this.selectedElements[a])}return b},_isSelectedElement:function(c){var a=false;if(c&&c.id){for(var b in this.selectedElements){if(b===c.id){a=true}}}return a},_removeAllSelectedElement:function(){var b;for(b in this.selectedElements){var a=this.selectedElements[b];delete this.selectedElements[b];if(a&&a.shape){a.shape.onDeSelectShape()}}},setConnectGuide:function(e,d){var h=this._RENDERER;var i=this,m,g,f,c,b,j=h.getRootGroup();var j=h.getRootGroup();var l=function(u){var r=i._CONFIG.EDGE_MOVE_DELAY_SIZE;var p=[];var o=[];var v=$(u).data("type");var t=e.shape.geom.getVertices();var n;if(!i._CONFIG.AUTOMATIC_GUIDANCE){n=e.shape.geom.getVertices();$.each(n,function(w,x){o.push(x)})}else{var q=h.getAllEdges();$.each(q,function(w,x){n=x.shape.geom.getVertices();$.each(n,function(y,z){o.push(z)})})}if(v===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var s=$(u).data("index");if(s===0||s===t.length-1){$.each(j.childNodes,function(x,z){if($(z).attr("_type")===OG.Constants.NODE_TYPE.SHAPE&&$(z).attr("_shape")!==OG.Constants.SHAPE_TYPE.EDGE){var B=h.getBoundary(z);if(B&&B._upperLeft){var y=B._upperLeft;var A=B._width;var w=B._height;p.push({condition:{minX:y.x+(A/2)-r,maxX:y.x+(A/2)+r,minY:y.y,maxY:y.y+w,},fixedPosition:{x:y.x+(A/2)},id:x});p.push({condition:{minX:y.x,maxX:y.x+A,minY:y.y+(w/2)-r,maxY:y.y+(w/2)+r,},fixedPosition:{y:y.y+(w/2)},id:x})}}})}}$.each(o,function(x,w){p.push({condition:{minX:w.x-r,maxX:w.x+r,},fixedPosition:{x:w.x},id:x});p.push({condition:{minY:w.y-r,maxY:w.y+r,},fixedPosition:{y:w.y},id:x})});$(u).data("correctionConditions",p)};var k=function(q,r){var o={x:r.x,y:r.y};var n=function(t){if(!t){return o}if(t.x&&!t.y){return{x:t.x,y:o.y}}if(t.y&&!t.x){return{x:o.x,y:t.y}}if(t.x&&t.y){return t}return o};var p=$(q).data("correctionConditions");if(!p){return o}var s=[];$.each(p,function(u,t){var w=t.condition;var v=true;if(w.minX){if(r.xw.maxX){v=false}}if(w.minY){if(r.yw.maxY){v=false}}if(v){s.push(t)}});$.each(s,function(t,u){o=n(u.fixedPosition)});return o};var a=function(p){var q;var o=e.shape.geom.getVertices();if($(p).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var n=$(p).data("index");if(n||n===0){if(n===0){q="from"}if(n===o.length-1){q="to"}}}return q};$(e).bind({mousemove:function(r){if(!i._isConnectable(e.shape)){return}var p=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var s=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var n=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER);var q=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);var o=$(j).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);if(!p||n||q||o){return}if(s){if(i._CONFIG.SPOT_ON_SELECT&&$(e).attr("_selected")!="true"){return}c=i._getOffset(r);var t=h.createVirtualSpot(c.x,c.y,e);if(t){$(t).bind({mousedown:function(){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,true)},mouseup:function(){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false)}});$(t).draggable({start:function(v){h.removeAllGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,true);var x=i._getOffset(v);var I=$(this).data("vertice");var E=e.shape.geom;$(this).data("offset",{x:x.x-I.x,y:x.y-I.y});var w=$(this).data("prev");var A=$(this).data("next");var C=E.getVertices();var y=$(this).data("offset");var u=x.x-y.x;var K=x.y-y.y;var J=E.convertCoordinate([u,K]);f=h.getCircleSpots(e);$.each(f,function(N,L){var M=$(L).data("index");if(M>=A){$(L).data("index",M+1)}});C.splice(A,0,J);E.setVertices(C);$(this).attr("name",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT);$(this).data("index",A);var D=true;if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var B=$(this).data("index");if(B===0&&B===C.length-1){D=false}}if(D){var G=$(e).attr("_from");var F=$(e).attr("_to");if(G){var z=h._getPositionFromTerminal(G);C[0]=E.convertCoordinate([z.x,z.y])}if(F){var H=h._getPositionFromTerminal(F);C[C.length-1]=E.convertCoordinate([H.x,H.y])}E.setVertices(C)}$(this).data("corrections",l(t));e=h.drawEdge(new OG.PolyLine(C),E.style,e.id);h.removeRubberBand(h.getRootElement());h.selectSpot(t)},drag:function(w){if(!h._getREleById(t.id)){h.removeAllConnectGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);return}var x=i._getOffset(w);var B=$(this).data("offset");var A=x.x-B.x;var z=x.y-B.y;var v=e.shape.geom.getVertices();var y=k(t,{x:A,y:z});A=y.x;z=y.y;h.setAttr(t,{cx:A});h.setAttr(t,{cy:z});var u=$(this).data("index");v[u].x=A;v[u].y=z;h.drawEdge(new OG.PolyLine(v),e.shape.geom.style,e.id);h.trimConnectIntersection(e)},stop:function(w){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);var x=i._getOffset(w);var B=$(this).data("offset");var v=$(this).data("index");var A=x.x-B.x;var z=x.y-B.y;var u=e.shape.geom.getVertices();var y=k(t,{x:A,y:z});y.x=i._grid(y.x,"move");y.y=i._grid(y.y,"move");A=y.x;z=y.y;u[v].x=A;u[v].y=z;h.drawEdge(new OG.PolyLine(u),e.shape.geom.style,e.id);h.removeConnectGuide(e);h.removeVirtualSpot(e);h.trimConnectInnerVertice(e);h.trimConnectIntersection(e);h.trimEdge(e);h.addHistory()}})}}},mouseout:function(p){if(!i._isConnectable(e.shape)){return}var n=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var q=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var o=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);if(!n){return}if(!q){if(o){return}h.removeConnectGuide(e)}if(q){if(o){return}b=false;c=i._getOffset(p);g=h.getSpots(e);$(g).each(function(s,t){m=h.getBBox(t);if(c.x>=m.x&&c.x<=m.x2&&c.y>=m.y&&c.y<=m.y2){b=true}});var r=h.getVirtualSpot(e);if(r){m=h.getBBox(r);if(c.x>=m.x&&c.x<=m.x2&&c.y>=m.y&&c.y<=m.y2){b=true}}if(!b){h.removeConnectGuide(e);h.removeVirtualSpot(e)}}p.stopImmediatePropagation()},mouseover:function(s){if(!i._isConnectable(e.shape)){return}var n;var o=i._CONFIG.DEFAULT_STYLE.CONNECTABLE_HIGHLIGHT;var q=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var t=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var r=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);var p=$(j).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);if(!q){return}if(!t){if(r){return}h.removeAllConnectGuide();h.drawConnectGuide(e)}if(t){if(i._CONFIG.SPOT_ON_SELECT&&$(e).attr("_selected")!="true"){return}if(p){return}if(r){return}h.removeOtherConnectGuide(e);n=h.drawConnectGuide(e);if(n&&n.spots){$(n.spots).each(function(u,v){$(v).bind({mouseover:function(){var w=false;if($(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG)){w=true}if(!w){h.selectSpot(v);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,true)}},mouseout:function(){var w=false;if($(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG)){w=true}if(!w){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false)}}});$(v).draggable({start:function(w){h.removeAllGuide();h.toFront(e);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,true);var z=i._getOffset(w);var K=$(this).data("vertice");var G=e.shape.geom;var E=G.getVertices();$(this).data("offset",{x:z.x-K.x,y:z.y-K.y});var F=true;if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var D=$(this).data("index");if(D===0||D===E.length-1){F=false}}$(this).data("needToRedrawVertices",F);if(F){var I=$(e).attr("_from");var H=$(e).attr("_to");if(I){var B=h._getPositionFromTerminal(I);E[0]=G.convertCoordinate([B.x,B.y])}if(H){var J=h._getPositionFromTerminal(H);E[E.length-1]=G.convertCoordinate([J.x,J.y])}G.setVertices(E)}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){$(this).data("corrections",l(v));h.remove(n.bBox);h.removeRubberBand(h.getRootElement())}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){E=G.getVertices();var y=$(this).data("prev");var A=$(this).data("next");if(y===0){var C=e.shape.geom.convertCoordinate([E[0].x,E[0].y]);E.splice(y,0,C);$(this).data("prev",y+1);$(this).data("next",A+1);A=A+1}if(A===E.length-1){var x=G.convertCoordinate([E[E.length-1].x,E[E.length-1].y]);E.splice(A,0,x)}G.setVertices(E);$(this).data("corrections",l(v));h.remove(n.bBox);h.removeRubberBand(h.getRootElement())}},drag:function(z){if(!h._getREleById(v.id)){h.removeAllConnectGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);return}var B=i._getOffset(z);var C=$(this).data("offset");var y=B.x-C.x;var K=B.y-C.y;var F=e.shape.geom.getVertices();var G=k(v,{x:y,y:K});if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){y=G.x;K=G.y;h.setAttr(v,{cx:y});h.setAttr(v,{cy:K});var E=$(this).data("index");F[E].x=y;F[E].y=K}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){y=G.x;K=G.y;var x=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var J=x.h;var H=$(this).data("direction");var A=$(this).data("prev");var D=$(this).data("next");if(H==="vertical"){F[A].x=y;F[D].x=y;h.setAttr(v,{x:y-(J/2)})}if(H==="horizontal"){F[A].y=K;F[D].y=K;h.setAttr(v,{y:K-(J/2)})}}h.drawEdge(new OG.PolyLine(F),e.shape.geom.style,e.id);if($(this).data("needToRedrawVertices")){h.trimConnectIntersection(e)}var w=a(v);var I=h.getFrontForCoordinate([B.x,B.y]);$.each(h.getAllNotEdges(),function(L,M){if(I&&w){if(M.id===I.id){h.setHighlight(M,o);h.drawConnectGuide(M)}else{h.removeHighlight(M,o);h.removeConnectGuide(M)}}else{h.removeHighlight(M,o);h.removeConnectGuide(M)}})},stop:function(H){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);var N=i._getOffset(H);var x=$(this).data("offset");var z=$(this).data("index");var L=N.x-x.x;var J=N.y-x.y;var y=e.shape.geom.getVertices();var B=k(v,{x:L,y:J});B.x=i._grid(B.x,"move");B.y=i._grid(B.y,"move");if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){L=B.x;J=B.y;h.setAttr(v,{cx:L});h.setAttr(v,{cy:J});var z=$(this).data("index");y[z].x=L;y[z].y=J}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){L=B.x;J=B.y;var w=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var C=w.h;var M=$(this).data("direction");var D=$(this).data("prev");var E=$(this).data("next");if(M==="vertical"){y[D].x=L;y[E].x=L;h.setAttr(v,{x:L-(C/2)})}if(M==="horizontal"){y[D].y=J;y[E].y=J;h.setAttr(v,{y:J-(C/2)})}}h.drawEdge(new OG.PolyLine(y),e.shape.geom.style,e.id);h.removeConnectGuide(e);h.removeVirtualSpot(e);var A=a(v);var I=h.getFrontForCoordinate([N.x,N.y]);if(I){h.removeHighlight(I,o)}if(A&&I){var F=[L,J];var K=h.createTerminalString(I,F);var G=i._isConnectable(I.shape);if(G){if(A==="from"){if(i._isConnectableFrom(I.shape)){h.connect(K,null,e,e.shape.geom.style)}}if(A==="to"){if(i._isConnectableTo(I.shape)){h.connect(null,K,e,e.shape.geom.style)}}}}if(A&&!I){h.disconnectOneWay(e,A)}h.trimConnectInnerVertice(e);h.trimConnectIntersection(e);h.trimEdge(e);h.addHistory()}})})}}s.stopImmediatePropagation()}})}};OG.handler.EventHandler.prototype.constructor=OG.handler.EventHandler;OG.EventHandler=OG.handler.EventHandler;OG.handler.RemoteUser=function(b,a,c){this.key=b;this.name=a;this.sessionId=c;this.isMaster=false;this.editable=false};OG.handler.RemoteUser.prototype={getKey:function(){return this.key},setKey:function(a){this.key=a},getName:function(){return this.name},setName:function(a){this.name=a},getSessionId:function(){return this.sessionId},setSessionId:function(a){this.sessionId=a},getIsMaster:function(){return this.isMaster},setIsMaster:function(a){this.isMaster=a},getEditable:function(){return this.editable},setEditable:function(a){this.editable=a}};OG.handler.RemoteUser.prototype.constructor=OG.handler.RemoteUser;OG.RemoteUser=OG.handler.RemoteUser();OG.handler.RemoteRepo={};OG.handler.RemoteHandler=function(){this._REPO=OG.handler.RemoteRepo;this._CLASSNAME="org.uengine.opengraph.RemoteService";this._SESSIONID=null;this._ENCODESUFFIX="_%$";this._SCHEDULER=null};OG.handler.RemoteHandler.prototype={encodeJson:function(a){return JSON.stringify(a).replace(/"/gi,this._ENCODESUFFIX)},getRepo:function(){return this._REPO},setCanvasForIdentifier:function(b,a){var c=this.getRepo();if(!c[a]){c[a]={canvas:null,users:[]}}c[a].canvas=b;return c[a]},getCanvasByIdentifier:function(a){var b=this.getRepo();if(!b[a]){return null}return b[a].canvas},getRemote:function(c){var b={__className:this._CLASSNAME};if(c){for(var a in c){b[a]=c[a]}}return new MetaworksObject(b,"body")},convertRemoteUser:function(b){var a=new OG.handler.RemoteUser();a.setKey(b.key);a.setName(b.name);a.setSessionId(b.sessionId);a.setIsMaster(b.isMaster);a.setEditable(b.editable);return a},closeRemote:function(b){var a=b.__objectId;$("#objDiv_"+a).remove();delete mw3.objects[a]},getCanvasId:function(a){return a._CONTAINER.id},startRemote:function(c,b,a,e){var d=this;if(!c||!b||!a){return}if(!a.key||!a.name){return}c.setRemotable(true);c.setIdentifier(b);d.setCanvasForIdentifier(c,b);d.registeToServer(b,a,function(f){e(f)})},getSelfSession:function(d){if(this._SESSIONID){d(this._SESSIONID);return}var b=this;var c=this.getRemote();var a=c.__objectId;c.selfSession(null,function(){var e=mw3.objects[a]["currentSessionId"];b.closeRemote(c);if(e){b._SESSIONID=e}d(e)})},registeToServer:function(d,c,g){var e=this,b;var f=this.getRemote({identifier:d,remoteUser:e.encodeJson(c)});var a=f.__objectId;f.registe(null,function(i){b=mw3.objects[a];e.closeRemote(f);var h=e.convertRemoteUser(JSON.parse(b.remoteUser));g(h)})},updateRemoteUser:function(e){var d=this;var g=JSON.parse(e);var b=g.identifier;var c=g.remoteUsers;if(!this.getRepo()[b]){return}var f=[];var a=this.getCanvasByIdentifier(b);this.getSelfSession(function(j){$.each(c,function(k,l){if(l.sessionId&&l.sessionId==j){a.setRemoteEditable(l.editable);a.setRemoteIsMaster(l.isMaster);$(a.getRootElement()).trigger("remoteStatusUpdated",[l])}if(l.isMaster){f.push(d.convertRemoteUser(l))}});$.each(c,function(k,l){if(!l.isMaster){f.push(d.convertRemoteUser(l))}});d.getRepo()[b]["users"]=f;var i=$("#"+d.getCanvasId(a));i.find(".userPanel").remove();var h=$('
      ');h.css({position:"absolute",top:"0px",left:"0px"});i.append(h);$.each(f,function(m,n){var l=$('
      ');if(n.isMaster){l.append(""+n.getName()+" (Master)")}else{l.append(""+n.getName()+" ");if(a.getRemoteIsMaster()){var k;if(!n.editable){k=$("");k.data("identifier",b);k.data("mode","readonly");k.data("user",n)}else{k=$("");k.data("identifier",b);k.data("mode","editable");k.data("user",n)}l.append(k);k.click(function(){var q=$(this).data("identifier");var p=$(this).data("mode");var o=$(this).data("user");if(p==="readonly"){o.setEditable(true)}else{o.setEditable(false)}d.updateUserState(q,o,function(){})})}}h.append(l)})})},updateUserState:function(d,c,g){var e=this,b;var f=this.getRemote({identifier:d,remoteUser:e.encodeJson(c)});var a=f.__objectId;f.updateUserState(null,function(){b=mw3.objects[a];e.closeRemote(f);var h=e.convertRemoteUser(JSON.parse(b.remoteUser));g(h)})},updateCanvas:function(d){var e=JSON.parse(d);var c=e.identifier;var b=e.canvasData;var a=this.getCanvasByIdentifier(c);if(!a||!a.getRemotable()){return}a.setRemoteDuring(true);a.loadJSON(b);a.setRemoteDuring(false);$(a.getRootElement()).trigger("updateCanvas",[b])},broadCastCanvas:function(d,g){if(!d.getRemotable()){g(null);return}if(!d.getRemoteEditable()){g(null);return}var c=d.getIdentifier();var e=this,b;var f=this.getRemote({identifier:c,canvasData:e.encodeJson(d.toJSON())});var a=f.__objectId;f.broadCastCanvas(null,function(){b=mw3.objects[a];e.closeRemote(f);g(d)})},remoteExit:function(c,f){var d=this,b;var e=this.getRemote({identifier:c});var a=e.__objectId;e.remoteUserExited(null,function(){b=mw3.objects[a];d.closeRemote(e);f(null)})},checkExpiredRemoteCanvas:function(){if(this._SCHEDULER){return}var d=this,c,b,a;this._SCHEDULER=setInterval(function(){c=d.getRepo();for(b in c){a=c[b].canvas;if(a&&d.getCanvasId(a)&&$("#"+d.getCanvasId(a)).length){return}delete c[b];d.remoteExit(b,function(){})}},1000)}};OG.handler.RemoteHandler.prototype.constructor=OG.handler.RemoteHandler;OG.RemoteHandler=new OG.handler.RemoteHandler();OG.RemoteHandler.checkExpiredRemoteCanvas();OG.graph.Canvas=function(a,d,b,c){this._CONFIG={POOL_DROP_EVENT:false,AUTOMATIC_GUIDANCE:true,SPOT_ON_SELECT:false,BACKDOOR:{url:null,scale:100,opacity:1,width:null,height:null,container:null,container_updated:false},FAST_LOADING:false,AUTO_SLIDER_UPDATE:true,AUTO_HISTORY:false,WHEEL_SCALABLE:false,DRAG_PAGE_MOVABLE:false,FOCUS_CANVAS_ONSELECT:true,CHECK_BRIDGE_EDGE:true,STICK_GUIDE:true,SLIDER:null,REMOTE_PERFORMED_DURING:false,REMOTE_IDENTIFIER:null,REMOTEABLE:false,REMOTE_EDITABLE:false,REMOTE_ISMASTER:false,HISTORY_INDEX:0,HISTORY:[],HISTORY_SIZE:100,USE_SLIDER:true,SELECTABLE:true,DRAG_SELECTABLE:true,MOVABLE:true,MOVABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},RESIZE_CANVAS_MARGIN:5,RESIZABLE:true,RESIZABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},CONNECTABLE:true,SELF_CONNECTABLE:true,CONNECT_CLONEABLE:true,CONNECT_STYLE_CHANGE:true,CONNECT_STYLE_CHANGE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},DELETABLE:true,DELETABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},LABEL_EDITABLE:true,LABEL_EDITABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},GROUP_DROPABLE:true,DRAG_GRIDABLE:true,ENABLE_HOTKEY:true,ENABLE_HOTKEY_CTRL_Z:true,ENABLE_HOTKEY_DELETE:true,ENABLE_HOTKEY_CTRL_A:true,ENABLE_HOTKEY_CTRL_C:true,ENABLE_HOTKEY_CTRL_V:true,ENABLE_HOTKEY_CTRL_D:true,ENABLE_HOTKEY_CTRL_G:true,ENABLE_HOTKEY_CTRL_U:true,ENABLE_HOTKEY_ARROW:true,ENABLE_HOTKEY_SHIFT_ARROW:true,ENABLE_CONTEXTMENU:true,ENABLE_ROOT_CONTEXTMENU:true,SCALE:1,SCALE_MIN:0.1,SCALE_MAX:10,EDGE_PADDING:20,LABEL_PADDING:5,LABEL_EDITOR_WIDTH:500,LABEL_EDITOR_HEIGHT:16,FROMTO_LABEL_OFFSET_TOP:15,GUIDE_LINE_SIZE:20,GUIDE_LINE_MARGIN:10,GUIDE_RECT_SIZE:8,GUIDE_MIN_SIZE:18,GUIDE_CONTROL_LINE_NUM:2,COLLAPSE_SIZE:10,MOVE_SNAP_SIZE:8,TERMINAL_SIZE:5,COPY_PASTE_PADDING:20,FIT_CANVAS_PADDING:20,AUTO_EXTENSIONAL:true,AUTO_EXTENSION_SIZE:100,CANVAS_BACKGROUND:"#f9f9f9",IMAGE_BASE:"resources/images/symbol/",IMAGE_USER:"http://processcodi.com/images/opengraph/User.png",IMAGE_SEND:"http://processcodi.com/images/opengraph/Send.png",IMAGE_RECEIVE:"http://processcodi.com/images/opengraph/Receive.png",IMAGE_MANUAL:"http://processcodi.com/images/opengraph/Manual.png",IMAGE_SERVICE:"http://processcodi.com/images/opengraph/Service.png",IMAGE_RULE:"http://processcodi.com/images/opengraph/BusinessRule.png",IMAGE_SCRIPT:"http://processcodi.com/images/opengraph/Script.png",IMAGE_MAPPER:"http://processcodi.com/images/opengraph/mapper.png",IMAGE_WEB:"http://processcodi.com/images/opengraph/w_services.png",TRIM_EDGE_ANGLE_SIZE:170,EDGE_MOVE_DELAY_SIZE:14,LANE_MIN_SIZE:50,LANE_DEFAULT_SIZE:100,POOL_DEFAULT_SIZE:[300,200],GROUP_INNER_SAPCE:10,LABEL_MIN_SIZE:0,LABEL_MAX_SIZE:1000,DEFAULT_STYLE:{SHAPE:{cursor:"default"},GEOM:{stroke:"black","fill-r":".5","fill-cx":".5","fill-cy":".5",fill:"white","fill-opacity":0,"label-position":"center"},TEXT:{stroke:"none","text-anchor":"middle"},HTML:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},IMAGE:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},SVG:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},EDGE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.5,"stroke-opacity":1,"edge-type":"plain","arrow-start":"none","arrow-end":"block","stroke-dasharray":"","label-position":"center","stroke-linejoin":"round",cursor:"pointer"},EDGE_SHADOW:{stroke:"#00FF00",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,"arrow-start":"none","arrow-end":"none","stroke-dasharray":"- ","edge-type":"plain",cursor:"pointer"},EDGE_HIDDEN:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":10,"stroke-opacity":0,cursor:"pointer"},GROUP:{stroke:"black",fill:"none","fill-opacity":0,"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},GROUP_HIDDEN:{stroke:"black",fill:"white","fill-opacity":0,"stroke-opacity":0,cursor:"move"},GROUP_SHADOW:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":15,"stroke-opacity":0,cursor:"pointer"},GROUP_SHADOW_MAPPER:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":0,cursor:"pointer"},GUIDE_BBOX:{stroke:"#00FF00",fill:"white","fill-opacity":0,"stroke-dasharray":"- ","shape-rendering":"crispEdges",cursor:"move"},GUIDE_UL:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nwse-resize","shape-rendering":"crispEdges"},GUIDE_UR:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nesw-resize","shape-rendering":"crispEdges"},GUIDE_LL:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nesw-resize","shape-rendering":"crispEdges"},GUIDE_LR:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nwse-resize","shape-rendering":"crispEdges"},GUIDE_LC:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_UC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_RC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_LWC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_FROM:{stroke:"black",fill:"#00FF00",cursor:"move","shape-rendering":"crispEdges"},GUIDE_TO:{stroke:"black",fill:"#00FF00",cursor:"move","shape-rendering":"crispEdges"},GUIDE_CTL_H:{stroke:"black",fill:"#00FF00",cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_CTL_V:{stroke:"black",fill:"#00FF00",cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_SHADOW:{stroke:"black",fill:"none","stroke-dasharray":"- ","shape-rendering":"crispEdges"},GUIDE_LINE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.2,"stroke-opacity":1,"stroke-dasharray":"","arrow-end":"block","stroke-linejoin":"round",cursor:"pointer"},GUIDE_LINE_ESSENSIA:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.2,"stroke-opacity":1,"stroke-dasharray":"","arrow-start":"diamond","arrow-end":"none","stroke-linejoin":"round",cursor:"pointer"},GUIDE_VIRTUAL_EDGE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,"stroke-dasharray":"- ","stroke-linejoin":"round","arrow-start":"none","arrow-end":"none"},GUIDE_LINE_AREA:{stroke:"#ffffff",fill:"#ffffff","fill-opacity":0.1,"stroke-width":1,"stroke-opacity":0.2,cursor:"pointer"},GUIDE_RECT_AREA:{stroke:"black",fill:"#ffffff","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,cursor:"pointer"},RUBBER_BAND:{stroke:"#0000FF",opacity:0.2,fill:"#0077FF"},DROP_OVER_BBOX:{stroke:"#0077FF",fill:"none",opacity:0.3,"shape-rendering":"crispEdges"},LABEL:{"font-size":12,"font-color":"black",fill:"none"},LABEL_EDITOR:{position:"absolute",overflow:"visible",resize:"none","text-align":"center",display:"block",padding:0},COLLAPSE:{stroke:"black",fill:"none","fill-opacity":0,cursor:"pointer","shape-rendering":"crispEdges"},COLLAPSE_BBOX:{stroke:"none",fill:"none","fill-opacity":0},BUTTON:{stroke:"#9FD7FF",fill:"white","fill-opacity":0,cursor:"pointer","shape-rendering":"crispEdges"},CONNECT_GUIDE_EVENT_AREA:{stroke:"#ffffff",fill:"none","fill-opacity":0,"stroke-width":20,"stroke-opacity":0},CONNECT_GUIDE_BBOX:{stroke:"#00FF00",fill:"none","stroke-dasharray":"- ","shape-rendering":"crispEdges"},CONNECT_GUIDE_BBOX_EXPEND:10,CONNECT_GUIDE_SPOT_CIRCLE:{r:7,stroke:"#A6A6A6","stroke-width":1,fill:"#FFE400","fill-opacity":0.5,cursor:"pointer"},CONNECT_GUIDE_SPOT_RECT:{stroke:"#A6A6A6","stroke-width":1,fill:"#FFE400","fill-opacity":0.2,cursor:"ns-resize",w:20,h:10},CONNECTABLE_HIGHLIGHT:{"stroke-width":2},NOT_CONNECTABLE_HIGHLIGHT:{fill:"#FAAFBE","fill-opacity":0.5}}};this._RENDERER=a?new OG.RaphaelRenderer(a,d,b,c,this._CONFIG):null;this._RENDERER._CANVAS=this;this._HANDLER=new OG.EventHandler(this._RENDERER,this._CONFIG);this._CONTAINER=OG.Util.isElement(a)?a:document.getElementById(a)};OG.graph.Canvas.prototype={fastLoadingON:function(){this._CONFIG.FAST_LOADING=true},fastLoadingOFF:function(){this._CONFIG.FAST_LOADING=false;this.updateSlider()},getEventHandler:function(){return this._HANDLER},setRemoteDuring:function(a){this._CONFIG.REMOTE_PERFORMED_DURING=a},getRemoteDuring:function(){return this._CONFIG.REMOTE_PERFORMED_DURING},setIdentifier:function(a){this._CONFIG.REMOTE_IDENTIFIER=a},getIdentifier:function(){return this._CONFIG.REMOTE_IDENTIFIER},getRemotable:function(){return this._CONFIG.REMOTEABLE},setRemotable:function(a){this._CONFIG.REMOTEABLE=a},setRemoteEditable:function(a){this._CONFIG.REMOTE_EDITABLE=a},getRemoteEditable:function(){return this._CONFIG.REMOTE_EDITABLE},setRemoteIsMaster:function(a){this._CONFIG.REMOTE_ISMASTER=a},getRemoteIsMaster:function(){return this._CONFIG.REMOTE_ISMASTER},setCurrentCanvas:function(a){this._RENDERER.setCanvas(a)},initConfig:function(a){if(a){this._CONFIG.REMOTEABLE=a.remoteable===undefined?this._CONFIG.REMOTEABLE:a.remoteable;this._CONFIG.SELECTABLE=a.selectable===undefined?this._CONFIG.SELECTABLE:a.selectable;this._CONFIG.DRAG_SELECTABLE=a.dragSelectable===undefined?this._CONFIG.DRAG_SELECTABLE:a.dragSelectable;this._CONFIG.MOVABLE=a.movable===undefined?this._CONFIG.MOVABLE:a.movable;this._CONFIG.RESIZABLE=a.resizable===undefined?this._CONFIG.RESIZABLE:a.resizable;this._CONFIG.CONNECTABLE=a.connectable===undefined?this._CONFIG.CONNECTABLE:a.connectable;this._CONFIG.SELF_CONNECTABLE=a.selfConnectable===undefined?this._CONFIG.SELF_CONNECTABLE:a.selfConnectable;this._CONFIG.CONNECT_CLONEABLE=a.connectCloneable===undefined?this._CONFIG.CONNECT_CLONEABLE:a.connectCloneable;this._CONFIG.LABEL_EDITABLE=a.labelEditable===undefined?this._CONFIG.LABEL_EDITABLE:a.labelEditable;this._CONFIG.GROUP_DROPABLE=a.groupDropable===undefined?this._CONFIG.GROUP_DROPABLE:a.groupDropable;this._CONFIG.ENABLE_HOTKEY=a.enableHotKey===undefined?this._CONFIG.ENABLE_HOTKEY:a.enableHotKey;this._CONFIG.ENABLE_CONTEXTMENU=a.enableContextMenu===undefined?this._CONFIG.ENABLE_CONTEXTMENU:a.enableContextMenu;this._CONFIG.AUTO_EXTENSIONAL=a.autoExtensional===undefined?this._CONFIG.AUTO_EXTENSIONAL:a.autoExtensional;this._CONFIG.USE_SLIDER=a.useSlider===undefined?this._CONFIG.USE_SLIDER:a.useSlider;this._CONFIG.STICK_GUIDE=a.stickGuide===undefined?this._CONFIG.STICK_GUIDE:a.stickGuide;this._CONFIG.CHECK_BRIDGE_EDGE=a.checkBridgeEdge===undefined?this._CONFIG.CHECK_BRIDGE_EDGE:a.checkBridgeEdge;this._CONFIG.AUTO_HISTORY=a.autoHistory===undefined?this._CONFIG.AUTO_HISTORY:a.autoHistory;this._CONFIG.AUTO_SLIDER_UPDATE=a.autoSliderUpdate===undefined?this._CONFIG.AUTO_SLIDER_UPDATE:a.autoSliderUpdate}this._HANDLER.setDragSelectable(this._CONFIG.SELECTABLE&&this._CONFIG.DRAG_SELECTABLE);this._HANDLER.setWheelScale();this._HANDLER.setDragPageMovable();this._HANDLER.setEnableHotKey(this._CONFIG.ENABLE_HOTKEY);if(this._CONFIG.ENABLE_CONTEXTMENU){if(this._CONFIG.ENABLE_ROOT_CONTEXTMENU){this._HANDLER.enableRootContextMenu()}this._HANDLER.enableShapeContextMenu()}this.CONFIG_INITIALIZED=true},getRenderer:function(){return this._RENDERER},getContainer:function(){return this._CONTAINER},getEventHandler:function(){return this._HANDLER},addBackDoor:function(b,e,a){var c=this;var d=new Image();d.src=b;d.onload=function(){var j=d.naturalWidth;var m=d.naturalHeight;c._CONFIG.BACKDOOR.url=b;c._CONFIG.BACKDOOR.scale=e?e:c._CONFIG.BACKDOOR.scale;c._CONFIG.BACKDOOR.opacity=a?a:c._CONFIG.BACKDOOR.opacity;c._CONFIG.BACKDOOR.width=j;c._CONFIG.BACKDOOR.height=m;c._CONFIG.BACKDOOR.container_updated=true;var i=c._CONTAINER;var l=i.id+OG.Constants.BACKDOOR_SUFFIX;var g=$("#"+i.id).find("#"+l);if(!g||g.length<1){g=$("");g.attr("id",l);g.css({position:"absolute",top:"0px",left:"0px"});$(c._RENDERER.getRootElement()).before(g);g.attr("src",b)}else{g.attr("src",b)}c._CONFIG.BACKDOOR.container=g;var k=c.getScale();var f=c.getCanvasSize();if(f[0]');d.append();d.unbind("click");d.bind("click",function(){if($(this).data("collape")){var n=$(this).data("collape");k.height(n);c.show();$(this).data("collape",false)}else{$(this).data("collape",k.height());c.hide();k.height(40)}});j=$('
      ');j.css({position:"relative",width:"100%"});l=$('
      ');b=$('');b.bind("change",function(){m.updateSlider($(this).val())});b.bind("input",function(){m.updateSlider($(this).val())});b.css({position:"relative",width:"100%",height:"8px"});f=$('
      ');f.css({position:"absolute",top:"50px",bottom:"5px",left:"5px",right:"5px","overflow-x":"hidden","overflow-y":"auto",background:"white"});h=$('');h.css({position:"absolute",top:"0px",left:"0px"});h.attr("width","100%");h.attr("id",a.id+"sliderImage");e=$('
      ');e.css({position:"absolute",top:"0px",left:"0px",width:"100px",height:"100px",background:"transparent"});g=function(){var r,n,u,v,p,s,q,t,o,x,w;r=m._RENDERER.getRootElement();v=h.width();p=h.height();n=$(r).attr("width");u=$(r).attr("height");s=v/n;q=p/u;if(s>1){s=1}if(q>1){q=1}t=e.offset().left-h.offset().left;if(t<0){t=0}o=e.offset().top-h.offset().top;if(o<0){o=0}x=t*(1/s);w=o*(1/q);a.scrollLeft=x;a.scrollTop=w};$(a).unbind("scroll");$(a).bind("scroll",function(n){if(e.data("drag")){return}m.updateNavigatior()});h.click(function(p){var o,n,r,q;o=p.pageX-h.offset().left;n=p.pageY-h.offset().top;r=o-(e.width()/2);q=n-(e.height()/2);if(r<0){r=0}if(q<0){q=0}if((r+e.width())>h.width()){r=h.width()-e.width()}if((q+e.height())>h.height()){q=h.height()-e.height()}e.css({left:r+"px",top:q+"px"});g()});e.draggable({containment:"#"+a.id+"sliderImage",scroll:false,start:function(n){e.data("drag",true)},drag:function(n){g()},stop:function(n){g();e.data("drag",false)}});c.append(j);j.append(l);j.append(b);c.append(f);f.append(h);f.append(e);$(a).on("remove",function(){m.removeSlider()});if(this._CONFIG.SLIDER){m.removeSlider()}this._CONFIG.SLIDER=c;this.updateSlider(this._CONFIG.SCALE*100)},updateNavigatior:function(){var m=this;var h=m._RENDERER.getRootElement();var p,i,o,n,j,f,k,d;var c=this._CONFIG.SLIDER;if(!c){return}var g=c.find(".sliderImage");var e=c.find(".sliderNavigator");var b=m._CONTAINER;p=$(h).attr("width");i=$(h).attr("height");o=b.scrollLeft;n=b.scrollTop;j=$(b).width()/p;f=$(b).height()/i;if(j>1){j=1}if(f>1){f=1}k=g.width()/p;d=g.height()/i;e.width(g.width()*j);e.height(g.height()*f);e.css({left:(o*k)+"px",top:(n*d)+"px"});var l=c.find(".scaleSliderText");var a=c.find(".scaleSlider");l.html(Math.round(this._CONFIG.SCALE*100));a.val(Math.round(this._CONFIG.SCALE*100))},updateSlider:function(v){if(this._CONFIG.AUTO_SLIDER_UPDATE&&!this._CONFIG.FAST_LOADING){var q=this;if(!this._CONFIG.SLIDER){return}if(!v){v=this._CONFIG.SCALE*100}var m=this._CONFIG.SLIDER;var f=m.find(".scaleSliderText");var k=m.find(".scaleSlider");var u=m.find(".sliderImage");var g=m.find(".sliderNavigator");var s=m.find(".sliderImageWrapper");f.html(Math.round(v));k.val(Math.round(v));q._RENDERER.setScale(v/100);var i=q._RENDERER.getRootElement();var p=new XMLSerializer().serializeToString(i);var a=this.getCanvasSize();if(OG.Util.isIE()){p=''+p.replace('xmlns="http://www.w3.org/2000/svg"',"").replace('xmlns:NS1=""',"").replace("NS1:","");var b=window.btoa(unescape(encodeURIComponent(p)));var j=document.createElement("img");$(j).css({position:"absolute",top:"0px",left:"0px",opacity:0});document.body.appendChild(j);j.src="data:image/svg+xml;base64,"+b;j.onload=function(){var w=document.getElementById(u.attr("id"));w.width=s.width();w.height=s.width()*j.height/j.width;var x=w.getContext("2d");try{x.drawImage(j,0,0,s.width(),s.width()*j.height/j.width);$(j).remove();q.updateNavigatior()}catch(y){$(j).remove()}}}else{var j=new Image();j.src="data:image/svg+xml;utf-8,"+p;j.onload=function(){var w=document.getElementById(u.attr("id"));w.width=s.width();w.height=s.width()*j.height/j.width;var x=w.getContext("2d");try{x.drawImage(j,0,0,s.width(),s.width()*j.height/j.width);$(j).remove();q.updateNavigatior()}catch(y){$(j).remove()}}}if(q._CONFIG.BACKDOOR.container){var t=q._CONFIG.BACKDOOR.scale;var c=q._CONFIG.BACKDOOR.opacity;var l=q._CONFIG.BACKDOOR.width;var h=q._CONFIG.BACKDOOR.height;var d=q.getScale();var r=s.width();var n=(l*(t/100)/a[0]*d)*r;var o=n*h/l;var e=s.find(".sliderBackDoorWrapper");if(!e||e.length<1){e=$('
      ');e.css({position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%"});s.data("backdoor",true);e.css({"background-image":"url("+q._CONFIG.BACKDOOR.url+")","background-repeat":"no-repeat","background-size":n+"px "+o+"px",opacity:c});u.before(e)}else{if(q._CONFIG.BACKDOOR.container_updated){q._CONFIG.BACKDOOR.container_updated=false;e.css({"background-image":"url("+q._CONFIG.BACKDOOR.url+")","background-repeat":"no-repeat","background-size":n+"px "+o+"px",opacity:c})}else{e.css({"background-size":n+"px "+o+"px",opacity:c})}}}}},removeSlider:function(){if(this._CONFIG.SLIDER){this._CONFIG.SLIDER.dialog("destroy");this._CONFIG.SLIDER.remove()}},drawShape:function(f,g,i,b,c,e,h,a){var d=this._RENDERER.drawShape(f,g,i,b,c,h,a);if(f&&(g.TYPE===OG.Constants.SHAPE_TYPE.EDGE)){d=this._RENDERER.move(d,f)}if(e&&this._RENDERER.getElementById(e)){this._RENDERER.appendChild(d,e)}if(!this.CONFIG_INITIALIZED){this.initConfig()}this._HANDLER.setClickSelectable(d,this._HANDLER._isSelectable(d.shape));this._HANDLER.setMovable(d,this._HANDLER._isMovable(d.shape));this._HANDLER.setGroupDropable(d);this._HANDLER.setConnectGuide(d,this._HANDLER._isConnectable(d.shape));if(this._HANDLER._isLabelEditable(d.shape)){this._HANDLER.enableEditLabel(d)}if(!c){this._RENDERER.addHistory()}this.updateSlider();return d},drawTransformer:function(s,j,f,g,b,n){var r=this,c,e,p,d,o,l,t,k,h,m,q;c=new OG.shape.Transformer(j);if(!Array.isArray(f)||!Array.isArray(g)){return null}var a=Math.max(f.length,g.length);e=r.drawShape(s,c,[120,30+(a*25)],p,n);d=e.shape.geom.getBoundary();$.each(f,function(i,u){m=new OG.shape.bpmn.M_Text(u);m.MOVABLE=false;m.SELECTABLE=false;m.CONNECTABLE=false;m.DELETABLE=false;q=r.drawShape([d.getUpperLeft().x+35,d.getUpperLeft().y+(i*25)+40],m,[50,20]);e.appendChild(q);l=new OG.shape.To();k=r.drawShape([d.getUpperLeft().x+15,d.getUpperLeft().y+(i*25)+40],l,[5,5],{r:5});e.appendChild(k);var v=JSON.parse(JSON.stringify(b));v.type="input";v.name=u;v.parentId=e.id;r.setCustomData(k,v)});$.each(g,function(i,u){m=new OG.shape.bpmn.M_Text(u);m.MOVABLE=false;m.SELECTABLE=false;m.CONNECTABLE=false;m.DELETABLE=false;q=r.drawShape([d.getUpperRight().x-35,d.getUpperRight().y+(i*25)+40],m,[50,20]);e.appendChild(q);t=new OG.shape.From();h=r.drawShape([d.getUpperRight().x-15,d.getUpperRight().y+(i*25)+40],t,[5,5],{r:5});e.appendChild(h);var v=JSON.parse(JSON.stringify(b));v.type="output";v.name=u;v.parentId=e.id;r.setCustomData(h,v)});if(!n){this._RENDERER.addHistory()}},setExceptionType:function(a,b){this._HANDLER.setExceptionType(a,b)},setInclusion:function(a,b){this._HANDLER.setInclusion(a,b)},setShapeStyle:function(a,b){this._RENDERER.setShapeStyle(a,b)},setTextListInController:function(a,b){this._RENDERER.setTextListInController(a,b)},getTextListInController:function(a){this._RENDERER.getTextListInController(a)},drawLabel:function(a,c,b){return this._RENDERER.drawLabel(a,c,b)},redrawConnectedEdge:function(a){this._RENDERER.redrawConnectedEdge(a)},reconnect:function(a){return this._RENDERER.reconnect(a)},connect:function(j,g,b,l,d,e,k,c,a){var i,n,f,h,m;if(d){i=this._RENDERER.createTerminalString(j,d)}else{i=this._RENDERER.createDefaultTerminalString(j)}if(e){n=this._RENDERER.createTerminalString(g,e)}else{n=this._RENDERER.createDefaultTerminalString(g)}h=this._RENDERER._getPositionFromTerminal(i);h=[h.x,h.y];m=this._RENDERER._getPositionFromTerminal(n);m=[m.x,m.y];a=a?a:new OG.EdgeShape();a.from=h;a.to=m;f=this._RENDERER.drawShape(null,a,null,b,c);f=this._RENDERER.trimEdgeDirection(f,j,g);l=l?l:undefined;f=this._RENDERER.connect(i,n,f,b,l,k);if(f){this._HANDLER.setClickSelectable(f,f.shape.SELECTABLE);this._HANDLER.setMovable(f,f.shape.SELECTABLE&&f.shape.MOVABLE);this._HANDLER.setConnectGuide(f,this._HANDLER._isConnectable(f.shape));if(f.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(f)}}this.updateSlider();return f},connectWithTerminalId:function(fromTerminal,toTerminal,style,label,id,shapeId,geom){var vertices,edge,fromPosition,toPosition,fromto,shape;fromPosition=this._RENDERER._getPositionFromTerminal(fromTerminal);fromPosition=[fromPosition.x,fromPosition.y];toPosition=this._RENDERER._getPositionFromTerminal(toTerminal);toPosition=[toPosition.x,toPosition.y];if(!geom){vertices=[fromPosition,toPosition]}else{vertices=geom.vertices}fromto=JSON.stringify(vertices[0])+","+JSON.stringify(vertices[vertices.length-1]);shape=eval("new "+shapeId+"("+fromto+")");label=label?label:undefined;if(label){shape.label=label}if(geom){if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.POLYLINE]){geom=new OG.geometry.PolyLine(geom.vertices);shape.geom=geom}else{if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.CURVE]){geom=new OG.geometry.Curve(geom.controlPoints);shape.geom=geom}}}edge=this.drawShape(null,shape,null,style,id,null);edge=this._RENDERER.connect(fromTerminal,toTerminal,edge,style,label,true);if(edge){this._HANDLER.setClickSelectable(edge,edge.shape.SELECTABLE);this._HANDLER.setMovable(edge,edge.shape.SELECTABLE&&edge.shape.MOVABLE);this._HANDLER.setConnectGuide(edge,this._HANDLER._isConnectable(edge.shape));if(edge.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(edge)}}this.updateSlider();return edge},disconnect:function(a){this._RENDERER.disconnect(a)},group:function(a){var b=this._RENDERER.group(a);this._HANDLER.setClickSelectable(b,b.shape.SELECTABLE);this._HANDLER.setMovable(b,b.shape.SELECTABLE&&b.shape.MOVABLE);if(b.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(b)}return b},ungroup:function(a){return this._RENDERER.ungroup(a)},addToGroup:function(a,b){this._RENDERER.addToGroup(a,b)},collapse:function(a){this._RENDERER.collapse(a)},expand:function(a){this._RENDERER.expand(a)},clear:function(){this._RENDERER.clear()},removeShape:function(b,a){this._RENDERER.removeShape(b,a)},removeChild:function(a){this._RENDERER.removeChild(a)},removeGuide:function(a){this._RENDERER.removeGuide(a)},removeAllGuide:function(){this._RENDERER.removeAllGuide()},getRootElement:function(){return this._RENDERER.getRootElement()},getRootGroup:function(){return this._RENDERER.getRootGroup()},getElementByPoint:function(a){return this._RENDERER.getElementByPoint(a)},getElementsByBBox:function(a){return this._RENDERER.getElementsByBBox(a)},setAttr:function(a,b){this._RENDERER.setAttr(a,b)},getAttr:function(b,a){return this._RENDERER.getAttr(b,a)},toFront:function(a){this._RENDERER.toFront(a)},toBack:function(a){this._RENDERER.toBack(a)},bringForward:function(a){this._RENDERER.bringForward(a)},sendBackward:function(a){this._RENDERER.sendBackward(a)},getCanvasSize:function(){return this._RENDERER.getCanvasSize()},setCanvasSize:function(a){this._RENDERER.setCanvasSize(a)},fitCanvasSize:function(b,a){this._RENDERER.fitCanvasSize(b,a)},setViewBox:function(a,b,c){this._RENDERER.setViewBox(a,b,c)},getScale:function(){return this._RENDERER.getScale()},setScale:function(a){this._RENDERER.setScale(a)},show:function(a){this._RENDERER.show(a)},hide:function(a){this._RENDERER.hide(a)},appendChild:function(a,b){return this._RENDERER.appendChild(a,b)},insertAfter:function(a,b){return this._RENDERER.insertAfter(a,b)},insertBefore:function(a,b){return this._RENDERER.insertBefore(a,b)},move:function(a,b){return this._RENDERER.move(a,b)},moveCentroid:function(b,a){return this._RENDERER.moveCentroid(b,a)},rotate:function(a,b){return this._RENDERER.rotate(a,b)},resize:function(b,c,a){return this._RENDERER.resize(b,c,a)},resizeBox:function(c,b,a){return this._RENDERER.resizeBox(c,b,a)},clone:function(a){return this._RENDERER.clone(a)},getBoundary:function(a){return this._RENDERER.getBoundary(a)},getElementById:function(a){return this._RENDERER.getElementById(a)},getElementsByType:function(b,a){return this._RENDERER.getElementsByType(b,a)},getElementsByShapeId:function(b){var a=this.getRootGroup();return $(a).find("[_type=SHAPE][_shape_id='"+b+"']")},getRelatedEdgeFromShapes:function(a){return this._RENDERER.getRelatedEdgeFromShapes(a)},getRelatedElementsFromEdge:function(b){var d=this,c=OG.Util.isElement(b)?b:this.getElementById(b),a=function(e){if(e){return d._RENDERER.getElementById(e.substring(0,e.indexOf(OG.Constants.TERMINAL)))}else{return null}};if($(c).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){return{from:a($(b).attr("_from")),to:a($(b).attr("_to"))}}else{return{from:null,to:null}}},getParent:function(a){return this._RENDERER.getParent(a)},getChilds:function(a){return this._RENDERER.getChilds(a)},getAllShapes:function(){return this._RENDERER.getAllShapes()},getAllEdges:function(){return this._RENDERER.getAllEdges()},getBBox:function(a){return this._RENDERER.getBBox(a)},getRootBBox:function(){return this._RENDERER.getRootBBox()},getRealRootBBox:function(){return this._RENDERER.getRealRootBBox()},isSVG:function(){return this._RENDERER.isSVG()},isVML:function(){return this._RENDERER.isVML()},setCustomData:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.data=c;a.shape.data=c},getCustomData:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);if(!a.data){a.data=a.shape.data}return a.data},setExtCustomData:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.dataExt=c},getExtCustomData:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);return a.dataExt},setCustomContextMenu:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.shape.customContextMenu=c},getCustomContextMenu:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);return a.shape.customContextMenu},toXML:function(){return OG.Util.jsonToXml(this.toJSON())},toJSON:function(){var j=this,k=this._RENDERER.getRootBBox(),h=this._RENDERER.getRootGroup(),c=this.getScale(),a=this.getCanvasSize()[0],g=this.getCanvasSize()[1],f=this._CONFIG.BACKDOOR,l={opengraph:{"@width":a,"@height":g,"@scale":c,cell:[],backdoor:[{"@url":f.url,"@scale":f.scale,"@opacity":f.opacity,"@width":f.width,"@height":f.height}]}},e,d,b;b={};e=function(i){$(i).find("[_type=SHAPE]").each(function(w,z){var q=z.shape,m=z.shape.geom.style.map,s=q.geom,r=s.getBoundary(),x={},p,v,u,n,t;if(q.ignoreExport){return}x["@id"]=$(z).attr("id");if($(z).parent().attr("id")===$(i).attr("id")){x["@parent"]=$(i).attr("id")}else{x["@parent"]=$(z).parent().attr("id")}x["@shapeType"]=q.TYPE;x["@shapeId"]=q.SHAPE_ID;x["@x"]=r.getCentroid().x;x["@y"]=r.getCentroid().y;x["@width"]=r.getWidth();x["@height"]=r.getHeight();if(m){x["@style"]=escape(OG.JSON.encode(m))}if(q.TYPE===OG.Constants.SHAPE_TYPE.EDGE){if($(z).attr("_from")){x["@from"]=$(z).attr("_from")}if($(z).attr("_to")){x["@to"]=$(z).attr("_to")}}else{n=j.getPrevShapeIds(z);t=j.getNextShapeIds(z);if(n.length>0){x["@from"]=n.toString()}if(t.length>0){x["@to"]=t.toString()}}if($(z).attr("_fromedge")){x["@fromEdge"]=$(z).attr("_fromedge")}if($(z).attr("_toedge")){x["@toEdge"]=$(z).attr("_toedge")}if(q.label){x["@label"]=escape(q.label)}if(q.fromLabel){x["@fromLabel"]=escape(q.fromLabel)}if(q.toLabel){x["@toLabel"]=escape(q.toLabel)}if(q.angle&&q.angle!==0){x["@angle"]=q.angle}if(q instanceof OG.shape.ImageShape){x["@value"]=q.image}else{if(q instanceof OG.shape.HtmlShape){x["@value"]=escape(q.html)}else{if(q instanceof OG.shape.TextShape){x["@value"]=escape(q.text)}else{if(q instanceof OG.shape.EdgeShape){p=s.getVertices();x["@value"]="";for(var o=0,y=p.length;o(x-width/2))?(x-width/2):minX;minY=(minY>(y-height/2))?(y-height/2):minY;maxX=(maxX<(x+width/2))?(x+width/2):maxX;maxY=(maxY<(y+height/2))?(y+height/2):maxY;switch(shapeType){case OG.Constants.SHAPE_TYPE.GEOM:case OG.Constants.SHAPE_TYPE.GROUP:shape=eval("new "+shapeId+"()");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height],OG.JSON.decode(style),id,parent);if(element.shape instanceof OG.shape.bpmn.A_Task){element.shape.LoopType=loopType;element.shape.TaskType=taskType}break;case OG.Constants.SHAPE_TYPE.EDGE:var list=JSON.parse("["+value+"]");var fromto=JSON.stringify(list[0])+","+JSON.stringify(list[list.length-1]);shape=eval("new "+shapeId+"("+fromto+")");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}if(fromLabel){shape.fromLabel=unescape(fromLabel)}if(toLabel){shape.toLabel=unescape(toLabel)}if(geom){geom=OG.JSON.decode(geom);if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.POLYLINE]){geom=new OG.geometry.PolyLine(geom.vertices);shape.geom=geom}else{if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.CURVE]){geom=new OG.geometry.Curve(geom.controlPoints);shape.geom=geom}}}element=this.drawShape(null,shape,null,OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.HTML:shape=eval("new "+shapeId+"()");if(value){shape.html=unescape(value)}if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.IMAGE:shape=eval("new "+shapeId+"('"+value+"')");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.TEXT:shape=eval("new "+shapeId+"()");if(value){shape.text=unescape(value)}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break}if(from){$(element).attr("_from",from)}if(to){$(element).attr("_to",to)}if(fromEdge){$(element).attr("_fromedge",fromEdge)}if(toEdge){$(element).attr("_toedge",toEdge)}if(data){element.data=OG.JSON.decode(unescape(data))}if(dataExt){element.dataExt=OG.JSON.decode(unescape(dataExt))}cellCount++;$(renderer._PAPER.canvas).trigger("loading",[Math.round((cellCount/totalCount)*100)])}if(json.opengraph.backdoor&&OG.Util.isArray(json.opengraph.backdoor)&&json.opengraph.backdoor.length){var backdoor=json.opengraph.backdoor[0];if(backdoor["@url"]){this.addBackDoor(backdoor["@url"],backdoor["@scale"],backdoor["@opacity"])}}this.fastLoadingOFF();$(renderer._PAPER.canvas).trigger("loading",["end"]);return{width:maxX-minX,height:maxY-minY,x:minX,y:minY,x2:maxX,y2:maxY}}this.fastLoadingOFF();$(renderer._PAPER.canvas).trigger("loading",["end"]);return{width:0,height:0,x:0,y:0,x2:0,y2:0}},undo:function(){this._RENDERER.undo()},redo:function(){this._RENDERER.redo()},getPrevEdges:function(a){return this._RENDERER.getPrevEdges(a)},getNextEdges:function(a){return this._RENDERER.getNextEdges(a)},getPrevShapes:function(a){return this._RENDERER.getPrevShapes(a)},getPrevShapeIds:function(a){return this._RENDERER.getPrevShapeIds(a)},getNextShapes:function(a){return this._RENDERER.getNextShapes(a)},getNextShapeIds:function(a){return this._RENDERER.getNextShapeIds(a)},onDrawShape:function(a){$(this.getRootElement()).bind("drawShape",function(c,b){a(c,b)})},onUndo:function(a){$(this.getRootElement()).bind("undo",function(b){a(b)})},onRedo:function(a){$(this.getRootElement()).bind("redo",function(b){a(b)})},onDivideLane:function(a){$(this.getRootElement()).bind("divideLane",function(c,b){a(c,b)})},onDrawLabel:function(a){$(this.getRootElement()).bind("drawLabel",function(d,b,c){a(d,b,c)})},onLabelChanged:function(a){$(this.getRootElement()).bind("labelChanged",function(e,c,b,d){a(e,c,b,d)})},onBeforeLabelChange:function(a){$(this.getRootElement()).bind("beforeLabelChange",function(b){if(a(b,b.element,b.afterText,b.beforeText)===false){b.stopPropagation()}})},onRedrawShape:function(a){$(this.getRootElement()).bind("redrawShape",function(c,b){a(c,b)})},onRemoveShape:function(a){$(this.getRootElement()).bind("removeShape",function(c,b){a(c,b)})},onRotateShape:function(a){$(this.getRootElement()).bind("rotateShape",function(c,b,d){a(c,b,d)})},onMoveShape:function(a){$(this.getRootElement()).bind("moveShape",function(c,b,d){a(c,b,d)})},onResizeShape:function(a){$(this.getRootElement()).bind("resizeShape",function(c,b,d){a(c,b,d)})},onBeforeConnectShape:function(a){$(this.getRootElement()).bind("beforeConnectShape",function(b){if(a(b,b.edge,b.fromShape,b.toShape)===false){b.stopPropagation()}})},onBeforeRemoveShape:function(a){$(this.getRootElement()).bind("beforeRemoveShape",function(b){if(a(b,b.element)===false){b.stopPropagation()}})},onConnectShape:function(a){$(this.getRootElement()).bind("connectShape",function(d,c,e,b){a(d,c,e,b)})},onDisconnectShape:function(a){$(this.getRootElement()).bind("disconnectShape",function(d,c,e,b){a(d,c,e,b)})},onGroup:function(a){$(this.getRootElement()).bind("group",function(c,b){a(c,b)})},onUnGroup:function(a){$(this.getRootElement()).bind("ungroup",function(b,c){a(b,c)})},onCollapsed:function(a){$(this.getRootElement()).bind("collapsed",function(c,b){a(c,b)})},onExpanded:function(a){$(this.getRootElement()).bind("expanded",function(c,b){a(c,b)})},onLoading:function(a){$(this.getRootElement()).bind("loading",function(c,b){a(c,b)})}};OG.graph.Canvas.prototype.constructor=OG.graph.Canvas;OG.Canvas=OG.graph.Canvas; \ No newline at end of file diff --git a/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT-min.js b/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT-min.js index a5076ca..731415f 100644 --- a/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT-min.js +++ b/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT-min.js @@ -1,2 +1,2 @@ -(function(i){var e="0.3.4",j="hasOwnProperty",b=/[\.\/]/,a="*",g=function(){},f=function(m,l){return m-l},d,h,k={n:{}},c=function(m,C){var v=k,s=h,w=Array.prototype.slice.call(arguments,2),y=c.listeners(m),x=0,u=false,p,o=[],t={},q=[],n=d,A=[];d=m;h=0;for(var r=0,B=y.length;r';aH=aE.firstChild;aH.style.behavior="url(#default#VML)";if(!(aH&&typeof aH.adj=="object")){return(aR.type=aX)}aE=null}aR.svg=!(aR.vml=aR.type=="VML");aR._Paper=bF;aR.fn=a4=bF.prototype=aR.prototype;aR._id=0;aR._oid=0;aR.is=function(d,b){b=bK.call(b);if(b=="finite"){return !av[ak](+d)}if(b=="array"){return d instanceof Array}return(b=="null"&&d===null)||(b==typeof d&&d!==null)||(b=="object"&&d===Object(d))||(b=="array"&&Array.isArray&&Array.isArray(d))||a1.call(d).slice(8,-1).toLowerCase()==b};function X(g){if(Object(g)!==g){return g}var d=new g.constructor;for(var b in g){if(g[ak](b)){d[b]=X(g[b])}}return d}aR.angle=function(E,S,g,R,d,i){if(d==null){var b=E-g,bL=S-R;if(!b&&!bL){return 0}return(180+au.atan2(-bL,-b)*180/aV+360)%360}else{return aR.angle(E,S,d,i)-aR.angle(g,R,d,i)}};aR.rad=function(b){return b%360*aV/180};aR.deg=function(b){return b*180/aV%360};aR.snapTo=function(d,E,b){b=aR.is(b,"finite")?b:10;if(aR.is(d,bd)){var g=d.length;while(g--){if(aw(d[g]-E)<=b){return d[g]}}}else{d=+d;var R=E%d;if(Rd-b){return E-R+d}}return E};var h=aR.createUUID=(function(b,d){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(b,d).toUpperCase()}})(/[xy]/g,function(g){var d=au.random()*16|0,b=g=="x"?d:(d&3|8);return b.toString(16)});aR.setWindow=function(b){eve("raphael.setWindow",aR,aA.win,b);aA.win=b;aA.doc=aA.win.document;if(aR._engine.initWin){aR._engine.initWin(aA.win)}};var bf=function(g){if(aR.vml){var b=/^\s+|\s+$/g;var R;try{var S=new ActiveXObject("htmlfile");S.write("");S.close();R=S.body}catch(bL){R=createPopup().document.body}var d=R.createTextRange();bf=aG(function(i){try{R.style.color=bH(i).replace(b,aX);var bM=d.queryCommandValue("ForeColor");bM=((bM&255)<<16)|(bM&65280)|((bM&16711680)>>>16);return"#"+("000000"+bM.toString(16)).slice(-6)}catch(bN){return"none"}})}else{var E=aA.doc.createElement("i");E.title="Rapha\xebl Colour Picker";E.style.display="none";aA.doc.body.appendChild(E);bf=aG(function(i){E.style.color=i;return aA.doc.defaultView.getComputedStyle(E,aX).getPropertyValue("color")})}return bf(g)},aI=function(){return"hsb("+[this.h,this.s,this.b]+")"},M=function(){return"hsl("+[this.h,this.s,this.l]+")"},x=function(){return this.hex},aY=function(R,E,d){if(E==null&&aR.is(R,"object")&&"r" in R&&"g" in R&&"b" in R){d=R.b;E=R.g;R=R.r}if(E==null&&aR.is(R,aj)){var i=aR.getRGB(R);R=i.r;E=i.g;d=i.b}if(R>1||E>1||d>1){R/=255;E/=255;d/=255}return[R,E,d]},a2=function(R,E,d,S){R*=255;E*=255;d*=255;var i={r:R,g:E,b:d,hex:aR.rgb(R,E,d),toString:x};aR.is(S,"finite")&&(i.opacity=S);return i};aR.color=function(b){var d;if(aR.is(b,"object")&&"h" in b&&"s" in b&&"b" in b){d=aR.hsb2rgb(b);b.r=d.r;b.g=d.g;b.b=d.b;b.hex=d.hex}else{if(aR.is(b,"object")&&"h" in b&&"s" in b&&"l" in b){d=aR.hsl2rgb(b);b.r=d.r;b.g=d.g;b.b=d.b;b.hex=d.hex}else{if(aR.is(b,"string")){b=aR.getRGB(b)}if(aR.is(b,"object")&&"r" in b&&"g" in b&&"b" in b){d=aR.rgb2hsl(b);b.h=d.h;b.s=d.s;b.l=d.l;d=aR.rgb2hsb(b);b.v=d.b}else{b={hex:"none"};b.r=b.g=b.b=b.h=b.s=b.v=b.l=-1}}}b.toString=x;return b};aR.hsb2rgb=function(S,bN,bL,i){if(this.is(S,"object")&&"h" in S&&"s" in S&&"b" in S){bL=S.b;bN=S.s;S=S.h;i=S.o}S*=360;var E,bM,d,g,b;S=(S%360)/60;b=bL*bN;g=b*(1-aw(S%2-1));E=bM=d=bL-b;S=~~S;E+=[b,g,0,0,g,b][S];bM+=[g,b,b,g,0,0][S];d+=[0,0,g,b,b,g][S];return a2(E,bM,d,i)};aR.hsl2rgb=function(bL,bN,E,i){if(this.is(bL,"object")&&"h" in bL&&"s" in bL&&"l" in bL){E=bL.l;bN=bL.s;bL=bL.h}if(bL>1||bN>1||E>1){bL/=360;bN/=100;E/=100}bL*=360;var S,bM,d,g,b;bL=(bL%360)/60;b=2*bN*(E<0.5?E:1-E);g=b*(1-aw(bL%2-1));S=bM=d=E-b/2;bL=~~bL;S+=[b,g,0,0,g,b][bL];bM+=[g,b,b,g,0,0][bL];d+=[0,0,g,b,b,g][bL];return a2(S,bM,d,i)};aR.rgb2hsb=function(bM,bL,d){d=aY(bM,bL,d);bM=d[0];bL=d[1];d=d[2];var R,E,i,bN;i=m(bM,bL,d);bN=i-bm(bM,bL,d);R=(bN==0?null:i==bM?(bL-d)/bN:i==bL?(d-bM)/bN+2:(bM-bL)/bN+4);R=((R+360)%6)*60/360;E=bN==0?0:bN/i;return{h:R,s:E,b:i,toString:aI}};aR.rgb2hsl=function(d,bL,bO){bO=aY(d,bL,bO);d=bO[0];bL=bO[1];bO=bO[2];var bP,R,bN,bM,E,i;bM=m(d,bL,bO);E=bm(d,bL,bO);i=bM-E;bP=(i==0?null:bM==d?(bL-bO)/i:bM==bL?(bO-d)/i+2:(d-bL)/i+4);bP=((bP+360)%6)*60/360;bN=(bM+E)/2;R=(i==0?0:bN<0.5?i/(2*bN):i/(2-2*bN));return{h:bP,s:R,l:bN,toString:M}};aR._path2string=function(){return this.join(",").replace(bg,"$1")};function bk(E,g){for(var b=0,d=E.length;b=1000&&delete R[bL.shift()];bL.push(S);R[S]=i[bG](d,E);return b?b(R[S]):R[S]}return g}var bv=aR._preload=function(g,d){var b=aA.doc.createElement("img");b.style.cssText="position:absolute;left:-9999em;top:-9999em";b.onload=function(){d.call(this);this.onload=null;aA.doc.body.removeChild(this)};b.onerror=function(){aA.doc.body.removeChild(this)};aA.doc.body.appendChild(b);b.src=g};function aq(){return this.hex}aR.getRGB=aG(function(b){if(!b||!!((b=bH(b)).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:aq}}if(b=="none"){return{r:-1,g:-1,b:-1,hex:"none",toString:aq}}!(n[ak](b.toLowerCase().substring(0,2))||b.charAt()=="#")&&(b=bf(b));var E,d,g,S,i,bM,bL,R=b.match(A);if(R){if(R[2]){S=U(R[2].substring(5),16);g=U(R[2].substring(3,5),16);d=U(R[2].substring(1,3),16)}if(R[3]){S=U((bM=R[3].charAt(3))+bM,16);g=U((bM=R[3].charAt(2))+bM,16);d=U((bM=R[3].charAt(1))+bM,16)}if(R[4]){bL=R[4][F](bi);d=an(bL[0]);bL[0].slice(-1)=="%"&&(d*=2.55);g=an(bL[1]);bL[1].slice(-1)=="%"&&(g*=2.55);S=an(bL[2]);bL[2].slice(-1)=="%"&&(S*=2.55);R[1].toLowerCase().slice(0,4)=="rgba"&&(i=an(bL[3]));bL[3]&&bL[3].slice(-1)=="%"&&(i/=100)}if(R[5]){bL=R[5][F](bi);d=an(bL[0]);bL[0].slice(-1)=="%"&&(d*=2.55);g=an(bL[1]);bL[1].slice(-1)=="%"&&(g*=2.55);S=an(bL[2]);bL[2].slice(-1)=="%"&&(S*=2.55);(bL[0].slice(-3)=="deg"||bL[0].slice(-1)=="\xb0")&&(d/=360);R[1].toLowerCase().slice(0,4)=="hsba"&&(i=an(bL[3]));bL[3]&&bL[3].slice(-1)=="%"&&(i/=100);return aR.hsb2rgb(d,g,S,i)}if(R[6]){bL=R[6][F](bi);d=an(bL[0]);bL[0].slice(-1)=="%"&&(d*=2.55);g=an(bL[1]);bL[1].slice(-1)=="%"&&(g*=2.55);S=an(bL[2]);bL[2].slice(-1)=="%"&&(S*=2.55);(bL[0].slice(-3)=="deg"||bL[0].slice(-1)=="\xb0")&&(d/=360);R[1].toLowerCase().slice(0,4)=="hsla"&&(i=an(bL[3]));bL[3]&&bL[3].slice(-1)=="%"&&(i/=100);return aR.hsl2rgb(d,g,S,i)}R={r:d,g:g,b:S,toString:aq};R.hex="#"+(16777216|S|(g<<8)|(d<<16)).toString(16).slice(1);aR.is(i,"finite")&&(R.opacity=i);return R}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:aq}},aR);aR.hsb=aG(function(i,g,d){return aR.hsb2rgb(i,g,d).hex});aR.hsl=aG(function(g,d,b){return aR.hsl2rgb(g,d,b).hex});aR.rgb=aG(function(E,i,d){return"#"+(16777216|d|(i<<8)|(E<<16)).toString(16).slice(1)});aR.getColor=function(d){var g=this.getColor.start=this.getColor.start||{h:0,s:1,b:d||0.75},b=this.hsb2rgb(g.h,g.s,g.b);g.h+=0.075;if(g.h>1){g.h=0;g.s-=0.2;g.s<=0&&(this.getColor.start={h:0,s:1,b:g.b})}return b.hex};aR.getColor.reset=function(){delete this.start};function bb(E,bL){var S=[];for(var g=0,b=E.length;b-2*!bL>g;g+=2){var R=[{x:+E[g-2],y:+E[g-1]},{x:+E[g],y:+E[g+1]},{x:+E[g+2],y:+E[g+3]},{x:+E[g+4],y:+E[g+5]}];if(bL){if(!g){R[0]={x:+E[b-2],y:+E[b-1]}}else{if(b-4==g){R[3]={x:+E[0],y:+E[1]}}else{if(b-2==g){R[2]={x:+E[0],y:+E[1]};R[3]={x:+E[2],y:+E[3]}}}}}else{if(b-4==g){R[3]=R[2]}else{if(!g){R[0]={x:+E[g],y:+E[g+1]}}}}S.push(["C",(-R[0].x+6*R[1].x+R[2].x)/6,(-R[0].y+6*R[1].y+R[2].y)/6,(R[1].x+6*R[2].x-R[3].x)/6,(R[1].y+6*R[2].y-R[3].y)/6,R[2].x,R[2].y])}return S}aR.parsePathString=function(b){if(!b){return null}var g=Y(b);if(g.arr){return aZ(g.arr)}var i={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},d=[];if(aR.is(b,bd)&&aR.is(b[0],bd)){d=aZ(b)}if(!d.length){bH(b).replace(a0,function(R,E,bM){var bL=[],S=E.toLowerCase();bM.replace(aP,function(bO,bN){bN&&bL.push(+bN)});if(S=="m"&&bL.length>2){d.push([E][bE](bL.splice(0,2)));S="l";E=E=="m"?"l":"L"}if(S=="r"){d.push([E][bE](bL))}else{while(bL.length>=i[S]){d.push([E][bE](bL.splice(0,i[S])));if(!i[S]){break}}}})}d.toString=aR._path2string;g.arr=aZ(d);return d};aR.parseTransformString=aG(function(d){if(!d){return null}var g={r:3,s:4,t:2,m:6},b=[];if(aR.is(d,bd)&&aR.is(d[0],bd)){b=aZ(d)}if(!b.length){bH(d).replace(ai,function(E,i,bL){var S=[],R=bK.call(i);bL.replace(aP,function(bN,bM){bM&&S.push(+bM)});b.push([i][bE](S))})}b.toString=aR._path2string;return b});var Y=function(d){var b=Y.ps=Y.ps||{};if(b[d]){b[d].sleep=100}else{b[d]={sleep:100}}setTimeout(function(){for(var g in b){if(b[ak](g)&&g!=d){b[g].sleep--;!b[g].sleep&&delete b[g]}}});return b[d]};aR.findDotsAtSegment=function(d,b,b2,b0,S,E,bN,bL,bV){var bS=1-bV,bX=bp(bS,3),bY=bp(bS,2),bP=bV*bV,bM=bP*bV,bR=bX*d+bY*3*bV*b2+bS*3*bV*bV*S+bM*bN,bO=bX*b+bY*3*bV*b0+bS*3*bV*bV*E+bM*bL,bW=d+2*bV*(b2-d)+bP*(S-2*b2+d),bU=b+2*bV*(b0-b)+bP*(E-2*b0+b),b1=b2+2*bV*(S-b2)+bP*(bN-2*S+b2),bZ=b0+2*bV*(E-b0)+bP*(bL-2*E+b0),bT=bS*d+bV*b2,bQ=bS*b+bV*b0,i=bS*S+bV*bN,g=bS*E+bV*bL,R=(90-au.atan2(bW-b1,bU-bZ)*180/aV);(bW>b1||bU=d.x&&b<=d.x2&&g>=d.y&&g<=d.y2};aR.isBBoxIntersect=function(g,d){var b=aR.isPointInsideBBox;return b(d,g.x,g.y)||b(d,g.x2,g.y)||b(d,g.x,g.y2)||b(d,g.x2,g.y2)||b(g,d.x,d.y)||b(g,d.x2,d.y)||b(g,d.x,d.y2)||b(g,d.x2,d.y2)||(g.xd.x||d.xg.x)&&(g.yd.y||d.yg.y)};function bj(b,S,R,E,i){var g=-3*S+9*R-9*E+3*i,d=b*g+6*S-12*R+6*E;return b*d-3*S+3*R}function q(bW,R,bV,g,bU,d,bR,b,bO){if(bO==null){bO=1}bO=bO>1?1:bO<0?0:bO;var bP=bO/2,bQ=12,bL=[-0.1252,0.1252,-0.3678,0.3678,-0.5873,0.5873,-0.7699,0.7699,-0.9041,0.9041,-0.9816,0.9816],bT=[0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],E=0;for(var bS=0;bSS){i/=2;R+=(Em(b,bS)||m(bQ,bO)m(bN,bM)){return}var bL=(i*bO-bQ*g)*(b-bS)-(i-g)*(b*bM-bN*bS),S=(i*bO-bQ*g)*(bN-bM)-(bQ-bO)*(b*bM-bN*bS),E=(i-g)*(bN-bM)-(bQ-bO)*(b-bS);if(!E){return}var bR=bL/E,bP=S/E,R=+bR.toFixed(2),d=+bP.toFixed(2);if(R<+bm(i,g).toFixed(2)||R>+m(i,g).toFixed(2)||R<+bm(b,bS).toFixed(2)||R>+m(b,bS).toFixed(2)||d<+bm(bQ,bO).toFixed(2)||d>+m(bQ,bO).toFixed(2)||d<+bm(bN,bM).toFixed(2)||d>+m(bN,bM).toFixed(2)){return}return{x:bR,y:bP}}function ay(d,b){return af(d,b)}function t(d,b){return af(d,b,1)}function af(b2,b1,b0){var E=aR.bezierBBox(b2),d=aR.bezierBBox(b1);if(!aR.isBBoxIntersect(E,d)){return b0?0:[]}var bV=q.apply(0,b2),bU=q.apply(0,b1),bM=~~(bV/5),bL=~~(bU/5),bS=[],bR=[],g={},b3=b0?0:[];for(var bX=0;bX=0&&bO<=1&&bN>=0&&bN<=1){if(b0){b3++}else{b3.push({x:R.x,y:R.y,t1:bO,t2:bN})}}}}}return b3}aR.pathIntersection=function(d,b){return D(d,b)};aR.pathIntersectionNumber=function(d,b){return D(d,b,1)};function D(g,b,bW){g=aR._path2curve(g);b=aR._path2curve(b);var bU,S,bT,E,bR,bL,d,bO,b0,bZ,b1=bW?0:[];for(var bS=0,bM=g.length;bS1){ch=au.sqrt(ch);b1=ch*b1;bZ=ch*bZ}var g=b1*b1,ca=bZ*bZ,cc=(bN==E?-1:1)*au.sqrt(aw((g*ca-g*b6*b6-ca*b7*b7)/(g*b6*b6+ca*b7*b7))),bW=cc*b1*b6/bZ+(bS+bR)/2,bV=cc*-bZ*b7/b1+(cn+cm)/2,bM=au.asin(((cn-bV)/bZ).toFixed(9)),bL=au.asin(((cm-bV)/bZ).toFixed(9));bM=bSbL){bM=bM-aV*2}if(!E&&bL>bM){bL=bL-aV*2}}else{bM=bU[0];bL=bU[1];bW=bU[2];bV=bU[3]}var bQ=bL-bM;if(aw(bQ)>bY){var bX=bL,b0=bR,bO=cm;bL=bM+bY*(E&&bL>bM?1:-1);bR=bW+b1*au.cos(bL);cm=bV+bZ*au.sin(bL);b5=ae(bR,cm,b1,bZ,bT,0,E,b0,bO,[bL,bX,bW,bV])}bQ=bL-bM;var S=au.cos(bM),cl=au.sin(bM),R=au.cos(bL),ck=au.sin(bL),b8=au.tan(bQ/4),cb=4/3*b1*b8,b9=4/3*bZ*b8,ci=[bS,cn],cg=[bS+cb*cl,cn-b9*S],cf=[bR+cb*ck,cm-b9*R],cd=[bR,cm];cg[0]=2*ci[0]-cg[0];cg[1]=2*ci[1]-cg[1];if(bU){return[cg,cf,cd][bE](b5)}else{b5=[cg,cf,cd][bE](b5).join()[F](",");var b3=[];for(var ce=0,b4=b5.length;ce"1e12"&&(bL=0.5);aw(S)>"1e12"&&(S=0.5);if(bL>0&&bL<1){g=ag(i,d,R,E,bU,bT,bQ,bN,bL);bR.push(g.x);bO.push(g.y)}if(S>0&&S<1){g=ag(i,d,R,E,bU,bT,bQ,bN,S);bR.push(g.x);bO.push(g.y)}bS=(bT-2*E+d)-(bN-2*bT+E);bP=2*(E-d)-2*(bT-E);bM=d-E;bL=(-bP+au.sqrt(bP*bP-4*bS*bM))/2/bS;S=(-bP-au.sqrt(bP*bP-4*bS*bM))/2/bS;aw(bL)>"1e12"&&(bL=0.5);aw(S)>"1e12"&&(S=0.5);if(bL>0&&bL<1){g=ag(i,d,R,E,bU,bT,bQ,bN,bL);bR.push(g.x);bO.push(g.y)}if(S>0&&S<1){g=ag(i,d,R,E,bU,bT,bQ,bN,S);bR.push(g.x);bO.push(g.y)}return{min:{x:bm[bG](0,bR),y:bm[bG](0,bO)},max:{x:m[bG](0,bR),y:m[bG](0,bO)}}}),W=aR._path2curve=aG(function(bU,bP){var bN=!bP&&Y(bU);if(!bP&&bN.curve){return aZ(bN.curve)}var E=w(bU),bQ=bP&&w(bP),bR={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},d={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},S=function(bV,bW){var i,bX;if(!bV){return["C",bW.x,bW.y,bW.x,bW.y,bW.x,bW.y]}!(bV[0] in {T:1,Q:1})&&(bW.qx=bW.qy=null);switch(bV[0]){case"M":bW.X=bV[1];bW.Y=bV[2];break;case"A":bV=["C"][bE](ae[bG](0,[bW.x,bW.y][bE](bV.slice(1))));break;case"S":i=bW.x+(bW.x-(bW.bx||bW.x));bX=bW.y+(bW.y-(bW.by||bW.y));bV=["C",i,bX][bE](bV.slice(1));break;case"T":bW.qx=bW.x+(bW.x-(bW.qx||bW.x));bW.qy=bW.y+(bW.y-(bW.qy||bW.y));bV=["C"][bE](bn(bW.x,bW.y,bW.qx,bW.qy,bV[1],bV[2]));break;case"Q":bW.qx=bV[1];bW.qy=bV[2];bV=["C"][bE](bn(bW.x,bW.y,bV[1],bV[2],bV[3],bV[4]));break;case"L":bV=["C"][bE](bI(bW.x,bW.y,bV[1],bV[2]));break;case"H":bV=["C"][bE](bI(bW.x,bW.y,bV[1],bW.y));break;case"V":bV=["C"][bE](bI(bW.x,bW.y,bW.x,bV[1]));break;case"Z":bV=["C"][bE](bI(bW.x,bW.y,bW.X,bW.Y));break}return bV},b=function(bV,bW){if(bV[bW].length>7){bV[bW].shift();var bX=bV[bW];while(bX.length){bV.splice(bW++,0,["C"][bE](bX.splice(0,6)))}bV.splice(bW,1);bS=m(E.length,bQ&&bQ.length||0)}},g=function(bZ,bY,bW,bV,bX){if(bZ&&bY&&bZ[bX][0]=="M"&&bY[bX][0]!="M"){bY.splice(bX,0,["M",bV.x,bV.y]);bW.bx=0;bW.by=0;bW.x=bZ[bX][1];bW.y=bZ[bX][2];bS=m(E.length,bQ&&bQ.length||0)}};for(var bM=0,bS=m(E.length,bQ&&bQ.length||0);bMR){if(d&&!bS.start){bQ=k(bP,bO,g[1],g[2],g[3],g[4],g[5],g[6],R-bN);E+=["C"+bQ.start.x,bQ.start.y,bQ.m.x,bQ.m.y,bQ.x,bQ.y];if(S){return E}bS.start=E;E=["M"+bQ.x,bQ.y+"C"+bQ.n.x,bQ.n.y,bQ.end.x,bQ.end.y,g[5],g[6]].join();bN+=bL;bP=+g[5];bO=+g[6];continue}if(!b&&!d){bQ=k(bP,bO,g[1],g[2],g[3],g[4],g[5],g[6],R-bN);return{x:bQ.x,y:bQ.y,alpha:bQ.alpha}}}bN+=bL;bP=+g[5];bO=+g[6]}E+=g.shift()+g}bS.end=E;bQ=b?bN:d?bS:aR.findDotsAtSegment(bP,bO,g[0],g[1],g[2],g[3],g[4],g[5],1);bQ.alpha&&(bQ={x:bQ.x,y:bQ.y,alpha:bQ.alpha});return bQ}};var aS=a6(1),J=a6(),ad=a6(0,1);aR.getTotalLength=aS;aR.getPointAtLength=J;aR.getSubpath=function(d,i,g){if(this.getTotalLength(d)-g<0.000001){return ad(d,i).end}var b=ad(d,g,1);return i?ad(b,i).end:b};bh.getTotalLength=function(){if(this.type!="path"){return}if(this.node.getTotalLength){return this.node.getTotalLength()}return aS(this.attrs.path)};bh.getPointAtLength=function(b){if(this.type!="path"){return}return J(this.attrs.path,b)};bh.getSubpath=function(d,b){if(this.type!="path"){return}return aR.getSubpath(this.attrs.path,d,b)};var o=aR.easing_formulas={linear:function(b){return b},"<":function(b){return bp(b,1.7)},">":function(b){return bp(b,0.48)},"<>":function(bL){var i=0.48-bL/1.04,g=au.sqrt(0.1734+i*i),b=g-i,S=bp(aw(b),1/3)*(b<0?-1:1),R=-g-i,E=bp(aw(R),1/3)*(R<0?-1:1),d=S+E+0.5;return(1-d)*3*d*d+d*d*d},backIn:function(d){var b=1.70158;return d*d*((b+1)*d-b)},backOut:function(d){d=d-1;var b=1.70158;return d*d*((b+1)*d+b)+1},elastic:function(b){if(b==!!b){return b}return bp(2,-10*b)*au.sin((b-0.075)*(2*aV)/0.3)+1},bounce:function(i){var d=7.5625,g=2.75,b;if(i<(1/g)){b=d*i*i}else{if(i<(2/g)){i-=(1.5/g);b=d*i*i+0.75}else{if(i<(2.5/g)){i-=(2.25/g);b=d*i*i+0.9375}else{i-=(2.625/g);b=d*i*i+0.984375}}}return b}};o.easeIn=o["ease-in"]=o["<"];o.easeOut=o["ease-out"]=o[">"];o.easeInOut=o["ease-in-out"]=o["<>"];o["back-in"]=o.backIn;o["back-out"]=o.backOut;var ab=[],aN=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){setTimeout(b,16)},bC=function(){var bL=+new Date,bT=0;for(;bT1&&!bZ.next){for(b1 in d){if(d[ak](b1)){bX[b1]=bZ.totalOrigin[b1]}}bZ.el.attr(bX);aM(bZ.anim,bZ.el,bZ.anim.percents[0],null,bZ.totalOrigin,bZ.repeat-1)}if(bZ.next&&!bZ.stop){aM(bZ.anim,bZ.el,bZ.next,null,bZ.totalOrigin,bZ.repeat)}}}aR.svg&&S&&S.paper&&S.paper.safari();ab.length&&aN(bC)},H=function(b){return b>255?255:b<0?0:b};bh.animateWith=function(d,E,g,b,bL,bQ){var S=this;if(S.removed){bQ&&bQ.call(S);return S}var bO=g instanceof bA?g:aR.animation(g,b,bL,bQ),bN,bM;aM(bO,S,bO.percents[0],null,S.attr());for(var R=0,bP=ab.length;RbY){return bY}while(bZbU){bZ=bW}else{bY=bW}bW=(bY-bZ)/2+bZ}return bW}return g(bR,1/(200*bL))}bh.onAnimation=function(b){b?eve.on("raphael.anim.frame."+this.id,b):eve.unbind("raphael.anim.frame."+this.id);return this};function bA(E,g){var d=[],i={};this.ms=g;this.times=1;if(E){for(var b in E){if(E[ak](b)){i[an(b)]=E[b];d.push(an(b))}}d.sort(u)}this.anim=i;this.top=d[d.length-1];this.percents=d}bA.prototype.delay=function(d){var b=new bA(this.anim,this.ms);b.times=this.times;b.del=+d||0;return b};bA.prototype.repeat=function(d){var b=new bA(this.anim,this.ms);b.del=this.del;b.times=au.floor(m(d,0))||1;return b};function aM(b3,g,b,b1,bL,bP){b=an(b);var ca,S,bO,cb=[],bV,bU,R,bX=b3.ms,b2={},E={},bR={};if(b1){for(b6=0,bQ=ab.length;b6b1*b3.top){b=b3.percents[b6];bU=b3.percents[b6-1]||0;bX=bX/b3.top*(b-bU);bV=b3.percents[b6+1];ca=b3.anim[b];break}else{if(b1){g.attr(b3.anim[b3.percents[b6]])}}}if(!ca){return}if(!S){for(var bZ in ca){if(ca[ak](bZ)){if(ar[ak](bZ)||g.paper.customAttributes[ak](bZ)){b2[bZ]=g.attr(bZ);(b2[bZ]==null)&&(b2[bZ]=r[bZ]);E[bZ]=ca[bZ];switch(ar[bZ]){case aL:bR[bZ]=(E[bZ]-b2[bZ])/bX;break;case"colour":b2[bZ]=aR.getRGB(b2[bZ]);var b0=aR.getRGB(E[bZ]);bR[bZ]={r:(b0.r-b2[bZ].r)/bX,g:(b0.g-b2[bZ].g)/bX,b:(b0.b-b2[bZ].b)/bX};break;case"path":var bM=W(b2[bZ],E[bZ]),bT=bM[1];b2[bZ]=bM[0];bR[bZ]=[];for(b6=0,bQ=b2[bZ].length;b61?G.opacity/100:G.opacity});case"stroke":G=l.getRGB(R);T.setAttribute(S,G.hex);S=="stroke"&&G[d]("opacity")&&i(T,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity});if(S=="stroke"&&P._.arrows){"startString" in P._.arrows&&c(P,P._.arrows.startString);"endString" in P._.arrows&&c(P,P._.arrows.endString,1)}break;case"gradient":(P.type=="circle"||P.type=="ellipse"||B(R).charAt()!="r")&&a(P,R);break;case"opacity":if(Q.gradient&&!Q[d]("stroke-opacity")){i(T,{"stroke-opacity":R>1?R/100:R})}case"fill-opacity":if(Q.gradient){D=l._g.doc.getElementById(T.getAttribute("fill").replace(/^url\(#|\)$/g,r));if(D){J=D.getElementsByTagName("stop");i(J[J.length-1],{"stop-opacity":R})}break}case"shape-rendering":T.setAttribute(S,R);break;case"text-decoration":T.setAttribute(S,R);break;case"word-wrap":T.setAttribute(S,R);break;default:S=="font-size"&&(R=q(R,10)+"px");var K=S.replace(/(\-.)/g,function(Y){return Y.substring(1).toUpperCase()});T.style[K]=R;P._.dirty=1;T.setAttribute(S,R);break}}}p(P,X,N);T.style.visibility=M},A=1.2,p=function(D,H,S){if(D.type!="text"||!(H[d]("text")||H[d]("font")||H[d]("font-size")||H[d]("x")||H[d]("y"))){return}var O=D.attrs,G=D.node,R=G.firstChild?q(l._g.doc.defaultView.getComputedStyle(G.firstChild,r).getPropertyValue("font-size"),10):10;if(H[d]("text")){O.text=H.text;while(G.firstChild){G.removeChild(G.firstChild)}var E=[],J=[],M;var P=H["font-size"];P=P?P:12;var F=parseInt(S[0]/(P/2));function L(Z,aa){var U=Z.split("\n"),ab;var af=[];var V=false;var W=function(ag){var ah=new RegExp(/^\s$/);return ah.test(ag.charAt(0))};for(var ac=0;ac=0;I--){if(W(ab.charAt(I))){Y=Y+ab.slice(0,I);ab=ab.slice(I+1);ae=true;af.push(Y);break}}if(!ae){Y=Y+ab.slice(0,aa);ab=ab.slice(aa);af.push(Y)}}}while(!V)}var ad=[];for(var T=0,X=af.length;T0){ad.push(af[T])}}if(!af.length){af.push("")}return af}if(!H.text){J=[];J.push("")}if(!F||isNaN(F)){J=[];J.push(H.text)}else{if(H["word-wrap"]=="none"){J=H.text.split("\n")}else{J=L(H.text,F)}}for(var I=0,Q=J.length;I"));var U=ag.getBoundingClientRect();aq.W=an.w=(U.right-U.left)/ab;aq.H=an.h=(U.bottom-U.top)/ab;aq.X=an.x;aq.Y=an.y+aq.H/2;("x" in aj||"y" in aj)&&(aq.path.v=l.format("m{0},{1}l{2},{1}",B(an.x*b),B(an.y*b),B(an.x*b)+1));var T=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var ai=0,ak=T.length;ai0.25&&(W=h.sqrt(0.25-L(Y-0.5,2))*((W>0.5)*2-1)+0.5);Q=Y+k+W}return q});R=R.split(/\s*\-\s*/);if(P=="linear"){var J=R.shift();J=-n(J);if(isNaN(J)){return null}}var O=l._parseDots(R);if(!O){return null}E=E.shape||E.node;if(O.length){E.removeChild(U);U.on=true;U.method="none";U.color=O[0].color;U.color2=O[O.length-1].color;var V=[];for(var K=0,T=O.length;K')}}catch(E){G=function(L){return J.createElement("<"+L+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}};l._engine.initWin(l._g.win);l._engine.create=function(){var K=l._getContainer.apply(0,arguments),E=K.container,Q=K.height,R,J=K.width,P=K.x,O=K.y;if(!E){throw new Error("VML container not found.")}var M=new l._Paper,N=M.canvas=l._g.doc.createElement("div"),L=N.style;P=P||0;O=O||0;J=J||512;Q=Q||342;M.width=J;M.height=Q;J==+J&&(J+="px");Q==+Q&&(Q+="px");M.coordsize=b*1000+k+b*1000;M.coordorigin="0 0";M.span=l._g.doc.createElement("span");M.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;";N.appendChild(M.span);L.cssText=l.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",J,Q);if(E==1){l._g.doc.body.appendChild(N);L.left=P+"px";L.top=O+"px";L.position="absolute"}else{if(E.firstChild){E.insertBefore(N,E.firstChild)}else{E.appendChild(N)}}M.renderfix=function(){};return M};l.prototype.clear=function(){l.eve("raphael.clear",this);this.canvas.innerHTML=q;this.span=l._g.doc.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas.appendChild(this.span);this.bottom=this.top=null};l.prototype.remove=function(){l.eve("raphael.remove",this);this.canvas.parentNode.removeChild(this.canvas);for(var E in this){this[E]=typeof this[E]=="function"?l._removedFactory(E):null}return true};var y=l.st;for(var g in m){if(m[e](g)&&!y[e](g)){y[g]=(function(E){return function(){var J=arguments;return this.forEach(function(K){K[E].apply(K,J)})}})(g)}}}(window.Raphael);var OG=window.OG||{};OG.common={};OG.geometry={};OG.graph={};OG.handler={};OG.layout={};OG.renderer={};OG.marker={};OG.pattern={};OG.shape={};OG.shape.bpmn={};OG.shape.elec={};OG.shape.dids={};OG.shape.component={};OG.shape.essencia={};OG.common.Constants={CANVAS_SUFFIX:"OG-CANVAS",GEOM_TYPE:{NULL:0,POINT:1,LINE:2,POLYLINE:3,POLYGON:4,RECTANGLE:5,CIRCLE:6,ELLIPSE:7,CURVE:8,BEZIER_CURVE:9,COLLECTION:10},GEOM_NAME:["","Point","Line","PolyLine","Polygon","Rectangle","Circle","Ellipse","Curve","BezierCurve","Collection"],NUM_PRECISION:0,NODE_TYPE:{ROOT:"ROOT",SHAPE:"SHAPE",ETC:"ETC"},SHAPE_TYPE:{GEOM:"GEOM",TEXT:"TEXT",HTML:"HTML",IMAGE:"IMAGE",SVG:"SVG",EDGE:"EDGE",GROUP:"GROUP"},EDGE_TYPE:{STRAIGHT:"straight",PLAIN:"plain",BEZIER:"bezier"},LABEL_SUFFIX:"_LABEL",LABEL_EDITOR_SUFFIX:"_LABEL_EDITOR",FROM_LABEL_SUFFIX:"_FROMLABEL",TO_LABEL_SUFFIX:"_TOLABEL",RUBBER_BAND_ID:"OG_R_BAND",RUBBER_BAND_TOLERANCE:3,GUIDE_SUFFIX:{ONRESIZE:"ONRESIZE",GUIDE:"_GUIDE",BBOX:"_GUIDE_BBOX",UL:"_GUIDE_UL",UR:"_GUIDE_UR",LWL:"_GUIDE_LWL",LWR:"_GUIDE_LWR",LC:"_GUIDE_LC",UC:"_GUIDE_UC",RC:"_GUIDE_RC",LWC:"_GUIDE_LWC",FROM:"_GUIDE_FROM",TO:"_GUIDE_TO",CTL:"_GUIDE_CTL_",CTL_H:"_GUIDE_CTL_H_",CTL_V:"_GUIDE_CTL_V_",LINE:"_GUIDE_LINE",LINE_TEXT:"_GUIDE_LINE_TEXT",LINE_CONNECT_MODE:"LINE_CONNECT_MODE",LINE_CONNECT_TEXT:"LINE_CONNECT_TEXT",LINE_CONNECT_SHAPE:"LINE_CONNECT_SHAPE",LINE_CONNECT_LABEL:"LINE_CONNECT_LABEL",LINE_VIRTUAL_EDGE:"LINE_VIRTUAL_EDGE",RECT_CONNECT_MODE:"RECT_CONNECT_MODE",TRASH:"_GUIDE_TRASH",RECT:"_GUIDE_RECT",QUARTER_UPPER:"QUARTER_UPPER",QUARTER_LOW:"QUARTER_LOW",QUARTER_BISECTOR:"QUARTER_BISECTOR",QUARTER_THIRDS:"QUARTER_THIRDS"},COLLAPSE_SUFFIX:"_COLLAPSE",COLLAPSE_BBOX_SUFFIX:"_COLLAPSE_BBOX",LOOPTYPE_SUFFIX:"_LOOPTYPE",LOOPTYPE_BBOX_SUFFIX:"_LOOPTYPE_BBOX",TASKTYPE_SUFFIX:"_TASKTYPE",TASKTYPE_BBOX_SUFFIX:"_TASKTYPE_BBOX",INCLUSION_SUFFIX:"_INCLUSION",INCLUSION_BBOX_SUFFIX:"_INCLUSION_BBOX",STATUS_SUFFIX:"_STATUS",STATUS_BBOX_SUFFIX:"_STATUS_BBOX",EXCEPTIONTYPE_SUFFIX:"_EXCEPTIONTYPE",EXCEPTIONTYPE_BBOX_SUFFIX:"_EXCEPTIONTYPE_BBOX",MOVE_SNAP_SIZE:5,DROP_OVER_BBOX_SUFFIX:"_DROP_OVER",TERMINAL_SUFFIX:{GROUP:"_TERMINAL",BOX:"_TERMINAL_BOX"},TERMINAL:"_TERMINAL",MARKER_TEMP_NODE:"MARKER_TEMP_NODE",PATTERN_TEMP_NODE:"PATTERN_TEMP_NODE",MARKER_DEFS_SUFFIX:"_MARKER",ORIGINAL_NODE:"ORIGINAL_NODE",CONNECT_GUIDE_EVENT_AREA:{NAME:"CONNECT_GUIDE"},CONNECT_GUIDE_SUFFIX:{SPOT:"_CONNECT_SPOT",VIRTUAL_SPOT:"_CONNECT_VIRTUAL_SPOT",BBOX:"_CONNECT_GUIDE_BBOX",SPOT_CIRCLE:"CIRCLE",SPOT_RECT:"RECT",SPOT_EVENT_DRAG:"SPOT_EVENT_DRAG",SPOT_EVENT_MOUSEROVER:"SPOT_EVENT_MOUSEROVER",CONNECTABLE_SPOT_DRAG:"CONNECTABLE_SPOT_DRAG",CONNECT_FOCUS_SHAPE:"CONNECT_FOCUS_SHAPE"},BACKDOOR_SUFFIX:"backdoor"};OG.Constants=OG.common.Constants;if(typeof KeyEvent==="undefined"){var KeyEvent={DOM_VK_CANCEL:3,DOM_VK_HELP:6,DOM_VK_BACK_SPACE:8,DOM_VK_TAB:9,DOM_VK_CLEAR:12,DOM_VK_RETURN:13,DOM_VK_ENTER:14,DOM_VK_SHIFT:16,DOM_VK_CONTROL:17,DOM_VK_ALT:18,DOM_VK_PAUSE:19,DOM_VK_CAPS_LOCK:20,DOM_VK_ESCAPE:27,DOM_VK_SPACE:32,DOM_VK_PAGE_UP:33,DOM_VK_PAGE_DOWN:34,DOM_VK_END:35,DOM_VK_HOME:36,DOM_VK_LEFT:37,DOM_VK_UP:38,DOM_VK_RIGHT:39,DOM_VK_DOWN:40,DOM_VK_PRINTSCREEN:44,DOM_VK_INSERT:45,DOM_VK_DELETE:46,DOM_VK_0:48,DOM_VK_1:49,DOM_VK_2:50,DOM_VK_3:51,DOM_VK_4:52,DOM_VK_5:53,DOM_VK_6:54,DOM_VK_7:55,DOM_VK_8:56,DOM_VK_9:57,DOM_VK_SEMICOLON:59,DOM_VK_EQUALS:61,DOM_VK_A:65,DOM_VK_B:66,DOM_VK_C:67,DOM_VK_D:68,DOM_VK_E:69,DOM_VK_F:70,DOM_VK_G:71,DOM_VK_H:72,DOM_VK_I:73,DOM_VK_J:74,DOM_VK_K:75,DOM_VK_L:76,DOM_VK_M:77,DOM_VK_N:78,DOM_VK_O:79,DOM_VK_P:80,DOM_VK_Q:81,DOM_VK_R:82,DOM_VK_S:83,DOM_VK_T:84,DOM_VK_U:85,DOM_VK_V:86,DOM_VK_W:87,DOM_VK_X:88,DOM_VK_Y:89,DOM_VK_Z:90,DOM_VK_COMMAND:91,DOM_VK_CONTEXT_MENU:93,DOM_VK_NUMPAD0:96,DOM_VK_NUMPAD1:97,DOM_VK_NUMPAD2:98,DOM_VK_NUMPAD3:99,DOM_VK_NUMPAD4:100,DOM_VK_NUMPAD5:101,DOM_VK_NUMPAD6:102,DOM_VK_NUMPAD7:103,DOM_VK_NUMPAD8:104,DOM_VK_NUMPAD9:105,DOM_VK_MULTIPLY:106,DOM_VK_ADD:107,DOM_VK_SEPARATOR:108,DOM_VK_SUBTRACT:109,DOM_VK_DECIMAL:110,DOM_VK_DIVIDE:111,DOM_VK_F1:112,DOM_VK_F2:113,DOM_VK_F3:114,DOM_VK_F4:115,DOM_VK_F5:116,DOM_VK_F6:117,DOM_VK_F7:118,DOM_VK_F8:119,DOM_VK_F9:120,DOM_VK_F10:121,DOM_VK_F11:122,DOM_VK_F12:123,DOM_VK_F13:124,DOM_VK_F14:125,DOM_VK_F15:126,DOM_VK_F16:127,DOM_VK_F17:128,DOM_VK_F18:129,DOM_VK_F19:130,DOM_VK_F20:131,DOM_VK_F21:132,DOM_VK_F22:133,DOM_VK_F23:134,DOM_VK_F24:135,DOM_VK_NUM_LOCK:144,DOM_VK_SCROLL_LOCK:145,DOM_VK_COMMA:188,DOM_VK_PERIOD:190,DOM_VK_SLASH:191,DOM_VK_BACK_QUOTE:192,DOM_VK_OPEN_BRACKET:219,DOM_VK_BACK_SLASH:220,DOM_VK_CLOSE_BRACKET:221,DOM_VK_QUOTE:222,DOM_VK_META:224}};OG.common.Util={isEmpty:function(b,a){return b===null||b===undefined||((OG.Util.isArray(b)&&!b.length))||(!a?b==="":false)},isArray:function(a){return Object.prototype.toString.apply(a)==="[object Array]"},isDate:function(a){return Object.prototype.toString.apply(a)==="[object Date]"},isObject:function(a){return !!a&&Object.prototype.toString.call(a)==="[object Object]"},isPrimitive:function(a){return OG.Util.isString(a)||OG.Util.isNumber(a)||OG.Util.isBoolean(a)},isFunction:function(a){return Object.prototype.toString.apply(a)==="[object Function]"},isNumber:function(a){return typeof a==="number"&&isFinite(a)},isString:function(a){return typeof a==="string"},isBoolean:function(a){return typeof a==="boolean"},isElement:function(a){return !!a&&a.tagName?true:false},isDefined:function(a){return typeof a!=="undefined"},isWebKit:function(){return(/webkit/).test(navigator.userAgent.toLowerCase())},isGecko:function(){return !OG.Util.isWebKit()&&(/gecko/).test(navigator.userAgent.toLowerCase())},isOpera:function(){return(/opera/).test(navigator.userAgent.toLowerCase())},isChrome:function(){return(/\bchrome\b/).test(navigator.userAgent.toLowerCase())},isSafari:function(){return !OG.Util.isChrome()&&(/safari/).test(navigator.userAgent.toLowerCase())},isFirefox:function(){return(/firefox/).test(navigator.userAgent.toLowerCase())},isIE:function(){if(navigator.appName=="Microsoft Internet Explorer"||!!(navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/rv 11/))){return true}else{return false}},isIE6:function(){return OG.Util.isIE()&&(/msie 6/).test(navigator.userAgent.toLowerCase())},isIE7:function(){return OG.Util.isIE()&&((/msie 7/).test(navigator.userAgent.toLowerCase())||document.documentMode===7)},isIE8:function(){return OG.Util.isIE()&&((/msie 8/).test(navigator.userAgent.toLowerCase())||document.documentMode===8)},isIE9:function(){return OG.Util.isIE()&&((/msie 9/).test(navigator.userAgent.toLowerCase())||document.documentMode===9)},isWindows:function(){return(/windows|win32/).test(navigator.userAgent.toLowerCase())},isMac:function(){return(/macintosh|mac os x/).test(navigator.userAgent.toLowerCase())},isLinux:function(){return(/linux/).test(navigator.userAgent.toLowerCase())},trim:function(a){return a===null||a===undefined?a:a.replace(/^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g,"")},clone:function(g){if(g===null||g===undefined){return g}if(g.nodeType&&g.cloneNode){return g.cloneNode(true)}var e,c,b,h,d,f=Object.prototype.toString.call(g),a=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];if(f==="[object Date]"){return new Date(g.getTime())}if(f==="[object Array]"){e=g.length;h=[];while(e--){h[e]=this.clone(g[e])}}else{if(f==="[object Object]"&&g.constructor===Object){h={};for(d in g){h[d]=this.clone(g[d])}if(a){for(c=a.length;c--;){b=a[c];h[b]=g[b]}}}}return h||g},round:function(a){return this.roundPrecision(a,OG.Constants.NUM_PRECISION)},roundPrecision:function(c,a){var b=Math.pow(10,a);return Math.round(c*b)/b},roundGrid:function(a,b){b=b||OG.Constants.MOVE_SNAP_SIZE;return OG.Util.round(a/b)*b},apply:function(d,a,c){var b;if(c){this.apply(d,c)}if(d&&a&&typeof a==="object"){for(b in a){d[b]=a[b]}}return d},extend:(function(){var b=function(d){var c;for(c in d){this[c]=d[c]}},a=Object.prototype.constructor;return function(h,e,g){if(OG.Util.isObject(e)){g=e;e=h;h=g.constructor!==a?g.constructor:function(){e.apply(this,arguments)}}var d=function(){},f,c=e.prototype;d.prototype=c;f=h.prototype=new d();f.constructor=h;h.superclass=c;if(c.constructor===a){c.constructor=e}h.override=function(i){OG.Util.override(h,i)};f.superclass=f.supr=(function(){return c}());f.override=b;OG.Util.override(h,g);h.extend=function(i){return OG.Util.extend(h,i)};return h}}()),override:function(a,c){if(c){var b=a.prototype;OG.Util.apply(b,c);if((/msie/).test(navigator.userAgent.toLowerCase())&&c.hasOwnProperty("toString")){b.toString=c.toString}}},xmlToJson:function(c){var b={},a=function(f){var e={};for(var g in f){if(f.hasOwnProperty(g)){e[g]=f[g]}}return e},d=function(g,m,r){if(g.nodeType===3){if(!g.nodeValue.match(/[\S]+/)){return}if(m["$"] instanceof Array){m["$"].push(g.nodeValue)}else{if(m["$"] instanceof Object){m["$"]=[m["$"],g.nodeValue]}else{m["$"]=g.nodeValue}}}else{if(g.nodeType===1){var f={};var s=g.nodeName;for(var n=0;g.attributes&&n"+m+"":f+h+"/>"}}};for(var a in d){if(d.hasOwnProperty(a)&&a.indexOf("@")==-1){return''+c(a,d[a],{})}}return null},parseXML:function(b){var a,c;if(window.ActiveXObject){a=new ActiveXObject("Microsoft.XMLDOM");a.async="false";a.loadXML(b)}else{c=new DOMParser();a=c.parseFromString(b,"text/xml")}return a}};OG.Util=OG.common.Util;OG.common.CurveUtil={CatmullRomSpline:function(c){var b=[],e,f={},d={},a=function(g){return function(j,i){var h=c.length,k,l;if(h<2){return NaN}j=j-1;if(!i&&b[g]){i=true}if(!i){f[g]=2*c[0][g]-c[1][g];d[g]=2*c[h-1][g]-c[h-2][g];e=[f].concat(c,[d]);b[g]=[];for(k=0;k=h-3){return e[h-2][g]}}k=Math.floor(j);if(k===j){return e[k][g]}j-=k;l=b[g][k];return 0.5*(((l[3]*j+l[2])*j+l[1])*j+l[0])}};return{getX:a(0),getY:a(1),maxT:c.length+1}},Bezier:function(c){var a,b=function(d){return function(f,e){var i=Math.floor(f)*3,h=f,g=1-h;if(!e&&a){e=true}if(!e){a=Math.floor(c.length/3)}if(f<0){return c[0][d]}if(f>=a){return c[c.length-1][d]}if(isNaN(f)){return NaN}return g*g*(g*c[i][d]+3*h*c[i+1][d])+(3*g*c[i+2][d]+h*c[i+3][d])*h*h}};return{getX:b(0),getY:b(1),maxT:Math.floor(c.length/3)+0.01}},BSpline:function(d,a){var e,g=[],f=function(m,h){var i,l=[];for(i=0;i=w){q=0}else{q=p[m+1]}u=x[m+o-1]-x[m];if(u===0){p[m]=0}else{p[m]=(v-x[m])/u*r}u=x[m+o]-x[m+1];if(u!==0){p[m]+=(x[m+o]-v)/u*q}}}return p},b=function(h){return function(p,l){var i=d.length,u,o,q,r=i-1,m=a;if(r<=0){return NaN}if(r+2<=m){m=r+1}if(p<=0){return d[0][h]}if(p>=r-m+2){return d[r][h]}e=f(r,m);q=Math.floor(p)+m-1;g=c(p,e,r,m,q);u=0;for(o=q-m+1;o<=q;o++){if(o=0){u+=d[o][h]*g[o]}}return u}};return{getX:b(0),getY:b(1),maxT:d.length-2}}};OG.CurveUtil=OG.common.CurveUtil;OG.common.NotSupportedException=function(a){this.name="OG.NotSupportedException";this.message=a||"Not Supported!"};OG.NotSupportedException=OG.common.NotSupportedException;OG.common.NotImplementedException=function(a){this.name="OG.NotImplementedException";this.message=a||"Not Implemented!"};OG.NotImplementedException=OG.common.NotImplementedException;OG.common.ParamError=function(a){this.name="OG.ParamError";this.message=a||"Invalid Parameter Error!"};OG.ParamError=OG.common.ParamError;OG.common.HashMap=function(a){this.map=a||{}};OG.common.HashMap.prototype={put:function(a,b){this.map[a]=b},get:function(a){return this.map[a]},containsKey:function(a){return this.map.hasOwnProperty(a)},containsValue:function(a){var b;for(b in this.map){if(this.map[b]===a){return true}}return false},isEmpty:function(){return this.size()===0},clear:function(){var a;for(a in this.map){delete this.map[a]}},remove:function(a){if(this.map[a]){delete this.map[a]}},keys:function(){var a=[],b;for(b in this.map){a.push(b)}return a},values:function(){var a=[],b;for(b in this.map){a.push(this.map[b])}return a},size:function(){var a=0,b;for(b in this.map){a++}return a},toString:function(){var a=[],b;for(b in this.map){a.push("'"+b+"':'"+this.map[b]+"'")}return"{"+a.join()+"}"}};OG.common.HashMap.prototype.constructor=OG.common.HashMap;OG.HashMap=OG.common.HashMap;OG.common.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty,USE_NATIVE_JSON=false,isNative=(function(){var useNative=null;return function(){if(useNative===null){useNative=USE_NATIVE_JSON&&window.JSON&&JSON.toString()==="[object JSON]"}return useNative}}()),m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},pad=function(n){return n<10?"0"+n:n},doDecode=function(json){return eval("("+json+")")},encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i=this._upperLeft.x&&a[0]<=this.getLowerRight().x&&a[1]>=this._upperLeft.y&&a[1]<=this.getLowerRight().y}else{return a.x>=this._upperLeft.x&&a.x<=this.getLowerRight().x&&a.y>=this._upperLeft.y&&a.y<=this.getLowerRight().y}},isContainsAll:function(c){for(var b=0,a=c.length;bc?h[g].x:c;a=h[g].y>a?h[g].y:a}b=new OG.geometry.Coordinate(f,e);d=c-f;j=a-e;this.boundary=new OG.geometry.Envelope(b,d,j)}return this.boundary},getCentroid:function(){return this.getBoundary().getCentroid()},getVertices:function(){throw new OG.NotImplementedException()},minDistance:function(d){var e=Number.MAX_VALUE,f=0,b=this.getVertices(),c;d=this.convertCoordinate(d);if(b.length===1){return d.distance(b[0])}for(var c=0,a=b.length-1;c=1){return e.distance(f)}c=((a.y-e.y)*(f.x-a.x)-(a.x-e.x)*(f.y-a.y))/((f.x-a.x)*(f.x-a.x)+(f.y-a.y)*(f.y-a.y));return OG.Util.round(Math.abs(c)*Math.sqrt(((f.x-a.x)*(f.x-a.x)+(f.y-a.y)*(f.y-a.y))))},distanceLineToLine:function(i,g){var f=this.convertCoordinate(i[0]),e=this.convertCoordinate(i[1]),d=this.convertCoordinate(g[0]),b=this.convertCoordinate(g[1]),c,k,j,h,l,a;if(f.isEquals(e)){return this.distanceToLine(f,[d,b])}if(d.isEquals(b)){return this.distanceToLine(b,[f,e])}c=(f.y-d.y)*(b.x-d.x)-(f.x-d.x)*(b.y-d.y);k=(e.x-f.x)*(b.y-d.y)-(e.y-f.y)*(b.x-d.x);j=(f.y-d.y)*(e.x-f.x)-(f.x-d.x)*(e.y-f.y);h=(e.x-f.x)*(b.y-d.y)-(e.y-f.y)*(b.x-d.x);if((k===0)||(h===0)){return Math.min(this.distanceToLine(f,[d,b]),Math.min(this.distanceToLine(e,[d,b]),Math.min(this.distanceToLine(d,[f,e]),this.distanceToLine(b,[f,e]))))}l=j/h;a=c/k;if((a<0)||(a>1)||(l<0)||(l>1)){return Math.min(this.distanceToLine(f,[d,b]),Math.min(this.distanceToLine(e,[d,b]),Math.min(this.distanceToLine(d,[f,e]),this.distanceToLine(b,[f,e]))))}return 0},intersectToLine:function(c){var e=this.getVertices(),b=[],a,g,f=function(j,l){for(var i=0,h=j.length;if){e=f;b=d[c]}}}return b},intersectLineToLine:function(k,h,j){var f=this.convertCoordinate(k[0]),e=this.convertCoordinate(k[1]),d=this.convertCoordinate(h[0]),c=this.convertCoordinate(h[1]),o,g,b,m,l,i,a,n;if(f.isEquals(e)){return this.distanceToLine(f,[d,c])===0?f:undefined}if(d.isEquals(c)){return this.distanceToLine(d,[f,e])===0?d:undefined}b=(f.y-d.y)*(c.x-d.x)-(f.x-d.x)*(c.y-d.y);m=(e.x-f.x)*(c.y-d.y)-(e.y-f.y)*(c.x-d.x);l=(f.y-d.y)*(e.x-f.x)-(f.x-d.x)*(e.y-f.y);i=(e.x-f.x)*(c.y-d.y)-(e.y-f.y)*(c.x-d.x);if(m!==0&&i!==0){a=b/m;n=l/i;if(0<=a&&a<=1&&0<=n&&n<=1){g="Intersection";o=new OG.Coordinate(OG.Util.round(f.x+a*(e.x-f.x)),OG.Util.round(f.y+a*(e.y-f.y)))}else{g="No Intersection";if(j){o=new OG.Coordinate(OG.Util.round(f.x+a*(e.x-f.x)),OG.Util.round(f.y+a*(e.y-f.y)))}}}else{if(b===0||l===0){g="Coincident"}else{g="Parallel"}}return o},intersectCircleToLine:function(c,j,o,p){var q=[],n=(p.x-o.x)*(p.x-o.x)+(p.y-o.y)*(p.y-o.y),m=2*((p.x-o.x)*(o.x-c.x)+(p.y-o.y)*(o.y-c.y)),i=c.x*c.x+c.y*c.y+o.x*o.x+o.y*o.y-2*(c.x*o.x+c.y*o.y)-j*j,d=m*m-4*n*i,l,h=function(e,b,a){return new OG.Coordinate(OG.Util.round(e.x+(b.x-e.x)*a),OG.Util.round(e.y+(b.y-e.y)*a))},k,g,f;if(d<0){l="Outside"}else{if(d===0){l="Tangent"}else{k=Math.sqrt(d);g=(-m+k)/(2*n);f=(-m-k)/(2*n);if((g<0||g>1)&&(f<0||f>1)){if((g<0&&f<0)||(g>1&&f>1)){l="Outside"}else{l="Inside"}}else{l="Intersection";if(0<=g&&g<=1){q.push(h(o,p,g))}if(0<=f&&f<=1){q.push(h(o,p,f))}}}}return q},intersectPointToLine:function(h,k){var c=this.convertCoordinate(k[0]),a=this.convertCoordinate(k[1]),b=this.convertCoordinate(h),j,g,i,e,f,d;if(a.y===c.y){return this.convertCoordinate([b.x,c.y])}if(a.x===c.x){return this.convertCoordinate([c.x,b.y])}j=(a.y-c.y)/(a.x-c.x);g=c.y-(j*c.x);i=(1/j)*-1;e=b.y-(i*b.x);f=(e-g)/(j-i);d=(f*j)+g;return this.convertCoordinate([f,d])},getPercentageDistanceFromPoint:function(g){var c,h,e,f,a,d,b;g=this.convertCoordinate(g);h=this.getBoundary();if(h&&h._upperLeft){e=h._upperLeft;f=h._width;a=h._height;d=Math.round(((g.x-e.x)/f)*100);b=Math.round(((g.y-e.y)/a)*100);c={px:d,py:b}}return c},isContainsPoint:function(e){var f,c,d,a,b;e=this.convertCoordinate(e);f=this.getBoundary();b=false;if(f&&f._upperLeft){c=f._upperLeft;d=f._width;a=f._height;if(e.x>=c.x&&e.x<=c.x+d&&e.y>=c.y&&e.y<=c.y+a){b=true}}return b},getPointFromPercentageDistance:function(b){var i,d,h,g,a,c,j,f,e;d=this.getBoundary();if(d&&d._upperLeft){h=b[0];g=b[1];a=d._upperLeft;c=d._width;j=d._height;f=a.x+(c*(h/100));e=a.y+(j*(g/100));i=this.convertCoordinate([Math.round(f),Math.round(e)])}return i},getParallelLine:function(o,c,f){var s=this;var r="plus";var j=0;var i=0;var b=this.convertCoordinate(o);var a=this.convertCoordinate(c);var g=function(u,m){u.y=u.y*-1;m.y=m.y*-1;j=0-u.x;i=0-u.y;u.x=u.x+j;m.x=m.x+j;u.y=u.y+i;m.y=m.y+i;return[u,m]};var t=function(u,m){u=s.convertCoordinate(u);m=s.convertCoordinate(m);u.x=u.x-j;m.x=m.x-j;u.y=u.y-i;m.y=m.y-i;u.y=u.y*-1;m.y=m.y*-1;return[u,m]};g(b,a);var q=b.x;var p=a.x;var e=b.y;var d=a.y;if(e==d&&q==p){return t(b,a)}if(e==d&&q==p){return t(b,a)}if(q==p){if(d>e){f=f*-1;r="minus"}}else{if(pz){J=I;F=A}else{J=E;F=z}}return[J,F]};return t(h(q,e,n,l,f),h(p,d,n,k,f))},getParallelPath:function(k,a){var h=this;var l=[];var f=[];for(var d=0,j=k.length;d0){for(var c=0,a=b.length;c0){for(var i=0,leni=controlPoints.length;i0&&!this.vertices[0].isEquals(this.vertices[this.vertices.length-1])){this.vertices.push(new OG.geometry.Coordinate(this.vertices[0].x,this.vertices[0].y))}this.TYPE=OG.Constants.GEOM_TYPE.POLYGON;this.IS_CLOSED=true;this.style=new OG.geometry.Style()};OG.geometry.Polygon.prototype=new OG.geometry.PolyLine();OG.geometry.Polygon.superclass=OG.geometry.PolyLine;OG.geometry.Polygon.prototype.constructor=OG.geometry.Polygon;OG.Polygon=OG.geometry.Polygon;OG.geometry.Rectangle=function(c,d,a){var b=this.convertCoordinate(c),e=this.convertCoordinate([b.x+d,b.y+a]);if(b.x>e.x||b.y>e.y){throw new OG.ParamError()}OG.geometry.Rectangle.superclass.call(this,[[b.x,b.y],[b.x+(e.x-b.x),b.y],[e.x,e.y],[b.x,b.y+(e.y-b.y)],[b.x,b.y]]);this.TYPE=OG.Constants.GEOM_TYPE.RECTANGLE;this.style=new OG.geometry.Style()};OG.geometry.Rectangle.prototype=new OG.geometry.Polygon();OG.geometry.Rectangle.superclass=OG.geometry.Polygon;OG.geometry.Rectangle.prototype.constructor=OG.geometry.Rectangle;OG.Rectangle=OG.geometry.Rectangle;OG.geometry.Rectangle.prototype.toString=function(){var a=[],b=OG.Util.round(Math.atan2(this.vertices[1].y-this.vertices[0].y,this.vertices[1].x-this.vertices[0].x)*180/Math.PI);a.push("type:'"+OG.Constants.GEOM_NAME[this.TYPE]+"'");a.push("upperLeft:"+this.vertices[0]);a.push("width:"+(this.vertices[0].distance(this.vertices[1])));a.push("height:"+(this.vertices[0].distance(this.vertices[3])));a.push("angle:"+b);return"{"+a.join()+"}"};OG.marker.IMarker=function(){this.MARKER_ID=null;this.geom=null};OG.marker.IMarker.prototype={createMarker:function(){throw new OG.NotImplementedException("OG.shape.IMarker.createMarker")}};OG.marker.IMarker.prototype.constructor=OG.marker.IMarker;OG.IMarker=OG.marker.IMarker;OG.marker.ArrowMarker=function(){OG.marker.ArrowMarker.superclass.call(this);this.MARKER_ID="OG.marker.ArrowMarker"};OG.marker.ArrowMarker.prototype=new OG.marker.IMarker();OG.marker.ArrowMarker.superclass=OG.marker.IMarker;OG.marker.ArrowMarker.prototype.constructor=OG.marker.ArrowMarker;OG.ArrowMarker=OG.marker.ArrowMarker;OG.marker.ArrowMarker.prototype.createMarker=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,0],[30,20],[0,40],[0,0]]);this.geom.style=new OG.geometry.Style({"fill-opacity":1,fill:"black"});return this.geom};OG.marker.CircleMarker=function(){OG.marker.CircleMarker.superclass.call(this);this.MARKER_ID="OG.marker.CircleMarker"};OG.marker.CircleMarker.prototype=new OG.marker.IMarker();OG.marker.CircleMarker.superclass=OG.marker.IMarker;OG.marker.CircleMarker.prototype.constructor=OG.marker.CircleMarker;OG.CircleMarker=OG.marker.CircleMarker;OG.marker.CircleMarker.prototype.createMarker=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);return this.geom};OG.marker.RectangleMarker=function(){OG.marker.RectangleMarker.superclass.call(this);this.MARKER_ID="OG.marker.RectangleMarker"};OG.marker.RectangleMarker.prototype=new OG.marker.IMarker();OG.marker.RectangleMarker.superclass=OG.marker.IMarker;OG.marker.RectangleMarker.prototype.constructor=OG.marker.RectangleMarker;OG.RectangleMarker=OG.marker.RectangleMarker;OG.marker.RectangleMarker.prototype.createMarker=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":4});b=new OG.geometry.Polygon([[20,75],[40,30],[60,60],[80,20],[60,75],[40,50]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.marker.SwitchLMarker=function(){OG.marker.SwitchLMarker.superclass.call(this);this.MARKER_ID="OG.marker.SwitchLMarker"};OG.marker.SwitchLMarker.prototype=new OG.marker.IMarker();OG.marker.SwitchLMarker.superclass=OG.marker.IMarker;OG.marker.SwitchLMarker.prototype.constructor=OG.marker.SwitchLMarker;OG.SwitchLMarker=OG.marker.SwitchLMarker;OG.marker.SwitchLMarker.prototype.createMarker=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.PolyLine([[0,0],[20,5]]);this.geom.style=new OG.geometry.Style({"fill-opacity":1});return this.geom};OG.marker.SwitchRMarker=function(){OG.marker.SwitchRMarker.superclass.call(this);this.MARKER_ID="OG.marker.SwitchRMarker"};OG.marker.SwitchRMarker.prototype=new OG.marker.IMarker();OG.marker.SwitchRMarker.superclass=OG.marker.IMarker;OG.marker.SwitchRMarker.prototype.constructor=OG.marker.SwitchRMarker;OG.SwitchRMarker=OG.marker.SwitchRMarker;OG.marker.SwitchRMarker.prototype.createMarker=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.PolyLine([[0,5],[20,0]]);this.geom.style=new OG.geometry.Style({"fill-opacity":1});return this.geom};OG.marker.SwitchXMarker=function(){OG.marker.SwitchXMarker.superclass.call(this);this.MARKER_ID="OG.marker.SwitchXMarker"};OG.marker.SwitchXMarker.prototype=new OG.marker.IMarker();OG.marker.SwitchXMarker.superclass=OG.marker.IMarker;OG.marker.SwitchXMarker.prototype.constructor=OG.marker.SwitchXMarker;OG.SwitchXMarker=OG.marker.SwitchXMarker;OG.marker.SwitchXMarker.prototype.createMarker=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Line([-10,10],[10,-10]);b=new OG.geometry.Line([-10,-10],[10,10]);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.pattern.IPattern=function(){this.PATTERN_ID=null;this.geom=null};OG.pattern.IPattern.prototype={createPattern:function(){throw new OG.NotImplementedException("OG.shape.IPattern.createPattern")}};OG.pattern.IPattern.prototype.constructor=OG.pattern.IPattern;OG.IPattern=OG.pattern.IPattern;OG.pattern.HatchedPattern=function(){OG.pattern.HatchedPattern.superclass.call(this);this.PATTERN_ID="OG.pattern.HatchedPattern"};OG.pattern.HatchedPattern.prototype=new OG.pattern.IPattern();OG.pattern.HatchedPattern.superclass=OG.pattern.IPattern;OG.pattern.HatchedPattern.prototype.constructor=OG.pattern.HatchedPattern;OG.HatchedPattern=OG.pattern.HatchedPattern;OG.pattern.HatchedPattern.prototype.createPattern=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Line([-1,1],[1,-1]);c=new OG.geometry.Line([0,4],[4,0]);b=new OG.geometry.Line([3,5],[5,3]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.pattern.RectPattern=function(){OG.pattern.RectPattern.superclass.call(this);this.PATTERN_ID="OG.pattern.RectPattern"};OG.pattern.RectPattern.prototype=new OG.pattern.IPattern();OG.pattern.RectPattern.superclass=OG.pattern.IPattern;OG.pattern.RectPattern.prototype.constructor=OG.pattern.RectPattern;OG.RectPattern=OG.pattern.RectPattern;OG.pattern.RectPattern.prototype.createPattern=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);return this.geom};OG.shape.IShape=function(){this.TYPE=null;this.SHAPE_ID=null;this.geom=null;this.label=null;this.isCollapsed=false;this.SELECTABLE=true;this.MOVABLE=true;this.RESIZABLE=true;this.RESIZEX=true;this.RESIZEY=true;this.CONNECTABLE=true;this.ENABLE_FROM=true;this.ENABLE_TO=true;this.SELF_CONNECTABLE=false;this.CONNECT_CLONEABLE=true;this.CONNECT_REQUIRED=true;this.CONNECT_STYLE_CHANGE=true;this.DELETABLE=true;this.LABEL_EDITABLE=true;this.COPYABLE=true;this.exceptionType="";this.data=null;this.textList=[];this.contextMenu=null;this.customContextMenu=null;this.currentElement=null;this.currentCanvas=null;this.ignoreExport=false;this.AXIS="none"};OG.shape.IShape.prototype={createShape:function(){throw new OG.NotImplementedException("OG.shape.IShape.createShape")},clone:function(){throw new OG.NotImplementedException("OG.shape.IShape.clone")},addEve:function(){},drawCustomControl:function(){},setData:function(a){this.data=a},getData:function(){return this.data},onResize:function(a){},onDrawLabel:function(a){},onLabelChanged:function(b,a){},onBeforeRemoveShape:function(){},onRemoveShape:function(){},onDrawShape:function(){},onBeforeLabelChange:function(){},onRedrawShape:function(){},onBeforeConnectShape:function(b,a,c){},onConnectShape:function(b,a,c){},onDisconnectShape:function(b,a,c){},onGroup:function(a){},onUnGroup:function(){},onMoveShape:function(a){},onRotateShape:function(a){},onDuplicated:function(b,a){},onPasteShape:function(a,b){},onAddToGroup:function(a,c,b){},onAddedToGroup:function(b,a,c){},onSelectShape:function(){},onDeSelectShape:function(){}};OG.shape.IShape.prototype.constructor=OG.shape.IShape;OG.IShape=OG.shape.IShape;OG.shape.GeomShape=function(){OG.shape.GeomShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.GEOM};OG.shape.GeomShape.prototype=new OG.shape.IShape();OG.shape.GeomShape.superclass=OG.shape.IShape;OG.shape.GeomShape.prototype.constructor=OG.shape.GeomShape;OG.GeomShape=OG.shape.GeomShape;OG.shape.GeomShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.label=this.label;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.TextShape=function(a){OG.shape.TextShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.TEXT;this.SHAPE_ID="OG.shape.TextShape";this.text=a||"Text Here";this.angle=0};OG.shape.TextShape.prototype=new OG.shape.IShape();OG.shape.TextShape.superclass=OG.shape.IShape;OG.shape.TextShape.prototype.constructor=OG.shape.TextShape;OG.TextShape=OG.shape.TextShape;OG.shape.TextShape.prototype.createShape=function(){return this.text};OG.shape.TextShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.text=this.text;shape.angle=this.angle;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.ImageShape=function(b,a){OG.shape.ImageShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.IMAGE;this.SHAPE_ID="OG.shape.ImageShape";this.label=a;this.image=b;this.angle=0};OG.shape.ImageShape.prototype=new OG.shape.IShape();OG.shape.ImageShape.superclass=OG.shape.IShape;OG.shape.ImageShape.prototype.constructor=OG.shape.ImageShape;OG.ImageShape=OG.shape.ImageShape;OG.shape.ImageShape.prototype.createShape=function(){return this.image};OG.shape.ImageShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.image=this.image;shape.label=this.label;shape.angle=this.angle;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.EdgeShape=function(e,d,a,b,c){OG.shape.EdgeShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.EDGE;this.SHAPE_ID="OG.shape.EdgeShape";this.from=e;this.to=d;this.label=a;this.fromLabel=b;this.toLabel=c};OG.shape.EdgeShape.prototype=new OG.shape.IShape();OG.shape.EdgeShape.superclass=OG.shape.IShape;OG.shape.EdgeShape.prototype.constructor=OG.shape.EdgeShape;OG.EdgeShape=OG.shape.EdgeShape;OG.shape.EdgeShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.PolyLine([this.from||[0,0],this.to||[70,0]]);return this.geom};OG.shape.EdgeShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.from=this.from;shape.to=this.to;shape.label=this.label;shape.fromLabel=this.fromLabel;shape.toLabel=this.toLabel;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.SvgShape=function(b,a){OG.shape.SvgShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.IMAGE;this.SHAPE_ID="OG.shape.SvgShape";this.label=a;this.xml=b;this.angle=0};OG.shape.SvgShape.prototype=new OG.shape.IShape();OG.shape.SvgShape.superclass=OG.shape.IShape;OG.shape.SvgShape.prototype.constructor=OG.shape.SvgShape;OG.SvgShape=OG.shape.SvgShape;OG.shape.SvgShape.prototype.createShape=function(){return this.xml};OG.shape.SvgShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.xml=this.xml;shape.label=this.label;shape.angle=this.angle;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.CircleShape=function(a){OG.shape.CircleShape.superclass.call(this);this.SHAPE_ID="OG.shape.CircleShape";this.label=a};OG.shape.CircleShape.prototype=new OG.shape.GeomShape();OG.shape.CircleShape.superclass=OG.shape.GeomShape;OG.shape.CircleShape.prototype.constructor=OG.shape.CircleShape;OG.CircleShape=OG.shape.CircleShape;OG.shape.CircleShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);return this.geom};OG.shape.EllipseShape=function(a){OG.shape.EllipseShape.superclass.call(this);this.SHAPE_ID="OG.shape.EllipseShape";this.label=a};OG.shape.EllipseShape.prototype=new OG.shape.GeomShape();OG.shape.EllipseShape.superclass=OG.shape.GeomShape;OG.shape.EllipseShape.prototype.constructor=OG.shape.EllipseShape;OG.EllipseShape=OG.shape.EllipseShape;OG.shape.EllipseShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Ellipse([50,50],50,30);return this.geom};OG.shape.From=function(a){OG.shape.From.superclass.call(this);this.SHAPE_ID="OG.shape.From";this.label=a;this.MOVABLE=false;this.RESIZABLE=false;this.SELF_CONNECTABLE=false;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.DELETABLE=false;this.CONNECT_STYLE_CHANGE=false;this.ENABLE_TO=false};OG.shape.From.prototype=new OG.shape.GeomShape();OG.shape.From.superclass=OG.shape.GeomShape;OG.shape.From.prototype.constructor=OG.shape.From;OG.From=OG.shape.From;OG.shape.From.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([10,10],10);return this.geom};OG.shape.GroupShape=function(a){OG.shape.GroupShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.GROUP;this.SHAPE_ID="OG.shape.GroupShape";this.label=a;this.CONNECTABLE=false;this.SELF_CONNECTABLE=false;this.GROUP_DROPABLE=true;this.GROUP_COLLAPSIBLE=false};OG.shape.GroupShape.prototype=new OG.shape.IShape();OG.shape.GroupShape.superclass=OG.shape.IShape;OG.shape.GroupShape.prototype.constructor=OG.shape.GroupShape;OG.GroupShape=OG.shape.GroupShape;OG.shape.GroupShape.prototype.layoutChild=function(){};OG.shape.GroupShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({fill:"#ffffff","fill-opacity":0,stroke:"none"});return this.geom};OG.shape.GroupShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.label=this.label;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.HorizontalLaneShape=function(a){OG.shape.HorizontalLaneShape.superclass.call(this,a);this.SHAPE_ID="OG.shape.HorizontalLaneShape"};OG.shape.HorizontalLaneShape.prototype=new OG.shape.GroupShape();OG.shape.HorizontalLaneShape.superclass=OG.shape.GroupShape;OG.shape.HorizontalLaneShape.prototype.constructor=OG.shape.HorizontalLaneShape;OG.HorizontalLaneShape=OG.shape.HorizontalLaneShape;OG.shape.HorizontalLaneShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"vertical","vertical-align":"top",fill:"#ffffff","fill-opacity":0});return this.geom};OG.shape.HorizontalPoolShape=function(a){OG.shape.HorizontalPoolShape.superclass.call(this,a);this.SHAPE_ID="OG.shape.HorizontalPoolShape";this.label=a;this.CONNECTABLE=true;this.LoopType="None";this.GROUP_COLLAPSIBLE=false};OG.shape.HorizontalPoolShape.prototype=new OG.shape.GroupShape();OG.shape.HorizontalPoolShape.superclass=OG.shape.GroupShape;OG.shape.HorizontalPoolShape.prototype.constructor=OG.shape.HorizontalPoolShape;OG.HorizontalPoolShape=OG.shape.HorizontalPoolShape;OG.shape.HorizontalPoolShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"vertical","vertical-align":"top",fill:"#ffffff","fill-opacity":0,"title-size":32});return this.geom};OG.shape.HorizontalPoolShape.prototype.createSubShape=function(){this.sub=[];var a;switch(this.LoopType){case"Standard":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"loop_standard.png");break;case"MIParallel":a=new OG.MIParallel();break;case"MISequential":a=new OG.MISequential();break}if(a){this.sub.push({shape:a,width:"15px",height:"15px",bottom:"5px",align:"center",style:{}})}return this.sub};OG.shape.HtmlShape=function(b,a){OG.shape.HtmlShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.HTML;this.SHAPE_ID="OG.shape.HtmlShape";this.label=a;this.html=b||"";this.angle=0};OG.shape.HtmlShape.prototype=new OG.shape.IShape();OG.shape.HtmlShape.superclass=OG.shape.IShape;OG.shape.HtmlShape.prototype.constructor=OG.shape.HtmlShape;OG.HtmlShape=OG.shape.HtmlShape;OG.shape.HtmlShape.prototype.createShape=function(){return this.html};OG.shape.HtmlShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.html=this.html;shape.label=this.label;shape.angle=this.angle;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.RectangleShape=function(a){OG.shape.RectangleShape.superclass.call(this);this.SHAPE_ID="OG.shape.RectangleShape";this.label=a};OG.shape.RectangleShape.prototype=new OG.shape.GeomShape();OG.shape.RectangleShape.superclass=OG.shape.GeomShape;OG.shape.RectangleShape.prototype.constructor=OG.shape.RectangleShape;OG.RectangleShape=OG.shape.RectangleShape;OG.shape.RectangleShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);return this.geom};OG.shape.SpotShape=function(a){OG.shape.SpotShape.superclass.call(this);this.SHAPE_ID="OG.shape.SpotShape";this.label=a};OG.shape.SpotShape.prototype=new OG.shape.GeomShape();OG.shape.SpotShape.superclass=OG.shape.GeomShape;OG.shape.SpotShape.prototype.constructor=OG.shape.SpotShape;OG.SpotShape=OG.shape.SpotShape;OG.shape.SpotShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([10,10],10);return this.geom};OG.shape.To=function(a){OG.shape.To.superclass.call(this);this.SHAPE_ID="OG.shape.To";this.label=a;this.MOVABLE=false;this.RESIZABLE=false;this.SELF_CONNECTABLE=false;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.DELETABLE=false;this.CONNECT_STYLE_CHANGE=false;this.ENABLE_FROM=false};OG.shape.To.prototype=new OG.shape.GeomShape();OG.shape.To.superclass=OG.shape.GeomShape;OG.shape.To.prototype.constructor=OG.shape.To;OG.To=OG.shape.To;OG.shape.To.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([10,10],10);return this.geom};OG.shape.Transformer=function(a){OG.shape.Transformer.superclass.call(this);this.SHAPE_ID="OG.shape.Transformer";this.label=a;this.CONNECTABLE=false;this.MOVABLE=true;this.RESIZABLE=false;this.SELF_CONNECTABLE=false;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false};OG.shape.Transformer.prototype=new OG.shape.GroupShape();OG.shape.Transformer.superclass=OG.shape.GroupShape;OG.shape.Transformer.prototype.constructor=OG.shape.Transformer;OG.Transformer=OG.shape.Transformer;OG.shape.Transformer.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"horizontal","vertical-align":"top",fill:"#ffffff","fill-opacity":0});return this.geom};OG.shape.VerticalLaneShape=function(a){OG.shape.VerticalLaneShape.superclass.call(this,a);this.SHAPE_ID="OG.shape.VerticalLaneShape"};OG.shape.VerticalLaneShape.prototype=new OG.shape.GroupShape();OG.shape.VerticalLaneShape.superclass=OG.shape.GroupShape;OG.shape.VerticalLaneShape.prototype.constructor=OG.shape.VerticalLaneShape;OG.VerticalLaneShape=OG.shape.VerticalLaneShape;OG.shape.VerticalLaneShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"horizontal","vertical-align":"top","title-size":24,fill:"#ffffff","fill-opacity":0});return this.geom};OG.shape.VerticalPoolShape=function(a){OG.shape.VerticalPoolShape.superclass.call(this,a);this.SHAPE_ID="OG.shape.VerticalPoolShape";this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false};OG.shape.VerticalPoolShape.prototype=new OG.shape.GroupShape();OG.shape.VerticalPoolShape.superclass=OG.shape.GroupShape;OG.shape.VerticalPoolShape.prototype.constructor=OG.shape.VerticalPoolShape;OG.VerticalPoolShape=OG.shape.VerticalPoolShape;OG.shape.VerticalPoolShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"horizontal","vertical-align":"top",fill:"#ffffff","fill-opacity":0});return this.geom};OG.shape.bpmn.A_Task=function(a){OG.shape.bpmn.A_Task.superclass.call(this);this.GROUP_DROPABLE=false;this.SHAPE_ID="OG.shape.bpmn.A_Task";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="None";this.status="None";this.Events=[]};OG.shape.bpmn.A_Task.prototype=new OG.shape.GroupShape();OG.shape.bpmn.A_Task.superclass=OG.shape.GroupShape;OG.shape.bpmn.A_Task.prototype.constructor=OG.shape.bpmn.A_Task;OG.A_Task=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_Task.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"fill-r":1,"fill-cx":0.1,"fill-cy":0.1,"stroke-width":1.2,fill:"r(.1, .1)#FFFFFF-#FFFFCC","fill-opacity":1,r:"10"});return this.geom};OG.shape.bpmn.A_Task.prototype.createSubShape=function(){this.sub=[];var b;switch(this.LoopType){case"Standard":b=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"loop_standard.png");break;case"MIParallel":b=new OG.MIParallel();break;case"MISequential":b=new OG.MISequential();break}if(b){this.sub.push({shape:b,width:"15px",height:"15px",bottom:"5px",align:"center",style:{}})}var a;switch(this.TaskType){case"User":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"User.png");break;case"Send":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Send.png");break;case"Receive":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Receive.png");break;case"Manual":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Manual.png");break;case"Service":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Service.png");break;case"BusinessRule":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"BusinessRule.png");break;case"Script":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Script.png");break;case"Mapper":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Mapper.png");break;case"WebService":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"WebService.png");break}if(a){this.sub.push({shape:a,width:"20px",height:"20px",top:"5px",left:"5px",style:{}})}var d,c;switch(this.status){case"Completed":d=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png");break;case"Running":d=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"running.png");c=new OG.RectangleShape();break}if(d){this.sub.push({shape:d,width:"20px",height:"20px",right:"25px",top:"5px",style:{}})}if(c){this.sub.push({shape:c,"z-index":-1,width:"120%",height:"120%",left:"-10%",top:"-10%",style:{"fill-opacity":1,animation:[{start:{fill:"white"},to:{fill:"#C9E2FC"},ms:1000},{start:{fill:"#C9E2FC"},to:{fill:"white"},ms:1000,delay:1000}],"animation-repeat":true,fill:"#C9E2FC","stroke-width":"0.2",r:"10","stroke-dasharray":"--"}})}return this.sub};OG.shape.bpmn.A_Task.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,changeshape:{name:"변경",items:{A_Task:{name:"추상",type:"radio",radio:"changeshape",value:"OG.shape.bpmn.A_Task",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},A_HumanTask:{name:"사용자",type:"radio",radio:"changeshape",value:"OG.shape.bpmn.A_HumanTask",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},A_WebServiceTask:{name:"서비스",type:"radio",radio:"changeshape",value:"OG.shape.bpmn.A_WebServiceTask",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},A_ManualTask:{name:"수동",type:"radio",radio:"changeshape",value:"OG.shape.bpmn.A_ManualTask",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}}}},addEvent:{name:"이벤트 추가",items:{Message:{name:"메시지",type:"radio",radio:"addEvent",value:"Message",events:{change:function(b){a.currentCanvas.getEventHandler().setAddEventSelectedShape(b.target.value)}}},Timer:{name:"타이머",type:"radio",radio:"addEvent",value:"Timer",events:{change:function(b){a.currentCanvas.getEventHandler().setAddEventSelectedShape(b.target.value)}}},Error:{name:"에러",type:"radio",radio:"addEvent",value:"Error",events:{change:function(b){a.currentCanvas.getEventHandler().setAddEventSelectedShape(b.target.value)}}},Conditional:{name:"조건부",type:"radio",radio:"addEvent",value:"Conditional",events:{change:function(b){a.currentCanvas.getEventHandler().setAddEventSelectedShape(b.target.value)}}}}},property:{name:"속성",callback:function(){a.currentCanvas.getEventHandler().showProperty()}}};return this.contextMenu};OG.shape.bpmn.Event=function(a){OG.shape.bpmn.Event.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.Event";this.label=a};OG.shape.bpmn.Event.prototype=new OG.shape.GeomShape();OG.shape.bpmn.Event.superclass=OG.shape.GeomShape;OG.shape.bpmn.Event.prototype.constructor=OG.shape.bpmn.Event;OG.Event=OG.shape.bpmn.Event;OG.shape.bpmn.Event.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,change:{name:"변경",items:{start:{name:"시작",items:{start:{name:"시작",type:"radio",radio:"start",value:"OG.shape.bpmn.E_Start",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},start_message:{name:"메시지 시작",type:"radio",radio:"start",value:"OG.shape.bpmn.E_Start_Message",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},start_timer:{name:"타이머 시작",type:"radio",radio:"start",value:"OG.shape.bpmn.E_Start_Timer",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},start_conditional:{name:"조건부 시작",type:"radio",radio:"start",value:"OG.shape.bpmn.E_Start_Rule",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}}}},intermediate:{name:"중간",items:{intermediate:{name:"중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},intermediate_openMessage:{name:"열린 메시지 중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate_Message",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},intermediate_closeMessage:{name:"닫힌 메시지 중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate_MessageFill",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},intermediate_timer:{name:"타이머 중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate_Timer",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},intermediate_conditional:{name:"조건부 중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate_Rule",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}}}},end:{name:"종료",items:{end:{name:"종료",type:"radio",radio:"end",value:"OG.shape.bpmn.E_End",events:{change:function(b){a.changeShape(b.target.value)}}},end_message:{name:"메시지 종료",type:"radio",radio:"end",value:"OG.shape.bpmn.E_End_Message",events:{change:function(b){a.changeShape(b.target.value)}}},end_process:{name:"프로세스 종료",type:"radio",radio:"end",value:"OG.shape.bpmn.E_Terminate",events:{change:function(b){a.changeShape(b.target.value)}}}}}}}};return this.contextMenu};OG.shape.bpmn.E_End=function(a){OG.shape.bpmn.E_End.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End";this.label=a;this.inclusion=false};OG.shape.bpmn.E_End.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End.prototype.constructor=OG.shape.bpmn.E_End;OG.E_End=OG.shape.bpmn.E_End;OG.shape.bpmn.E_End.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);this.geom.style=new OG.geometry.Style({"stroke-width":3,"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End.prototype.createSubShape=function(){this.sub=[];if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}return this.sub};OG.shape.bpmn.E_Intermediate=function(a){OG.shape.bpmn.E_Intermediate.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate";this.label=a};OG.shape.bpmn.E_Intermediate.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate.prototype.constructor=OG.shape.bpmn.E_Intermediate;OG.E_Intermediate=OG.shape.bpmn.E_Intermediate;OG.shape.bpmn.E_Intermediate.prototype.createShape=function(){var a=[];if(this.geom){return this.geom}a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start=function(a){OG.shape.bpmn.E_Start.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start";this.label=a;this.inclusion=false};OG.shape.bpmn.E_Start.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start.prototype.constructor=OG.shape.bpmn.E_Start;OG.E_Start=OG.shape.bpmn.E_Start;OG.shape.bpmn.E_Start.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5});return this.geom};OG.shape.bpmn.E_Start.prototype.createSubShape=function(){this.sub=[];if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}return this.sub};OG.shape.bpmn.G_Gateway=function(a){OG.shape.bpmn.G_Gateway.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Gateway";this.label=a};OG.shape.bpmn.G_Gateway.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.G_Gateway.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.G_Gateway.prototype.constructor=OG.shape.bpmn.G_Gateway;OG.G_Gateway=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Gateway.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);return this.geom};OG.shape.bpmn.G_Gateway.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,changegateway:{name:"변경",items:{G_Gateway:{name:"베타적",type:"radio",radio:"changegateway",value:"OG.shape.bpmn.G_Gateway",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},G_Parallel:{name:"병렬",type:"radio",radio:"changegateway",value:"OG.shape.bpmn.G_Parallel",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},G_Inclusive:{name:"포괄적",type:"radio",radio:"changegateway",value:"OG.shape.bpmn.G_Inclusive",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}}}}};return this.contextMenu};OG.shape.bpmn.A_HumanTask=function(a){OG.shape.bpmn.A_HumanTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_HumanTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="User";this.status="None"};OG.shape.bpmn.A_HumanTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_HumanTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_HumanTask.prototype.constructor=OG.shape.bpmn.A_HumanTask;OG.A_HumanTask=OG.shape.bpmn.A_HumanTask;OG.shape.bpmn.A_LoopTask=function(a){OG.shape.bpmn.A_LoopTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_LoopTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="Standard";this.TaskType="None";this.status="None"};OG.shape.bpmn.A_LoopTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_LoopTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_LoopTask.prototype.constructor=OG.shape.bpmn.A_LoopTask;OG.A_LoopTask=OG.shape.bpmn.A_LoopTask;OG.shape.bpmn.A_ManualTask=function(a){OG.shape.bpmn.A_ManualTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_ManualTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="Manual";this.status="None"};OG.shape.bpmn.A_ManualTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_ManualTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_ManualTask.prototype.constructor=OG.shape.bpmn.A_ManualTask;OG.A_ManualTask=OG.shape.bpmn.A_ManualTask;OG.shape.bpmn.A_MapperTask=function(a){OG.shape.bpmn.A_MapperTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_MapperTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="Mapper";this.status="None"};OG.shape.bpmn.A_MapperTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_MapperTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_MapperTask.prototype.constructor=OG.shape.bpmn.A_MapperTask;OG.A_MapperTask=OG.shape.bpmn.A_MapperTask;OG.shape.bpmn.A_ServiceTask=function(a){OG.shape.bpmn.A_HumanTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_ServiceTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="Service"};OG.shape.bpmn.A_ServiceTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_ServiceTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_ServiceTask.prototype.constructor=OG.shape.bpmn.A_ServiceTask;OG.A_ServiceTask=OG.shape.bpmn.A_ServiceTask;OG.shape.bpmn.A_Subprocess=function(a){OG.shape.bpmn.A_Subprocess.superclass.call(this);this.label=a;this.SHAPE_ID="OG.shape.bpmn.A_Subprocess";this.GROUP_COLLAPSIBLE=false;this.HaveButton=true;this.status="None";this.inclusion=false};OG.shape.bpmn.A_Subprocess.prototype=new OG.shape.GeomShape();OG.shape.bpmn.A_Subprocess.superclass=OG.shape.GeomShape;OG.shape.bpmn.A_Subprocess.prototype.constructor=OG.shape.bpmn.A_Subprocess;OG.A_Subprocess=OG.shape.bpmn.A_Subprocess;OG.shape.bpmn.A_Subprocess.prototype.createShape=function(){if(this.geom){return this.geom}this.CONNECTABLE=true;this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"stroke-width":1.2,r:6,fill:"#FFFFFF - #FFFFCC","fill-opacity":1});return this.geom};OG.shape.bpmn.A_Subprocess.prototype.createSubShape=function(){this.sub=[];var b,a;switch(this.status){case"Completed":b=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png");break;case"Running":b=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"running.png");a=new OG.RectangleShape();break}if(b){this.sub.push({shape:b,width:"20px",height:"20px",right:"25px",top:"5px",style:{}})}if(a){this.sub.push({shape:a,"z-index":-1,width:"120%",height:"120%",left:"-10%",top:"-10%",style:{"fill-opacity":1,animation:[{start:{fill:"white"},to:{fill:"#C9E2FC"},ms:1000},{start:{fill:"#C9E2FC"},to:{fill:"white"},ms:1000,delay:1000}],"animation-repeat":true,fill:"#C9E2FC","stroke-width":"0.2",r:"10","stroke-dasharray":"--"}})}if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}if(this.HaveButton){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"subprocess.png"),width:"20px",height:"20px",align:"center",bottom:"5px",style:{"stroke-width":1,fill:"white","fill-opacity":0,"shape-rendering":"crispEdges"}})}return this.sub};OG.shape.bpmn.A_Subprocess.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"속성",callback:function(){a.currentCanvas.getEventHandler().showProperty()}}};return this.contextMenu};OG.shape.bpmn.A_WebServiceTask=function(a){OG.shape.bpmn.A_WebServiceTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_WebServiceTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="WebService"};OG.shape.bpmn.A_WebServiceTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_WebServiceTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_WebServiceTask.prototype.constructor=OG.shape.bpmn.A_WebServiceTask;OG.A_WebServiceTask=OG.shape.bpmn.A_WebServiceTask;OG.shape.bpmn.C_Association=function(c,b,a){OG.shape.bpmn.C_Association.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_Association"};OG.shape.bpmn.C_Association.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_Association.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_Association.prototype.constructor=OG.shape.bpmn.C_Association;OG.C_Association=OG.shape.bpmn.C_Association;OG.shape.bpmn.C_Association.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[70,0]);this.geom.style=new OG.geometry.Style({"edge-type":"straight","arrow-start":"none","arrow-end":"none","stroke-dasharray":". "});return this.geom};OG.shape.bpmn.C_Conditional=function(c,b,a){OG.shape.bpmn.C_Conditional.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_Conditional"};OG.shape.bpmn.C_Conditional.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_Conditional.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_Conditional.prototype.constructor=OG.shape.bpmn.C_Conditional;OG.C_Conditional=OG.shape.bpmn.C_Conditional;OG.shape.bpmn.C_Conditional.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[70,0]);this.geom.style=new OG.geometry.Style({"edge-type":"straight","arrow-start":"open_diamond-wide-long","arrow-end":"open_block-wide-long"});return this.geom};OG.shape.bpmn.C_DataAssociation=function(c,b,a){OG.shape.bpmn.C_DataAssociation.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_DataAssociation"};OG.shape.bpmn.C_DataAssociation.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_DataAssociation.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_DataAssociation.prototype.constructor=OG.shape.bpmn.C_DataAssociation;OG.C_DataAssociation=OG.shape.bpmn.C_DataAssociation;OG.shape.bpmn.C_DataAssociation.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[70,0]);this.geom.style=new OG.geometry.Style({"edge-type":"straight","arrow-start":"none","arrow-end":"classic-wide-long","stroke-dasharray":". "});return this.geom};OG.shape.bpmn.C_Message=function(c,b,a){OG.shape.bpmn.C_Message.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_Message"};OG.shape.bpmn.C_Message.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_Message.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_Message.prototype.constructor=OG.shape.bpmn.C_Message;OG.C_Message=OG.shape.bpmn.C_Message;OG.shape.bpmn.C_Message.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[80,0]);this.geom.style=new OG.geometry.Style({"edge-type":"straight","arrow-start":"open_oval-wide-long","arrow-end":"open_block-wide-long","stroke-dasharray":"--"});return this.geom};OG.shape.bpmn.C_Sequence=function(c,b,a){OG.shape.bpmn.C_Sequence.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_Sequence"};OG.shape.bpmn.C_Sequence.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_Sequence.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_Sequence.prototype.constructor=OG.shape.bpmn.C_Sequence;OG.C_Sequence=OG.shape.bpmn.C_Sequence;OG.shape.bpmn.C_Sequence.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[80,0]);this.geom.style=new OG.geometry.Style({"edge-type":"plain","arrow-start":"none","arrow-end":"block-wide-long"});return this.geom};OG.shape.bpmn.D_Data=function(a){OG.shape.bpmn.D_Data.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.D_Data";this.label=a};OG.shape.bpmn.D_Data.prototype=new OG.shape.GeomShape();OG.shape.bpmn.D_Data.superclass=OG.shape.GeomShape;OG.shape.bpmn.D_Data.prototype.constructor=OG.shape.bpmn.D_Data;OG.D_Data=OG.shape.bpmn.D_Data;OG.shape.bpmn.D_Data.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.PolyLine([[0,0],[0,100],[100,100],[100,20],[80,0],[0,0],[80,0],[80,20],[100,20]]);return this.geom};OG.shape.bpmn.D_Store=function(a){OG.shape.bpmn.D_Store.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.D_Store";this.label=a};OG.shape.bpmn.D_Store.prototype=new OG.shape.GeomShape();OG.shape.bpmn.D_Store.superclass=OG.shape.GeomShape;OG.shape.bpmn.D_Store.prototype.constructor=OG.shape.bpmn.D_Store;OG.D_Store=OG.shape.bpmn.D_Store;OG.shape.bpmn.D_Store.prototype.createShape=function(){var f,e,d,c,a,b=[];if(this.geom){return this.geom}f=new OG.geometry.Ellipse([50,10],50,10);e=new OG.geometry.Line([0,10],[0,90]);d=new OG.geometry.Line([100,10],[100,90]);c=new OG.geometry.Curve([[100,90],[96,94],[85,97],[50,100],[15,97],[4,94],[0,90]]);a=new OG.geometry.Rectangle([0,10],100,80);a.style=new OG.geometry.Style({stroke:"none"});b.push(f);b.push(e);b.push(d);b.push(c);b.push(a);this.geom=new OG.geometry.GeometryCollection(b);return this.geom};OG.shape.bpmn.E_End_Cancel=function(a){OG.shape.bpmn.E_End_Cancel.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Cancel";this.label=a};OG.shape.bpmn.E_End_Cancel.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Cancel.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Cancel.prototype.constructor=OG.shape.bpmn.E_End_Cancel;OG.E_End_Cancel=OG.shape.bpmn.E_End_Cancel;OG.shape.bpmn.E_End_Cancel.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":3});c=new OG.geometry.Line([25,25],[75,75]);c.style=new OG.geometry.Style({"stroke-width":5});b=new OG.geometry.Line([25,75],[75,25]);b.style=new OG.geometry.Style({"stroke-width":5});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Compensation=function(a){OG.shape.bpmn.E_End_Compensation.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Compensation";this.label=a};OG.shape.bpmn.E_End_Compensation.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Compensation.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Compensation.prototype.constructor=OG.shape.bpmn.E_End_Compensation;OG.E_End_Compensation=OG.shape.bpmn.E_End_Compensation;OG.shape.bpmn.E_End_Compensation.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":3});c=new OG.geometry.Polygon([[15,50],[45,70],[45,30]]);c.style=new OG.geometry.Style({fill:"black","fill-opacity":1});b=new OG.geometry.Polygon([[45,50],[75,70],[75,30]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Connector=function(a){OG.shape.bpmn.E_End_Connector.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Connector";this.label=a};OG.shape.bpmn.E_End_Connector.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Connector.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Connector.prototype.constructor=OG.shape.bpmn.E_End_Connector;OG.E_End_Connector=OG.shape.bpmn.E_End_Connector;OG.shape.bpmn.E_End_Connector.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,34],[20,65],[60,65],[60,80],[85,50],[60,20],[60,34]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Error=function(a){OG.shape.bpmn.E_End_Error.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Error";this.label=a};OG.shape.bpmn.E_End_Error.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Error.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Error.prototype.constructor=OG.shape.bpmn.E_End_Error;OG.E_End_Error=OG.shape.bpmn.E_End_Error;OG.shape.bpmn.E_End_Error.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":4});b=new OG.geometry.Polygon([[20,75],[40,30],[60,60],[80,20],[60,75],[40,50]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Link=function(a){OG.shape.bpmn.E_End_Link.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Link";this.label=a};OG.shape.bpmn.E_End_Link.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Link.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Link.prototype.constructor=OG.shape.bpmn.E_End_Link;OG.E_End_Link=OG.shape.bpmn.E_End_Link;OG.shape.bpmn.E_End_Link.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,35],[20,65],[60,65],[60,80],[85,50],[60,20],[60,35]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Message=function(a){OG.shape.bpmn.E_End_Message.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Message";this.label=a};OG.shape.bpmn.E_End_Message.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Message.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Message.prototype.constructor=OG.shape.bpmn.E_End_Message;OG.E_End_Message=OG.shape.bpmn.E_End_Message;OG.shape.bpmn.E_End_Message.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":3});c=new OG.geometry.PolyLine([[20,25],[50,45],[80,25],[20,25]]);c.style=new OG.geometry.Style({fill:"black","fill-opacity":1});b=new OG.geometry.PolyLine([[20,35],[20,70],[80,70],[80,35],[50,55],[20,35]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Multiple=function(a){OG.shape.bpmn.E_End_Multiple.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Multiple";this.label=a};OG.shape.bpmn.E_End_Multiple.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Multiple.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Multiple.prototype.constructor=OG.shape.bpmn.E_End_Multiple;OG.E_End_Multiple=OG.shape.bpmn.E_End_Multiple;OG.shape.bpmn.E_End_Multiple.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":3});b=new OG.geometry.Polygon([[50,15],[39,33],[20,33],[29,50],[19,67],[40,67],[50,85],[60,68],[80,68],[70,50],[79,33],[60,33]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Intermediate_Compensation=function(a){OG.shape.bpmn.E_Intermediate_Compensation.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Compensation";this.label=a;this.selectable=true;this.movable=true};OG.shape.bpmn.E_Intermediate_Compensation.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Compensation.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Compensation.prototype.constructor=OG.shape.bpmn.E_Intermediate_Compensation;OG.E_Intermediate_Compensation=OG.shape.bpmn.E_Intermediate_Compensation;OG.shape.bpmn.E_Intermediate_Compensation.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Polygon([[15,50],[45,70],[45,30]]);b=new OG.geometry.Polygon([[45,50],[75,70],[75,30]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],40));a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"#969149","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Error=function(a){OG.shape.bpmn.E_Intermediate_Error.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Error";this.label=a};OG.shape.bpmn.E_Intermediate_Error.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Error.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Error.prototype.constructor=OG.shape.bpmn.E_Intermediate_Error;OG.E_Intermediate_Error=OG.shape.bpmn.E_Intermediate_Error;OG.shape.bpmn.E_Intermediate_Error.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,75],[40,30],[60,60],[80,20],[60,75],[40,50]]);b.style=new OG.geometry.Style({fill:"#ffffff"});a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Escalation=function(a){OG.shape.bpmn.E_Intermediate_Escalation.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Escalation";this.label=a};OG.shape.bpmn.E_Intermediate_Escalation.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Escalation.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Escalation.prototype.constructor=OG.shape.bpmn.E_Intermediate_Escalation;OG.E_Intermediate_Escalation=OG.shape.bpmn.E_Intermediate_Escalation;OG.shape.bpmn.E_Intermediate_Escalation.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,80],[50,20],[80,80],[50,50]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],40));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Link=function(a){OG.shape.bpmn.E_Intermediate_Link.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Link";this.label=a};OG.shape.bpmn.E_Intermediate_Link.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Link.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Link.prototype.constructor=OG.shape.bpmn.E_Intermediate_Link;OG.E_Intermediate_Link=OG.shape.bpmn.E_Intermediate_Link;OG.shape.bpmn.E_Intermediate_Link.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,0],[80,0],[100,50],[80,100],[0,100],[20,50]]);return this.geom};OG.shape.bpmn.E_Intermediate_Message=function(a){OG.shape.bpmn.E_Intermediate_Message.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Message";this.label=a};OG.shape.bpmn.E_Intermediate_Message.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Message.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Message.prototype.constructor=OG.shape.bpmn.E_Intermediate_Message;OG.E_Intermediate_Message=OG.shape.bpmn.E_Intermediate_Message;OG.shape.bpmn.E_Intermediate_Message.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.PolyLine([[20,25],[50,45],[80,25],[20,25]]);b=new OG.geometry.PolyLine([[20,35],[20,70],[80,70],[80,35],[50,55],[20,35]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],45));a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"black","stroke-width":1,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_MessageFill=function(a){OG.shape.bpmn.E_Intermediate_MessageFill.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_MessageFill";this.label=a};OG.shape.bpmn.E_Intermediate_MessageFill.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_MessageFill.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_MessageFill.prototype.constructor=OG.shape.bpmn.E_Intermediate_MessageFill;OG.E_Intermediate_MessageFill=OG.shape.bpmn.E_Intermediate_MessageFill;OG.shape.bpmn.E_Intermediate_MessageFill.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.PolyLine([[20,25],[50,45],[80,25],[20,25]]);c.style=new OG.geometry.Style({fill:"black","fill-opacity":1});b=new OG.geometry.PolyLine([[20,35],[20,70],[80,70],[80,35],[50,55],[20,35]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],45));a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"black","stroke-width":1,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Multiple=function(a){OG.shape.bpmn.E_Intermediate_Multiple.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Multiple";this.label=a};OG.shape.bpmn.E_Intermediate_Multiple.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Multiple.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Multiple.prototype.constructor=OG.shape.bpmn.E_Intermediate_Multiple;OG.E_Intermediate_Multiple=OG.shape.bpmn.E_Intermediate_Multiple;OG.shape.bpmn.E_Intermediate_Multiple.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,50],[50,20],[80,50],[65,75],[35,75]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],40));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"#969149","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Rule=function(a){OG.shape.bpmn.E_Intermediate_Rule.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Rule";this.label=a};OG.shape.bpmn.E_Intermediate_Rule.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Rule.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Rule.prototype.constructor=OG.shape.bpmn.E_Intermediate_Rule;OG.E_Intermediate_Rule=OG.shape.bpmn.E_Intermediate_Rule;OG.shape.bpmn.E_Intermediate_Rule.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Rectangle([25,20],50,60);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);a.push(new OG.geometry.Line([30,30],[70,30]));a.push(new OG.geometry.Line([30,45],[70,45]));a.push(new OG.geometry.Line([30,60],[70,60]));a.push(new OG.geometry.Line([30,70],[70,70]));this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"black","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Timer=function(a){OG.shape.bpmn.E_Intermediate_Timer.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Timer";this.label=a};OG.shape.bpmn.E_Intermediate_Timer.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Timer.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Timer.prototype.constructor=OG.shape.bpmn.E_Intermediate_Timer;OG.E_Intermediate_Timer=OG.shape.bpmn.E_Intermediate_Timer;OG.shape.bpmn.E_Intermediate_Timer.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],32);b=new OG.geometry.PolyLine([[50,30],[50,50],[70,50]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(c);a.push(new OG.geometry.Line([50,18],[50,25]));a.push(new OG.geometry.Line([50,82],[50,75]));a.push(new OG.geometry.Line([18,50],[25,50]));a.push(new OG.geometry.Line([82,50],[75,50]));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"black","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Start_Connector=function(a){OG.shape.bpmn.E_Start_Connector.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Connector";this.label=a};OG.shape.bpmn.E_Start_Connector.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Connector.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Connector.prototype.constructor=OG.shape.bpmn.E_Start_Connector;OG.E_Start_Connector=OG.shape.bpmn.E_Start_Connector;OG.shape.bpmn.E_Start_Connector.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,34],[20,65],[60,65],[60,80],[85,50],[60,20],[60,34]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Error=function(a){OG.shape.bpmn.E_Start_Error.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Error";this.label=a};OG.shape.bpmn.E_Start_Error.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Error.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Error.prototype.constructor=OG.shape.bpmn.E_Start_Error;OG.E_Start_Error=OG.shape.bpmn.E_Start_Error;OG.shape.bpmn.E_Start_Error.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);b=new OG.geometry.Polygon([[20,75],[40,30],[60,60],[80,20],[60,75],[40,50]]);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5});return this.geom};OG.shape.bpmn.E_Start_Link=function(a){OG.shape.bpmn.E_Start_Link.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Link";this.label=a};OG.shape.bpmn.E_Start_Link.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Link.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Link.prototype.constructor=OG.shape.bpmn.E_Start_Link;OG.E_Start_Link=OG.shape.bpmn.E_Start_Link;OG.shape.bpmn.E_Start_Link.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,35],[20,65],[60,65],[60,80],[85,50],[60,20],[60,35]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Message=function(a){OG.shape.bpmn.E_Start_Message.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Message";this.label=a};OG.shape.bpmn.E_Start_Message.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Message.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Message.prototype.constructor=OG.shape.bpmn.E_Start_Message;OG.E_Start_Message=OG.shape.bpmn.E_Start_Message;OG.shape.bpmn.E_Start_Message.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":1.5});c=new OG.geometry.PolyLine([[20,25],[50,45],[80,25],[20,25]]);b=new OG.geometry.PolyLine([[20,35],[20,70],[80,70],[80,35],[50,55],[20,35]]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Multiple=function(a){OG.shape.bpmn.E_Start_Multiple.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Multiple";this.label=a};OG.shape.bpmn.E_Start_Multiple.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Multiple.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Multiple.prototype.constructor=OG.shape.bpmn.E_Start_Multiple;OG.E_Start_Multiple=OG.shape.bpmn.E_Start_Multiple;OG.shape.bpmn.E_Start_Multiple.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);b=new OG.geometry.Polygon([[50,15],[39,33],[20,33],[29,50],[19,67],[40,67],[50,85],[60,68],[80,68],[70,50],[79,33],[60,33]]);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Rule=function(a){OG.shape.bpmn.E_Start_Rule.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Rule";this.label=a};OG.shape.bpmn.E_Start_Rule.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Rule.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Rule.prototype.constructor=OG.shape.bpmn.E_Start_Rule;OG.E_Start_Rule=OG.shape.bpmn.E_Start_Rule;OG.shape.bpmn.E_Start_Rule.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":1.5});b=new OG.geometry.Rectangle([25,20],50,60);a.push(c);a.push(b);a.push(new OG.geometry.Line([30,30],[70,30]));a.push(new OG.geometry.Line([30,45],[70,45]));a.push(new OG.geometry.Line([30,60],[70,60]));a.push(new OG.geometry.Line([30,70],[70,70]));this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Timer=function(a){OG.shape.bpmn.E_Start_Timer.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Timer";this.label=a};OG.shape.bpmn.E_Start_Timer.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Timer.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Timer.prototype.constructor=OG.shape.bpmn.E_Start_Timer;OG.E_Start_Timer=OG.shape.bpmn.E_Start_Timer;OG.shape.bpmn.E_Start_Timer.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":1.5});c=new OG.geometry.Circle([50,50],32);b=new OG.geometry.PolyLine([[50,30],[50,50],[70,50]]);a.push(d);a.push(c);a.push(new OG.geometry.Line([50,18],[50,25]));a.push(new OG.geometry.Line([50,82],[50,75]));a.push(new OG.geometry.Line([18,50],[25,50]));a.push(new OG.geometry.Line([82,50],[75,50]));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Terminate=function(a){OG.shape.bpmn.E_Terminate.superclass.call(this,a);this.SHAPE_ID="OG.shape.bpmn.E_Terminate"};OG.shape.bpmn.E_Terminate.prototype=new OG.shape.bpmn.E_End();OG.shape.bpmn.E_Terminate.superclass=OG.shape.bpmn.E_End;OG.shape.bpmn.E_Terminate.prototype.constructor=OG.shape.bpmn.E_Terminate;OG.E_Terminate=OG.shape.bpmn.E_Terminate;OG.shape.bpmn.E_Terminate.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":3});b=new OG.geometry.Circle([50,50],30);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.G_Complex=function(a){OG.shape.bpmn.G_Complex.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Complex";this.label=a};OG.shape.bpmn.G_Complex.prototype=new OG.shape.bpmn.G_Gateway();OG.shape.bpmn.G_Complex.superclass=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Complex.prototype.constructor=OG.shape.bpmn.G_Complex;OG.G_Complex=OG.shape.bpmn.G_Complex;OG.shape.bpmn.G_Complex.prototype.createShape=function(){var f,e,d,c,a,b=[];if(this.geom){return this.geom}f=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);e=new OG.geometry.Line([30,30],[70,70]);e.style=new OG.geometry.Style({"stroke-width":3});d=new OG.geometry.Line([30,70],[70,30]);d.style=new OG.geometry.Style({"stroke-width":3});c=new OG.geometry.Line([20,50],[80,50]);c.style=new OG.geometry.Style({"stroke-width":3});a=new OG.geometry.Line([50,20],[50,80]);a.style=new OG.geometry.Style({"stroke-width":3});b.push(f);b.push(e);b.push(d);b.push(c);b.push(a);this.geom=new OG.geometry.GeometryCollection(b);return this.geom};OG.shape.bpmn.G_Exclusive=function(a){OG.shape.bpmn.G_Exclusive.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Exclusive";this.label=a};OG.shape.bpmn.G_Exclusive.prototype=new OG.shape.bpmn.G_Gateway();OG.shape.bpmn.G_Exclusive.superclass=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Exclusive.prototype.constructor=OG.shape.bpmn.G_Exclusive;OG.G_Exclusive=OG.shape.bpmn.G_Exclusive;OG.shape.bpmn.G_Exclusive.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);c=new OG.geometry.Line([30,30],[70,70]);c.style=new OG.geometry.Style({"stroke-width":5});b=new OG.geometry.Line([30,70],[70,30]);b.style=new OG.geometry.Style({"stroke-width":5});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.G_Inclusive=function(a){OG.shape.bpmn.G_Inclusive.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Inclusive";this.label=a};OG.shape.bpmn.G_Inclusive.prototype=new OG.shape.bpmn.G_Gateway();OG.shape.bpmn.G_Inclusive.superclass=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Inclusive.prototype.constructor=OG.shape.bpmn.G_Inclusive;OG.G_Inclusive=OG.shape.bpmn.G_Inclusive;OG.shape.bpmn.G_Inclusive.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);b=new OG.geometry.Circle([50,50],25);b.style=new OG.geometry.Style({"stroke-width":3});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.G_Parallel=function(a){OG.shape.bpmn.G_Parallel.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Parallel";this.label=a};OG.shape.bpmn.G_Parallel.prototype=new OG.shape.bpmn.G_Gateway();OG.shape.bpmn.G_Parallel.superclass=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Parallel.prototype.constructor=OG.shape.bpmn.G_Parallel;OG.G_Parallel=OG.shape.bpmn.G_Parallel;OG.shape.bpmn.G_Parallel.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);c=new OG.geometry.Line([20,50],[80,50]);c.style=new OG.geometry.Style({"stroke-width":5});b=new OG.geometry.Line([50,20],[50,80]);b.style=new OG.geometry.Style({"stroke-width":5});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.MIParallel=function(a){OG.shape.bpmn.MIParallel.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.MIParallel";this.label=a};OG.shape.bpmn.MIParallel.prototype=new OG.shape.GeomShape();OG.shape.bpmn.MIParallel.superclass=OG.shape.GeomShape;OG.shape.bpmn.MIParallel.prototype.constructor=OG.shape.bpmn.MIParallel;OG.MIParallel=OG.shape.bpmn.MIParallel;OG.shape.bpmn.MIParallel.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Line([0,30],[0,0]);c=new OG.geometry.Line([15,30],[15,0]);b=new OG.geometry.Line([30,30],[30,0]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.MISequential=function(a){OG.shape.bpmn.MISequential.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.MISequential";this.label=a};OG.shape.bpmn.MISequential.prototype=new OG.shape.GeomShape();OG.shape.bpmn.MISequential.superclass=OG.shape.GeomShape;OG.shape.bpmn.MISequential.prototype.constructor=OG.shape.bpmn.MISequential;OG.MISequential=OG.shape.bpmn.MISequential;OG.shape.bpmn.MISequential.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Line([0,30],[30,30]);c=new OG.geometry.Line([0,15],[30,15]);b=new OG.geometry.Line([0,0],[30,0]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.M_Annotation=function(a){OG.shape.bpmn.M_Annotation.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.M_Annotation";this.label=a};OG.shape.bpmn.M_Annotation.prototype=new OG.shape.GeomShape();OG.shape.bpmn.M_Annotation.superclass=OG.shape.GeomShape;OG.shape.bpmn.M_Annotation.prototype.constructor=OG.shape.bpmn.M_Annotation;OG.M_Annotation=OG.shape.bpmn.M_Annotation;OG.shape.bpmn.M_Annotation.prototype.createShape=function(){if(this.geom){return this.geom}var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Rectangle([0,0],100,100);c.style=new OG.geometry.Style({stroke:"none"});b=new OG.geometry.PolyLine([[10,0],[0,0],[0,100],[10,100]]);b.style=new OG.geometry.Style({stroke:"black"});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({});return this.geom};OG.shape.bpmn.M_Group=function(a){OG.shape.bpmn.M_Group.superclass.call(this);this.CONNECTABLE=true;this.SHAPE_ID="OG.shape.bpmn.M_Group";this.label=a};OG.shape.bpmn.M_Group.prototype=new OG.shape.GroupShape();OG.shape.bpmn.M_Group.superclass=OG.shape.GroupShape;OG.shape.bpmn.M_Group.prototype.constructor=OG.shape.bpmn.M_Group;OG.M_Group=OG.shape.bpmn.M_Group;OG.shape.bpmn.M_Group.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({r:6,fill:"#ffffff","fill-opacity":0,"vertical-align":"top","text-anchor":"start"});return this.geom};OG.shape.bpmn.M_Text=function(a){OG.shape.bpmn.M_Text.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.M_Text";this.label=a||"Text"};OG.shape.bpmn.M_Text.prototype=new OG.shape.GeomShape();OG.shape.bpmn.M_Text.superclass=OG.shape.GeomShape;OG.shape.bpmn.M_Text.prototype.constructor=OG.shape.bpmn.M_Text;OG.M_Text=OG.shape.bpmn.M_Text;OG.shape.bpmn.M_Text.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({stroke:"none"});return this.geom};OG.shape.bpmn.ParallelMultiple=function(a){OG.shape.bpmn.ParallelMultiple.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.ParallelMultiple";this.label=a};OG.shape.bpmn.ParallelMultiple.prototype=new OG.shape.GeomShape();OG.shape.bpmn.ParallelMultiple.superclass=OG.shape.GeomShape;OG.shape.bpmn.ParallelMultiple.prototype.constructor=OG.shape.bpmn.ParallelMultiple;OG.ParallelMultiple=OG.shape.bpmn.ParallelMultiple;OG.shape.bpmn.ParallelMultiple.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);b=new OG.geometry.Circle([50,50],40);geom3=new OG.Polygon([[20,40],[20,60],[40,60],[40,80],[60,80],[60,60],[80,60],[80,40],[60,40],[60,20],[40,20],[40,40]]);a.push(c);a.push(b);a.push(geom3);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5,stroke:"#969149",fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.ScopeActivity=function(a){OG.shape.bpmn.ScopeActivity.superclass.call(this);this.GROUP_COLLAPSIBLE=false;this.CONNECTABLE=true;this.Events=[];this.SHAPE_ID="OG.shape.bpmn.ScopeActivity";this.label=a};OG.shape.bpmn.ScopeActivity.prototype=new OG.shape.bpmn.M_Group();OG.shape.bpmn.ScopeActivity.superclass=OG.shape.bpmn.M_Group;OG.shape.bpmn.ScopeActivity.prototype.constructor=OG.shape.bpmn.ScopeActivity;OG.ScopeActivity=OG.shape.bpmn.ScopeActivity;OG.shape.bpmn.ScopeActivity.prototype.layoutChild=function(){for(var a in this.Events){}};OG.shape.bpmn.Signal=function(a){OG.shape.bpmn.Signal.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.Signal";this.label=a};OG.shape.bpmn.Signal.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.Signal.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.Signal.prototype.constructor=OG.shape.bpmn.Signal;OG.Signal=OG.shape.bpmn.Signal;OG.shape.bpmn.Signal.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);c=new OG.geometry.Circle([50,50],40);b=new OG.Polygon([[20,75],[50,10],[80,75]]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5,stroke:"#969149",fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.Value_Chain=function(a){OG.shape.bpmn.Value_Chain.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.Value_Chain";this.label=a;this.HaveButton=true;this.LoopType="None";this.inclusion=false};OG.shape.bpmn.Value_Chain.prototype=new OG.shape.GeomShape();OG.shape.bpmn.Value_Chain.superclass=OG.shape.GeomShape;OG.shape.bpmn.Value_Chain.prototype.constructor=OG.shape.bpmn.Value_Chain;OG.Value_Chain=OG.shape.bpmn.Value_Chain;OG.shape.bpmn.Value_Chain.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,0],[10,50],[0,100],[90,100],[100,50],[90,0]]);this.geom.style=new OG.geometry.Style({fill:"#FFFFFF-#9FD7FF","fill-opacity":1,stroke:"#9FD7FF"});return this.geom};OG.shape.bpmn.Value_Chain.prototype.createSubShape=function(){this.sub=[];if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}if(this.HaveButton){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"subprocess.png"),width:"20px",height:"20px",align:"center",bottom:"5px",style:{"stroke-width":1,fill:"white","fill-opacity":0,"shape-rendering":"crispEdges"}})}return this.sub};OG.shape.bpmn.Value_Chain.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"속성",callback:function(){a.currentCanvas.getEventHandler().showProperty()}}};return this.contextMenu};OG.shape.bpmn.Value_Chain_Module=function(a){OG.shape.bpmn.Value_Chain_Module.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.Value_Chain_Module";this.label=a;this.HaveButton=true;this.LoopType="None";this.inclusion=false};OG.shape.bpmn.Value_Chain_Module.prototype=new OG.shape.bpmn.Value_Chain();OG.shape.bpmn.Value_Chain_Module.superclass=OG.shape.bpmn.Value_Chain;OG.shape.bpmn.Value_Chain_Module.prototype.constructor=OG.shape.bpmn.Value_Chain_Module;OG.Value_Chain_Module=OG.shape.bpmn.Value_Chain_Module;OG.shape.bpmn.Value_Chain_Module.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,0],[0,100],[90,100],[100,50],[90,0]]);this.geom.style=new OG.geometry.Style({fill:"#FFFFFF-#9FD7FF","fill-opacity":1,stroke:"#9FD7FF"});return this.geom};OG.shape.bpmn.Value_Chain.prototype.createSubShape=function(){this.sub=[];if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}if(this.HaveButton){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"subprocess.png"),width:"20px",height:"20px",align:"center",bottom:"5px",style:{"stroke-width":1,fill:"white","fill-opacity":0,"shape-rendering":"crispEdges"}})}return this.sub};OG.shape.elec.WireShape=function(c,b,a){OG.shape.elec.WireShape.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.elec.WireShape"};OG.shape.elec.WireShape.prototype=new OG.shape.EdgeShape();OG.shape.elec.WireShape.superclass=OG.shape.EdgeShape;OG.shape.elec.WireShape.prototype.constructor=OG.shape.elec.WireShape;OG.WireShape=OG.shape.elec.WireShape;OG.shape.elec.WireShape.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}},changeShape:{name:"변경",items:{Wire:{name:"Cable",type:"radio",radio:"changeShape",value:"OG.shape.elec.CableShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,null)}}},IPB:{name:"IPB",type:"radio",radio:"changeShape",value:"OG.shape.elec.BusductShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,"IPB")}}},SPB:{name:"SPB",type:"radio",radio:"changeShape",value:"OG.shape.elec.BusductShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,"SPB")}}},NSPB:{name:"NSPB",type:"radio",radio:"changeShape",value:"OG.shape.elec.BusductShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,"NSPB")}}},CRB:{name:"CRB",type:"radio",radio:"changeShape",value:"OG.shape.elec.BusductShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,"CRB")}}}}}};return this.contextMenu};OG.shape.elec.Load=function(a){OG.shape.elec.Load.superclass.call(this);this.SHAPE_ID="OG.shape.elec.Load";this.label=a};OG.shape.elec.Load.prototype=new OG.shape.GeomShape();OG.shape.elec.Load.superclass=OG.shape.GeomShape;OG.shape.elec.Load.prototype.constructor=OG.shape.elec.Load;OG.Load=OG.shape.elec.Load;OG.shape.elec.Load.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.BLDG=function(a){OG.shape.elec.BLDG.superclass.call(this);this.SHAPE_ID="OG.shape.elec.BLDG";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.CONNECTABLE=false};OG.shape.elec.BLDG.prototype=new OG.shape.HorizontalPoolShape();OG.shape.elec.BLDG.superclass=OG.shape.HorizontalPoolShape;OG.shape.elec.BLDG.prototype.constructor=OG.shape.elec.BLDG;OG.BLDG=OG.shape.elec.BLDG;OG.shape.elec.BLDG.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"horizontal","vertical-align":"top",fill:"#ffffff","fill-opacity":0,"title-size":26,"label-fill":"#428bca","label-fill-opacity":1,"font-weight":700,"font-color":"white"});return this.geom};OG.shape.elec.BLDG.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.BusductShape=function(c,b,a){OG.shape.elec.BusductShape.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.elec.BusductShape"};OG.shape.elec.BusductShape.prototype=new OG.shape.elec.WireShape();OG.shape.elec.BusductShape.superclass=OG.shape.elec.WireShape;OG.shape.elec.BusductShape.prototype.constructor=OG.shape.elec.BusductShape;OG.BusductShape=OG.shape.elec.BusductShape;OG.shape.elec.BusductShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.PolyLine([this.from||[0,0],this.to||[70,0]]);this.geom.style=new OG.geometry.Style({multi:[{top:-10,from:"20px",to:"end-20px",style:{marker:{start:{id:"OG.marker.SwitchRMarker",size:[8,8],ref:[8,0]},end:{id:"OG.marker.SwitchLMarker",size:[8,8],ref:[1,0]}}}},{top:10,from:"20px",to:"end-20px",style:{marker:{start:{id:"OG.marker.SwitchLMarker",size:[8,8],ref:[7,8]},end:{id:"OG.marker.SwitchRMarker",size:[8,8],ref:[0,8]}}}},{top:0,from:"start",to:"end",style:{}}]});return this.geom};OG.shape.elec.CableShape=function(c,b,a){OG.shape.elec.CableShape.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.elec.CableShape"};OG.shape.elec.CableShape.prototype=new OG.shape.elec.WireShape();OG.shape.elec.CableShape.superclass=OG.shape.elec.WireShape;OG.shape.elec.CableShape.prototype.constructor=OG.shape.elec.CableShape;OG.CableShape=OG.shape.elec.CableShape;OG.shape.elec.CableShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.PolyLine([this.from||[0,0],this.to||[70,0]]);this.geom.style=new OG.geometry.Style({multi:[{top:0,from:"start",to:"center",style:{marker:{end:{id:"OG.marker.SwitchLMarker",size:[20,8],ref:[3,0]}}}},{top:0,from:"center",to:"end",style:{marker:{start:{id:"OG.marker.SwitchXMarker",size:[6,6]}}}}]});return this.geom};OG.shape.elec.EHLoad=function(a){OG.shape.elec.EHLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.EHLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.EHLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.EHLoad.superclass=OG.shape.elec.Load;OG.shape.elec.EHLoad.prototype.constructor=OG.shape.elec.EHLoad;OG.EHLoad=OG.shape.elec.EHLoad;OG.shape.elec.EHLoad.prototype.createShape=function(){var e,d,c,b,a=[];if(this.geom){return this.geom}e=new OG.geometry.Circle([30,30],30);d=new OG.geometry.Curve([[0,0],[40,10],[20,20]]);c=new OG.geometry.Curve([[20,20],[40,30],[20,40]]);b=new OG.geometry.Curve([[20,40],[40,50],[0,60]]);a.push(e);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.EHLoad.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.EHSLoad=function(a){OG.shape.elec.EHSLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.EHSLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.EHSLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.EHSLoad.superclass=OG.shape.elec.Load;OG.shape.elec.EHSLoad.prototype.constructor=OG.shape.elec.EHSLoad;OG.EHSLoad=OG.shape.elec.EHSLoad;OG.shape.elec.EHSLoad.prototype.createShape=function(){var e,d,c,b,a=[];if(this.geom){return this.geom}e=new OG.geometry.Circle([30,30],30);d=new OG.geometry.Curve([[0,0],[40,10],[20,20]]);c=new OG.geometry.Curve([[20,20],[40,30],[20,40]]);b=new OG.geometry.Curve([[20,40],[40,50],[0,60]]);a.push(e);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.EHSLoad.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.HierarchyBldg=function(a){OG.shape.elec.HierarchyBldg.superclass.call(this);this.SHAPE_ID="OG.shape.elec.HierarchyBldg";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.CONNECTABLE=false};OG.shape.elec.HierarchyBldg.prototype=new OG.shape.HorizontalPoolShape();OG.shape.elec.HierarchyBldg.superclass=OG.shape.HorizontalPoolShape;OG.shape.elec.HierarchyBldg.prototype.constructor=OG.shape.elec.HierarchyBldg;OG.HierarchyBldg=OG.shape.elec.HierarchyBldg;OG.shape.elec.HierarchyBldg.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"vertical","vertical-align":"top",fill:"#ffffff","fill-opacity":0,"title-size":26,"label-fill":"#428bca","label-fill-opacity":1,"font-weight":700,"font-color":"white"});return this.geom};OG.shape.elec.HierarchyBldg.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.HierarchyFeeder=function(a){OG.shape.elec.HierarchyFeeder.superclass.call(this);this.SHAPE_ID="OG.shape.elec.HierarchyFeeder";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.textList=[{text:"cable",label:"",shape:"OG.CableShape"},{text:"IPB",label:"IPB",shape:"OG.BusductShape"},{text:"SPB",label:"SPB",shape:"OG.BusductShape"},{text:"NSPB",label:"NSPB",shape:"OG.BusductShape"},{text:"CRB",label:"CRB",shape:"OG.BusductShape"}]};OG.shape.elec.HierarchyFeeder.prototype=new OG.shape.GeomShape();OG.shape.elec.HierarchyFeeder.superclass=OG.shape.GeomShape;OG.shape.elec.HierarchyFeeder.prototype.constructor=OG.shape.elec.HierarchyFeeder;OG.HierarchyFeeder=OG.shape.elec.HierarchyFeeder;OG.shape.elec.HierarchyFeeder.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":4});b=new OG.geometry.Polygon([[30,80],[30,20],[70,20],[70,30],[40,30],[40,40],[70,40],[70,50],[40,50],[40,80],[30,80]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200});return this.geom};OG.shape.elec.HierarchyFeeder.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.SWGR_TYPE+" Swgr"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.HierarchyFloor=function(a){OG.shape.elec.HierarchyFloor.superclass.call(this);this.SHAPE_ID="OG.shape.elec.HierarchyFloor";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.CONNECTABLE=false};OG.shape.elec.HierarchyFloor.prototype=new OG.shape.HorizontalPoolShape();OG.shape.elec.HierarchyFloor.superclass=OG.shape.HorizontalPoolShape;OG.shape.elec.HierarchyFloor.prototype.constructor=OG.shape.elec.HierarchyFloor;OG.HierarchyFloor=OG.shape.elec.HierarchyFloor;OG.shape.elec.HierarchyFloor.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"vertical","vertical-align":"top",fill:"#ffffff","fill-opacity":0,"title-size":26,"label-fill":"#428bca","label-fill-opacity":1,"font-weight":700,"font-color":"white"});return this.geom};OG.shape.elec.HierarchyFloor.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.HierarchyFloor.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.Location=function(a){OG.shape.elec.Location.superclass.call(this);this.SHAPE_ID="OG.shape.elec.Location";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.textList=[{text:"Raceway",label:"",shape:"OG.RacewayShape"}]};OG.shape.elec.Location.prototype=new OG.shape.GeomShape();OG.shape.elec.Location.superclass=OG.shape.GeomShape;OG.shape.elec.Location.prototype.constructor=OG.shape.elec.Location;OG.Location=OG.shape.elec.Location;OG.shape.elec.Location.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"fill-r":1,"fill-cx":0.1,"fill-cy":0.1,"stroke-width":1.2,fill:"r(.1, .1)#428bca-#ffffff","fill-opacity":1,r:"10"});return this.geom};OG.shape.elec.Location.prototype.createSubShape=function(){if(!this.data){return}this.sub=[];return this.sub};OG.shape.elec.Location.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.MILoad=function(a){OG.shape.elec.MILoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.MILoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.MILoad.prototype=new OG.shape.elec.Load();OG.shape.elec.MILoad.superclass=OG.shape.elec.Load;OG.shape.elec.MILoad.prototype.constructor=OG.shape.elec.MILoad;OG.MILoad=OG.shape.elec.MILoad;OG.shape.elec.MILoad.prototype.createShape=function(){var l,k,j,i,h,g,f,e,d,c,b,a,m=[];if(this.geom){return this.geom}l=new OG.geometry.Polygon([[10,0],[27,10],[10,20]]);k=new OG.geometry.Polygon([[44,0],[27,10],[44,20]]);j=new OG.geometry.Line([27,10],[27,20]);i=new OG.geometry.Circle([27,27],7);h=new OG.geometry.PolyLine([[24,30],[24,24],[27,28],[30,24],[30,30]]);g=new OG.geometry.Polygon([[10,40],[27,50],[10,60]]);f=new OG.geometry.Polygon([[44,40],[27,50],[44,60]]);e=new OG.geometry.Line([27,50],[27,60]);d=new OG.geometry.Circle([27,67],7);c=new OG.geometry.PolyLine([[24,70],[24,64],[27,68],[30,64],[30,70]]);b=new OG.geometry.PolyLine([[10,10],[0,10],[0,34],[10,34],[10,40]]);a=new OG.geometry.PolyLine([[44,10],[54,10],[54,34],[44,34],[44,40]]);m.push(l);m.push(k);m.push(j);m.push(i);m.push(h);m.push(g);m.push(f);m.push(e);m.push(d);m.push(c);m.push(b);m.push(a);this.geom=new OG.geometry.GeometryCollection(m);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.MILoad.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.MKLoad=function(a){OG.shape.elec.MKLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.MKLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.MKLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.MKLoad.superclass=OG.shape.elec.Load;OG.shape.elec.MKLoad.prototype.constructor=OG.shape.elec.MKLoad;OG.MKLoad=OG.shape.elec.MKLoad;OG.shape.elec.MKLoad.prototype.createShape=function(){var f,e,d,c,a,b=[];if(this.geom){return this.geom}f=new OG.geometry.Polygon([[10,0],[27,10],[10,20]]);e=new OG.geometry.Polygon([[44,0],[27,10],[44,20]]);d=new OG.geometry.Line([27,10],[27,20]);c=new OG.geometry.Circle([27,27],7);a=new OG.geometry.PolyLine([[24,30],[24,24],[27,28],[30,24],[30,30]]);b.push(f);b.push(e);b.push(d);b.push(c);b.push(a);this.geom=new OG.geometry.GeometryCollection(b);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.MKLoad.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.MOLoad=function(a){OG.shape.elec.MOLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.MOLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.MOLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.MOLoad.superclass=OG.shape.elec.Load;OG.shape.elec.MOLoad.prototype.constructor=OG.shape.elec.MOLoad;OG.MOLoad=OG.shape.elec.MOLoad;OG.shape.elec.MOLoad.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.MOLoad.prototype.createSubShape=function(){this.sub=[{shape:new OG.TextShape("M"),width:"100%",height:"50%",align:"center","vertical-align":"middle",style:{"font-size":20,"font-color":"black","text-anchor":"middle"}}];if(this.data){this.sub.push({shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}})}return this.sub};OG.shape.elec.Manhole=function(b,a){OG.shape.elec.Manhole.superclass.call(this,b,a);this.SHAPE_ID="OG.shape.elec.Manhole";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;if(!b){this.image="resources/images/elec/manhole.svg"}this.textList=[{text:"Raceway",label:"",shape:"OG.RacewayShape"}]};OG.shape.elec.Manhole.prototype=new OG.shape.ImageShape();OG.shape.elec.Manhole.superclass=OG.shape.ImageShape;OG.shape.elec.Manhole.prototype.constructor=OG.shape.elec.Manhole;OG.Manhole=OG.shape.elec.Manhole;OG.shape.elec.Manhole.prototype.createSubShape=function(){if(!this.data){return}this.sub=[];return this.sub};OG.shape.elec.Manhole.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.NMLoad=function(a){OG.shape.elec.NMLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.NMLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.NMLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.NMLoad.superclass=OG.shape.elec.Load;OG.shape.elec.NMLoad.prototype.constructor=OG.shape.elec.NMLoad;OG.NMLoad=OG.shape.elec.NMLoad;OG.shape.elec.NMLoad.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,80);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.NMLoad.prototype.createSubShape=function(){this.sub=[{shape:new OG.TextShape("NM"),width:"100%",height:"50%",align:"center","vertical-align":"middle",style:{"font-size":20,"font-color":"black","text-anchor":"middle"}}];if(this.data){this.sub.push({shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}})}return this.sub};OG.shape.elec.PKGLoad=function(a){OG.shape.elec.PKGLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.PKGLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.PKGLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.PKGLoad.superclass=OG.shape.elec.Load;OG.shape.elec.PKGLoad.prototype.constructor=OG.shape.elec.PKGLoad;OG.PKGLoad=OG.shape.elec.PKGLoad;OG.shape.elec.PKGLoad.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,80);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.PKGLoad.prototype.createSubShape=function(){this.sub=[{shape:new OG.TextShape("PKG"),width:"100%",height:"50%",align:"center","vertical-align":"middle",style:{"font-size":20,"font-color":"black","text-anchor":"middle"}}];if(this.data){this.sub.push({shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}})}return this.sub};OG.shape.elec.RacewayShape=function(c,b,a){OG.shape.elec.RacewayShape.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.elec.RacewayShape"};OG.shape.elec.RacewayShape.prototype=new OG.shape.EdgeShape();OG.shape.elec.RacewayShape.superclass=OG.shape.EdgeShape;OG.shape.elec.RacewayShape.prototype.constructor=OG.shape.elec.RacewayShape;OG.RacewayShape=OG.shape.elec.RacewayShape;OG.shape.elec.RacewayShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[70,0]);var a={multi:[{top:-10,from:"start",to:"end",style:{}},{top:10,from:"start",to:"end",style:{}},{top:0,from:"start",to:"end",style:{pattern:{id:"OG.pattern.HatchedPattern",thickness:10,"unit-width":12,"unit-height":12,"pattern-width":8,"pattern-height":8,style:{stroke:"black"}},stroke:"none",}},{top:0,from:"start",to:"end",style:{"fill-opacity":1,animation:[{start:{stroke:"white"},to:{stroke:"#d9534f"},ms:1000},{start:{stroke:"#d9534f"},to:{stroke:"white"},ms:1000,delay:1000}],"animation-repeat":true,stroke:"#d9534f","stroke-width":"5"}}]};if(this.data&&this.data.selected){a.stroke="#d9534f";a["stroke-width"]=2;a.multi[2]["style"]["pattern"]["style"]["stroke"]="#d9534f"}this.geom.style=new OG.geometry.Style(a);return this.geom};OG.shape.elec.RacewayShape.prototype.createContextMenu=function(){var c=this;var a={"":""};if(this.data&&this.data.pathList){for(var b=0;b=c[0]&&b[1]<=c[1]&&b[1]+g>=c[1]){j=f}}}});for(var e in d.data.viewData.columns){f=d.data.viewData.columns[e];b=f.offset;a=f.width;g=f.height;if(b[0]<=c[0]&&b[0]+a>=c[0]&&b[1]<=c[1]&&b[1]+g>=c[1]){j=f}}return j};OG.shape.component.DataTable.prototype.getCellViewFromContent=function(e){var b=this;var d,a,c=null;if(e&&e.nodeType==1&&b.currentCanvas.getRenderer().isShape(e)){d=b.data.viewData.rows;$.each(d,function(f,h){for(var g in h.cells){c=h.cells[g];if(c.contents&&c.contents.length){$.each(c.contents,function(i,j){if(j==e.id){a=c}})}}})}return a};OG.shape.component.DataTable.prototype.emptyCell=function(d,a){var b=this;var c=b.getCellInformation(d);b.data.viewData.rows[c.rowIndex].cells[c.column]["value"]=null;b.data.tableData[c.rowDataIndex][c.column]=null;if(c.contents&&c.contents.length){$.each(c.contents,function(e,f){if(!a){b.currentCanvas.removeShape(f,true)}})}b.data.viewData.rows[c.rowIndex].cells[c.column]["contents"]=[];b.drawCell(d,true)};OG.shape.component.DataTable.prototype.addCellContent=function(e,f,d){var a=this;if(f&&f.nodeType==1&&a.currentCanvas.getRenderer().isShape(f)){var c=a.getCellInformation(e);if(!c.contents){c.contents=[];a.data.viewData.rows[c.rowIndex].cells[c.column]["contents"]=[]}var b=false;$.each(c.contents,function(h,j){if(j==f.id){b=true}});if(b){return}var g=a.removeCellContent(f,true);if(!d&&g){d=g}if(!d){d=f.shape.data?f.shape.data:{}}a.data.viewData.rows[c.rowIndex].cells[c.column]["contents"].push(f.id);if(!a.data.viewData.rows[c.rowIndex].cells[c.column]["value"]){a.data.viewData.rows[c.rowIndex].cells[c.column]["value"]=[];a.data.tableData[c.rowDataIndex][c.column]=[]}if(typeof a.data.viewData.rows[c.rowIndex].cells[c.column]["value"]=="object"){a.data.viewData.rows[c.rowIndex].cells[c.column]["value"].push(d);a.data.tableData[c.rowDataIndex][c.column].push(d)}a.drawCell(e,true)}};OG.shape.component.DataTable.prototype.removeCellContent=function(e,a){var b=this;var d=b.getCellViewFromContent(e);if(!d){return null}var c=b.getCellInformation(d);var f;if(c.contents&&c.contents.length){$.each(c.contents,function(g,h){if(h==e.id){if(!a){b.currentCanvas.removeShape(e,true)}b.data.viewData.rows[c.rowIndex].cells[c.column]["contents"].splice(g,1);var j=b.data.viewData.rows[c.rowIndex].cells[c.column]["value"];if(j&&typeof j=="object"){var k=JSON.parse(JSON.stringify(j));j.splice(g,1);b.data.tableData[c.rowDataIndex][c.column]=j;f=k[g]}b.drawCell(d,true)}})}return f};OG.shape.component.DataTable.prototype.redrawCell=function(b){var a=this;a.drawCell(b,"saved")};OG.shape.component.DataTable.prototype.reconnectEdgesToContent=function(m){var h=this;var b,j,c,g,o,k,f,l;var e=h.getCellInformation(m);var a=h.data.viewData.rows[e.rowDataIndex].cells[e.column]["connection"];if(a&&a.length&&e.contentElements){for(var d=0,n=a.length;df){o=true}else{if(g.indexOf(n)!=-1){o=true}}if(o){if(j.currentCanvas.getElementById(c)){j.currentCanvas.removeShape(c)}if(k&&j.currentCanvas.getElementById(k)){j.currentCanvas.removeShape(k)}}}}j.data.viewData.rows.splice(f,m)};OG.shape.component.DataTable.prototype.draw=function(n){var g=new Date();var o=this;o.grid=[];var y=o.currentCanvas.getBoundary(o.currentElement);if(!o.options.columns){throw new Error("No column options to render")}if(!o.data||!o.data.tableData){throw new Error("No table data to render")}var w=y.getUpperLeft();var u=0;var t=0;var B;var l=o.options.columns;var H;if(!n){}var C,j,K;for(var M=0,A=l.length;M0){g[D].left=r+C;r=r+l+C}else{g[D].left=r;r=r+l}if(u0){g[D].top=u+C;u=u+z+C}else{g[D].top=u;u=u+z}if(r=this.length){var c=b-this.length;while((c--)+1){this.push(undefined)}}this.splice(b,0,this.splice(d,1)[0]);return this}};OG.shape.component.DataTable.prototype=new OG.shape.GroupShape();OG.shape.component.DataTable.superclass=OG.shape.GroupShape;OG.shape.component.DataTable.prototype.constructor=OG.shape.component.DataTable;OG.DataTable=OG.shape.component.DataTable;OG.shape.component.DataTable.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({fill:"#ffffff","fill-opacity":0,"font-size":10,"font-color":"white",stroke:"none"});return this.geom};OG.shape.component.DataTable.prototype.createSubShape=function(){if(!this.geom.style.map){return}this.sub=[];var grid,gridData;if(this.data.viewData.grid){for(var i=0,leni=this.data.viewData.grid.length;ig){n=true}else{if(i.indexOf(m)==-1){n=true}}if(n){if(c&&c.length){$.each(c,function(q,l){if(h.currentCanvas.getElementById(l)){h.currentCanvas.removeShape(l)}})}delete p.cells[m]}}}h.data.viewData.rows.splice(g,j)};OG.shape.component.DataTable.prototype.getCellViewFromOffset=function(c){var d=this;var i,h,f,j,b,a,g;i=d.data.viewData.rows;$.each(i,function(k,m){h=m.cells;if(h){for(var l in h){f=h[l];b=f.offset;a=f.width;g=f.height;if(b[0]<=c[0]&&b[0]+a>=c[0]&&b[1]<=c[1]&&b[1]+g>=c[1]){j=f}}}});for(var e in d.data.viewData.columns){f=d.data.viewData.columns[e];b=f.offset;a=f.width;g=f.height;if(b[0]<=c[0]&&b[0]+a>=c[0]&&b[1]<=c[1]&&b[1]+g>=c[1]){j=f}}return j};OG.shape.component.DataTable.prototype.getCellViewFromContent=function(e){var b=this;var d,a,c=null;if(e&&e.nodeType==1&&b.currentCanvas.getRenderer().isShape(e)){d=b.data.viewData.rows;$.each(d,function(f,h){for(var g in h.cells){c=h.cells[g];if(c.contents&&c.contents.length){$.each(c.contents,function(i,j){if(j==e.id){a=c}})}}})}return a};OG.shape.component.DataTable.prototype.emptyCell=function(d,a){var b=this;var c=b.getCellInformation(d);b.data.viewData.rows[c.rowIndex].cells[c.column]["value"]=null;b.data.tableData[c.rowDataIndex][c.column]=null;if(c.contents&&c.contents.length){$.each(c.contents,function(e,f){if(!a){b.currentCanvas.removeShape(f,true)}})}b.data.viewData.rows[c.rowIndex].cells[c.column]["contents"]=[];b.drawCell(d,true)};OG.shape.component.DataTable.prototype.addCellContent=function(o,p){var l=this,n,j,b,r,a,m;var h=l.getCellInformation(o);if(!h.contents){h.contents=[];l.data.viewData.rows[h.rowIndex].cells[h.column]["contents"]=[]}if(!h.contentsPosition){h.contentsPosition={}}if(!h.contentsPosition.arrangement){h.contentsPosition.arrangement="horizontal"}var d=function(t,s){var w=[],c;for(var u=0;ub){r=r-1}l.data.viewData.rows[h.rowIndex].cells[h.column]["contents"].move(b,r);l.data.viewData.rows[h.rowIndex].cells[h.column]["value"].move(b,r);l.data.tableData[h.rowDataIndex][h.column]=JSON.parse(JSON.stringify(l.data.viewData.rows[h.rowIndex].cells[h.column]["value"]));l.redrawCell(l.refreshCellView(o))}}}};OG.shape.component.DataTable.prototype.removeCellContent=function(e,a){var b=this;var d=b.getCellViewFromContent(e);if(!d){return null}var c=b.getCellInformation(d);var f;if(c.contents&&c.contents.length){$.each(c.contents,function(g,h){if(h==e.id){if(!a){b.currentCanvas.removeShape(e,true)}b.data.viewData.rows[c.rowIndex].cells[c.column]["contents"].splice(g,1);var j=b.data.viewData.rows[c.rowIndex].cells[c.column]["value"];if(j&&typeof j=="object"){var k=JSON.parse(JSON.stringify(j));j.splice(g,1);b.data.tableData[c.rowDataIndex][c.column]=j;f=k[g]}b.drawCell(d,true)}})}return f};OG.shape.component.DataTable.prototype.redrawCell=function(b){var a=this;a.drawCell(b,"saved")};OG.shape.component.DataTable.prototype.reconnectEdgesToContent=function(m){var h=this;var b,j,c,g,o,k,f,l;var e=h.getCellInformation(m);var a=h.data.viewData.rows[e.rowDataIndex].cells[e.column]["connection"];if(a&&a.length&&e.contentElements){for(var d=0,n=a.length;d0){y[F].left=A+x;A=A+L+x}else{y[F].left=A;A=A+L}if(H0){y[F].top=H+x;H=H+p+x}else{y[F].top=H;H=H+p}if(AMath.abs(d.y-a.y)){c="e";b="w"}else{c="s";b="n"}}else{if(a.x<=d.x&&a.y>d.y){if(Math.abs(d.x-a.x)>Math.abs(d.y-a.y)){c="e";b="w"}else{c="n";b="s"}}else{if(a.x>d.x&&a.y<=d.y){if(Math.abs(d.x-a.x)>Math.abs(d.y-a.y)){c="w";b="e"}else{c="s";b="n"}}else{if(a.x>d.x&&a.y>d.y){if(Math.abs(d.x-a.x)>Math.abs(d.y-a.y)){c="w";b="e"}else{c="n";b="s"}}}}}return[c,b]},_getShapeFromTerminal:function(b){var a;if(b){var c=b.substring(0,b.indexOf(OG.Constants.TERMINAL));a=this.getElementById(c)}return a},drawShape:function(a,b,c,d,e){throw new OG.NotImplementedException()},drawGeom:function(b,a,c){throw new OG.NotImplementedException()},drawText:function(a,d,b,c,e){throw new OG.NotImplementedException()},drawImage:function(a,d,b,c,e){throw new OG.NotImplementedException()},drawEdge:function(a,c,d,b){throw new OG.NotImplementedException()},drawLabel:function(a,c,b){throw new OG.NotImplementedException()},drawEdgeLabel:function(a,c,b){throw new OG.NotImplementedException()},redrawShape:function(a,b){throw new OG.NotImplementedException()},redrawConnectedEdge:function(a){throw new OG.NotImplementedException()},connect:function(f,b,e,d,c,a){throw new OG.NotImplementedException()},disconnect:function(a){throw new OG.NotImplementedException()},drawDropOverGuide:function(a){throw new OG.NotImplementedException()},drawGuide:function(a){throw new OG.NotImplementedException()},removeGuide:function(a){throw new OG.NotImplementedException()},removeAllGuide:function(){throw new OG.NotImplementedException()},removeConnectGuide:function(){throw new OG.NotImplementedException()},removeAllConnectGuide:function(){throw new OG.NotImplementedException()},removeOtherConnectGuide:function(){throw new OG.NotImplementedException()},removeAllVirtualEdge:function(){throw new OG.NotImplementedException()},drawEdgeGuide:function(a){throw new OG.NotImplementedException()},drawRubberBand:function(a,b,c){throw new OG.NotImplementedException()},removeRubberBand:function(a){throw new OG.NotImplementedException()},drawDraggableGuide:function(a){throw new OG.NotImplementedException()},drawCollapseGuide:function(a){throw new OG.NotImplementedException()},removeCollapseGuide:function(a){throw new OG.NotImplementedException()},group:function(a){throw new OG.NotImplementedException()},ungroup:function(a){throw new OG.NotImplementedException()},addToGroup:function(a,c,b){throw new OG.NotImplementedException()},collapse:function(a){throw new OG.NotImplementedException()},expand:function(a){throw new OG.NotImplementedException()},clear:function(){throw new OG.NotImplementedException()},removeShape:function(a){throw new OG.NotImplementedException()},remove:function(a){throw new OG.NotImplementedException()},removeChild:function(a){throw new OG.NotImplementedException()},getRootElement:function(){throw new OG.NotImplementedException()},getRootGroup:function(){return this._ROOT_GROUP.node},getElementByPoint:function(a){throw new OG.NotImplementedException()},getElementsByBBox:function(b){var a=[];$(this.getRootElement()).find("[_type="+OG.Constants.NODE_TYPE.SHAPE+"]").each(function(c,d){if(d.shape.geom&&b.isContainsAll(d.shape.geom.getVertices())){a.push(d)}});return a},setAttr:function(a,b){throw new OG.NotImplementedException()},getAttr:function(b,a){throw new OG.NotImplementedException()},setShapeStyle:function(a,b){throw new OG.NotImplementedException()},toFront:function(a){throw new OG.NotImplementedException()},toBack:function(a){throw new OG.NotImplementedException()},bringForward:function(a){throw new OG.NotImplementedException()},sendBackward:function(a){throw new OG.NotImplementedException()},getCanvasSize:function(){throw new OG.NotImplementedException()},setCanvasSize:function(a){throw new OG.NotImplementedException()},fitCanvasSize:function(b,a){throw new OG.NotImplementedException()},setViewBox:function(a,b,c){throw new OG.NotImplementedException()},getScale:function(){throw new OG.NotImplementedException()},setScale:function(a){throw new OG.NotImplementedException()},show:function(a){throw new OG.NotImplementedException()},hide:function(a){throw new OG.NotImplementedException()},appendChild:function(a,b){throw new OG.NotImplementedException()},insertAfter:function(a,b){throw new OG.NotImplementedException()},insertBefore:function(a,b){throw new OG.NotImplementedException()},move:function(a,b){throw new OG.NotImplementedException()},moveCentroid:function(b,a){throw new OG.NotImplementedException()},rotate:function(a,b){throw new OG.NotImplementedException()},resize:function(a,b){throw new OG.NotImplementedException()},resizeBox:function(b,a){throw new OG.NotImplementedException()},clone:function(a){throw new OG.NotImplementedException()},getElementById:function(a){throw new OG.NotImplementedException()},getElementsByType:function(c,a){var b=this.getRootGroup();if(c&&a){return $(b).find("[_type=SHAPE][_shape="+c+"][_shape!="+a+"]")}else{if(c){return $(b).find("[_type=SHAPE][_shape="+c+"]")}else{if(a){return $(b).find("[_type=SHAPE][_shape!="+a+"]")}else{return $(b).find("[_type=SHAPE]")}}}},getBBox:function(a){throw new OG.NotImplementedException()},getRootBBox:function(){throw new OG.NotImplementedException()},getRealRootBBox:function(){var f=Number.MAX_VALUE,d=Number.MAX_VALUE,c=Number.MIN_VALUE,a=Number.MIN_VALUE,e=this.getElementsByType(),j,k,b,h,g,l={width:0,height:0,x:0,y:0,x2:0,y2:0};for(var g=0,m=e.length;gb.x?b.x:f;d=d>b.y?b.y:d;c=c=0;b--){this._remove(this._getREleById(c[b].id))}this._ELE_MAP.remove(a.id);a.remove()}};OG.renderer.RaphaelRenderer.prototype._removeChild=function(a){var c,b;if(a){c=a.node.childNodes;for(b=c.length-1;b>=0;b--){if(c[b].tagName=="svg"){c[b].parentNode.removeChild(c[b])}else{this._remove(this._getREleById(c[b].id))}}}};OG.renderer.RaphaelRenderer.prototype._getREleById=function(a){return this._ELE_MAP.get(a)};OG.renderer.RaphaelRenderer.prototype._drawSubShape=function(f){var H=this,g,y,s,q,d,o,G,j,x,a,E,h,r,w,B,p,A,m,C,n,u,D=[];if(!f.shape.createSubShape){return}g=f.shape.createSubShape();if(!g||!g.length){return}for(var z=0,c=g.length;z=0){f.appendChild(i)}else{if(!k){f.appendChild(i)}else{f.insertBefore(i,k)}}});H._remove(H._getREleById($(t).attr("id")))}};OG.renderer.RaphaelRenderer.prototype._drawGeometry=function(groupElement,geometry,style,parentStyle,isEdge){var me=this,i=0,pathStr="",vertices,element,geomObj,_style={},connectGuideElement;var svg=me.getRootElement();var getRoundedPath=function(rectangle,radius){var rectObj,rectVert,offset1,offset2,angle,array=[],getRoundedOffset=function(coord,dist,deg){var theta=Math.PI/180*deg;return new OG.geometry.Coordinate(OG.Util.round(coord.x+dist*Math.cos(theta)),OG.Util.round(coord.y+dist*Math.sin(theta)))};rectObj=OG.JSON.decode(rectangle.toString());rectVert=rectangle.getVertices();angle=rectObj.angle;offset1=getRoundedOffset(rectVert[0],radius,90+angle);offset2=getRoundedOffset(rectVert[0],radius,angle);array=array.concat(["M",offset1.x,offset1.y,"Q",rectVert[0].x,rectVert[0].y,offset2.x,offset2.y]);offset1=getRoundedOffset(rectVert[1],radius,180+angle);offset2=getRoundedOffset(rectVert[1],radius,90+angle);array=array.concat(["L",offset1.x,offset1.y,"Q",rectVert[1].x,rectVert[1].y,offset2.x,offset2.y]);offset1=getRoundedOffset(rectVert[2],radius,270+angle);offset2=getRoundedOffset(rectVert[2],radius,180+angle);array=array.concat(["L",offset1.x,offset1.y,"Q",rectVert[2].x,rectVert[2].y,offset2.x,offset2.y]);offset1=getRoundedOffset(rectVert[3],radius,angle);offset2=getRoundedOffset(rectVert[3],radius,270+angle);array=array.concat(["L",offset1.x,offset1.y,"Q",rectVert[3].x,rectVert[3].y,offset2.x,offset2.y,"Z"]);return array.toString()},getConnectGuideStyle=function(){return me._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_EVENT_AREA},setConnectGuideAttr=function(ele){ele.attr(getConnectGuideStyle())};if(parentStyle){OG.Util.apply(_style,(style instanceof OG.geometry.Style)?style.map:style||{},OG.Util.apply({},geometry.style.map,OG.Util.apply({},parentStyle,me._CONFIG.DEFAULT_STYLE.GEOM)))}else{OG.Util.apply(_style,(style instanceof OG.geometry.Style)?style.map:style||{},OG.Util.apply({},geometry.style.map,me._CONFIG.DEFAULT_STYLE.GEOM))}var multi=_style.multi;var rootMarker=_style.marker;var rootPattern=_style.pattern;var rootAnimation=_style.animation;var marker,pattern;var drawMulti=function(vertices){var multiData,top,from,to,nodeId,multiStyle;var getSubDistance=function(nodePath,distance){var totalLenth=Raphael.getTotalLength(nodePath);var length;if(typeof distance=="number"){length=distance}else{if(typeof distance=="string"){if(distance.indexOf("px")!=-1){length=parseInt(distance.replace("px",""))}if(distance.indexOf("%")!=-1){distance=parseInt(distance.replace("%",""));length=totalLenth*(distance/100)}else{if(distance=="start"){length=0}else{if(distance=="center"){length=totalLenth/2}else{if(distance=="end"){length=totalLenth}else{if(distance.indexOf("end-")!=-1){length=totalLenth-getSubDistance(nodePath,distance.replace("end-",""))}else{distance=parseInt(distance);length=distance}}}}}}}return length};for(var m=0,lenm=multi.length;m");me._remove(me._getREleById(tempNode.id));cloneNode.removeAttr("_type");cloneNode.removeAttr("_shape");cloneNode.removeAttr("id");cloneNode.children().each(function(){$(this).removeAttr("_type");$(this).removeAttr("_shape");$(this).removeAttr("id");$(this).removeAttr("marker-end");$(this).removeAttr("marker-start");$(this).removeAttr("marker-mid")});var data={id:patternId,x:0,y:0,width:patternWidth,height:patternHeight,patternUnits:"userSpaceOnUse"};if(patternTransform){data.patternTransform=patternTransform}var el=document.createElementNS("http://www.w3.org/2000/svg","pattern");el.appendChild(cloneNode.get(0));for(var k in data){el.setAttribute(k,data[k])}$(svg).find("defs").get(0).appendChild(el);if(isEdge){if(!thickness||thickness==0){return}var pathStr;var topVertices=geometry.getParallelPath(vertices,thickness);var bottomVertices=geometry.getParallelPath(vertices,-thickness);bottomVertices=bottomVertices.reverse();var newVertices=topVertices.concat(bottomVertices);for(var l=0,lenl=newVertices.length;l");me._remove(me._getREleById(tempNode.id));if(key=="start"){cloneNode.attr("transform","rotate(180,"+size[0]/2+","+size[1]/2+")")}cloneNode.removeAttr("_type");cloneNode.removeAttr("_shape");cloneNode.removeAttr("id");cloneNode.children().each(function(){$(this).removeAttr("_type");$(this).removeAttr("_shape");$(this).removeAttr("id");$(this).removeAttr("marker-end");$(this).removeAttr("marker-start");$(this).removeAttr("marker-mid")});var data={id:markerId,refX:ref[0],refY:ref[1],markerWidth:size[0],markerHeight:size[1],orient:"auto"};var el=document.createElementNS("http://www.w3.org/2000/svg","marker");el.appendChild(cloneNode.get(0));for(var k in data){el.setAttribute(k,data[k])}$(svg).find("defs").get(0).appendChild(el);makerData[key]=data}rElement.attr("stroke-opacity","0");var totalLenth=Raphael.getTotalLength(nodePath);var from,to;if(makerData.start&&makerData.end){from=makerData.start["markerWidth"]*1.5;to=totalLenth-makerData.end["markerWidth"]*1.5}else{if(makerData.start&&!makerData.end){from=makerData.start["markerWidth"]*1.5;to=totalLenth}else{if(!makerData.start&&makerData.end){from=0;to=totalLenth-makerData.end["markerWidth"]*1.5}else{from=0;to=totalLenth}}}var subPath=Raphael.getSubpath(nodePath,from,to);var virtualNode=me._PAPER.path(subPath);virtualNode.attr(nodeStyle);for(var key in makerData){$(virtualNode.node).attr("marker-"+key,"url(#"+makerData[key].id+")")}me._add(virtualNode);groupElement.appendChild(virtualNode.node)};var drawAnimation=function(rElement,nodeStyle){var animationData=nodeStyle.animation;var animationRepeat=nodeStyle["animation-repeat"];var maxDuration=0;var monitorAnimationIndex;var delay,ms;for(var i=0,leni=animationData.length;iv._CONFIG.LABEL_MAX_SIZE){o[0]=v._CONFIG.LABEL_MAX_SIZE}}c=this._PAPER.text(w[0],w[1],m,o);c.attr(h);g=c.getBBox();r=r?(r>g.width?r:g.width):g.width;p=p?(p>g.height?p:g.height):g.height;d=OG.Util.round(w[0]-r/2);n=OG.Util.round(w[1]-p/2);s=new OG.Rectangle([d,n],r,p);if(h["label-direction"]==="vertical"){switch(j){case"start":k=s.getBoundary().getLowerCenter().y;break;case"end":k=s.getBoundary().getUpperCenter().y;break;case"middle":k=s.getBoundary().getCentroid().y;break;default:k=s.getBoundary().getCentroid().y;break}switch(h["vertical-align"]){case"top":l=OG.Util.round(s.getBoundary().getLeftCenter().x+g.height/2);break;case"bottom":l=OG.Util.round(s.getBoundary().getRightCenter().x-g.height/2);break;case"middle":l=s.getBoundary().getCentroid().x;break;default:l=s.getBoundary().getCentroid().x;break}u=-90}else{switch(j){case"start":l=s.getBoundary().getLeftCenter().x;break;case"end":l=s.getBoundary().getRightCenter().x;break;case"middle":l=s.getBoundary().getCentroid().x;break;default:l=s.getBoundary().getCentroid().x;break}switch(h["vertical-align"]){case"top":k=OG.Util.round(s.getBoundary().getUpperCenter().y+g.height/2);break;case"bottom":k=OG.Util.round(s.getBoundary().getLowerCenter().y-g.height/2);break;case"middle":k=s.getBoundary().getCentroid().y;break;default:k=s.getBoundary().getCentroid().y;break}}c.attr({x:l,y:k,stroke:"none",fill:h["font-color"]||v._CONFIG.DEFAULT_STYLE.LABEL["font-color"],"font-size":h["font-size"]||v._CONFIG.DEFAULT_STYLE.LABEL["font-size"],"fill-opacity":1});if(m!=""){$(c.node).css({"background-color":h.fill||v._CONFIG.DEFAULT_STYLE.LABEL.fill})}$(c.node).css({cursor:"move"});if(u||h["label-angle"]){if(u===0){u=parseInt(h["label-angle"],10)}c.rotate(u)}c.attr({"text-anchor":j});if(f&&m){g=c.getBBox();b=this._PAPER.rect(g.x-e/2,g.y-e/2,g.width+e,g.height+e);var a=this._CANVAS_COLOR;if(a=="transparent"){a="white"}b.attr({stroke:"none",fill:a,"fill-opacity":1});this._add(b);i.node.appendChild(b.node)}this._add(c,q+"FO");i.node.appendChild(c.node);return i.node};OG.renderer.RaphaelRenderer.prototype.drawShape=function(h,i,o,a,c,l){var d=o?o[0]:100,n=o?o[1]:100,b,k,m,e,g,f,j=this;i.currentCanvas=this._CANVAS;if(i instanceof OG.shape.GeomShape){k=i.createShape();k.moveCentroid(h);k.resizeBox(d,n);b=this.drawGeom(k,a,c);i.geom=b.geom}else{if(i instanceof OG.shape.TextShape){m=i.createShape();b=this.drawText(h,m,o,a,c);i.text=b.text;i.angle=b.angle;i.geom=b.geom}else{if(i instanceof OG.shape.ImageShape){e=i.createShape();b=this.drawImage(h,e,o,a,c);i.image=b.image;i.angle=b.angle;i.geom=b.geom}else{if(i instanceof OG.shape.SvgShape){f=i.createShape();b=this.drawSvg(h,f,o,a,c);i.xml=b.xml;i.angle=b.angle;i.geom=b.geom}else{if(i instanceof OG.shape.HtmlShape){g=i.createShape();b=this.drawHtml(h,g,o,a,c);i.html=b.html;i.angle=b.angle;i.geom=b.geom}else{if(i instanceof OG.shape.EdgeShape){k=i.geom||i.createShape();b=this.drawEdge(k,a,c);i.geom=b.geom}else{if(i instanceof OG.shape.GroupShape){k=i.createShape();k.moveCentroid(h);k.resizeBox(d,n);b=this.drawGroup(k,a,c);i.geom=b.geom}}}}}}}if(i.geom){b.shape=i}b.shapeStyle=(a instanceof OG.geometry.Style)?a.map:a;$(b).attr("_shape_id",i.SHAPE_ID);j._drawSubShape(b);if(!(i instanceof OG.shape.TextShape)){this.drawLabel(b);if(i instanceof OG.shape.EdgeShape){this.drawEdgeLabel(b,null,"FROM");this.drawEdgeLabel(b,null,"TO")}}if(b.geom){if(OG.Util.isIE7()){b.removeAttribute("geom")}else{delete b.geom}}if(b.text){if(OG.Util.isIE7()){b.removeAttribute("text")}else{delete b.text}}if(b.image){if(OG.Util.isIE7()){b.removeAttribute("image")}else{delete b.image}}if(b.angle){if(OG.Util.isIE7()){b.removeAttribute("angle")}else{delete b.angle}}i.currentElement=b;if(!l){i.onDrawShape();$(this._PAPER.canvas).trigger("drawShape",[b])}return b};OG.renderer.RaphaelRenderer.prototype.drawGeom=function(e,b,f){var c=this,d,a={};OG.Util.apply(a,(b instanceof OG.geometry.Style)?b.map:b||{});if(f===0||f){d=this._getREleById(f);if(d){this._removeChild(d)}else{d=this._PAPER.group();this._add(d,f,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.GEOM);this._ROOT_GROUP.node.appendChild(d.node)}}else{d=this._PAPER.group();this._add(d,f,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.GEOM);this._ROOT_GROUP.node.appendChild(d.node)}this._drawGeometry(d.node,e,a);d.node.geom=e;d.attr(c._CONFIG.DEFAULT_STYLE.SHAPE);if(d.node.shape){d.node.shape.geom=e;if(d.node.geom){if(OG.Util.isIE7()){d.node.removeAttribute("geom")}else{delete d.node.geom}}}return d.node};OG.renderer.RaphaelRenderer.prototype.drawText=function(r,h,j,o,l){var q=this,m=j?j[0]:null,k=j?j[1]:null,p=j?j[2]||0:0,e,a,d={},n,c,b,i,g,f;OG.Util.apply(d,(o instanceof OG.geometry.Style)?o.map:o||{},q._CONFIG.DEFAULT_STYLE.TEXT);if(l===0||l){e=this._getREleById(l);if(e){this._removeChild(e)}else{e=this._PAPER.group();this._add(e,l,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.TEXT);this._ROOT_GROUP.node.appendChild(e.node)}}else{e=this._PAPER.group();this._add(e,l,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.TEXT);this._ROOT_GROUP.node.appendChild(e.node)}a=this._PAPER.text(r[0],r[1],h,j);a.attr(d);c=a.getBBox();m=m?(m>c.width?m:c.width):c.width;k=k?(k>c.height?k:c.height):c.height;b=OG.Util.round(r[0]-m/2);i=OG.Util.round(r[1]-k/2);n=new OG.Rectangle([b,i],m,k);n.style.map=d;switch(d["text-anchor"]){case"start":g=n.getBoundary().getLeftCenter().x;break;case"end":g=n.getBoundary().getRightCenter().x;break;case"middle":g=n.getBoundary().getCentroid().x;break;default:g=n.getBoundary().getCentroid().x;break}switch(d["vertical-align"]){case"top":f=OG.Util.round(n.getBoundary().getUpperCenter().y+c.height/2);break;case"bottom":f=OG.Util.round(n.getBoundary().getLowerCenter().y-c.height/2);break;case"middle":f=n.getBoundary().getCentroid().y;break;default:f=n.getBoundary().getCentroid().y;break}a.attr({x:g,y:f});a.attr({stroke:"none",fill:d["font-color"]||q._CONFIG.DEFAULT_STYLE.LABEL["font-color"],"font-size":d["font-size"]||q._CONFIG.DEFAULT_STYLE.LABEL["font-size"]});if(p){a.rotate(p)}this._add(a);e.node.appendChild(a.node);e.node.text=h;e.node.angle=p;e.node.geom=n;e.attr(q._CONFIG.DEFAULT_STYLE.SHAPE);if(e.node.shape){e.node.shape.text=h;e.node.shape.angle=p;e.node.shape.geom=n;if(e.node.text){if(OG.Util.isIE7()){e.node.removeAttribute("text")}else{delete e.node.text}}if(e.node.angle){if(OG.Util.isIE7()){e.node.removeAttribute("angle")}else{delete e.node.angle}}if(e.node.geom){if(OG.Util.isIE7()){e.node.removeAttribute("geom")}else{delete e.node.geom}}}return e.node};OG.renderer.RaphaelRenderer.prototype.drawHtml=function(i,h,p,a,b){var j=this,c=p?p[0]:null,n=p?p[1]:null,f=p?p[2]||0:0,m,g,e={},o,l,d,k;OG.Util.apply(e,(a instanceof OG.geometry.Style)?a.map:a||{},j._CONFIG.DEFAULT_STYLE.HTML);if(b===0||b){m=this._getREleById(b);if(m){this._removeChild(m)}else{m=this._PAPER.group();this._add(m,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.HTML);this._ROOT_GROUP.node.appendChild(m.node)}}else{m=this._PAPER.group();this._add(m,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.HTML);this._ROOT_GROUP.node.appendChild(m.node)}g=this._PAPER.foreignObject(h,i[0],i[1],c,n);g.attr(e);o=g.getBBox();c=c||o.width;n=n||o.height;d=OG.Util.round(i[0]-c/2);k=OG.Util.round(i[1]-n/2);g.attr({x:d,y:k});l=new OG.Rectangle([d,k],c,n);if(f){g.rotate(f)}l.style.map=e;this._add(g);m.node.appendChild(g.node);m.node.html=h;m.node.angle=f;m.node.geom=l;m.attr(j._CONFIG.DEFAULT_STYLE.SHAPE);if(m.node.shape){m.node.shape.html=h;m.node.shape.angle=f;m.node.shape.geom=l;if(m.node.html){if(OG.Util.isIE7()){m.node.removeAttribute("html")}else{delete m.node.html}}if(m.node.angle){if(OG.Util.isIE7()){m.node.removeAttribute("angle")}else{delete m.node.angle}}if(m.node.geom){if(OG.Util.isIE7()){m.node.removeAttribute("geom")}else{delete m.node.geom}}}return m.node};OG.renderer.RaphaelRenderer.prototype.drawImage=function(h,o,p,a,b){var i=this,c=p?p[0]:null,m=p?p[1]:null,f=p?p[2]||0:0,l,g,e={},n,k,d,j;OG.Util.apply(e,(a instanceof OG.geometry.Style)?a.map:a||{},i._CONFIG.DEFAULT_STYLE.IMAGE);if(b===0||b){l=this._getREleById(b);if(l){this._removeChild(l)}else{l=this._PAPER.group();this._add(l,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.IMAGE);this._ROOT_GROUP.node.appendChild(l.node)}}else{l=this._PAPER.group();this._add(l,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.IMAGE);this._ROOT_GROUP.node.appendChild(l.node)}g=this._PAPER.image(o,h[0],h[1],c,m);g.attr(e);n=g.getBBox();c=c||n.width;m=m||n.height;d=OG.Util.round(h[0]-c/2);j=OG.Util.round(h[1]-m/2);g.attr({x:d,y:j});k=new OG.Rectangle([d,j],c,m);if(f){g.rotate(f)}k.style.map=e;this._add(g);l.node.appendChild(g.node);l.node.image=o;l.node.angle=f;l.node.geom=k;l.attr(i._CONFIG.DEFAULT_STYLE.SHAPE);if(l.node.shape){l.node.shape.image=o;l.node.shape.angle=f;l.node.shape.geom=k;if(l.node.image){if(OG.Util.isIE7()){l.node.removeAttribute("image")}else{delete l.node.image}}if(l.node.angle){if(OG.Util.isIE7()){l.node.removeAttribute("angle")}else{delete l.node.angle}}if(l.node.geom){if(OG.Util.isIE7()){l.node.removeAttribute("geom")}else{delete l.node.geom}}}return l.node};OG.renderer.RaphaelRenderer.prototype.drawSvg=function(i,h,q,a,b){var j=this,c=q?q[0]:null,o=q?q[1]:null,f=q?q[2]||0:0,n,g,e={},p,l,d,k;OG.Util.apply(e,(a instanceof OG.geometry.Style)?a.map:a||{},j._CONFIG.DEFAULT_STYLE.SVG);if(b===0||b){n=this._getREleById(b);if(n){this._removeChild(n)}else{n=this._PAPER.group();this._add(n,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.SVG);this._ROOT_GROUP.node.appendChild(n.node)}}else{n=this._PAPER.group();this._add(n,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.SVG);this._ROOT_GROUP.node.appendChild(n.node)}g=$(h);for(var m in e){g.attr(m,e[m])}d=OG.Util.round(i[0]-c/2);k=OG.Util.round(i[1]-o/2);g.attr("x",d+"px");g.attr("y",k+"px");g.attr("width",c+"px");g.attr("height",o+"px");l=new OG.Rectangle([d,k],c,o);if(f){g.rotate(f)}l.style.map=e;$(n.node).append(g);n.node.xml=h;n.node.angle=f;n.node.geom=l;n.attr(j._CONFIG.DEFAULT_STYLE.SHAPE);if(n.node.shape){n.node.shape.xml=h;n.node.shape.angle=f;n.node.shape.geom=l;if(n.node.image){if(OG.Util.isIE7()){n.node.removeAttribute("image")}else{delete n.node.image}}if(n.node.angle){if(OG.Util.isIE7()){n.node.removeAttribute("angle")}else{delete n.node.angle}}if(n.node.geom){if(OG.Util.isIE7()){n.node.removeAttribute("geom")}else{delete n.node.geom}}}return n.node};OG.renderer.RaphaelRenderer.prototype._getPointOfInflectionFromEdge=function(c){var h=null,g,e,f,d,b,a;if(c instanceof OG.geometry.PolyLine){d=c.getVertices();if(d.length!=4){return h}g=d[0];e=d[d.length-1];f=d[1];h={x:f.x-g.x,y:f.y-g.y};b=OG.Util.round((e.x-g.x)/2);a=OG.Util.round((e.y-g.y)/2);h.x=(h.x==b)?0:h.x;h.y=(h.y==a)?0:h.y}return h};OG.renderer.RaphaelRenderer.prototype.drawEdge=function(n,b,c,f,a){var h=this,m,e={},g=n.getVertices(),k=g[0],j=g[g.length-1],l=[],d,i;OG.Util.apply(e,(b instanceof OG.geometry.Style)?b.map:b||{},OG.Util.apply({},n.style.map,h._CONFIG.DEFAULT_STYLE.EDGE));if(c===0||c){m=this._getREleById(c);if(m){this._removeEdgeChild(m)}else{m=this._PAPER.group();this._add(m,c,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.EDGE);this._ROOT_GROUP.node.appendChild(m.node)}}else{m=this._PAPER.group();this._add(m,c,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.EDGE);this._ROOT_GROUP.node.appendChild(m.node)}if(f){l=[[k.x,k.y-h._CONFIG.GUIDE_RECT_SIZE/2],[k.x+h._CONFIG.GUIDE_RECT_SIZE*2,k.y-h._CONFIG.GUIDE_RECT_SIZE],[k.x+h._CONFIG.GUIDE_RECT_SIZE*2,k.y+h._CONFIG.GUIDE_RECT_SIZE],[k.x,k.y+h._CONFIG.GUIDE_RECT_SIZE/2]]}else{if(n instanceof OG.geometry.Line){switch(e["edge-type"].toLowerCase()){case OG.Constants.EDGE_TYPE.STRAIGHT:l=[k,j];break;case OG.Constants.EDGE_TYPE.PLAIN:i=this._adjustEdgeDirection([k.x,k.y],[j.x,j.y]);l=[k,j];break;case OG.Constants.EDGE_TYPE.BEZIER:i=this._adjustEdgeDirection([k.x,k.y],[j.x,j.y]);l=this._bezierCurve([k.x,k.y],[j.x,j.y],i[0],i[1]);break}}else{if(n instanceof OG.geometry.Curve){l=n.getControlPoints()}else{if(n instanceof OG.geometry.BezierCurve){l=n.getControlPoints()}else{l=g}}}}if(f){d=new OG.Curve(l)}else{if(n instanceof OG.geometry.Curve){d=new OG.Curve(l)}else{if(n instanceof OG.geometry.BezierCurve){d=new OG.BezierCurve(l)}else{if(e["edge-type"].toLowerCase()===OG.Constants.EDGE_TYPE.BEZIER){d=new OG.BezierCurve(l)}else{d=new OG.PolyLine(l)}}}}this._drawGeometry(m.node,d,e,null,true);m.node.geom=d;m.attr(h._CONFIG.DEFAULT_STYLE.SHAPE);if(m.node.shape){m.node.shape.geom=d;if(m.node.geom){if(OG.Util.isIE7()){m.node.removeAttribute("geom")}else{delete m.node.geom}}}return m.node};OG.renderer.RaphaelRenderer.prototype.drawGroup=function(m,b,c){var k=this,n,p,e={},o,h,d,a,g,j={},f;OG.Util.apply(e,(b instanceof OG.geometry.Style)?b.map:b||{});if(c===0||c){n=this._getREleById(c);if(n){o=n.node.childNodes;for(h=o.length-1;h>=0;h--){if($(o[h]).attr("_type")!==OG.Constants.NODE_TYPE.SHAPE){this._remove(this._getREleById(o[h].id))}}}else{n=this._PAPER.group();this._add(n,c,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.GROUP);this._ROOT_GROUP.node.appendChild(n.node)}}else{n=this._PAPER.group();this._add(n,c,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.GROUP);this._ROOT_GROUP.node.appendChild(n.node)}p=this._drawGeometry(n.node,m,e);n.node.geom=m;n.attr(k._CONFIG.DEFAULT_STYLE.SHAPE);d=m.getBoundary();g=new OG.geometry.Rectangle(d.getUpperLeft(),(d.getUpperRight().x-d.getUpperLeft().x),(d.getLowerLeft().y-d.getUpperLeft().y));OG.Util.apply(j,m.style.map,e);if(j["label-direction"]&&j["vertical-align"]==="top"){if(j["label-direction"]==="vertical"){if(j["title-size"]){a=new OG.geometry.Line([d.getUpperLeft().x+j["title-size"],d.getUpperLeft().y],[d.getLowerLeft().x+j["title-size"],d.getLowerLeft().y]);g=new OG.geometry.Rectangle(d.getUpperLeft(),j["title-size"],(d.getLowerLeft().y-d.getUpperLeft().y))}else{a=new OG.geometry.Line([d.getUpperLeft().x+20,d.getUpperLeft().y],[d.getLowerLeft().x+20,d.getLowerLeft().y]);g=new OG.geometry.Rectangle(d.getUpperLeft(),20,(d.getLowerLeft().y-d.getUpperLeft().y))}}else{if(j["title-size"]){a=new OG.geometry.Line([d.getUpperLeft().x,d.getUpperLeft().y+j["title-size"]],[d.getUpperRight().x,d.getUpperRight().y+j["title-size"]]);g=new OG.geometry.Rectangle(d.getUpperLeft(),(d.getUpperRight().x-d.getUpperLeft().x),j["title-size"])}else{a=new OG.geometry.Line([d.getUpperLeft().x,d.getUpperLeft().y+20],[d.getUpperRight().x,d.getUpperRight().y+20]);g=new OG.geometry.Rectangle(d.getUpperLeft(),(d.getUpperRight().x-d.getUpperLeft().x),20)}}this._drawGeometry(n.node,a,e);var l=JSON.parse(JSON.stringify(k._CONFIG.DEFAULT_STYLE.GROUP_HIDDEN));if(j["label-fill"]){l.fill=j["label-fill"]}if(j["label-fill-opacity"]){l["fill-opacity"]=j["label-fill-opacity"]}this._drawGeometry(n.node,g,l)}if(p.id!==n.node.firstChild.id){n.node.insertBefore(p,n.node.firstChild)}if(n.node.shape){if(!n.node.shape.isCollapsed||n.node.shape.isCollapsed===false){n.node.shape.geom=m}if(n.node.geom){if(OG.Util.isIE7()){n.node.removeAttribute("geom")}else{delete n.node.geom}}}return n.node};OG.renderer.RaphaelRenderer.prototype.drawLabel=function(k,n,b){var g=this._getREleById(OG.Util.isElement(k)?k.id:k),e,i,j,c={},o,d,m,f,l=function(r){var t,v,w,q,p=0,s,u;if(r.shape.geom.style.get("edge-type")===OG.Constants.EDGE_TYPE.BEZIER){t=r.shape.geom.getControlPoints();v=t[0];w=t[t.length-1];return new OG.geometry.Coordinate(OG.Util.round((v.x+w.x)/2),OG.Util.round((v.y+w.y)/2))}else{t=r.shape.geom.getVertices();q=r.shape.geom.getLength();for(var s=0,x=t.length-1;sq/2){u=r.shape.geom.intersectCircleToLine(t[s+1],p-q/2,t[s+1],t[s]);break}}return u[0]}};OG.Util.apply(c,(b instanceof OG.geometry.Style)?b.map:b||{});if(g&&g.node.shape){n=OG.Util.trim(n);e=g.node;j=e.shape.geom.getBoundary();d=e.shape.label;if(n!==undefined&&n!==d){var h=e.shape.onBeforeLabelChange(n,d);if(typeof h=="boolean"&&!h){return false}m=jQuery.Event("beforeLabelChange",{element:e,afterText:n,beforeText:d});$(this._PAPER.canvas).trigger(m);if(m.isPropagationStopped()){return false}n=m.afterText}OG.Util.apply(e.shape.geom.style.map,c);e.shape.label=n===undefined?e.shape.label:n;if(e.shape.label!==undefined){switch(e.shape.geom.style.get("label-position")){case"left":f=[j.getCentroid().x-j.getWidth(),j.getCentroid().y];break;case"right":f=[j.getCentroid().x+j.getWidth(),j.getCentroid().y];break;case"top":f=[j.getCentroid().x,j.getCentroid().y-j.getHeight()];break;case"bottom":f=[j.getCentroid().x,j.getCentroid().y+j.getHeight()];break;default:f=[j.getCentroid().x,j.getCentroid().y];break}o=[j.getWidth(),j.getHeight()];if(e.shape instanceof OG.shape.EdgeShape){var a=l(e);f=[a.x,a.y]}i=this._drawLabel(f,e.shape.label,o,e.shape.geom.style,e.id+OG.Constants.LABEL_SUFFIX,e.shape instanceof OG.shape.EdgeShape);e.appendChild(i);if(n!==undefined){e.shape.onDrawLabel(n);$(this._PAPER.canvas).trigger("drawLabel",[e,n])}if(n!==undefined&&d!==undefined&&n!==d){e.shape.onLabelChanged(n,d);$(this._PAPER.canvas).trigger("labelChanged",[e,n,d])}}}return i};OG.renderer.RaphaelRenderer.prototype.drawEdgeLabel=function(i,k,h){var g=this,d=this._getREleById(OG.Util.isElement(i)?i.id:i),b,e,f,c,a,j;if(d&&d.node.shape){k=OG.Util.trim(k);b=d.node;if(b.shape instanceof OG.shape.EdgeShape){e=b.shape.geom.getVertices();if(h==="FROM"){c=[e[0].x,e[0].y+g._CONFIG.FROMTO_LABEL_OFFSET_TOP];b.shape.fromLabel=k||b.shape.fromLabel;a=b.shape.fromLabel;j=OG.Constants.FROM_LABEL_SUFFIX}else{c=[e[e.length-1].x,e[e.length-1].y+g._CONFIG.FROMTO_LABEL_OFFSET_TOP];b.shape.toLabel=k||b.shape.toLabel;a=b.shape.toLabel;j=OG.Constants.TO_LABEL_SUFFIX}if(a){f=this._drawLabel(c,a,[0,0],b.shape.geom.style,b.id+j,false);b.appendChild(f)}}}return f};OG.renderer.RaphaelRenderer.prototype.redrawShape=function(e,h,i){var g=this,f,b,c,j,a;var d=function(s,n){var t,r,p,l=n.childNodes,k,q,o,m;for(q=l.length-1;q>=0;q--){if(!g.isShape(n)){return}d(s,l[q]);m=false;t=$(l[q]).attr("_fromedge");if(t){t=t.split(",");for(var o=0,u=t.length;o3){ap=at.substring(0,3)+".."}p=z._PAPER.rect(ak.x+v,ak.y,ae,ae);E=z._PAPER.path(V(0,0));D=z._PAPER.text(0,0,ap,ae);p.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);if(!Z){E.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE)}if(Z){E.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_ESSENSIA)}F.appendChild(E);F.appendChild(D);F.appendChild(p);z._add(p,h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ar);z._add(E,h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ar+"1");z._add(D,h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ar+"2");if(!an.line){an.line=[]}an.line.push({node:p.node,text:at,label:aq?aq:"",shape:av});I.push(p)}function R(ap,aq){if(!C){return}p=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ap);E=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ap+"1");D=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ap+"2");I.push(p)}function K(){if(!B){return}M=z._PAPER.rect(ak.x+v,ak.y,ae,ae);M.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_RECT_AREA);F.appendChild(M);z._add(M,h.id+OG.Constants.GUIDE_SUFFIX.RECT);an.rect=M.node;I.push(M)}function q(){if(!B){return}M=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.RECT);I.push(M)}function c(ap){i=z._PAPER.image(z._CONFIG.IMAGE_BASE+"quarter-upper.png",0,0,ae,ae);i.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);F.appendChild(i);z._add(i,h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_UPPER);an.qUpper=i.node;$(i.node).click(function(){z.divideLane(t,OG.Constants.GUIDE_SUFFIX.QUARTER_UPPER)});aa=z._PAPER.image(z._CONFIG.IMAGE_BASE+"quarter-bisector.png",0,0,ae,ae);aa.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);F.appendChild(aa);z._add(aa,h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_BISECTOR);an.qBisector=aa.node;$(aa.node).click(function(){z.divideLane(t,OG.Constants.GUIDE_SUFFIX.QUARTER_BISECTOR)});Q=z._PAPER.image(z._CONFIG.IMAGE_BASE+"quarter-thirds.png",0,0,ae,ae);Q.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);F.appendChild(Q);z._add(Q,h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_THIRDS);an.qThirds=Q.node;$(Q.node).click(function(){z.divideLane(t,OG.Constants.GUIDE_SUFFIX.QUARTER_THIRDS)});g=z._PAPER.image(z._CONFIG.IMAGE_BASE+"quarter-low.png",0,0,ae,ae);g.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);F.appendChild(g);z._add(g,h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_LOW);an.qLow=g.node;$(g.node).click(function(){z.divideLane(t,OG.Constants.GUIDE_SUFFIX.QUARTER_LOW)});if(ap===0){af(aa);af(Q);I.push(i);I.push(g)}if(ap===1){af(Q);I.push(i);I.push(aa);I.push(g)}if(ap===2){I.push(i);I.push(aa);I.push(Q);I.push(g)}}function s(ap){i=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_UPPER);aa=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_BISECTOR);Q=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_THIRDS);g=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_LOW);if(ap===0){af(aa);af(Q);I.push(i);I.push(g)}if(ap===1){af(Q);I.push(i);I.push(aa);I.push(g)}if(ap===2){I.push(i);I.push(aa);I.push(Q);I.push(g)}$.each(I,function(aq,ar){U(ar)})}function af(ap){ap.attr({opacity:"0",x:-100,y:-100})}function U(ap){ap.attr({opacity:"1"})}function Y(){var au=4,ap,at,ar,aq;$.each(I,function(aw,av){ar=parseInt(aw/au);aq=parseInt(aw%au);ap=ak.x+((ar+1)*(v+ae)-ae);at=ak.y+(aq*(v+ae));av.attr({x:ap,y:at});if(av.id===h.id+OG.Constants.GUIDE_SUFFIX.LINE){if(z._CONFIG.GUIDE_CONTROL_LINE_NUM==2){z._getREleById(av.id+"1").attr({path:ao(ap,at,0,8)});z._getREleById(av.id+"2").attr({path:ao(ap,at,8,8)})}else{z._getREleById(av.id+"1").attr({path:ao(ap,at,0,4)})}}if(av.id.indexOf(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT)!=-1){var aw=av.id.replace(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT,"");z._getREleById(av.id+"1").attr({path:V(ap,at)});z._getREleById(av.id+"2").attr({x:ap+10,y:at+16})}})}var ad=z.getTextListInController(t);if(!ad){ad=[]}if(this._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.GUIDE)){if(!ab){d();aj();if(W){s(z.enableDivideCount(t))}if(!W){q();if(ad.length){$.each(ad,function(ap,aq){R(ap,aq)})}else{ah()}}f()}if(ab){d();f()}Y();return null}else{if(ab){e();y();ai()}if(!ab){e();y();S();if(W){c(z.enableDivideCount(t))}if(!W){K();if(ad.length){$.each(ad,function(ap,aq){l(ap,aq)})}else{j()}}ai()}Y();if(n){n.insertBefore(h)}if(F){z.getRootGroup().appendChild(F.node)}$(h.node).attr("_selected","true");return an}};OG.renderer.RaphaelRenderer.prototype.drawStickGuide=function(a){if(!this._CONFIG.STICK_GUIDE){return}var d=this,e,c,b;if(!a){return}if(a.x){c=a.x*d._CONFIG.SCALE;this.removeStickGuide("vertical");e=this._PAPER.path("M"+c+",0L"+c+",10000");this._stickGuideX=e}if(a.y){b=a.y*d._CONFIG.SCALE;this.removeStickGuide("horizontal");e=this._PAPER.path("M0,"+b+"L10000,"+b);this._stickGuideY=e}if(e){e.attr("stroke-width","2");e.attr("stroke","#FFCC50");e.attr("opacity","0.7")}};OG.renderer.RaphaelRenderer.prototype.removeStickGuide=function(a){if(!this._CONFIG.STICK_GUIDE){return}if(!a){return}if(a==="vertical"){if(this._stickGuideX){this._remove(this._stickGuideX);this._stickGuideX=null}}if(a==="horizontal"){if(this._stickGuideY){this._remove(this._stickGuideY);this._stickGuideY=null}}};OG.renderer.RaphaelRenderer.prototype.removeAllStickGuide=function(){if(!this._CONFIG.STICK_GUIDE){return}this.removeStickGuide("vertical");this.removeStickGuide("horizontal")};OG.renderer.RaphaelRenderer.prototype.removeGuide=function(c){var b=this._getREleById(OG.Util.isElement(c)?c.id:c),a,d;if(b){a=this._getREleById(b.id+OG.Constants.GUIDE_SUFFIX.GUIDE);d=this._getREleById(b.id+OG.Constants.GUIDE_SUFFIX.BBOX);b.node.removeAttribute("_selected");this._remove(a);this._remove(d);this.removeAllStickGuide()}};OG.renderer.RaphaelRenderer.prototype.removeAllGuide=function(){var a=this;$(a.getRootElement()).find("[_type="+OG.Constants.NODE_TYPE.SHAPE+"][_selected=true]").each(function(b,c){if(OG.Util.isElement(c)&&c.id){a.removeGuide(c)}})};OG.renderer.RaphaelRenderer.prototype.drawEdgeGuide=function(a){return null;var s=this,m=this._getREleById(OG.Util.isElement(a)?a.id:a),e=m?m.node.shape.geom:null,f,o,h,u,p,q,t,j,k,n=[],d=s._CONFIG.GUIDE_RECT_SIZE,l=OG.Util.round(d/2),g={},r;var c=a.shape.GUIDE_BBOX?a.shape.GUIDE_BBOX:s._CONFIG.DEFAULT_STYLE.GUIDE_BBOX;if(m&&e){OG.Util.apply(g,e.style.map,s._CONFIG.DEFAULT_STYLE.EDGE);f=g["edge-type"]===OG.Constants.EDGE_TYPE.BEZIER?e.getControlPoints():e.getVertices();o=$(a).attr("_from")&&$(a).attr("_to")&&$(a).attr("_from")===$(a).attr("_to");if(this._getREleById(m.id+OG.Constants.GUIDE_SUFFIX.GUIDE)){this._remove(this._getREleById(m.id+OG.Constants.GUIDE_SUFFIX.BBOX));p="";if(g["edge-type"]===OG.Constants.EDGE_TYPE.BEZIER){for(var r=0,b=f.length;r1){for(var f=0,m=a.length;f0){for(var f=0,l=h.length;fd.shape.geom.boundary._leftCenter.x?d.shape.geom.boundary._leftCenter.x:a}});$(b.getRootElement()).find("[_selected=true]").each(function(c,d){if(d.shape.TYPE=="EDGE"){return}b.move(d,[a-d.shape.geom.boundary._leftCenter.x,0]);b.drawGuide(d)});b._CANVAS._HANDLER.selectShapes(b._CANVAS._HANDLER._getSelectedElement())};OG.renderer.RaphaelRenderer.prototype.alignRight=function(){var b=0,a=this;$(a.getRootElement()).find("[_selected=true]").each(function(c,d){if(d.shape.TYPE=="EDGE"){return}if(b==0){b=d.shape.geom.boundary._rightCenter.x}else{b=bd.shape.geom.boundary._rightCenter.y?d.shape.geom.boundary._rightCenter.y:b}});$(a.getRootElement()).find("[_selected=true]").each(function(c,d){if(d.shape.TYPE=="EDGE"){return}a.move(d,[0,b-d.shape.geom.boundary._rightCenter.y]);a.drawGuide(d)});a._CANVAS._HANDLER.selectShapes(a._CANVAS._HANDLER._getSelectedElement())};OG.renderer.RaphaelRenderer.prototype.removeShape=function(f,b){var c=this._getREleById(OG.Util.isElement(f)?f.id:f),h,e,d,g;h=c.node.childNodes;e=jQuery.Event("beforeRemoveShape",{element:c.node});if(!b){if(f.shape){var a=f.shape.onBeforeRemoveShape();if(typeof a=="boolean"&&!a){return false}}$(this._PAPER.canvas).trigger(e);if(e.isPropagationStopped()){return false}}this.removeAllConnectGuide();for(d=h.length-1;d>=0;d--){if(h[d].tagName=="svg"){h[d].parentNode.removeChild(h[d])}else{if($(h[d]).attr("_type")===OG.Constants.NODE_TYPE.SHAPE){this.removeShape(h[d])}}}this.disconnect(c.node);this.removeGuide(c.node);this.removeCollapseGuide(c.node);g=OG.Util.clone(c.node);if(!b){if(f.shape){f.shape.onRemoveShape()}}this.remove(c.node);if(!b){$(this._PAPER.canvas).trigger("removeShape",[g])}};OG.renderer.RaphaelRenderer.prototype.remove=function(b){var c=OG.Util.isElement(b)?b.id:b,a=this._getREleById(c);this._remove(a)};OG.renderer.RaphaelRenderer.prototype.removeChild=function(b){var c=OG.Util.isElement(b)?b.id:b,a=this._getREleById(c);this._removeChild(a)};OG.renderer.RaphaelRenderer.prototype.getRootElement=function(){return this._PAPER.canvas};OG.renderer.RaphaelRenderer.prototype.getElementByPoint=function(a){var b=this._PAPER.getElementByPoint(a[0],a[1]);return b?b.node.parentNode:null};OG.renderer.RaphaelRenderer.prototype.setAttr=function(b,c){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a){a.attr(c)}};OG.renderer.RaphaelRenderer.prototype.getAttr=function(c,b){var a=this._getREleById(OG.Util.isElement(c)?c.id:c);if(a){return a.attr(b)}return null};OG.renderer.RaphaelRenderer.prototype.setShapeStyle=function(b,c){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a&&b.shape&&b.shape.geom){OG.Util.apply(b.shape.geom.style.map,c||{});b.shapeStyle=b.shapeStyle||{};OG.Util.apply(b.shapeStyle,c||{});this.redrawShape(b)}};OG.renderer.RaphaelRenderer.prototype.setTextListInController=function(b,c){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a&&b.shape&&b.shape.geom){b.shape.textList=c}};OG.renderer.RaphaelRenderer.prototype.getTextListInController=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a&&b.shape&&b.shape.geom){return b.shape.textList}};OG.renderer.RaphaelRenderer.prototype.toFront=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a){a.toFront()}};OG.renderer.RaphaelRenderer.prototype.toBack=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a){a.toBack()}};OG.renderer.RaphaelRenderer.prototype.bringForward=function(c){var b=this._getREleById(OG.Util.isElement(c)?c.id:c);if(!b){return}c=b.node;var e=this,a=$(e.getRootGroup());if(e.isLane(c)){c=e._RENDERER.getRootLane(c)}var d=$(c).prevAll().length;a[0].insertBefore(c,OG.Util.isIE()?a[0].childNodes[d+1]:a[0].children[d+1])};OG.renderer.RaphaelRenderer.prototype.sendBackward=function(c){var b=this._getREleById(OG.Util.isElement(c)?c.id:c);if(!b){return}c=b.node;var e=this,a=$(e.getRootGroup());if(e.isLane(c)){c=e.getRootLane(c)}var d=$(c).prevAll().length;var f=d-2;if(f<0){f=0}a[0].insertBefore(c,OG.Util.isIE()?a[0].childNodes[f]:a[0].children[f])};OG.renderer.RaphaelRenderer.prototype.getCanvasSize=function(){return[this._PAPER.width,this._PAPER.height]};OG.renderer.RaphaelRenderer.prototype.setCanvasSize=function(a){this._PAPER.setSize(a[0],a[1])};OG.renderer.RaphaelRenderer.prototype.fitCanvasSize=function(a,c){var g=this,h=this.getRealRootBBox(),f,e,d=1,b=h.width+g._CONFIG.FIT_CANVAS_PADDING*2,i=h.height+g._CONFIG.FIT_CANVAS_PADDING*2;if(h.width!==0&&h.height!==0){f=h.x>g._CONFIG.FIT_CANVAS_PADDING?-1*(h.x-g._CONFIG.FIT_CANVAS_PADDING):g._CONFIG.FIT_CANVAS_PADDING-h.x;e=h.y>g._CONFIG.FIT_CANVAS_PADDING?-1*(h.y-g._CONFIG.FIT_CANVAS_PADDING):g._CONFIG.FIT_CANVAS_PADDING-h.y;this.move(this.getRootGroup(),[f,e]);this.removeAllGuide();if(a&&a.length===2){if(OG.Util.isDefined(c)&&c===true){d=a[0]/b>a[1]/i?a[1]/i:a[0]/b}b=b=0;c--){if($("#"+e[c].id)&&$("#"+e[c].id).attr("name")==OG.Constants.CONNECT_GUIDE_EVENT_AREA.NAME){b.push(e[c])}}}return b};OG.renderer.RaphaelRenderer.prototype.getNotConnectGuideElements=function(c){var e,b,d=[];var a=this._getREleById(OG.Util.isElement(c)?c.id:c);if(a){e=a.node.childNodes;for(b=e.length-1;b>=0;b--){if($("#"+e[b].id)&&$("#"+e[b].id).attr("name")!==OG.Constants.CONNECT_GUIDE_EVENT_AREA.NAME){d.push(e[b])}}}return d};OG.renderer.RaphaelRenderer.prototype.drawConnectGuide=function(e){var i=this,f=this._getREleById(OG.Util.isElement(e)?e.id:e),k=f?f.node.shape.geom:null,h,d,c,o,m,j=i._CONFIG.GUIDE_RECT_SIZE;var b=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_CIRCLE;var a=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var l=function(){var q=k.getVertices();var s=[];for(var r=0,p=q.length;r0){var B=k.isRightAngleBetweenPoints(q[v-1],q[v]);if(B.flag){var y={x:(q[v-1].x+q[v].x)/2,y:(q[v-1].y+q[v].y)/2};if(B.type==="vertical"){var A=q[v-1].y-q[v].y;if(Math.abs(A)<50){return}var x=a.w;var u=a.h;m={x:y.x-(u/2),y:y.y-(x/2),width:u,height:x};a.cursor="ew-resize"}else{var A=q[v-1].x-q[v].x;if(Math.abs(A)<50){return}var x=a.w;var u=a.h;m={x:y.x-(x/2),y:y.y-(u/2),width:x,height:u};a.cursor="ns-resize"}var w=i._PAPER.rect(m.x,m.y,m.width,m.height);w.attr(a);i._add(w);f.appendChild(w);$(w.node).data("prev",v-1);$(w.node).data("next",v);$(w.node).data("parent",f);$(w.node).data("vertice",y);$(w.node).attr("name",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT);$(w.node).data("type",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT);$(w.node).data("direction",B.type);i.toFront(w);s.push(w.node)}}});return s};if(i.getSpots(e).length>0){return null}if(!i._CANVAS._HANDLER._isSelectable(e.shape)){return null}if(f&&k){h=k.getBoundary();o=h.getUpperLeft();var n={x:o.x-i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX_EXPEND,y:o.y-i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX_EXPEND,width:h.getWidth()+i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX_EXPEND*2,height:h.getHeight()+i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX_EXPEND*2};this._remove(this._getREleById(f.id+OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX));c=this._PAPER.rect(n.x,n.y,n.width,n.height);c.attr(i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX);this._add(c,f.id+OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX);if($(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){var g=l();d={bBox:c.node,spots:g}}else{d={bBox:c.node}}c.insertBefore(f);return d}return null};OG.renderer.RaphaelRenderer.prototype.removeConnectGuide=function(b){var d=this;var a=d._getREleById(OG.Util.isElement(b)?b.id:b);if(!a){return}var c=d._getREleById(a.id+OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX);$(d.getSpots(b)).each(function(e,f){d._remove(d._getREleById(f.id))});d._remove(c)};OG.renderer.RaphaelRenderer.prototype.removeAllConnectGuide=function(){var a=this;$(a.getRootElement()).find("[_type="+OG.Constants.NODE_TYPE.SHAPE+"]").each(function(b,c){if(OG.Util.isElement(c)&&c.id){a.removeConnectGuide(c);a.removeVirtualSpot(c)}})};OG.renderer.RaphaelRenderer.prototype.removeOtherConnectGuide=function(a){var b=this;$(b.getRootElement()).find("[_type="+OG.Constants.NODE_TYPE.SHAPE+"]").each(function(c,d){if(OG.Util.isElement(d)&&d.id&&a.id!==d.id){b.removeConnectGuide(d);b.removeVirtualSpot(d)}})};OG.renderer.RaphaelRenderer.prototype.getSpots=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),c=[];if(a){$("#"+a.id).find("[name="+OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT+"]").each(function(d,e){c.push(e)})}return c};OG.renderer.RaphaelRenderer.prototype.getCircleSpots=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),c=[];if(a){$("#"+a.id).find("[name="+OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT+"]").each(function(d,e){if($(e).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){c.push(e)}})}return c};OG.renderer.RaphaelRenderer.prototype.createVirtualSpot=function(m,k,c){var j=this,e=this._getREleById(OG.Util.isElement(c)?c.id:c),l=e?e.node.shape.geom:null,h,i=[],n=0,b=[],f,d,o,a,g;j.removeVirtualSpot(c);if($(c).attr("_shape")!==OG.Constants.SHAPE_TYPE.EDGE){return null}if(e&&l){h=l.getVertices();i=[];b=[];n=0;$.each(h,function(p,q){if(p>0){var r=l.distanceToLine([m,k],[h[p-1],h[p]]);if(p==1){n=r;i=[h[p-1],h[p]];b=[p-1,p]}else{if(r=v){d=false}}if(s===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){var r=$(t).attr("width");if($(t).attr("height")>$(t).attr("width")){r=$(t).attr("height")}var u=a.r+parseInt(r);if(u>=v){d=false}}});if(!d){return null}g=j._PAPER.circle(o.x,o.y,a.r);g.attr(a);j._add(g);e.appendChild(g);$(g.node).data("prev",b[0]);$(g.node).data("next",b[1]);$(g.node).data("vertice",o);$(g.node).data("parent",e);$(g.node).data("type",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE);$(g.node).attr("name",OG.Constants.CONNECT_GUIDE_SUFFIX.VIRTUAL_SPOT);j.toFront(g);return g.node}return null};OG.renderer.RaphaelRenderer.prototype.getVirtualSpot=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),d,c;if(a){c=$("#"+a.id).find("[name="+OG.Constants.CONNECT_GUIDE_SUFFIX.VIRTUAL_SPOT+"]");d=c.attr("id")}return this.getElementById(d)};OG.renderer.RaphaelRenderer.prototype.removeVirtualSpot=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),d,c;if(a){c=$("#"+a.id).find("[name="+OG.Constants.CONNECT_GUIDE_SUFFIX.VIRTUAL_SPOT+"]");d=c.attr("id")}return this.remove(d)};OG.renderer.RaphaelRenderer.prototype.selectSpot=function(c){var d=this;var b=this._getREleById(OG.Util.isElement(c)?c.id:c);if(b){var a=$(b.node).data("parent");this._remove(this._getREleById(a.id+OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX));$(d.getSpots(a.node)).each(function(f,e){if(e.id!==b.node.id){d.remove(e)}})}};OG.renderer.RaphaelRenderer.prototype._removeEdgeChild=function(b){var d,c;if(b){d=b.node.childNodes;for(c=d.length-1;c>=0;c--){var a=false;if($(d[c]).attr("name")===OG.Constants.CONNECT_GUIDE_SUFFIX.VIRTUAL_SPOT){a=true}if($(d[c]).attr("name")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT){a=true}if(!a){this._remove(this._getREleById(d[c].id))}}}};OG.renderer.RaphaelRenderer.prototype.getChildNodes=function(c){var a=this._getREleById(OG.Util.isElement(c)?c.id:c);var d,b;if(a){d=a.node.childNodes}if(!d){return[]}else{return d}};OG.renderer.RaphaelRenderer.prototype.trimEdge=function(d){var f=this,a=this._getREleById(OG.Util.isElement(d)?d.id:d),h=a?a.node.shape.geom:null;var b=h.getVertices();var e=b.length;for(var c=b.length;c--;){if(c=f._CONFIG.TRIM_EDGE_ANGLE_SIZE){b.splice(c,1)}}}}}if(e!==b.length){d.shape.geom.setVertices(b);d=f.drawEdge(new OG.PolyLine(b),d.shape.geom.style,d.id);f.drawLabel(d);f.drawEdgeLabel(d,null,"FROM");f.drawEdgeLabel(d,null,"TO")}};OG.renderer.RaphaelRenderer.prototype.trimConnectInnerVertice=function(a){var t=this,j=this._getREleById(OG.Util.isElement(a)?a.id:a),e=j?j.node.shape.geom:null,o,b,v,h,l,p;var f=e.getVertices();o=$(a).attr("_from");b=$(a).attr("_to");if(o){v=this._getShapeFromTerminal(o);l=this._getPositionFromTerminal(o)}if(b){h=this._getShapeFromTerminal(b);p=this._getPositionFromTerminal(b)}var g;var u;var r;var k;var s;var m;var d=function(){if(r){if(k>0&&k=0;q--){if(q==f.length-1){g=f[q];u=q;continue}var n=h.shape.geom.isContainsPoint(f[q]);if(n){if(q==0){r=f[q];k=q;s=f[q+1];m=q+1}else{r=f[q-1];k=q-1;s=f[q];m=q}}}d()}if(f.length===2){a=t.drawEdge(new OG.Line(f[0],f[1]),a.shape.geom.style,a.id);a=t.trimEdgeDirection(a,v,h)}else{a.shape.geom.setVertices(f);a=t.drawEdge(new OG.PolyLine(f),a.shape.geom.style,a.id)}t.drawLabel(a);t.drawEdgeLabel(a,null,"FROM");t.drawEdgeLabel(a,null,"TO");return a};OG.renderer.RaphaelRenderer.prototype.trimConnectIntersection=function(d){var h=this,e=this._getREleById(OG.Util.isElement(d)?d.id:d),i=e?e.node.shape.geom:null,j,k,l,c,g,b,a;var f=i.getVertices();j=$(d).attr("_from");k=$(d).attr("_to");if(j){l=this._getShapeFromTerminal(j);g=this._getPositionFromTerminal(j)}if(k){c=this._getShapeFromTerminal(k);b=this._getPositionFromTerminal(k)}if(j){a=l.shape.geom.shortestIntersectToLine([f[1],[g.x,g.y]]);if(a){f[0].x=a.x;f[0].y=a.y}else{f[0].x=g.x;f[0].y=g.y}}if(k){a=c.shape.geom.shortestIntersectToLine([f[f.length-2],[b.x,b.y]]);if(a){f[f.length-1].x=a.x;f[f.length-1].y=a.y}else{f[f.length-1].x=b.x;f[f.length-1].y=b.y}}d.shape.geom.setVertices(f);d=h.drawEdge(new OG.PolyLine(f),d.shape.geom.style,d.id);h.drawLabel(d);h.drawEdgeLabel(d,null,"FROM");h.drawEdgeLabel(d,null,"TO");return d};OG.renderer.RaphaelRenderer.prototype.getBoundary=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),c;if(a&&a.node&&a.node.shape&&a.node.shape.geom){c=a.node.shape.geom.getBoundary()}return c};OG.renderer.RaphaelRenderer.prototype.setHighlight=function(c,b){var a=this._getREleById(OG.Util.isElement(c)?c.id:c);var d=this;if(a){c=a.node;var e=d.getNotConnectGuideElements(c);$.each(e,function(f,i){var j={};for(var h in b){var g=d.getAttr(i,h);if(g){j[h]=g}}$(i).data("orgAttrGroup",j);d.setAttr(i,b)})}};OG.renderer.RaphaelRenderer.prototype.removeHighlight=function(c,b){var a=this._getREleById(OG.Util.isElement(c)?c.id:c);var d=this;if(a){c=a.node;var e=d.getNotConnectGuideElements(c);$.each(e,function(f,i){var j=$(i).data("orgAttrGroup");if(!j){return}for(var h in b){var g=j[h];if(!g){j[h]=null}}$(i).removeData("orgAttrGroup");d.setAttr(i,j)})}};OG.renderer.RaphaelRenderer.prototype.createTerminalString=function(e,a){var d;var b=this._getREleById(OG.Util.isElement(e)?e.id:e);if(b){var c=b.node.shape.geom.getPercentageDistanceFromPoint(a);if(c){d=b.node.id+OG.Constants.TERMINAL+"_"+c.px+"_"+c.py}}return d};OG.renderer.RaphaelRenderer.prototype.createDefaultTerminalString=function(d){var c;var a=this._getREleById(OG.Util.isElement(d)?d.id:d);if(a){var b={px:50,py:50};if(b){c=a.node.id+OG.Constants.TERMINAL+"_"+b.px+"_"+b.py}}return c};OG.renderer.RaphaelRenderer.prototype._getPercentageFromTerminal=function(c){var d;if(c){var e=c.substring(0,c.indexOf(OG.Constants.TERMINAL));var b=c.replace(e+OG.Constants.TERMINAL+"_","");var a=b.split("_");d=[parseInt(a[0]),parseInt(a[1])]}return d};OG.renderer.RaphaelRenderer.prototype._getPositionFromTerminal=function(d){var e=this;var g,f;var b={px:50,py:50};if(d){var h=d.substring(0,d.indexOf(OG.Constants.TERMINAL));var c=d.replace(h+OG.Constants.TERMINAL+"_","");f=c.split("_");var a=this._getREleById(h);if(a){g=a.node.shape.geom.getPointFromPercentageDistance(f);if(!g||isNaN(g.x)||isNaN(g.y)){g=a.node.shape.geom.getPointFromPercentageDistance([b.px,b.py])}g.x=e._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(g.x,e._CONFIG.MOVE_SNAP_SIZE/2):g.x;g.y=e._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(g.y,e._CONFIG.MOVE_SNAP_SIZE/2):g.y}}return g};OG.renderer.RaphaelRenderer.prototype.toFrontEdges=function(){var e=this;var a=e.getRootGroup();var c=e.getAllEdges();for(var d=0,b=c.length;dx[0]){w.x=t[0]-s}if(t[0]x[1]){w.y=t[1]-r}if(t[1]=0){b=b-1;a._CANVAS.loadJSON(c[b])}a._CONFIG.HISTORY_INDEX=b;$(this._PAPER.canvas).trigger("undo")};OG.renderer.RaphaelRenderer.prototype.redo=function(){var a=this;var c=a._CONFIG.HISTORY;var b=a._CONFIG.HISTORY_INDEX;if(b(f*3)){return 2}if(a>(f*2)){return 1}}if(this.isVerticalLane(c)){if(d>(f*3)){return 2}if(d>(f*2)){return 1}}return 0};OG.renderer.RaphaelRenderer.prototype.getExceptTitleLaneArea=function(h){var j=this;var i=j._getREleById(OG.Util.isElement(h)?h.id:h);var k=i?i.node.shape.geom:null;if(!i||!k){return null}var f=k.getBoundary();var d=k.style.map;var c=d["title-size"]?d["title-size"]:20;var b=f.getUpperLeft();var e=f.getWidth();var l=f.getHeight();var m,g,a;if(!j.isLane(h)&&!j.isPool(h)){return f}if(j.isHorizontalLane(h)||j.isHorizontalPool(h)){m=new OG.geometry.Coordinate(b.x+c,b.y);g=e-c;a=l}if(j.isVerticalLane(h)||j.isVerticalPool(h)){m=new OG.geometry.Coordinate(b.x,b.y+c);g=e;a=l-c}if(m){return new OG.geometry.Envelope(m,g,a)}return f};OG.renderer.RaphaelRenderer.prototype.divideLane=function(d,z){var w=[];var F=this;var u=F._getREleById(OG.Util.isElement(d)?d.id:d);var l=u?u.node.shape.geom:null;if(!u||!l){return}d=u.node;if(!F.isLane(d)){return}var D=z===OG.Constants.GUIDE_SUFFIX.QUARTER_UPPER;var h=z===OG.Constants.GUIDE_SUFFIX.QUARTER_LOW;var e=z===OG.Constants.GUIDE_SUFFIX.QUARTER_BISECTOR;var g=z===OG.Constants.GUIDE_SUFFIX.QUARTER_THIRDS;if(e||g){var r=e?2:3;var m=F.getExceptTitleLaneArea(d);var t=m.getUpperLeft();for(var B=0;By.y){v=H}}if(F.isVerticalLane(d)&&D){if(x.x>y.x){v=H}}if(F.isVerticalLane(d)&&h){if(x.xk){E.push(i)}}});var q=F._CANVAS.drawShape([p+(j/2),o+(G/2)],b,[j,G],null,null,n.id,true);w.push(q);$.each(E,function(x,i){F.move(i,a)});F.reEstablishLane(v);F.fitLaneOrder(v)}}if(w.length){for(var B=0,f=w.length;B0){var r=g.getParent(p);if(r&&r.id){m[r.id]=r}}});for(var l in m){n.push(m[l])}b(n)}b(d)};OG.renderer.RaphaelRenderer.prototype.getBoundaryOfElements=function(d){var b=[],f,e,c;if(d&&d.length>0){for(var c=0,a=d.length;cMath.abs(n-a)){h=Math.abs(n-a);g=p}});return g};OG.renderer.RaphaelRenderer.prototype.getBoundaryOfInnerShapesGroup=function(b){var c=this;var f=[];var a=c._getREleById(OG.Util.isElement(b)?b.id:b);if(!a){return null}b=a.node;var e;var d=[];if(c.isLane(b)){d=c.getInnerShapesOfLane(b)}else{d=c.getChilds(b)}$.each(d,function(g,h){if(!c.isLane(h)){f.push(h)}});if(!f.length){return null}return c.getBoundaryOfElements(f)};OG.renderer.RaphaelRenderer.prototype.getSmallestBaseLane=function(c){var e=this;var b=e._getREleById(OG.Util.isElement(c)?c.id:c);if(!b){return null}c=b.node;if(!e.isLane(c)){return null}var a=e.getBaseLanes(c);var f;var d;$.each(a,function(i,h){var g;var j=e.getBoundary(h);if(e.isHorizontalLane(h)){g=j.getWidth()}if(e.isVerticalLane(h)){g=j.getHeight()}if(g){if(!d){d=h;f=g}if(g0){k.resize(d[j-1],[0,(a*-1),0,0])}if(j0){k.resize(d[j-1],[0,0,(c*-1),0])}if(j0){n=e[g-1]}if(c0){f=e[b-1]}if(al){n.push([m.x,m.y]);n.push([l+((a-l)/2),m.y]);n.push([l+((a-l)/2),d.y]);n.push([d.x,d.y])}else{if(i>j){n.push([m.x,m.y]);n.push([i+((j-i)/2),m.y]);n.push([i+((j-i)/2),d.y]);n.push([d.x,d.y])}else{n.push([m.x,m.y]);n.push([m.x,m.y+((d.y-m.y)/2)]);n.push([d.x,m.y+((d.y-m.y)/2)]);n.push([d.x,d.y])}}if(p._CONFIG.DRAG_GRIDABLE){$.each(n,function(t,s){s[0]=OG.Util.roundGrid(s[0],p._CONFIG.MOVE_SNAP_SIZE/2);s[1]=OG.Util.roundGrid(s[1],p._CONFIG.MOVE_SNAP_SIZE/2);n[t]=s})}return p.drawEdge(new OG.PolyLine(n),f.shape.geom.style,f.id)};OG.renderer.RaphaelRenderer.prototype.putInnerShapeToPool=function(b){var c=this;var a=c.getRootGroup();var e;if(!c.isLane(b)&&!c.isPool(b)){return b}if(c.isLane(b)){e=c.getRootLane(b)}else{e=b}var h=e.shape.geom;var f=h.getBoundary();var g=[];var d=c.getChilds(a);$.each(d,function(i,j){if(!c.isEdge(j)&&j.id!=b.id){g.push(j)}});$.each(g,function(j,i){var k=i.shape.geom.getBoundary();if(f.isContainsAll(k.getVertices())){e.appendChild(i)}})};OG.renderer.RaphaelRenderer.prototype.setDropablePool=function(h){var k=this;var m=k.getRootGroup();if(!k.isLane(h)&&!k.isPool(h)){return h}var l=h.shape.geom;var i=[];var j=k.getChilds(m);$.each(j,function(o,p){if(!k.isLane(p)&&!k.isPool(p)&&!k.isEdge(p)){i.push(p)}});var d=k._CONFIG.POOL_DEFAULT_SIZE;var a=30;var g=l.getBoundary();var f=g.getCentroid();var e={};var c=function(){var t=[];if(!i.length){return t}var s=k.getBoundaryOfElements(i);var q=k.getBoundary(h);var o=s.getCentroid();var r=(q.getWidth()/2)-((s.getWidth()/2)+a);var p=(q.getHeight()/2)-((s.getHeight()/2)+a);if(r<0){r=0}if(p<0){p=0}t.push({condition:{maxX:o.x+r},fixedPosition:{x:o.x+r}});t.push({condition:{minX:o.x-r},fixedPosition:{x:o.x-r}});t.push({condition:{maxY:o.y+p},fixedPosition:{y:o.y+p}});t.push({condition:{minY:o.y-p},fixedPosition:{y:o.y-p}});return t};if(k.isVerticalLane(h)||k.isVerticalPool(h)){e.width=d[1];e.height=d[0]}else{e.width=d[0];e.height=d[1]}if(i.length){var n=k.getBoundaryOfElements(i);f=n.getCentroid();if(e.widthy/2){C=z.shape.geom.intersectCircleToLine(B[A+1],x-y/2,B[A+1],B[A]);break}}return C[0]}},v;var w=b._getOffset(q);var s=c.getFrontForCoordinate([w.x,w.y]);if(!s){q.stopImmediatePropagation();return}if(s.id!==a.id){q.stopImmediatePropagation();return}if(a.shape.isCollapsed===false){$(k).append("");o=$("#"+p);switch(a.shape.geom.style.get("text-anchor")){case"start":g="left";break;case"middle":g="center";break;case"end":g="right";break;default:g="center";break}if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.HTML){$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":"left",overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.html);u=a.shape.html;$(o).bind({focusout:function(){a.shape.html=this.value;i=this.value;if(a.shape.html){c.redrawShape(a);this.parentNode.removeChild(this)}else{c.removeShape(a);this.parentNode.removeChild(this)}if(u!==i){c.addHistory()}}})}else{if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.TEXT){$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":g,overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.text);u=a.shape.text;$(o).bind({focusout:function(){a.shape.text=this.value;i=this.value;if(a.shape.text){c.redrawShape(a);this.parentNode.removeChild(this)}else{c.removeShape(a);this.parentNode.removeChild(this)}if(u!==i){c.addHistory()}}})}else{if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){if(a.shape.label&&c.isSVG()){$(a).children("[id$=_LABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height})})}else{v=t(a);f=v.x-b._CONFIG.LABEL_EDITOR_WIDTH/2;l=v.y-b._CONFIG.LABEL_EDITOR_HEIGHT/2;n=b._CONFIG.LABEL_EDITOR_WIDTH;m=b._CONFIG.LABEL_EDITOR_HEIGHT}$(q.srcElement).parents("[id$=_FROMLABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height;h=a.shape.fromLabel})});$(q.srcElement).parents("[id$=_TOLABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height;r=a.shape.toLabel})});$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f*b._CONFIG.SCALE,top:l*b._CONFIG.SCALE,width:n*b._CONFIG.SCALE,height:m*b._CONFIG.SCALE,overflow:"hidden",resize:"none"}));$(o).focus();if(h||r){$(o).val(h?a.shape.fromLabel:a.shape.toLabel)}else{$(o).val(a.shape.label);u=a.shape.label}$(o).bind({focusout:function(){if(h){c.drawEdgeLabel(a,this.value,"FROM")}else{if(r){c.drawEdgeLabel(a,this.value,"TO")}else{c.drawLabel(a,this.value);i=this.value;if(u!==i){c.addHistory()}}}this.parentNode.removeChild(this)}})}else{$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":g,overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.label);u=a.shape.label;$(o).bind({focusout:function(){c.drawLabel(a,this.value);this.parentNode.removeChild(this);i=this.value;if(u!==i){c.addHistory()}}})}}}}}})},setMovable:function(f,g){var i=this,c;var h=i._RENDERER;var k=h.getRootGroup();if(!f){return}var j=$(f).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var m=h.isLane(f);if(j){return}var b=function(x){var u=i._CONFIG.EDGE_MOVE_DELAY_SIZE;var p=[];if(!i._CONFIG.AUTOMATIC_GUIDANCE){return p}if(!x){return p}if(x.length!==1){return p}var r=h.getBoundary(f);var w=r.getCentroid();var v=r.getHeight();var o=r.getWidth();var t=h.getAllShapes();$.each(t,function(z,A){if(h.isEdge(A)){return}if(A.id===f.id){return}var D=h.getBoundary(A);var y=D.getCentroid();var B=D.getUpperLeft();var C=D.getLowerRight();p.push({condition:{minY:(B.y-v/2)-u,maxY:(B.y-v/2)+u},fixedPosition:{y:(B.y-v/2)},guidePosition:{y:B.y},id:z});p.push({condition:{minY:(B.y+v/2)-u,maxY:(B.y+v/2)+u},fixedPosition:{y:(B.y+v/2)},guidePosition:{y:B.y},id:z});p.push({condition:{minY:(C.y+v/2)-u,maxY:(C.y+v/2)+u},fixedPosition:{y:(C.y+v/2)},guidePosition:{y:C.y},id:z});p.push({condition:{minY:(C.y-v/2)-u,maxY:(C.y-v/2)+u},fixedPosition:{y:(C.y-v/2)},guidePosition:{y:C.y},id:z});p.push({condition:{minX:(B.x-o/2)-u,maxX:(B.x-o/2)+u},fixedPosition:{x:(B.x-o/2)},guidePosition:{x:B.x},id:z});p.push({condition:{minX:(B.x+o/2)-u,maxX:(B.x+o/2)+u},fixedPosition:{x:(B.x+o/2)},guidePosition:{x:B.x},id:z});p.push({condition:{minX:(C.x+o/2)-u,maxX:(C.x+o/2)+u},fixedPosition:{x:(C.x+o/2)},guidePosition:{x:C.x},id:z});p.push({condition:{minX:(C.x-o/2)-u,maxX:(C.x-o/2)+u},fixedPosition:{x:(C.x-o/2)},guidePosition:{x:C.x},id:z});p.push({condition:{minX:y.x-u,maxX:y.x+u},fixedPosition:{x:y.x},guidePosition:{x:y.x},id:z});p.push({condition:{minY:y.y-u,maxY:y.y+u,},fixedPosition:{y:y.y},guidePosition:{y:y.y},id:z})});var s=[];var n=h.getPrevEdges(f);var q=h.getNextEdges(f);$.each(n,function(y,z){s.push({edge:z,type:"prev"})});$.each(q,function(y,z){s.push({edge:z,type:"next"})});$.each(s,function(G,D){var z=D.edge;var C=D.type;var E=$(z).attr("_from");var F=$(z).attr("_to");if(!E||!F){return}var J;var I;if(C==="prev"){J=F;I=E}else{J=E;I=F}var H=h._getPositionFromTerminal(J);var y=h._getPositionFromTerminal(I);var B=w.x-H.x;var A=w.y-H.y;p.push({condition:{minX:y.x+B-u,maxX:y.x+B+u},fixedPosition:{x:y.x+B},guidePosition:{x:y.x},id:G});p.push({condition:{minY:y.y+A-u,maxY:y.y+A+u},fixedPosition:{y:y.y+A},guidePosition:{y:y.y},id:G})});return p};var l=function(v,u){var s={dx:v,dy:u};if(!i._CONFIG.AUTOMATIC_GUIDANCE){return s}var o=h.getBoundary(f);var p=o.getCentroid();var n={x:p.x+v,y:p.y+u};var t=function(w){if(!w){return s}if(w.x&&!w.y){return{dx:w.x-p.x,dy:s.dy}}if(w.y&&!w.x){return{dx:s.dx,dy:w.y-p.y}}if(w.x&&w.y){return{dx:w.x-p.x,dy:w.y-p.y}}return s};var q=$(f).data("correctionConditions");if(!q){return s}var r=[];$.each(q,function(x,w){var z=w.condition;var y=true;if(z.minX){if(n.xz.maxX){y=false}}if(z.minY){if(n.yz.maxY){y=false}}if(y){r.push(w)}});$.each(r,function(w,x){s=t(x.fixedPosition);var y=x.guidePosition;h.drawStickGuide(y)});if(!r.length){h.removeAllStickGuide()}return s};var e=function(){var n=$("[id$="+OG.Constants.DROP_OVER_BBOX_SUFFIX+"]");$.each(n,function(o,p){h.remove(p.id)});$(k).removeData("groupTarget")};var d=function(){e();var w=$(k).data("bBoxArray");if(!w){return}var r=[];var o=[];$.each(w,function(x,y){o=h.getAttr(y.box,"transform")[0];r.push(h.getElementById(y.id))});if(!o.length){return}var p=h.getBoundaryOfElements(r);var q=p.getUpperCenter().y+o[2];var t=p.getLeftCenter().x+o[1];var v=new OG.geometry.Envelope([t,q],p.getWidth(),p.getHeight());var n=h.getFrontForBoundary(v);if(!n){return}if(!i._CONFIG.GROUP_DROPABLE||!n.shape.GROUP_DROPABLE){return}if(h.isLane(n)){n=h.getRootLane(n)}if(n.shape instanceof OG.shape.bpmn.A_Task){return}if(n.shape.isCollapsed===true){return}var s=false;$.each(w,function(x,y){if(n.id===y.id){s=true}});if(s){return}var u=false;$.each(w,function(x,y){if(h.isLane(y.id)){u=true}});if(u){return}$(k).data("groupTarget",n);h.drawDropOverGuide(n)};if(g===true){$(f).draggable({start:function(n){var q=i._getOffset(n),p;if(!i._isSelectedElement(f)){$.each(i._getSelectedElement(),function(w,x){if(OG.Util.isElement(x)&&x.id){h.removeGuide(x)}})}h.removeAllEdgeGuide();h.removeGuide(f);p=h.drawGuide(f);if(m){h.drawGuide(h.getRootLane(f))}var o=[];$(i._RENDERER.getRootElement()).find("[id$="+OG.Constants.GUIDE_SUFFIX.BBOX+"]").each(function(x,y){if(y.id&&y.id.indexOf(OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX)==-1){var w=y.id.replace(OG.Constants.GUIDE_SUFFIX.BBOX,"");o.push({id:w})}});var s=false;var t;var r=function(x){if(x.id===f.id){s=true}var w=h.getChilds(x);$.each(w,function(y,z){h.removeGuide(z);if(x.id===f.id){s=true}if(h.isGroup(z)){r(z)}})};var u=function(w){if(!w){return}$.each(o,function(x,y){if(y.id===w.id){t=w}});u(h.getParent(w))};$.each(o,function(w,y){var x=h.getElementById(y.id);if(h.isGroup(x)){r(x)}});if(s){u(f);if(t){h.removeGuide(t);p=h.drawGuide(t)}}$(this).data("start",{x:q.x,y:q.y});$(this).data("offset",{x:q.x-i._num(h.getAttr(p.bBox,"x")),y:q.y-i._num(h.getAttr(p.bBox,"y"))});var v=i._getMoveTargets();$(k).data("bBoxArray",v);$(f).data("correctionConditions",b(v));h.removeRubberBand(h.getRootElement())},drag:function(q){var r=i._getOffset(q),u=$(this).data("start"),t=$(k).data("bBoxArray"),p=r.x-u.x,o=r.y-u.y,s=$(this).data("offset");var n=l(p,o);if("Y"==f.shape.AXIS){n.dx=0}else{if("X"==f.shape.AXIS){n.dy=0}}p=i._grid(n.dx,"move");o=i._grid(n.dy,"move");i._autoExtend(r.x,r.y,f);$(this).css({position:"",left:"",top:""});$.each(t,function(v,w){h.setAttr(w.box,{transform:"t"+p+","+o,"stroke-width":1})});d();h.removeAllConnectGuide()},stop:function(o){var r=i._getOffset(o),p=$(this).data("start"),v=$(k).data("bBoxArray"),x=r.x-p.x,w=r.y-p.y,t=$(k).data("groupTarget"),s=$(this).data("offset"),u;var q=l(x,w);if("Y"==f.shape.AXIS){q.dx=0}else{if("X"==f.shape.AXIS){q.dy=0}}x=i._grid(q.dx,"move");w=i._grid(q.dy,"move");$(this).css({position:"",left:"",top:""});u=i._moveElements(v,x,w);$(k).removeData("bBoxArray");h.removeAllGuide();if(t&&OG.Util.isElement(t)){h.addToGroup(t,u,r);h.remove(t.id+OG.Constants.DROP_OVER_BBOX_SUFFIX);$(k).removeData("groupTarget")}else{var n=[];$.each(u,function(z,A){var y=A.parentElement;if(!y){y=A.parentNode}if(y&&y.id!==k.id){n.push(A)}});h.addToGroup(k,n,r)}$.each(i._getSelectedElement(),function(y,z){c=h.drawGuide(z);if(c){i.setResizable(z,c,i._isResizable(z.shape));i.setConnectable(z,c,i._isConnectable(z.shape));h.toFront(c.group)}});h.removeAllConnectGuide();h.toFrontEdges();h.checkAllBridgeEdge();h.addHistory()}});h.setAttr(f,{cursor:"move"});OG.Util.apply(f.shape.geom.style.map,{cursor:"move"})}else{h.setAttr(f,{cursor:i._isSelectable(f.shape)?"pointer":i._CONFIG.DEFAULT_STYLE.SHAPE.cursor});OG.Util.apply(f.shape.geom.style.map,{cursor:i._isSelectable(f.shape)?"pointer":i._CONFIG.DEFAULT_STYLE.SHAPE.cursor});if(i._CONFIG.DRAG_PAGE_MOVABLE){var a=i._RENDERER._CANVAS._CONTAINER;$(f).bind("mousedown",function(o){if(o.button!=0){return}k=h.getRootGroup();var n=$(k).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);var p=$(k).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE);if(n==="active"||p==="active"){return}$(k).data("dragPageMove",{x:o.pageX,y:o.pageY});$(k).data("dragPageScroll",{x:a.scrollLeft,y:a.scrollTop})})}}},setConnectable:function(d,b,h){var e=this,c=e._RENDERER.getRootGroup(),a,g;var f=$(d).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE?true:false;if(!d||!b){return}if(h){if(!f){$.each(b.line,function(k,j){$(j.node).bind({click:function(i){g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);if(a){$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE,"created");$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_TEXT,j.text);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_LABEL,j.label);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_SHAPE,j.shape)}}});$(j.node).draggable({start:function(i){e.deselectAll();e._RENDERER.removeAllConnectGuide();e._RENDERER.removeAllVirtualEdge();g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE,"active");$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_TEXT,j.text);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_LABEL,j.label);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_SHAPE,j.shape)}})});$(b.rect).bind({click:function(i){g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);if(a){$(c).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE,"created")}}});$(b.rect).draggable({start:function(i){e.deselectAll();e._RENDERER.removeAllConnectGuide();e._RENDERER.removeAllVirtualEdge();g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);$(c).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE,"active")}})}}},setResizable:function(j,y,k){var x=this;var s=x._RENDERER.getRootGroup();if(!j||!y){return}var o=$(j).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE?true:false;var r=x._RENDERER;var t=x._RENDERER.getBoundary(j);var m=t.getUpperCenter().y;var q=t.getLowerCenter().y;var g=t.getLeftCenter().x;var i=t.getRightCenter().x;var w=t.getWidth();var n=t.getHeight();var d=function(Q){var P=[];var z=x._CONFIG.GUIDE_MIN_SIZE;var N=x._CONFIG.LANE_MIN_SIZE;var C=x._CONFIG.GROUP_INNER_SAPCE;if(!x._CONFIG.AUTOMATIC_GUIDANCE){return P}var R=x._CONFIG.EDGE_MOVE_DELAY_SIZE;var J=r.getAllShapes();$.each(J,function(T,U){if(r.isEdge(U)){return}if(U.id===j.id){return}var X=r.getBoundary(U);var S=X.getCentroid();var V=X.getUpperLeft();var W=X.getLowerRight();P.push({condition:{maxY:V.y-R,minY:V.y+R},fixedPosition:{y:V.y},guidePosition:{y:V.y},id:T});P.push({condition:{maxY:W.y-R,minY:W.y+R},fixedPosition:{y:W.y},guidePosition:{y:W.y},id:T});P.push({condition:{maxX:V.x-R,minX:V.x+R},fixedPosition:{x:V.x},guidePosition:{x:V.x},id:T});P.push({condition:{maxX:W.x-R,minX:W.x+R},fixedPosition:{x:W.x},guidePosition:{x:W.x},id:T});P.push({condition:{maxX:S.x-R,minX:S.x+R},fixedPosition:{x:S.x},guidePosition:{x:S.x},id:T});P.push({condition:{maxY:S.y-R,minY:S.y+R,},fixedPosition:{y:S.y},guidePosition:{y:S.y},id:T})});function A(){P.push({condition:{minX:g+z},fixedPosition:{x:g+z}})}function I(){P.push({condition:{maxX:i-z},fixedPosition:{x:i-z}})}function F(){P.push({condition:{maxY:q-z},fixedPosition:{y:q-z}})}function B(){P.push({condition:{minY:m+z},fixedPosition:{y:m+z}})}function D(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var U=r.getNearestBaseLaneIndexAsDirection(j,"upper");if(U>0){var T=S[U-1];var V=r.getBoundary(T).getHeight()-N;P.push({condition:{minY:m-V},fixedPosition:{y:m-V}})}}}function H(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var W=r.getNearestBaseLaneIndexAsDirection(j,"upper");var T=S[W];var Y=r.getBoundary(T).getHeight()-N;P.push({condition:{maxY:m+Y},fixedPosition:{y:m+Y}});if(W===0){var V=r.getBoundaryOfInnerShapesGroup(j);if(V){P.push({condition:{maxY:V.getUpperCenter().y-C},fixedPosition:{y:V.getUpperCenter().y-C}})}}}if(r.isVerticalLane(j)){var X=r.getSmallestBaseLane(j);var Y=r.getExceptTitleLaneArea(X).getHeight()-N;P.push({condition:{maxY:m+Y},fixedPosition:{y:m+Y}});var V=r.getBoundaryOfInnerShapesGroup(j);if(V){var Z=r.getRootLane(j);var U=r.getBoundary(Z).getHeight()-r.getExceptTitleLaneArea(Z).getHeight();P.push({condition:{maxY:V.getUpperCenter().y-C-U},fixedPosition:{y:V.getUpperCenter().y-C-U}})}}}function O(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var V=r.getNearestBaseLaneIndexAsDirection(j,"low");var T=S[V];var X=r.getBoundary(T).getHeight()-N;P.push({condition:{minY:q-X},fixedPosition:{y:q-X}});if(V===S.length-1){var U=r.getBoundaryOfInnerShapesGroup(j);if(U){P.push({condition:{minY:U.getLowerCenter().y+C},fixedPosition:{y:U.getLowerCenter().y+C}})}}}if(r.isVerticalLane(j)){var W=r.getSmallestBaseLane(j);var X=r.getExceptTitleLaneArea(W).getHeight()-N;P.push({condition:{minY:q-X},fixedPosition:{y:q-X}});var U=r.getBoundaryOfInnerShapesGroup(j);if(U){P.push({condition:{minY:U.getLowerCenter().y+C},fixedPosition:{y:U.getLowerCenter().y+C}})}}}function E(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var U=r.getNearestBaseLaneIndexAsDirection(j,"low");if(U0){var T=S[U-1];var V=r.getBoundary(T).getWidth()-N;P.push({condition:{maxX:i+V},fixedPosition:{x:i+V}})}}}if(b(Q)){F()}if(a(Q)){B()}if(f(Q)){I()}if(l(Q)){A()}if(r.isLane(j)){if(b(Q)){D();H()}if(a(Q)){O();E()}if(f(Q)){M();G()}if(l(Q)){K();L()}}return P};var c=function(A,D){var B={x:D.x,y:D.y};if(!x._CONFIG.AUTOMATIC_GUIDANCE){return B}var z=function(F){if(!F){return B}if(F.x&&!F.y){return{x:F.x,y:B.y}}if(F.y&&!F.x){return{x:B.x,y:F.y}}if(F.x&&F.y){return F}return B};var C=$(A).data("correctionConditions");if(!C){return B}var E=[];$.each(C,function(G,F){var I=F.condition;var H=true;if(I.minX){if(D.x>I.minX){H=false}}if(I.maxX){if(D.xI.minY){H=false}}if(I.maxY){if(D.y4){p=4}var h=d._CANVAS._CONTAINER;var g=m.x;var e=m.y;d.setScale(p);m=c._getOffset(f);var q=m.x;var o=m.y;var l=(g-q)*p;var k=(e-o)*p;var i=h.scrollLeft;var n=h.scrollTop;$(h).scrollLeft(i+l);$(h).scrollTop(n+k);d._CANVAS.updateNavigatior()};$(b).bind("mousewheel DOMMouseScroll",function(e){if(c._CONFIG.WHEEL_SCALABLE){e.preventDefault();e.stopPropagation();if(e.originalEvent.wheelDelta>0||e.deltaY>0){a(e,true)}else{a(e,false)}}})},setDragSelectable:function(isSelectable){var renderer=this._RENDERER;var me=this,rootEle=renderer.getRootElement(),root=renderer.getRootGroup();var correctionConditionAnalysis=function(correctionConditions,offset){var fixedPosition={x:offset.x,y:offset.y};var calculateFixedPosition=function(expectedPosition){if(!expectedPosition){return fixedPosition}if(expectedPosition.x&&!expectedPosition.y){return{x:expectedPosition.x,y:fixedPosition.y}}if(expectedPosition.y&&!expectedPosition.x){return{x:fixedPosition.x,y:expectedPosition.y}}if(expectedPosition.x&&expectedPosition.y){return expectedPosition}return fixedPosition};if(!correctionConditions||!correctionConditions.length){return fixedPosition}var conditionsPassCandidates=[];$.each(correctionConditions,function(index,correctionCondition){var condition=correctionCondition.condition;var conditionsPassToFix=true;if(condition.minX){if(offset.x>condition.minX){conditionsPassToFix=false}}if(condition.maxX){if(offset.xcondition.minY){conditionsPassToFix=false}}if(condition.maxY){if(offset.yOG.Constants.RUBBER_BAND_TOLERANCE&&Math.abs(height)>OG.Constants.RUBBER_BAND_TOLERANCE){$(this).data("rubber_band_status","start");x=width<=0?first.x+width:first.x;y=height<=0?first.y+height:first.y;renderer.drawRubberBand([x,y],[Math.abs(width),Math.abs(height)])}}});$(rootEle).bind("mouseup",function(event){var isConnectMode=$(root).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);var isRectMode=$(root).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE);if(isConnectMode==="active"||isRectMode==="active"){return}if("start"==$(this).data("rubber_band_status")&&!me._CONFIG.DRAG_PAGE_MOVABLE){var first=$(this).data("dragBox_first"),eventOffset,width,height,x,y,envelope,guide,elements=[];renderer.removeRubberBand(rootEle);if(first){eventOffset=me._getOffset(event);width=eventOffset.x-first.x;height=eventOffset.y-first.y;x=width<=0?first.x+width:first.x;y=height<=0?first.y+height:first.y;envelope=new OG.Envelope([x,y],Math.abs(width),Math.abs(height));$.each(renderer.getAllShapes(),function(index,element){if(!element.shape.geom){return}if(!envelope.isContainsAll(element.shape.geom.getVertices())){return}if(renderer.isEdge(element)){return}elements.push(element)});me.selectShapes(elements);$(this).data("dragBox",{width:width,height:height,x:x,y:y})}$(this).data("rubber_band_status","none")}});$(rootEle).bind("contextmenu",function(event){renderer.removeRubberBand(rootEle)})}else{$(rootEle).unbind("mousedown");$(rootEle).unbind("mousemove");$(rootEle).unbind("mouseup");$(rootEle).unbind("contextmenu")}},setEnableHotKey:function(d){var b=this;var c=b._RENDERER;if(d===true){var a;if(b._CONFIG.FOCUS_CANVAS_ONSELECT){a=$(c.getContainer())}else{a=$(document)}a.bind("keydown",function(e){if(!/^textarea$/i.test(e.target.tagName)&&!/^input$/i.test(e.target.tagName)){if(b._CONFIG.ENABLE_HOTKEY_CTRL_Z&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_Z){if(e.shiftKey){e.preventDefault();c.redo()}else{e.preventDefault();c.undo()}}if(b._CONFIG.ENABLE_HOTKEY_DELETE&&(e.keyCode===KeyEvent.DOM_VK_DELETE||e.keyCode===KeyEvent.DOM_VK_BACK_SPACE)){e.preventDefault();b.deleteSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_A&&b._CONFIG.SELECTABLE&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_A){e.preventDefault();b.selectAll()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_C&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_C){e.preventDefault();b.copySelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_C&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_X){e.preventDefault();b.cutSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_V&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_V){e.preventDefault();b.pasteSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_D&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_D){e.preventDefault();b.duplicateSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_G&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_G){e.preventDefault();b.groupSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_U&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_U){e.preventDefault();b.ungroupSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_SHIFT_ARROW){if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_LEFT){e.preventDefault();b._moveElements(b._getMoveTargets(),-1*(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1),0);c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_RIGHT){e.preventDefault();b._moveElements(b._getMoveTargets(),(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1),0);c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_UP){e.preventDefault();b._moveElements(b._getMoveTargets(),0,-1*(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1));c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_DOWN){e.preventDefault();b._moveElements(b._getMoveTargets(),0,(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1));c.addHistory()}}if(b._CONFIG.ENABLE_HOTKEY_ARROW){if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_LEFT){e.preventDefault();b._moveElements(b._getMoveTargets(),-1*(b._CONFIG.MOVE_SNAP_SIZE/2),0);b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_RIGHT){e.preventDefault();b._moveElements(b._getMoveTargets(),(b._CONFIG.MOVE_SNAP_SIZE/2),0);b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_UP){e.preventDefault();b._moveElements(b._getMoveTargets(),0,-1*(b._CONFIG.MOVE_SNAP_SIZE/2));b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_DOWN){e.preventDefault();b._moveElements(b._getMoveTargets(),0,(b._CONFIG.MOVE_SNAP_SIZE/2));b.selectShapes(b._getSelectedElement());c.addHistory()}}}})}else{$(c.getContainer()).unbind("keydown")}},enableRootContextMenu:function(){var a=this;var b=a._RENDERER;$.contextMenu({position:function(d,c,e){d.$menu.css({top:e+10,left:c+10})},selector:"#"+a._RENDERER.getRootElement().id,build:function(c,g){var f=a._RENDERER.getRootGroup(),d=$(f).data("copied");if(a._CONFIG.FOCUS_CANVAS_ONSELECT){$(a._RENDERER.getContainer()).focus()}return{items:{selectAll:{name:"모두 선택",callback:function(){a.selectAll()}},sep1:"---------",paste:{name:"붙여넣기",callback:function(){a.pasteSelectedShape(g)},disabled:(d?false:true)},sep2:"---------",view:{name:"스케일",items:{view_actualSize:{name:"실제 사이즈",callback:function(){a._RENDERER.setScale(1);b.addHistory()}},sep2_1:"---------",view_fitWindow:{name:"윈도우에 맞추기",callback:function(){a.fitWindow()}},sep2_2:"---------",view_25:{name:"25%",callback:function(){a._RENDERER.setScale(0.25);b.addHistory()}},view_50:{name:"50%",callback:function(){a._RENDERER.setScale(0.5);b.addHistory()}},view_75:{name:"75%",callback:function(){a._RENDERER.setScale(0.75);b.addHistory()}},view_100:{name:"100%",callback:function(){a._RENDERER.setScale(1);b.addHistory()}},view_150:{name:"150%",callback:function(){a._RENDERER.setScale(1.5);b.addHistory()}},view_200:{name:"200%",callback:function(){a._RENDERER.setScale(2);b.addHistory()}},view_300:{name:"300%",callback:function(){a._RENDERER.setScale(3);b.addHistory()}},view_400:{name:"400%",callback:function(){a._RENDERER.setScale(4);b.addHistory()}},sep2_3:"---------",view_zoomin:{name:"확대",callback:function(){a.zoomIn()}},view_zoomout:{name:"축소",callback:function(){a.zoomOut()}}}}}}}})},makeRotate:function(){var a=this;return{rotate:{name:"회전",items:{rotate_select:{name:"선택",type:"select",options:{"0":"0","45":"45","90":"90","135":"135","180":"180","-45":"-45","-90":"-90","-135":"-135","-180":"-180"},selected:"0",events:{change:function(b){a.rotateSelectedShape(b.target.value)}}},sep8_8_1:"---------",rotate_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.rotateSelectedShape(b.target.value)}}}}}}}},makeFillColor:function(){var a=this;return{fillColor:{name:"색상",items:{fillColor_select:{name:"선택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFillColorSelectedShape(b.target.value)}}}},sep5_1_1:"---------",fillColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFillColorSelectedShape(b.target.value)}}}}}}}},makeFillOpacity:function(){var a=this;return{fillOpacity:{name:"투명도",items:{fillOpacity_select:{name:"선택",type:"select",options:{"":"","0.0":"0%","0.1":"10%","0.2":"20%","0.3":"30%","0.4":"40%","0.5":"50%","0.6":"60%","0.7":"70%","0.8":"80%","0.9":"90%","1.0":"100%"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFillOpacitySelectedShape(b.target.value)}}}}}}}},makeLineStyle:function(){var a=this;return{lineStyle:{name:"선 스타일",items:{lineStyle_1:{name:"──────",type:"radio",radio:"lineStyle",value:"",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_2:{name:"---------",type:"radio",radio:"lineStyle",value:"-",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_3:{name:"············",type:"radio",radio:"lineStyle",value:".",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_4:{name:"-·-·-·-·-·",type:"radio",radio:"lineStyle",value:"-.",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_5:{name:"-··-··-··-",type:"radio",radio:"lineStyle",value:"-..",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_6:{name:"· · · · · ·",type:"radio",radio:"lineStyle",value:". ",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_7:{name:"- - - - -",type:"radio",radio:"lineStyle",value:"- ",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_8:{name:"─ ─ ─ ─",type:"radio",radio:"lineStyle",value:"--",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_9:{name:"- ·- ·- ·-",type:"radio",radio:"lineStyle",value:"- .",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_10:{name:"--·--·--·-",type:"radio",radio:"lineStyle",value:"--.",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_11:{name:"--··--··--",type:"radio",radio:"lineStyle",value:"--..",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}}}}}},makeLineColor:function(){var a=this;return{lineColor:{name:"선 색상",items:{lineColor_select:{name:"석택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setLineColorSelectedShape(b.target.value)}}}},sep5_4_1:"---------",lineColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLineColorSelectedShape(b.target.value)}}}}}}}},makeLineWidth:function(){var a=this;return{lineWidth:{name:"선 두께",items:{lineWidth_select:{name:"선택",type:"select",options:{0:"",1:"1px",2:"2px",3:"3px",4:"4px",5:"5px",6:"6px",8:"8px",10:"10px",12:"12px",16:"16px",24:"24px"},selected:0,events:{change:function(b){if(b.target.value!==0){a.setLineWidthSelectedShape(b.target.value)}}}},sep5_5_1:"---------",lineWidth_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLineWidthSelectedShape(b.target.value)}}}}}}}},makeFont:function(){var a=this;return{text:{name:"글꼴",items:{fontFamily:{name:"폰트",items:{fontFamily_1:{name:'Arial',type:"radio",radio:"fontFamily",value:"Arial",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_2:{name:"Comic Sans MS",type:"radio",radio:"fontFamily",value:"Comic Sans MS",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_3:{name:"Courier New",type:"radio",radio:"fontFamily",value:"Courier New",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_4:{name:'Garamond',type:"radio",radio:"fontFamily",value:"Garamond",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_5:{name:'Georgia',type:"radio",radio:"fontFamily",value:"Georgia",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_6:{name:"Lucida Console",type:"radio",radio:"fontFamily",value:"Lucida Console",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_7:{name:"MS Gothic",type:"radio",radio:"fontFamily",value:"MS Gothic",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_8:{name:"MS Sans Serif",type:"radio",radio:"fontFamily",value:"MS Sans Serif",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_9:{name:'Verdana',type:"radio",radio:"fontFamily",value:"Verdana",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_10:{name:"Times New Roman",type:"radio",radio:"fontFamily",value:"Times New Roman",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},sep6_1_1:"---------",fontFamily_custom:{name:"Custom",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontFamilySelectedShape(b.target.value)}}}}}},fontColor:{name:"글 색상",items:{fontColor_select:{name:"선택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFontColorSelectedShape(b.target.value)}}}},sep6_1_2:"---------",fontColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontColorSelectedShape(b.target.value)}}}}}},fontSize:{name:"글 크기",items:{fontSize_select:{name:"선택",type:"select",options:{"":"","6":"6","8":"8","9":"9","10":"10","11":"11","12":"12","14":"14","18":"18","24":"24","36":"36","48":"48","72":"72"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFontSizeSelectedShape(b.target.value)}}}},sep6_1_3:"---------",fontSize_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontSizeSelectedShape(b.target.value)}}}}}},sep6_1:"---------",fontWeight_bold:{name:'굵게',type:"checkbox",events:{change:function(b){if(b.target.checked){a.setFontWeightSelectedShape("bold")}else{a.setFontWeightSelectedShape("normal")}}}},fontWeight_italic:{name:'이탤릭',type:"checkbox",events:{change:function(b){if(b.target.checked){a.setFontStyleSelectedShape("italic")}else{a.setFontStyleSelectedShape("normal")}}}},sep6_2:"---------",position:{name:"글 위치",items:{position_left:{name:"왼쪽",type:"radio",radio:"position",value:"left",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_center:{name:"가운데",type:"radio",radio:"position",value:"center",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_right:{name:"오른쪽",type:"radio",radio:"position",value:"right",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_top:{name:"위",type:"radio",radio:"position",value:"top",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_bottom:{name:"아래",type:"radio",radio:"position",value:"bottom",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}}}},vertical:{name:"수직 정렬",items:{vertical_top:{name:"위",type:"radio",radio:"vertical",value:"top",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}},vertical_middle:{name:"가운데",type:"radio",radio:"vertical",value:"middle",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}},vertical_bottom:{name:"아래",type:"radio",radio:"vertical",value:"bottom",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}}}},horizontal:{name:"수평 정렬",items:{vertical_start:{name:"왼쪽",type:"radio",radio:"horizontal",value:"start",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}},horizontal_middle:{name:"가운데",type:"radio",radio:"horizontal",value:"middle",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}},horizontal_end:{name:"오른쪽",type:"radio",radio:"horizontal",value:"end",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}}}},sep6_5:"---------",textRotate:{name:"글 회전각",items:{textRotate_select:{name:"선택",type:"select",options:{"0":"0","45":"45","90":"90","135":"135","180":"180","-45":"-45","-90":"-90","-135":"-135","-180":"-180"},selected:"0",events:{change:function(b){a.setLabelAngleSelectedShape(b.target.value)}}},sep6_6_1:"---------",textRotate_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLabelAngleSelectedShape(b.target.value)}}}}}}}}}},makeBring:function(){var a=this;return{bringToFront:{name:"맨 앞으로 가져오기",items:{bringToFront:{name:"맨 앞으로 가져오기",callback:function(){a.bringToFront()}},bringForward:{name:"앞으로 가져오기",callback:function(){a.bringForward()}}}}}},makeSend:function(){var a=this;return{sendToBack:{name:"맨 뒤로 보내기",items:{sendToBack:{name:"맨 뒤로 보내기",callback:function(){a.sendToBack()}},sendBackward:{name:"뒤로 보내기",callback:function(){a.sendBackward()}}}}}},makeDelete:function(){var a=this;return{"delete":{name:"삭제",callback:function(){a.deleteSelectedShape()}}}},makeCopy:function(){var a=this;return{copy:{name:"복사",callback:function(){a.copySelectedShape()}}}},makeAlign:function(){var a=this;return{align:{name:"도형 정렬",items:{Top:{name:"위로정렬",type:"radio",radio:"align",value:"Top",events:{change:function(b){a._RENDERER.alignTop();a._RENDERER.addHistory()}}},Left:{name:"왼쪽정렬",type:"radio",radio:"align",value:"Left",events:{change:function(b){a._RENDERER.alignLeft();a._RENDERER.addHistory()}}},Right:{name:"오른쪽정렬",type:"radio",radio:"align",value:"Right",events:{change:function(b){a._RENDERER.alignRight();a._RENDERER.addHistory()}}},Bottom:{name:"아래로정렬",type:"radio",radio:"align",value:"Bottom",events:{change:function(b){a._RENDERER.alignBottom();a._RENDERER.addHistory()}}}}}}},makeFormat:function(){return{format:{name:"형식",items:this.mergeContextMenu(this.makeFillColor(),this.makeFillOpacity(),this.makeRotate(),this.makeLineStyle(),this.makeLineColor(),this.makeLineWidth())}}},makeMultiContextMenu:function(){return this.mergeContextMenu(this.makeDelete(),this.makeCopy(),this.makeAlign())},mergeContextMenu:function(){var d={};for(var c=0,a=arguments.length;c=a._CONFIG.SCALE_MIN){a._RENDERER.setScale(a._CONFIG.SCALE-a._CONFIG.SCALE*0.1)}a._RENDERER.addHistory()},fitWindow:function(){var b=this,a=b._RENDERER.getContainer();b._RENDERER.fitCanvasSize([a.clientWidth,a.clientHeight],true);b._RENDERER.addHistory()},_isContainsConnectedShape:function(a,k){var g=this,e,l,h,b,f=false,d=false,c;e=$(a).attr("_from");l=$(a).attr("_to");if(e){h=g._getShapeFromTerminal(e)}if(l){b=g._getShapeFromTerminal(l)}for(var c=0,j=k.length;c0){c._copyChildren(h,i)}}})},_deselectChildren:function(b){var c=this,a=b.childNodes;$.each(a,function(d,e){if($(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE){if(e.childNodes.length>0){c._deselectChildren(e);c._delSelectedElement(e)}if($(e).attr("_selected")==="true"){c._RENDERER.removeGuide(e);$(e).draggable("destroy")}}})},_isParentSelected:function(b){var c=this,a=b.parentNode;if(a){if(c._isParentSelected(a)){return true}if($(a).attr("_type")===OG.Constants.NODE_TYPE.SHAPE&&$(a).attr("_selected")==="true"){return true}}return false},_num:function(a){return parseInt(a,10)},_grid:function(c,a){var b=this;if(a){return b._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(c,b._CONFIG.MOVE_SNAP_SIZE/2):c}else{return b._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(c,b._CONFIG.MOVE_SNAP_SIZE):c}},_isSelectable:function(a){var b=this;return b._CONFIG.SELECTABLE&&a.SELECTABLE},_isConnectable:function(a){var b=this;return b._CONFIG.CONNECTABLE&&a.CONNECTABLE},_isConnectableFrom:function(a){var b=this;return a.ENABLE_FROM},_isConnectableTo:function(a){var b=this;return a.ENABLE_TO},_isSelfConnectable:function(a){var b=this;return b._CONFIG.SELF_CONNECTABLE&&a.SELF_CONNECTABLE},_isConnectCloneable:function(a){var b=this;return b._CONFIG.CONNECT_CLONEABLE&&a.CONNECT_CLONEABLE},_isMovable:function(a){var b=this;return(b._CONFIG.SELECTABLE&&a.SELECTABLE)&&(b._CONFIG.MOVABLE&&b._CONFIG.MOVABLE_[a.TYPE]&&a.MOVABLE)},_isDeletable:function(a){var b=this;return(b._CONFIG.DELETABLE&&a.DELETABLE)&&(b._CONFIG.DELETABLE&&b._CONFIG.DELETABLE_[a.TYPE]&&a.DELETABLE)},_isConnectStyleChangable:function(a){var b=this;return(b._CONFIG.CONNECT_STYLE_CHANGE&&a.CONNECT_STYLE_CHANGE)&&(b._CONFIG.CONNECT_STYLE_CHANGE&&b._CONFIG.CONNECT_STYLE_CHANGE_[a.TYPE]&&a.CONNECT_STYLE_CHANGE)},_isResizable:function(a){var b=this;return(b._CONFIG.SELECTABLE&&a.SELECTABLE)&&(b._CONFIG.RESIZABLE&&b._CONFIG.RESIZABLE_[a.TYPE]&&a.RESIZABLE)},_isLabelEditable:function(a){var b=this;return b._CONFIG.LABEL_EDITABLE&&b._CONFIG.LABEL_EDITABLE_[a.TYPE]&&a.LABEL_EDITABLE},_addSelectedElement:function(a){if(undefined==this.selectedElements){this.selectedElements={}}this.selectedElements[a.attributes.id.value]=a;if(a.shape){a.shape.onSelectShape()}},_delSelectedElement:function(a){if(this.selectedElements){delete this.selectedElements[a.attributes.id.value];if(a.shape){a.shape.onDeSelectShape()}}},_getSelectedElement:function(){var a,b=[];for(a in this.selectedElements){b.push(this.selectedElements[a])}return b},_isSelectedElement:function(c){var a=false;if(c&&c.id){for(var b in this.selectedElements){if(b===c.id){a=true}}}return a},_removeAllSelectedElement:function(){var b;for(b in this.selectedElements){var a=this.selectedElements[b];delete this.selectedElements[b];if(a&&a.shape){a.shape.onDeSelectShape()}}},setConnectGuide:function(e,d){var h=this._RENDERER;var i=this,m,g,f,c,b,j=h.getRootGroup();var j=h.getRootGroup();var l=function(u){var r=i._CONFIG.EDGE_MOVE_DELAY_SIZE;var p=[];var o=[];var v=$(u).data("type");var t=e.shape.geom.getVertices();var n;if(!i._CONFIG.AUTOMATIC_GUIDANCE){n=e.shape.geom.getVertices();$.each(n,function(w,x){o.push(x)})}else{var q=h.getAllEdges();$.each(q,function(w,x){n=x.shape.geom.getVertices();$.each(n,function(y,z){o.push(z)})})}if(v===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var s=$(u).data("index");if(s===0||s===t.length-1){$.each(j.childNodes,function(x,z){if($(z).attr("_type")===OG.Constants.NODE_TYPE.SHAPE&&$(z).attr("_shape")!==OG.Constants.SHAPE_TYPE.EDGE){var B=h.getBoundary(z);if(B&&B._upperLeft){var y=B._upperLeft;var A=B._width;var w=B._height;p.push({condition:{minX:y.x+(A/2)-r,maxX:y.x+(A/2)+r,minY:y.y,maxY:y.y+w,},fixedPosition:{x:y.x+(A/2)},id:x});p.push({condition:{minX:y.x,maxX:y.x+A,minY:y.y+(w/2)-r,maxY:y.y+(w/2)+r,},fixedPosition:{y:y.y+(w/2)},id:x})}}})}}$.each(o,function(x,w){p.push({condition:{minX:w.x-r,maxX:w.x+r,},fixedPosition:{x:w.x},id:x});p.push({condition:{minY:w.y-r,maxY:w.y+r,},fixedPosition:{y:w.y},id:x})});$(u).data("correctionConditions",p)};var k=function(q,r){var o={x:r.x,y:r.y};var n=function(t){if(!t){return o}if(t.x&&!t.y){return{x:t.x,y:o.y}}if(t.y&&!t.x){return{x:o.x,y:t.y}}if(t.x&&t.y){return t}return o};var p=$(q).data("correctionConditions");if(!p){return o}var s=[];$.each(p,function(u,t){var w=t.condition;var v=true;if(w.minX){if(r.xw.maxX){v=false}}if(w.minY){if(r.yw.maxY){v=false}}if(v){s.push(t)}});$.each(s,function(t,u){o=n(u.fixedPosition)});return o};var a=function(p){var q;var o=e.shape.geom.getVertices();if($(p).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var n=$(p).data("index");if(n||n===0){if(n===0){q="from"}if(n===o.length-1){q="to"}}}return q};$(e).bind({mousemove:function(r){if(!i._isConnectable(e.shape)){return}var p=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var s=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var n=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER);var q=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);var o=$(j).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);if(!p||n||q||o){return}if(s){if(i._CONFIG.SPOT_ON_SELECT&&$(e).attr("_selected")!="true"){return}c=i._getOffset(r);var t=h.createVirtualSpot(c.x,c.y,e);if(t){$(t).bind({mousedown:function(){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,true)},mouseup:function(){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false)}});$(t).draggable({start:function(v){h.removeAllGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,true);var x=i._getOffset(v);var I=$(this).data("vertice");var E=e.shape.geom;$(this).data("offset",{x:x.x-I.x,y:x.y-I.y});var w=$(this).data("prev");var A=$(this).data("next");var C=E.getVertices();var y=$(this).data("offset");var u=x.x-y.x;var K=x.y-y.y;var J=E.convertCoordinate([u,K]);f=h.getCircleSpots(e);$.each(f,function(N,L){var M=$(L).data("index");if(M>=A){$(L).data("index",M+1)}});C.splice(A,0,J);E.setVertices(C);$(this).attr("name",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT);$(this).data("index",A);var D=true;if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var B=$(this).data("index");if(B===0&&B===C.length-1){D=false}}if(D){var G=$(e).attr("_from");var F=$(e).attr("_to");if(G){var z=h._getPositionFromTerminal(G);C[0]=E.convertCoordinate([z.x,z.y])}if(F){var H=h._getPositionFromTerminal(F);C[C.length-1]=E.convertCoordinate([H.x,H.y])}E.setVertices(C)}$(this).data("corrections",l(t));e=h.drawEdge(new OG.PolyLine(C),E.style,e.id);h.removeRubberBand(h.getRootElement());h.selectSpot(t)},drag:function(w){if(!h._getREleById(t.id)){h.removeAllConnectGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);return}var x=i._getOffset(w);var B=$(this).data("offset");var A=x.x-B.x;var z=x.y-B.y;var v=e.shape.geom.getVertices();var y=k(t,{x:A,y:z});A=y.x;z=y.y;h.setAttr(t,{cx:A});h.setAttr(t,{cy:z});var u=$(this).data("index");v[u].x=A;v[u].y=z;h.drawEdge(new OG.PolyLine(v),e.shape.geom.style,e.id);h.trimConnectIntersection(e)},stop:function(w){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);var x=i._getOffset(w);var B=$(this).data("offset");var v=$(this).data("index");var A=x.x-B.x;var z=x.y-B.y;var u=e.shape.geom.getVertices();var y=k(t,{x:A,y:z});y.x=i._grid(y.x,"move");y.y=i._grid(y.y,"move");A=y.x;z=y.y;u[v].x=A;u[v].y=z;h.drawEdge(new OG.PolyLine(u),e.shape.geom.style,e.id);h.removeConnectGuide(e);h.removeVirtualSpot(e);h.trimConnectInnerVertice(e);h.trimConnectIntersection(e);h.trimEdge(e);h.addHistory()}})}}},mouseout:function(p){if(!i._isConnectable(e.shape)){return}var n=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var q=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var o=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);if(!n){return}if(!q){if(o){return}h.removeConnectGuide(e)}if(q){if(o){return}b=false;c=i._getOffset(p);g=h.getSpots(e);$(g).each(function(s,t){m=h.getBBox(t);if(c.x>=m.x&&c.x<=m.x2&&c.y>=m.y&&c.y<=m.y2){b=true}});var r=h.getVirtualSpot(e);if(r){m=h.getBBox(r);if(c.x>=m.x&&c.x<=m.x2&&c.y>=m.y&&c.y<=m.y2){b=true}}if(!b){h.removeConnectGuide(e);h.removeVirtualSpot(e)}}p.stopImmediatePropagation()},mouseover:function(s){if(!i._isConnectable(e.shape)){return}var n;var o=i._CONFIG.DEFAULT_STYLE.CONNECTABLE_HIGHLIGHT;var q=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var t=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var r=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);var p=$(j).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);if(!q){return}if(!t){if(r){return}h.removeAllConnectGuide();h.drawConnectGuide(e)}if(t){if(i._CONFIG.SPOT_ON_SELECT&&$(e).attr("_selected")!="true"){return}if(p){return}if(r){return}h.removeOtherConnectGuide(e);n=h.drawConnectGuide(e);if(n&&n.spots){$(n.spots).each(function(u,v){$(v).bind({mouseover:function(){var w=false;if($(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG)){w=true}if(!w){h.selectSpot(v);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,true)}},mouseout:function(){var w=false;if($(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG)){w=true}if(!w){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false)}}});$(v).draggable({start:function(w){h.removeAllGuide();h.toFront(e);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,true);var z=i._getOffset(w);var K=$(this).data("vertice");var G=e.shape.geom;var E=G.getVertices();$(this).data("offset",{x:z.x-K.x,y:z.y-K.y});var F=true;if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var D=$(this).data("index");if(D===0||D===E.length-1){F=false}}$(this).data("needToRedrawVertices",F);if(F){var I=$(e).attr("_from");var H=$(e).attr("_to");if(I){var B=h._getPositionFromTerminal(I);E[0]=G.convertCoordinate([B.x,B.y])}if(H){var J=h._getPositionFromTerminal(H);E[E.length-1]=G.convertCoordinate([J.x,J.y])}G.setVertices(E)}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){$(this).data("corrections",l(v));h.remove(n.bBox);h.removeRubberBand(h.getRootElement())}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){E=G.getVertices();var y=$(this).data("prev");var A=$(this).data("next");if(y===0){var C=e.shape.geom.convertCoordinate([E[0].x,E[0].y]);E.splice(y,0,C);$(this).data("prev",y+1);$(this).data("next",A+1);A=A+1}if(A===E.length-1){var x=G.convertCoordinate([E[E.length-1].x,E[E.length-1].y]);E.splice(A,0,x)}G.setVertices(E);$(this).data("corrections",l(v));h.remove(n.bBox);h.removeRubberBand(h.getRootElement())}},drag:function(z){if(!h._getREleById(v.id)){h.removeAllConnectGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);return}var B=i._getOffset(z);var C=$(this).data("offset");var y=B.x-C.x;var K=B.y-C.y;var F=e.shape.geom.getVertices();var G=k(v,{x:y,y:K});if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){y=G.x;K=G.y;h.setAttr(v,{cx:y});h.setAttr(v,{cy:K});var E=$(this).data("index");F[E].x=y;F[E].y=K}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){y=G.x;K=G.y;var x=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var J=x.h;var H=$(this).data("direction");var A=$(this).data("prev");var D=$(this).data("next");if(H==="vertical"){F[A].x=y;F[D].x=y;h.setAttr(v,{x:y-(J/2)})}if(H==="horizontal"){F[A].y=K;F[D].y=K;h.setAttr(v,{y:K-(J/2)})}}h.drawEdge(new OG.PolyLine(F),e.shape.geom.style,e.id);if($(this).data("needToRedrawVertices")){h.trimConnectIntersection(e)}var w=a(v);var I=h.getFrontForCoordinate([B.x,B.y]);$.each(h.getAllNotEdges(),function(L,M){if(I&&w){if(M.id===I.id){h.setHighlight(M,o);h.drawConnectGuide(M)}else{h.removeHighlight(M,o);h.removeConnectGuide(M)}}else{h.removeHighlight(M,o);h.removeConnectGuide(M)}})},stop:function(H){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);var N=i._getOffset(H);var x=$(this).data("offset");var z=$(this).data("index");var L=N.x-x.x;var J=N.y-x.y;var y=e.shape.geom.getVertices();var B=k(v,{x:L,y:J});B.x=i._grid(B.x,"move");B.y=i._grid(B.y,"move");if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){L=B.x;J=B.y;h.setAttr(v,{cx:L});h.setAttr(v,{cy:J});var z=$(this).data("index");y[z].x=L;y[z].y=J}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){L=B.x;J=B.y;var w=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var C=w.h;var M=$(this).data("direction");var D=$(this).data("prev");var E=$(this).data("next");if(M==="vertical"){y[D].x=L;y[E].x=L;h.setAttr(v,{x:L-(C/2)})}if(M==="horizontal"){y[D].y=J;y[E].y=J;h.setAttr(v,{y:J-(C/2)})}}h.drawEdge(new OG.PolyLine(y),e.shape.geom.style,e.id);h.removeConnectGuide(e);h.removeVirtualSpot(e);var A=a(v);var I=h.getFrontForCoordinate([N.x,N.y]);if(I){h.removeHighlight(I,o)}if(A&&I){var F=[L,J];var K=h.createTerminalString(I,F);var G=i._isConnectable(I.shape);if(G){if(A==="from"){if(i._isConnectableFrom(I.shape)){h.connect(K,null,e,e.shape.geom.style)}}if(A==="to"){if(i._isConnectableTo(I.shape)){h.connect(null,K,e,e.shape.geom.style)}}}}if(A&&!I){h.disconnectOneWay(e,A)}h.trimConnectInnerVertice(e);h.trimConnectIntersection(e);h.trimEdge(e);h.addHistory()}})})}}s.stopImmediatePropagation()}})}};OG.handler.EventHandler.prototype.constructor=OG.handler.EventHandler;OG.EventHandler=OG.handler.EventHandler;OG.handler.RemoteUser=function(b,a,c){this.key=b;this.name=a;this.sessionId=c;this.isMaster=false;this.editable=false};OG.handler.RemoteUser.prototype={getKey:function(){return this.key},setKey:function(a){this.key=a},getName:function(){return this.name},setName:function(a){this.name=a},getSessionId:function(){return this.sessionId},setSessionId:function(a){this.sessionId=a},getIsMaster:function(){return this.isMaster},setIsMaster:function(a){this.isMaster=a},getEditable:function(){return this.editable},setEditable:function(a){this.editable=a}};OG.handler.RemoteUser.prototype.constructor=OG.handler.RemoteUser;OG.RemoteUser=OG.handler.RemoteUser();OG.handler.RemoteRepo={};OG.handler.RemoteHandler=function(){this._REPO=OG.handler.RemoteRepo;this._CLASSNAME="org.uengine.opengraph.RemoteService";this._SESSIONID=null;this._ENCODESUFFIX="_%$";this._SCHEDULER=null};OG.handler.RemoteHandler.prototype={encodeJson:function(a){return JSON.stringify(a).replace(/"/gi,this._ENCODESUFFIX)},getRepo:function(){return this._REPO},setCanvasForIdentifier:function(b,a){var c=this.getRepo();if(!c[a]){c[a]={canvas:null,users:[]}}c[a].canvas=b;return c[a]},getCanvasByIdentifier:function(a){var b=this.getRepo();if(!b[a]){return null}return b[a].canvas},getRemote:function(c){var b={__className:this._CLASSNAME};if(c){for(var a in c){b[a]=c[a]}}return new MetaworksObject(b,"body")},convertRemoteUser:function(b){var a=new OG.handler.RemoteUser();a.setKey(b.key);a.setName(b.name);a.setSessionId(b.sessionId);a.setIsMaster(b.isMaster);a.setEditable(b.editable);return a},closeRemote:function(b){var a=b.__objectId;$("#objDiv_"+a).remove();delete mw3.objects[a]},getCanvasId:function(a){return a._CONTAINER.id},startRemote:function(c,b,a,e){var d=this;if(!c||!b||!a){return}if(!a.key||!a.name){return}c.setRemotable(true);c.setIdentifier(b);d.setCanvasForIdentifier(c,b);d.registeToServer(b,a,function(f){e(f)})},getSelfSession:function(d){if(this._SESSIONID){d(this._SESSIONID);return}var b=this;var c=this.getRemote();var a=c.__objectId;c.selfSession(null,function(){var e=mw3.objects[a]["currentSessionId"];b.closeRemote(c);if(e){b._SESSIONID=e}d(e)})},registeToServer:function(d,c,g){var e=this,b;var f=this.getRemote({identifier:d,remoteUser:e.encodeJson(c)});var a=f.__objectId;f.registe(null,function(i){b=mw3.objects[a];e.closeRemote(f);var h=e.convertRemoteUser(JSON.parse(b.remoteUser));g(h)})},updateRemoteUser:function(e){var d=this;var g=JSON.parse(e);var b=g.identifier;var c=g.remoteUsers;if(!this.getRepo()[b]){return}var f=[];var a=this.getCanvasByIdentifier(b);this.getSelfSession(function(j){$.each(c,function(k,l){if(l.sessionId&&l.sessionId==j){a.setRemoteEditable(l.editable);a.setRemoteIsMaster(l.isMaster);$(a.getRootElement()).trigger("remoteStatusUpdated",[l])}if(l.isMaster){f.push(d.convertRemoteUser(l))}});$.each(c,function(k,l){if(!l.isMaster){f.push(d.convertRemoteUser(l))}});d.getRepo()[b]["users"]=f;var i=$("#"+d.getCanvasId(a));i.find(".userPanel").remove();var h=$('
      ');h.css({position:"absolute",top:"0px",left:"0px"});i.append(h);$.each(f,function(m,n){var l=$('
      ');if(n.isMaster){l.append(""+n.getName()+" (Master)")}else{l.append(""+n.getName()+" ");if(a.getRemoteIsMaster()){var k;if(!n.editable){k=$("");k.data("identifier",b);k.data("mode","readonly");k.data("user",n)}else{k=$("");k.data("identifier",b);k.data("mode","editable");k.data("user",n)}l.append(k);k.click(function(){var q=$(this).data("identifier");var p=$(this).data("mode");var o=$(this).data("user");if(p==="readonly"){o.setEditable(true)}else{o.setEditable(false)}d.updateUserState(q,o,function(){})})}}h.append(l)})})},updateUserState:function(d,c,g){var e=this,b;var f=this.getRemote({identifier:d,remoteUser:e.encodeJson(c)});var a=f.__objectId;f.updateUserState(null,function(){b=mw3.objects[a];e.closeRemote(f);var h=e.convertRemoteUser(JSON.parse(b.remoteUser));g(h)})},updateCanvas:function(d){var e=JSON.parse(d);var c=e.identifier;var b=e.canvasData;var a=this.getCanvasByIdentifier(c);if(!a||!a.getRemotable()){return}a.setRemoteDuring(true);a.loadJSON(b);a.setRemoteDuring(false);$(a.getRootElement()).trigger("updateCanvas",[b])},broadCastCanvas:function(d,g){if(!d.getRemotable()){g(null);return}if(!d.getRemoteEditable()){g(null);return}var c=d.getIdentifier();var e=this,b;var f=this.getRemote({identifier:c,canvasData:e.encodeJson(d.toJSON())});var a=f.__objectId;f.broadCastCanvas(null,function(){b=mw3.objects[a];e.closeRemote(f);g(d)})},remoteExit:function(c,f){var d=this,b;var e=this.getRemote({identifier:c});var a=e.__objectId;e.remoteUserExited(null,function(){b=mw3.objects[a];d.closeRemote(e);f(null)})},checkExpiredRemoteCanvas:function(){if(this._SCHEDULER){return}var d=this,c,b,a;this._SCHEDULER=setInterval(function(){c=d.getRepo();for(b in c){a=c[b].canvas;if(a&&d.getCanvasId(a)&&$("#"+d.getCanvasId(a)).length){return}delete c[b];d.remoteExit(b,function(){})}},1000)}};OG.handler.RemoteHandler.prototype.constructor=OG.handler.RemoteHandler;OG.RemoteHandler=new OG.handler.RemoteHandler();OG.RemoteHandler.checkExpiredRemoteCanvas();OG.graph.Canvas=function(a,d,b,c){this._CONFIG={AUTOMATIC_GUIDANCE:true,SPOT_ON_SELECT:false,BACKDOOR:{url:null,scale:100,opacity:1,width:null,height:null,container:null,container_updated:false},FAST_LOADING:false,AUTO_SLIDER_UPDATE:true,AUTO_HISTORY:false,WHEEL_SCALABLE:false,DRAG_PAGE_MOVABLE:false,FOCUS_CANVAS_ONSELECT:true,CHECK_BRIDGE_EDGE:true,STICK_GUIDE:true,SLIDER:null,REMOTE_PERFORMED_DURING:false,REMOTE_IDENTIFIER:null,REMOTEABLE:false,REMOTE_EDITABLE:false,REMOTE_ISMASTER:false,HISTORY_INDEX:0,HISTORY:[],HISTORY_SIZE:100,USE_SLIDER:true,SELECTABLE:true,DRAG_SELECTABLE:true,MOVABLE:true,MOVABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},RESIZE_CANVAS_MARGIN:5,RESIZABLE:true,RESIZABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},CONNECTABLE:true,SELF_CONNECTABLE:true,CONNECT_CLONEABLE:true,CONNECT_STYLE_CHANGE:true,CONNECT_STYLE_CHANGE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},DELETABLE:true,DELETABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},LABEL_EDITABLE:true,LABEL_EDITABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},GROUP_DROPABLE:true,DRAG_GRIDABLE:true,ENABLE_HOTKEY:true,ENABLE_HOTKEY_CTRL_Z:true,ENABLE_HOTKEY_DELETE:true,ENABLE_HOTKEY_CTRL_A:true,ENABLE_HOTKEY_CTRL_C:true,ENABLE_HOTKEY_CTRL_V:true,ENABLE_HOTKEY_CTRL_D:true,ENABLE_HOTKEY_CTRL_G:true,ENABLE_HOTKEY_CTRL_U:true,ENABLE_HOTKEY_ARROW:true,ENABLE_HOTKEY_SHIFT_ARROW:true,ENABLE_CONTEXTMENU:true,ENABLE_ROOT_CONTEXTMENU:true,SCALE:1,SCALE_MIN:0.1,SCALE_MAX:10,EDGE_PADDING:20,LABEL_PADDING:5,LABEL_EDITOR_WIDTH:500,LABEL_EDITOR_HEIGHT:16,FROMTO_LABEL_OFFSET_TOP:15,GUIDE_LINE_SIZE:20,GUIDE_LINE_MARGIN:10,GUIDE_RECT_SIZE:8,GUIDE_MIN_SIZE:18,GUIDE_CONTROL_LINE_NUM:2,COLLAPSE_SIZE:10,MOVE_SNAP_SIZE:8,TERMINAL_SIZE:5,COPY_PASTE_PADDING:20,FIT_CANVAS_PADDING:20,AUTO_EXTENSIONAL:true,AUTO_EXTENSION_SIZE:100,CANVAS_BACKGROUND:"#f9f9f9",IMAGE_BASE:"resources/images/symbol/",IMAGE_USER:"http://processcodi.com/images/opengraph/User.png",IMAGE_SEND:"http://processcodi.com/images/opengraph/Send.png",IMAGE_RECEIVE:"http://processcodi.com/images/opengraph/Receive.png",IMAGE_MANUAL:"http://processcodi.com/images/opengraph/Manual.png",IMAGE_SERVICE:"http://processcodi.com/images/opengraph/Service.png",IMAGE_RULE:"http://processcodi.com/images/opengraph/BusinessRule.png",IMAGE_SCRIPT:"http://processcodi.com/images/opengraph/Script.png",IMAGE_MAPPER:"http://processcodi.com/images/opengraph/mapper.png",IMAGE_WEB:"http://processcodi.com/images/opengraph/w_services.png",TRIM_EDGE_ANGLE_SIZE:170,EDGE_MOVE_DELAY_SIZE:14,LANE_MIN_SIZE:50,LANE_DEFAULT_SIZE:100,POOL_DEFAULT_SIZE:[300,200],GROUP_INNER_SAPCE:10,LABEL_MIN_SIZE:0,LABEL_MAX_SIZE:1000,DEFAULT_STYLE:{SHAPE:{cursor:"default"},GEOM:{stroke:"black","fill-r":".5","fill-cx":".5","fill-cy":".5",fill:"white","fill-opacity":0,"label-position":"center"},TEXT:{stroke:"none","text-anchor":"middle"},HTML:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},IMAGE:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},SVG:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},EDGE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.5,"stroke-opacity":1,"edge-type":"plain","arrow-start":"none","arrow-end":"block","stroke-dasharray":"","label-position":"center","stroke-linejoin":"round",cursor:"pointer"},EDGE_SHADOW:{stroke:"#00FF00",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,"arrow-start":"none","arrow-end":"none","stroke-dasharray":"- ","edge-type":"plain",cursor:"pointer"},EDGE_HIDDEN:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":10,"stroke-opacity":0,cursor:"pointer"},GROUP:{stroke:"black",fill:"none","fill-opacity":0,"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},GROUP_HIDDEN:{stroke:"black",fill:"white","fill-opacity":0,"stroke-opacity":0,cursor:"move"},GROUP_SHADOW:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":15,"stroke-opacity":0,cursor:"pointer"},GROUP_SHADOW_MAPPER:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":0,cursor:"pointer"},GUIDE_BBOX:{stroke:"#00FF00",fill:"white","fill-opacity":0,"stroke-dasharray":"- ","shape-rendering":"crispEdges",cursor:"move"},GUIDE_UL:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nwse-resize","shape-rendering":"crispEdges"},GUIDE_UR:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nesw-resize","shape-rendering":"crispEdges"},GUIDE_LL:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nesw-resize","shape-rendering":"crispEdges"},GUIDE_LR:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nwse-resize","shape-rendering":"crispEdges"},GUIDE_LC:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_UC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_RC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_LWC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_FROM:{stroke:"black",fill:"#00FF00",cursor:"move","shape-rendering":"crispEdges"},GUIDE_TO:{stroke:"black",fill:"#00FF00",cursor:"move","shape-rendering":"crispEdges"},GUIDE_CTL_H:{stroke:"black",fill:"#00FF00",cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_CTL_V:{stroke:"black",fill:"#00FF00",cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_SHADOW:{stroke:"black",fill:"none","stroke-dasharray":"- ","shape-rendering":"crispEdges"},GUIDE_LINE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.2,"stroke-opacity":1,"stroke-dasharray":"","arrow-end":"block","stroke-linejoin":"round",cursor:"pointer"},GUIDE_LINE_ESSENSIA:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.2,"stroke-opacity":1,"stroke-dasharray":"","arrow-start":"diamond","arrow-end":"none","stroke-linejoin":"round",cursor:"pointer"},GUIDE_VIRTUAL_EDGE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,"stroke-dasharray":"- ","stroke-linejoin":"round","arrow-start":"none","arrow-end":"none"},GUIDE_LINE_AREA:{stroke:"#ffffff",fill:"#ffffff","fill-opacity":0.1,"stroke-width":1,"stroke-opacity":0.2,cursor:"pointer"},GUIDE_RECT_AREA:{stroke:"black",fill:"#ffffff","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,cursor:"pointer"},RUBBER_BAND:{stroke:"#0000FF",opacity:0.2,fill:"#0077FF"},DROP_OVER_BBOX:{stroke:"#0077FF",fill:"none",opacity:0.3,"shape-rendering":"crispEdges"},LABEL:{"font-size":12,"font-color":"black",fill:"none"},LABEL_EDITOR:{position:"absolute",overflow:"visible",resize:"none","text-align":"center",display:"block",padding:0},COLLAPSE:{stroke:"black",fill:"none","fill-opacity":0,cursor:"pointer","shape-rendering":"crispEdges"},COLLAPSE_BBOX:{stroke:"none",fill:"none","fill-opacity":0},BUTTON:{stroke:"#9FD7FF",fill:"white","fill-opacity":0,cursor:"pointer","shape-rendering":"crispEdges"},CONNECT_GUIDE_EVENT_AREA:{stroke:"#ffffff",fill:"none","fill-opacity":0,"stroke-width":20,"stroke-opacity":0},CONNECT_GUIDE_BBOX:{stroke:"#00FF00",fill:"none","stroke-dasharray":"- ","shape-rendering":"crispEdges"},CONNECT_GUIDE_BBOX_EXPEND:10,CONNECT_GUIDE_SPOT_CIRCLE:{r:7,stroke:"#A6A6A6","stroke-width":1,fill:"#FFE400","fill-opacity":0.5,cursor:"pointer"},CONNECT_GUIDE_SPOT_RECT:{stroke:"#A6A6A6","stroke-width":1,fill:"#FFE400","fill-opacity":0.2,cursor:"ns-resize",w:20,h:10},CONNECTABLE_HIGHLIGHT:{"stroke-width":2},NOT_CONNECTABLE_HIGHLIGHT:{fill:"#FAAFBE","fill-opacity":0.5}}};this._RENDERER=a?new OG.RaphaelRenderer(a,d,b,c,this._CONFIG):null;this._RENDERER._CANVAS=this;this._HANDLER=new OG.EventHandler(this._RENDERER,this._CONFIG);this._CONTAINER=OG.Util.isElement(a)?a:document.getElementById(a)};OG.graph.Canvas.prototype={fastLoadingON:function(){this._CONFIG.FAST_LOADING=true},fastLoadingOFF:function(){this._CONFIG.FAST_LOADING=false;this.updateSlider()},getEventHandler:function(){return this._HANDLER},setRemoteDuring:function(a){this._CONFIG.REMOTE_PERFORMED_DURING=a},getRemoteDuring:function(){return this._CONFIG.REMOTE_PERFORMED_DURING},setIdentifier:function(a){this._CONFIG.REMOTE_IDENTIFIER=a},getIdentifier:function(){return this._CONFIG.REMOTE_IDENTIFIER},getRemotable:function(){return this._CONFIG.REMOTEABLE},setRemotable:function(a){this._CONFIG.REMOTEABLE=a},setRemoteEditable:function(a){this._CONFIG.REMOTE_EDITABLE=a},getRemoteEditable:function(){return this._CONFIG.REMOTE_EDITABLE},setRemoteIsMaster:function(a){this._CONFIG.REMOTE_ISMASTER=a},getRemoteIsMaster:function(){return this._CONFIG.REMOTE_ISMASTER},setCurrentCanvas:function(a){this._RENDERER.setCanvas(a)},initConfig:function(a){if(a){this._CONFIG.REMOTEABLE=a.remoteable===undefined?this._CONFIG.REMOTEABLE:a.remoteable;this._CONFIG.SELECTABLE=a.selectable===undefined?this._CONFIG.SELECTABLE:a.selectable;this._CONFIG.DRAG_SELECTABLE=a.dragSelectable===undefined?this._CONFIG.DRAG_SELECTABLE:a.dragSelectable;this._CONFIG.MOVABLE=a.movable===undefined?this._CONFIG.MOVABLE:a.movable;this._CONFIG.RESIZABLE=a.resizable===undefined?this._CONFIG.RESIZABLE:a.resizable;this._CONFIG.CONNECTABLE=a.connectable===undefined?this._CONFIG.CONNECTABLE:a.connectable;this._CONFIG.SELF_CONNECTABLE=a.selfConnectable===undefined?this._CONFIG.SELF_CONNECTABLE:a.selfConnectable;this._CONFIG.CONNECT_CLONEABLE=a.connectCloneable===undefined?this._CONFIG.CONNECT_CLONEABLE:a.connectCloneable;this._CONFIG.LABEL_EDITABLE=a.labelEditable===undefined?this._CONFIG.LABEL_EDITABLE:a.labelEditable;this._CONFIG.GROUP_DROPABLE=a.groupDropable===undefined?this._CONFIG.GROUP_DROPABLE:a.groupDropable;this._CONFIG.ENABLE_HOTKEY=a.enableHotKey===undefined?this._CONFIG.ENABLE_HOTKEY:a.enableHotKey;this._CONFIG.ENABLE_CONTEXTMENU=a.enableContextMenu===undefined?this._CONFIG.ENABLE_CONTEXTMENU:a.enableContextMenu;this._CONFIG.AUTO_EXTENSIONAL=a.autoExtensional===undefined?this._CONFIG.AUTO_EXTENSIONAL:a.autoExtensional;this._CONFIG.USE_SLIDER=a.useSlider===undefined?this._CONFIG.USE_SLIDER:a.useSlider;this._CONFIG.STICK_GUIDE=a.stickGuide===undefined?this._CONFIG.STICK_GUIDE:a.stickGuide;this._CONFIG.CHECK_BRIDGE_EDGE=a.checkBridgeEdge===undefined?this._CONFIG.CHECK_BRIDGE_EDGE:a.checkBridgeEdge;this._CONFIG.AUTO_HISTORY=a.autoHistory===undefined?this._CONFIG.AUTO_HISTORY:a.autoHistory;this._CONFIG.AUTO_SLIDER_UPDATE=a.autoSliderUpdate===undefined?this._CONFIG.AUTO_SLIDER_UPDATE:a.autoSliderUpdate}this._HANDLER.setDragSelectable(this._CONFIG.SELECTABLE&&this._CONFIG.DRAG_SELECTABLE);this._HANDLER.setWheelScale();this._HANDLER.setDragPageMovable();this._HANDLER.setEnableHotKey(this._CONFIG.ENABLE_HOTKEY);if(this._CONFIG.ENABLE_CONTEXTMENU){if(this._CONFIG.ENABLE_ROOT_CONTEXTMENU){this._HANDLER.enableRootContextMenu()}this._HANDLER.enableShapeContextMenu()}this.CONFIG_INITIALIZED=true},getRenderer:function(){return this._RENDERER},getContainer:function(){return this._CONTAINER},getEventHandler:function(){return this._HANDLER},addBackDoor:function(b,e,a){var c=this;var d=new Image();d.src=b;d.onload=function(){var j=d.naturalWidth;var m=d.naturalHeight;c._CONFIG.BACKDOOR.url=b;c._CONFIG.BACKDOOR.scale=e?e:c._CONFIG.BACKDOOR.scale;c._CONFIG.BACKDOOR.opacity=a?a:c._CONFIG.BACKDOOR.opacity;c._CONFIG.BACKDOOR.width=j;c._CONFIG.BACKDOOR.height=m;c._CONFIG.BACKDOOR.container_updated=true;var i=c._CONTAINER;var l=i.id+OG.Constants.BACKDOOR_SUFFIX;var g=$("#"+i.id).find("#"+l);if(!g||g.length<1){g=$("");g.attr("id",l);g.css({position:"absolute",top:"0px",left:"0px"});$(c._RENDERER.getRootElement()).before(g);g.attr("src",b)}else{g.attr("src",b)}c._CONFIG.BACKDOOR.container=g;var k=c.getScale();var f=c.getCanvasSize();if(f[0]');d.append();d.unbind("click");d.bind("click",function(){if($(this).data("collape")){var n=$(this).data("collape");k.height(n);c.show();$(this).data("collape",false)}else{$(this).data("collape",k.height());c.hide();k.height(40)}});j=$('
      ');j.css({position:"relative",width:"100%"});l=$('
      ');b=$('');b.bind("change",function(){m.updateSlider($(this).val())});b.bind("input",function(){m.updateSlider($(this).val())});b.css({position:"relative",width:"100%",height:"8px"});f=$('
      ');f.css({position:"absolute",top:"50px",bottom:"5px",left:"5px",right:"5px","overflow-x":"hidden","overflow-y":"auto",background:"white"});h=$('');h.css({position:"absolute",top:"0px",left:"0px"});h.attr("width","100%");h.attr("id",a.id+"sliderImage");e=$('
      ');e.css({position:"absolute",top:"0px",left:"0px",width:"100px",height:"100px",background:"transparent"});g=function(){var r,n,u,v,p,s,q,t,o,x,w;r=m._RENDERER.getRootElement();v=h.width();p=h.height();n=$(r).attr("width");u=$(r).attr("height");s=v/n;q=p/u;if(s>1){s=1}if(q>1){q=1}t=e.offset().left-h.offset().left;if(t<0){t=0}o=e.offset().top-h.offset().top;if(o<0){o=0}x=t*(1/s);w=o*(1/q);a.scrollLeft=x;a.scrollTop=w};$(a).unbind("scroll");$(a).bind("scroll",function(n){if(e.data("drag")){return}m.updateNavigatior()});h.click(function(p){var o,n,r,q;o=p.pageX-h.offset().left;n=p.pageY-h.offset().top;r=o-(e.width()/2);q=n-(e.height()/2);if(r<0){r=0}if(q<0){q=0}if((r+e.width())>h.width()){r=h.width()-e.width()}if((q+e.height())>h.height()){q=h.height()-e.height()}e.css({left:r+"px",top:q+"px"});g()});e.draggable({containment:"#"+a.id+"sliderImage",scroll:false,start:function(n){e.data("drag",true)},drag:function(n){g()},stop:function(n){g();e.data("drag",false)}});c.append(j);j.append(l);j.append(b);c.append(f);f.append(h);f.append(e);$(a).on("remove",function(){m.removeSlider()});if(this._CONFIG.SLIDER){m.removeSlider()}this._CONFIG.SLIDER=c;this.updateSlider(this._CONFIG.SCALE*100)},updateNavigatior:function(){var m=this;var h=m._RENDERER.getRootElement();var p,i,o,n,j,f,k,d;var c=this._CONFIG.SLIDER;if(!c){return}var g=c.find(".sliderImage");var e=c.find(".sliderNavigator");var b=m._CONTAINER;p=$(h).attr("width");i=$(h).attr("height");o=b.scrollLeft;n=b.scrollTop;j=$(b).width()/p;f=$(b).height()/i;if(j>1){j=1}if(f>1){f=1}k=g.width()/p;d=g.height()/i;e.width(g.width()*j);e.height(g.height()*f);e.css({left:(o*k)+"px",top:(n*d)+"px"});var l=c.find(".scaleSliderText");var a=c.find(".scaleSlider");l.html(Math.round(this._CONFIG.SCALE*100));a.val(Math.round(this._CONFIG.SCALE*100))},updateSlider:function(v){if(this._CONFIG.AUTO_SLIDER_UPDATE&&!this._CONFIG.FAST_LOADING){var q=this;if(!this._CONFIG.SLIDER){return}if(!v){v=this._CONFIG.SCALE*100}var m=this._CONFIG.SLIDER;var f=m.find(".scaleSliderText");var k=m.find(".scaleSlider");var u=m.find(".sliderImage");var g=m.find(".sliderNavigator");var s=m.find(".sliderImageWrapper");f.html(Math.round(v));k.val(Math.round(v));q._RENDERER.setScale(v/100);var i=q._RENDERER.getRootElement();var p=new XMLSerializer().serializeToString(i);var a=this.getCanvasSize();if(OG.Util.isIE()){p=''+p.replace('xmlns="http://www.w3.org/2000/svg"',"").replace('xmlns:NS1=""',"").replace("NS1:","");var b=window.btoa(unescape(encodeURIComponent(p)));var j=document.createElement("img");$(j).css({position:"absolute",top:"0px",left:"0px",opacity:0});document.body.appendChild(j);j.src="data:image/svg+xml;base64,"+b;j.onload=function(){var w=document.getElementById(u.attr("id"));w.width=s.width();w.height=s.width()*j.height/j.width;var x=w.getContext("2d");try{x.drawImage(j,0,0,s.width(),s.width()*j.height/j.width);$(j).remove();q.updateNavigatior()}catch(y){$(j).remove()}}}else{var j=new Image();j.src="data:image/svg+xml;utf-8,"+p;j.onload=function(){var w=document.getElementById(u.attr("id"));w.width=s.width();w.height=s.width()*j.height/j.width;var x=w.getContext("2d");try{x.drawImage(j,0,0,s.width(),s.width()*j.height/j.width);$(j).remove();q.updateNavigatior()}catch(y){$(j).remove()}}}if(q._CONFIG.BACKDOOR.container){var t=q._CONFIG.BACKDOOR.scale;var c=q._CONFIG.BACKDOOR.opacity;var l=q._CONFIG.BACKDOOR.width;var h=q._CONFIG.BACKDOOR.height;var d=q.getScale();var r=s.width();var n=(l*(t/100)/a[0]*d)*r;var o=n*h/l;var e=s.find(".sliderBackDoorWrapper");if(!e||e.length<1){e=$('
      ');e.css({position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%"});s.data("backdoor",true);e.css({"background-image":"url("+q._CONFIG.BACKDOOR.url+")","background-repeat":"no-repeat","background-size":n+"px "+o+"px",opacity:c});u.before(e)}else{if(q._CONFIG.BACKDOOR.container_updated){q._CONFIG.BACKDOOR.container_updated=false;e.css({"background-image":"url("+q._CONFIG.BACKDOOR.url+")","background-repeat":"no-repeat","background-size":n+"px "+o+"px",opacity:c})}else{e.css({"background-size":n+"px "+o+"px",opacity:c})}}}}},removeSlider:function(){if(this._CONFIG.SLIDER){this._CONFIG.SLIDER.dialog("destroy");this._CONFIG.SLIDER.remove()}},drawShape:function(a,c,e,f,h,g,b){var d=this._RENDERER.drawShape(a,c,e,f,h,b);if(a&&(c.TYPE===OG.Constants.SHAPE_TYPE.EDGE)){d=this._RENDERER.move(d,a)}if(g&&this._RENDERER.getElementById(g)){this._RENDERER.appendChild(d,g)}if(!this.CONFIG_INITIALIZED){this.initConfig()}this._HANDLER.setClickSelectable(d,this._HANDLER._isSelectable(d.shape));this._HANDLER.setMovable(d,this._HANDLER._isMovable(d.shape));this._HANDLER.setGroupDropable(d);this._HANDLER.setConnectGuide(d,this._HANDLER._isConnectable(d.shape));if(this._HANDLER._isLabelEditable(d.shape)){this._HANDLER.enableEditLabel(d)}if(!h){this._RENDERER.addHistory()}this.updateSlider();return d},drawTransformer:function(s,j,f,g,b,n){var r=this,c,e,p,d,o,l,t,k,h,m,q;c=new OG.shape.Transformer(j);if(!Array.isArray(f)||!Array.isArray(g)){return null}var a=Math.max(f.length,g.length);e=r.drawShape(s,c,[120,30+(a*25)],p,n);d=e.shape.geom.getBoundary();$.each(f,function(i,u){m=new OG.shape.bpmn.M_Text(u);m.MOVABLE=false;m.SELECTABLE=false;m.CONNECTABLE=false;m.DELETABLE=false;q=r.drawShape([d.getUpperLeft().x+35,d.getUpperLeft().y+(i*25)+40],m,[50,20]);e.appendChild(q);l=new OG.shape.To();k=r.drawShape([d.getUpperLeft().x+15,d.getUpperLeft().y+(i*25)+40],l,[5,5],{r:5});e.appendChild(k);var v=JSON.parse(JSON.stringify(b));v.type="input";v.name=u;v.parentId=e.id;r.setCustomData(k,v)});$.each(g,function(i,u){m=new OG.shape.bpmn.M_Text(u);m.MOVABLE=false;m.SELECTABLE=false;m.CONNECTABLE=false;m.DELETABLE=false;q=r.drawShape([d.getUpperRight().x-35,d.getUpperRight().y+(i*25)+40],m,[50,20]);e.appendChild(q);t=new OG.shape.From();h=r.drawShape([d.getUpperRight().x-15,d.getUpperRight().y+(i*25)+40],t,[5,5],{r:5});e.appendChild(h);var v=JSON.parse(JSON.stringify(b));v.type="output";v.name=u;v.parentId=e.id;r.setCustomData(h,v)});if(!n){this._RENDERER.addHistory()}},setExceptionType:function(a,b){this._HANDLER.setExceptionType(a,b)},setInclusion:function(a,b){this._HANDLER.setInclusion(a,b)},setShapeStyle:function(a,b){this._RENDERER.setShapeStyle(a,b)},setTextListInController:function(a,b){this._RENDERER.setTextListInController(a,b)},getTextListInController:function(a){this._RENDERER.getTextListInController(a)},drawLabel:function(a,c,b){return this._RENDERER.drawLabel(a,c,b)},redrawConnectedEdge:function(a){this._RENDERER.redrawConnectedEdge(a)},reconnect:function(a){return this._RENDERER.reconnect(a)},connect:function(j,g,b,l,d,e,k,c,a){var i,n,f,h,m;if(d){i=this._RENDERER.createTerminalString(j,d)}else{i=this._RENDERER.createDefaultTerminalString(j)}if(e){n=this._RENDERER.createTerminalString(g,e)}else{n=this._RENDERER.createDefaultTerminalString(g)}h=this._RENDERER._getPositionFromTerminal(i);h=[h.x,h.y];m=this._RENDERER._getPositionFromTerminal(n);m=[m.x,m.y];a=a?a:new OG.EdgeShape();a.from=h;a.to=m;f=this._RENDERER.drawShape(null,a,null,b,c);f=this._RENDERER.trimEdgeDirection(f,j,g);l=l?l:undefined;f=this._RENDERER.connect(i,n,f,b,l,k);if(f){this._HANDLER.setClickSelectable(f,f.shape.SELECTABLE);this._HANDLER.setMovable(f,f.shape.SELECTABLE&&f.shape.MOVABLE);this._HANDLER.setConnectGuide(f,this._HANDLER._isConnectable(f.shape));if(f.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(f)}}this.updateSlider();return f},connectWithTerminalId:function(fromTerminal,toTerminal,style,label,id,shapeId,geom){var vertices,edge,fromPosition,toPosition,fromto,shape;fromPosition=this._RENDERER._getPositionFromTerminal(fromTerminal);fromPosition=[fromPosition.x,fromPosition.y];toPosition=this._RENDERER._getPositionFromTerminal(toTerminal);toPosition=[toPosition.x,toPosition.y];if(!geom){vertices=[fromPosition,toPosition]}else{vertices=geom.vertices}fromto=JSON.stringify(vertices[0])+","+JSON.stringify(vertices[vertices.length-1]);shape=eval("new "+shapeId+"("+fromto+")");label=label?label:undefined;if(label){shape.label=label}if(geom){if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.POLYLINE]){geom=new OG.geometry.PolyLine(geom.vertices);shape.geom=geom}else{if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.CURVE]){geom=new OG.geometry.Curve(geom.controlPoints);shape.geom=geom}}}edge=this.drawShape(null,shape,null,style,id,null);edge=this._RENDERER.connect(fromTerminal,toTerminal,edge,style,label,true);if(edge){this._HANDLER.setClickSelectable(edge,edge.shape.SELECTABLE);this._HANDLER.setMovable(edge,edge.shape.SELECTABLE&&edge.shape.MOVABLE);this._HANDLER.setConnectGuide(edge,this._HANDLER._isConnectable(edge.shape));if(edge.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(edge)}}this.updateSlider();return edge},disconnect:function(a){this._RENDERER.disconnect(a)},group:function(a){var b=this._RENDERER.group(a);this._HANDLER.setClickSelectable(b,b.shape.SELECTABLE);this._HANDLER.setMovable(b,b.shape.SELECTABLE&&b.shape.MOVABLE);if(b.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(b)}return b},ungroup:function(a){return this._RENDERER.ungroup(a)},addToGroup:function(a,b){this._RENDERER.addToGroup(a,b)},collapse:function(a){this._RENDERER.collapse(a)},expand:function(a){this._RENDERER.expand(a)},clear:function(){this._RENDERER.clear()},removeShape:function(b,a){this._RENDERER.removeShape(b,a)},removeChild:function(a){this._RENDERER.removeChild(a)},removeGuide:function(a){this._RENDERER.removeGuide(a)},removeAllGuide:function(){this._RENDERER.removeAllGuide()},getRootElement:function(){return this._RENDERER.getRootElement()},getRootGroup:function(){return this._RENDERER.getRootGroup()},getElementByPoint:function(a){return this._RENDERER.getElementByPoint(a)},getElementsByBBox:function(a){return this._RENDERER.getElementsByBBox(a)},setAttr:function(a,b){this._RENDERER.setAttr(a,b)},getAttr:function(b,a){return this._RENDERER.getAttr(b,a)},toFront:function(a){this._RENDERER.toFront(a)},toBack:function(a){this._RENDERER.toBack(a)},bringForward:function(a){this._RENDERER.bringForward(a)},sendBackward:function(a){this._RENDERER.sendBackward(a)},getCanvasSize:function(){return this._RENDERER.getCanvasSize()},setCanvasSize:function(a){this._RENDERER.setCanvasSize(a)},fitCanvasSize:function(b,a){this._RENDERER.fitCanvasSize(b,a)},setViewBox:function(a,b,c){this._RENDERER.setViewBox(a,b,c)},getScale:function(){return this._RENDERER.getScale()},setScale:function(a){this._RENDERER.setScale(a)},show:function(a){this._RENDERER.show(a)},hide:function(a){this._RENDERER.hide(a)},appendChild:function(a,b){return this._RENDERER.appendChild(a,b)},insertAfter:function(a,b){return this._RENDERER.insertAfter(a,b)},insertBefore:function(a,b){return this._RENDERER.insertBefore(a,b)},move:function(a,b){return this._RENDERER.move(a,b)},moveCentroid:function(b,a){return this._RENDERER.moveCentroid(b,a)},rotate:function(a,b){return this._RENDERER.rotate(a,b)},resize:function(b,c,a){return this._RENDERER.resize(b,c,a)},resizeBox:function(c,b,a){return this._RENDERER.resizeBox(c,b,a)},clone:function(a){return this._RENDERER.clone(a)},getBoundary:function(a){return this._RENDERER.getBoundary(a)},getElementById:function(a){return this._RENDERER.getElementById(a)},getElementsByType:function(b,a){return this._RENDERER.getElementsByType(b,a)},getElementsByShapeId:function(b){var a=this.getRootGroup();return $(a).find("[_type=SHAPE][_shape_id='"+b+"']")},getRelatedEdgeFromShapes:function(a){return this._RENDERER.getRelatedEdgeFromShapes(a)},getRelatedElementsFromEdge:function(b){var d=this,c=OG.Util.isElement(b)?b:this.getElementById(b),a=function(e){if(e){return d._RENDERER.getElementById(e.substring(0,e.indexOf(OG.Constants.TERMINAL)))}else{return null}};if($(c).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){return{from:a($(b).attr("_from")),to:a($(b).attr("_to"))}}else{return{from:null,to:null}}},getParent:function(a){return this._RENDERER.getParent(a)},getChilds:function(a){return this._RENDERER.getChilds(a)},getAllShapes:function(){return this._RENDERER.getAllShapes()},getAllEdges:function(){return this._RENDERER.getAllEdges()},getBBox:function(a){return this._RENDERER.getBBox(a)},getRootBBox:function(){return this._RENDERER.getRootBBox()},getRealRootBBox:function(){return this._RENDERER.getRealRootBBox()},isSVG:function(){return this._RENDERER.isSVG()},isVML:function(){return this._RENDERER.isVML()},setCustomData:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.data=c;a.shape.data=c},getCustomData:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);if(!a.data){a.data=a.shape.data}return a.data},setExtCustomData:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.dataExt=c},getExtCustomData:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);return a.dataExt},setCustomContextMenu:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.shape.customContextMenu=c},getCustomContextMenu:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);return a.shape.customContextMenu},toXML:function(){return OG.Util.jsonToXml(this.toJSON())},toJSON:function(){var j=this,k=this._RENDERER.getRootBBox(),h=this._RENDERER.getRootGroup(),c=this.getScale(),a=this.getCanvasSize()[0],g=this.getCanvasSize()[1],f=this._CONFIG.BACKDOOR,l={opengraph:{"@width":a,"@height":g,"@scale":c,cell:[],backdoor:[{"@url":f.url,"@scale":f.scale,"@opacity":f.opacity,"@width":f.width,"@height":f.height}]}},e,d,b;b={};e=function(i){$(i).find("[_type=SHAPE]").each(function(w,z){var q=z.shape,m=z.shape.geom.style.map,s=q.geom,r=s.getBoundary(),x={},p,v,u,n,t;if(q.ignoreExport){return}x["@id"]=$(z).attr("id");if($(z).parent().attr("id")===$(i).attr("id")){x["@parent"]=$(i).attr("id")}else{x["@parent"]=$(z).parent().attr("id")}x["@shapeType"]=q.TYPE;x["@shapeId"]=q.SHAPE_ID;x["@x"]=r.getCentroid().x;x["@y"]=r.getCentroid().y;x["@width"]=r.getWidth();x["@height"]=r.getHeight();if(m){x["@style"]=escape(OG.JSON.encode(m))}if(q.TYPE===OG.Constants.SHAPE_TYPE.EDGE){if($(z).attr("_from")){x["@from"]=$(z).attr("_from")}if($(z).attr("_to")){x["@to"]=$(z).attr("_to")}}else{n=j.getPrevShapeIds(z);t=j.getNextShapeIds(z);if(n.length>0){x["@from"]=n.toString()}if(t.length>0){x["@to"]=t.toString()}}if($(z).attr("_fromedge")){x["@fromEdge"]=$(z).attr("_fromedge")}if($(z).attr("_toedge")){x["@toEdge"]=$(z).attr("_toedge")}if(q.label){x["@label"]=escape(q.label)}if(q.fromLabel){x["@fromLabel"]=escape(q.fromLabel)}if(q.toLabel){x["@toLabel"]=escape(q.toLabel)}if(q.angle&&q.angle!==0){x["@angle"]=q.angle}if(q instanceof OG.shape.ImageShape){x["@value"]=q.image}else{if(q instanceof OG.shape.HtmlShape){x["@value"]=escape(q.html)}else{if(q instanceof OG.shape.TextShape){x["@value"]=escape(q.text)}else{if(q instanceof OG.shape.EdgeShape){p=s.getVertices();x["@value"]="";for(var o=0,y=p.length;o(x-width/2))?(x-width/2):minX;minY=(minY>(y-height/2))?(y-height/2):minY;maxX=(maxX<(x+width/2))?(x+width/2):maxX;maxY=(maxY<(y+height/2))?(y+height/2):maxY;switch(shapeType){case OG.Constants.SHAPE_TYPE.GEOM:case OG.Constants.SHAPE_TYPE.GROUP:shape=eval("new "+shapeId+"()");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height],OG.JSON.decode(style),id,parent);if(element.shape instanceof OG.shape.bpmn.A_Task){element.shape.LoopType=loopType;element.shape.TaskType=taskType}break;case OG.Constants.SHAPE_TYPE.EDGE:var list=JSON.parse("["+value+"]");var fromto=JSON.stringify(list[0])+","+JSON.stringify(list[list.length-1]);shape=eval("new "+shapeId+"("+fromto+")");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}if(fromLabel){shape.fromLabel=unescape(fromLabel)}if(toLabel){shape.toLabel=unescape(toLabel)}if(geom){geom=OG.JSON.decode(geom);if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.POLYLINE]){geom=new OG.geometry.PolyLine(geom.vertices);shape.geom=geom}else{if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.CURVE]){geom=new OG.geometry.Curve(geom.controlPoints);shape.geom=geom}}}element=this.drawShape(null,shape,null,OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.HTML:shape=eval("new "+shapeId+"()");if(value){shape.html=unescape(value)}if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.IMAGE:shape=eval("new "+shapeId+"('"+value+"')");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.TEXT:shape=eval("new "+shapeId+"()");if(value){shape.text=unescape(value)}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break}if(from){$(element).attr("_from",from)}if(to){$(element).attr("_to",to)}if(fromEdge){$(element).attr("_fromedge",fromEdge)}if(toEdge){$(element).attr("_toedge",toEdge)}if(data){element.data=OG.JSON.decode(unescape(data))}if(dataExt){element.dataExt=OG.JSON.decode(unescape(dataExt))}cellCount++;$(renderer._PAPER.canvas).trigger("loading",[Math.round((cellCount/totalCount)*100)])}if(json.opengraph.backdoor&&OG.Util.isArray(json.opengraph.backdoor)&&json.opengraph.backdoor.length){var backdoor=json.opengraph.backdoor[0];if(backdoor["@url"]){this.addBackDoor(backdoor["@url"],backdoor["@scale"],backdoor["@opacity"])}}this.fastLoadingOFF();$(renderer._PAPER.canvas).trigger("loading",["end"]);return{width:maxX-minX,height:maxY-minY,x:minX,y:minY,x2:maxX,y2:maxY}}this.fastLoadingOFF();$(renderer._PAPER.canvas).trigger("loading",["end"]);return{width:0,height:0,x:0,y:0,x2:0,y2:0}},undo:function(){this._RENDERER.undo()},redo:function(){this._RENDERER.redo()},getPrevEdges:function(a){return this._RENDERER.getPrevEdges(a)},getNextEdges:function(a){return this._RENDERER.getNextEdges(a)},getPrevShapes:function(a){return this._RENDERER.getPrevShapes(a)},getPrevShapeIds:function(a){return this._RENDERER.getPrevShapeIds(a)},getNextShapes:function(a){return this._RENDERER.getNextShapes(a)},getNextShapeIds:function(a){return this._RENDERER.getNextShapeIds(a)},onDrawShape:function(a){$(this.getRootElement()).bind("drawShape",function(c,b){a(c,b)})},onUndo:function(a){$(this.getRootElement()).bind("undo",function(b){a(b)})},onRedo:function(a){$(this.getRootElement()).bind("redo",function(b){a(b)})},onDivideLane:function(a){$(this.getRootElement()).bind("divideLane",function(c,b){a(c,b)})},onDrawLabel:function(a){$(this.getRootElement()).bind("drawLabel",function(d,b,c){a(d,b,c)})},onLabelChanged:function(a){$(this.getRootElement()).bind("labelChanged",function(e,c,b,d){a(e,c,b,d)})},onBeforeLabelChange:function(a){$(this.getRootElement()).bind("beforeLabelChange",function(b){if(a(b,b.element,b.afterText,b.beforeText)===false){b.stopPropagation()}})},onRedrawShape:function(a){$(this.getRootElement()).bind("redrawShape",function(c,b){a(c,b)})},onRemoveShape:function(a){$(this.getRootElement()).bind("removeShape",function(c,b){a(c,b)})},onRotateShape:function(a){$(this.getRootElement()).bind("rotateShape",function(c,b,d){a(c,b,d)})},onMoveShape:function(a){$(this.getRootElement()).bind("moveShape",function(c,b,d){a(c,b,d)})},onResizeShape:function(a){$(this.getRootElement()).bind("resizeShape",function(c,b,d){a(c,b,d)})},onBeforeConnectShape:function(a){$(this.getRootElement()).bind("beforeConnectShape",function(b){if(a(b,b.edge,b.fromShape,b.toShape)===false){b.stopPropagation()}})},onBeforeRemoveShape:function(a){$(this.getRootElement()).bind("beforeRemoveShape",function(b){if(a(b,b.element)===false){b.stopPropagation()}})},onConnectShape:function(a){$(this.getRootElement()).bind("connectShape",function(d,c,e,b){a(d,c,e,b)})},onDisconnectShape:function(a){$(this.getRootElement()).bind("disconnectShape",function(d,c,e,b){a(d,c,e,b)})},onGroup:function(a){$(this.getRootElement()).bind("group",function(c,b){a(c,b)})},onUnGroup:function(a){$(this.getRootElement()).bind("ungroup",function(b,c){a(b,c)})},onCollapsed:function(a){$(this.getRootElement()).bind("collapsed",function(c,b){a(c,b)})},onExpanded:function(a){$(this.getRootElement()).bind("expanded",function(c,b){a(c,b)})},onLoading:function(a){$(this.getRootElement()).bind("loading",function(c,b){a(c,b)})}};OG.graph.Canvas.prototype.constructor=OG.graph.Canvas;OG.Canvas=OG.graph.Canvas; \ No newline at end of file +(function(i){var e="0.3.4",j="hasOwnProperty",b=/[\.\/]/,a="*",g=function(){},f=function(m,l){return m-l},d,h,k={n:{}},c=function(m,C){var v=k,s=h,w=Array.prototype.slice.call(arguments,2),y=c.listeners(m),x=0,u=false,p,o=[],t={},q=[],n=d,A=[];d=m;h=0;for(var r=0,B=y.length;r';aH=aE.firstChild;aH.style.behavior="url(#default#VML)";if(!(aH&&typeof aH.adj=="object")){return(aR.type=aX)}aE=null}aR.svg=!(aR.vml=aR.type=="VML");aR._Paper=bF;aR.fn=a4=bF.prototype=aR.prototype;aR._id=0;aR._oid=0;aR.is=function(d,b){b=bK.call(b);if(b=="finite"){return !av[ak](+d)}if(b=="array"){return d instanceof Array}return(b=="null"&&d===null)||(b==typeof d&&d!==null)||(b=="object"&&d===Object(d))||(b=="array"&&Array.isArray&&Array.isArray(d))||a1.call(d).slice(8,-1).toLowerCase()==b};function X(g){if(Object(g)!==g){return g}var d=new g.constructor;for(var b in g){if(g[ak](b)){d[b]=X(g[b])}}return d}aR.angle=function(E,S,g,R,d,i){if(d==null){var b=E-g,bL=S-R;if(!b&&!bL){return 0}return(180+au.atan2(-bL,-b)*180/aV+360)%360}else{return aR.angle(E,S,d,i)-aR.angle(g,R,d,i)}};aR.rad=function(b){return b%360*aV/180};aR.deg=function(b){return b*180/aV%360};aR.snapTo=function(d,E,b){b=aR.is(b,"finite")?b:10;if(aR.is(d,bd)){var g=d.length;while(g--){if(aw(d[g]-E)<=b){return d[g]}}}else{d=+d;var R=E%d;if(Rd-b){return E-R+d}}return E};var h=aR.createUUID=(function(b,d){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(b,d).toUpperCase()}})(/[xy]/g,function(g){var d=au.random()*16|0,b=g=="x"?d:(d&3|8);return b.toString(16)});aR.setWindow=function(b){eve("raphael.setWindow",aR,aA.win,b);aA.win=b;aA.doc=aA.win.document;if(aR._engine.initWin){aR._engine.initWin(aA.win)}};var bf=function(g){if(aR.vml){var b=/^\s+|\s+$/g;var R;try{var S=new ActiveXObject("htmlfile");S.write("");S.close();R=S.body}catch(bL){R=createPopup().document.body}var d=R.createTextRange();bf=aG(function(i){try{R.style.color=bH(i).replace(b,aX);var bM=d.queryCommandValue("ForeColor");bM=((bM&255)<<16)|(bM&65280)|((bM&16711680)>>>16);return"#"+("000000"+bM.toString(16)).slice(-6)}catch(bN){return"none"}})}else{var E=aA.doc.createElement("i");E.title="Rapha\xebl Colour Picker";E.style.display="none";aA.doc.body.appendChild(E);bf=aG(function(i){E.style.color=i;return aA.doc.defaultView.getComputedStyle(E,aX).getPropertyValue("color")})}return bf(g)},aI=function(){return"hsb("+[this.h,this.s,this.b]+")"},M=function(){return"hsl("+[this.h,this.s,this.l]+")"},x=function(){return this.hex},aY=function(R,E,d){if(E==null&&aR.is(R,"object")&&"r" in R&&"g" in R&&"b" in R){d=R.b;E=R.g;R=R.r}if(E==null&&aR.is(R,aj)){var i=aR.getRGB(R);R=i.r;E=i.g;d=i.b}if(R>1||E>1||d>1){R/=255;E/=255;d/=255}return[R,E,d]},a2=function(R,E,d,S){R*=255;E*=255;d*=255;var i={r:R,g:E,b:d,hex:aR.rgb(R,E,d),toString:x};aR.is(S,"finite")&&(i.opacity=S);return i};aR.color=function(b){var d;if(aR.is(b,"object")&&"h" in b&&"s" in b&&"b" in b){d=aR.hsb2rgb(b);b.r=d.r;b.g=d.g;b.b=d.b;b.hex=d.hex}else{if(aR.is(b,"object")&&"h" in b&&"s" in b&&"l" in b){d=aR.hsl2rgb(b);b.r=d.r;b.g=d.g;b.b=d.b;b.hex=d.hex}else{if(aR.is(b,"string")){b=aR.getRGB(b)}if(aR.is(b,"object")&&"r" in b&&"g" in b&&"b" in b){d=aR.rgb2hsl(b);b.h=d.h;b.s=d.s;b.l=d.l;d=aR.rgb2hsb(b);b.v=d.b}else{b={hex:"none"};b.r=b.g=b.b=b.h=b.s=b.v=b.l=-1}}}b.toString=x;return b};aR.hsb2rgb=function(S,bN,bL,i){if(this.is(S,"object")&&"h" in S&&"s" in S&&"b" in S){bL=S.b;bN=S.s;S=S.h;i=S.o}S*=360;var E,bM,d,g,b;S=(S%360)/60;b=bL*bN;g=b*(1-aw(S%2-1));E=bM=d=bL-b;S=~~S;E+=[b,g,0,0,g,b][S];bM+=[g,b,b,g,0,0][S];d+=[0,0,g,b,b,g][S];return a2(E,bM,d,i)};aR.hsl2rgb=function(bL,bN,E,i){if(this.is(bL,"object")&&"h" in bL&&"s" in bL&&"l" in bL){E=bL.l;bN=bL.s;bL=bL.h}if(bL>1||bN>1||E>1){bL/=360;bN/=100;E/=100}bL*=360;var S,bM,d,g,b;bL=(bL%360)/60;b=2*bN*(E<0.5?E:1-E);g=b*(1-aw(bL%2-1));S=bM=d=E-b/2;bL=~~bL;S+=[b,g,0,0,g,b][bL];bM+=[g,b,b,g,0,0][bL];d+=[0,0,g,b,b,g][bL];return a2(S,bM,d,i)};aR.rgb2hsb=function(bM,bL,d){d=aY(bM,bL,d);bM=d[0];bL=d[1];d=d[2];var R,E,i,bN;i=m(bM,bL,d);bN=i-bm(bM,bL,d);R=(bN==0?null:i==bM?(bL-d)/bN:i==bL?(d-bM)/bN+2:(bM-bL)/bN+4);R=((R+360)%6)*60/360;E=bN==0?0:bN/i;return{h:R,s:E,b:i,toString:aI}};aR.rgb2hsl=function(d,bL,bO){bO=aY(d,bL,bO);d=bO[0];bL=bO[1];bO=bO[2];var bP,R,bN,bM,E,i;bM=m(d,bL,bO);E=bm(d,bL,bO);i=bM-E;bP=(i==0?null:bM==d?(bL-bO)/i:bM==bL?(bO-d)/i+2:(d-bL)/i+4);bP=((bP+360)%6)*60/360;bN=(bM+E)/2;R=(i==0?0:bN<0.5?i/(2*bN):i/(2-2*bN));return{h:bP,s:R,l:bN,toString:M}};aR._path2string=function(){return this.join(",").replace(bg,"$1")};function bk(E,g){for(var b=0,d=E.length;b=1000&&delete R[bL.shift()];bL.push(S);R[S]=i[bG](d,E);return b?b(R[S]):R[S]}return g}var bv=aR._preload=function(g,d){var b=aA.doc.createElement("img");b.style.cssText="position:absolute;left:-9999em;top:-9999em";b.onload=function(){d.call(this);this.onload=null;aA.doc.body.removeChild(this)};b.onerror=function(){aA.doc.body.removeChild(this)};aA.doc.body.appendChild(b);b.src=g};function aq(){return this.hex}aR.getRGB=aG(function(b){if(!b||!!((b=bH(b)).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:aq}}if(b=="none"){return{r:-1,g:-1,b:-1,hex:"none",toString:aq}}!(n[ak](b.toLowerCase().substring(0,2))||b.charAt()=="#")&&(b=bf(b));var E,d,g,S,i,bM,bL,R=b.match(A);if(R){if(R[2]){S=U(R[2].substring(5),16);g=U(R[2].substring(3,5),16);d=U(R[2].substring(1,3),16)}if(R[3]){S=U((bM=R[3].charAt(3))+bM,16);g=U((bM=R[3].charAt(2))+bM,16);d=U((bM=R[3].charAt(1))+bM,16)}if(R[4]){bL=R[4][F](bi);d=an(bL[0]);bL[0].slice(-1)=="%"&&(d*=2.55);g=an(bL[1]);bL[1].slice(-1)=="%"&&(g*=2.55);S=an(bL[2]);bL[2].slice(-1)=="%"&&(S*=2.55);R[1].toLowerCase().slice(0,4)=="rgba"&&(i=an(bL[3]));bL[3]&&bL[3].slice(-1)=="%"&&(i/=100)}if(R[5]){bL=R[5][F](bi);d=an(bL[0]);bL[0].slice(-1)=="%"&&(d*=2.55);g=an(bL[1]);bL[1].slice(-1)=="%"&&(g*=2.55);S=an(bL[2]);bL[2].slice(-1)=="%"&&(S*=2.55);(bL[0].slice(-3)=="deg"||bL[0].slice(-1)=="\xb0")&&(d/=360);R[1].toLowerCase().slice(0,4)=="hsba"&&(i=an(bL[3]));bL[3]&&bL[3].slice(-1)=="%"&&(i/=100);return aR.hsb2rgb(d,g,S,i)}if(R[6]){bL=R[6][F](bi);d=an(bL[0]);bL[0].slice(-1)=="%"&&(d*=2.55);g=an(bL[1]);bL[1].slice(-1)=="%"&&(g*=2.55);S=an(bL[2]);bL[2].slice(-1)=="%"&&(S*=2.55);(bL[0].slice(-3)=="deg"||bL[0].slice(-1)=="\xb0")&&(d/=360);R[1].toLowerCase().slice(0,4)=="hsla"&&(i=an(bL[3]));bL[3]&&bL[3].slice(-1)=="%"&&(i/=100);return aR.hsl2rgb(d,g,S,i)}R={r:d,g:g,b:S,toString:aq};R.hex="#"+(16777216|S|(g<<8)|(d<<16)).toString(16).slice(1);aR.is(i,"finite")&&(R.opacity=i);return R}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:aq}},aR);aR.hsb=aG(function(i,g,d){return aR.hsb2rgb(i,g,d).hex});aR.hsl=aG(function(g,d,b){return aR.hsl2rgb(g,d,b).hex});aR.rgb=aG(function(E,i,d){return"#"+(16777216|d|(i<<8)|(E<<16)).toString(16).slice(1)});aR.getColor=function(d){var g=this.getColor.start=this.getColor.start||{h:0,s:1,b:d||0.75},b=this.hsb2rgb(g.h,g.s,g.b);g.h+=0.075;if(g.h>1){g.h=0;g.s-=0.2;g.s<=0&&(this.getColor.start={h:0,s:1,b:g.b})}return b.hex};aR.getColor.reset=function(){delete this.start};function bb(E,bL){var S=[];for(var g=0,b=E.length;b-2*!bL>g;g+=2){var R=[{x:+E[g-2],y:+E[g-1]},{x:+E[g],y:+E[g+1]},{x:+E[g+2],y:+E[g+3]},{x:+E[g+4],y:+E[g+5]}];if(bL){if(!g){R[0]={x:+E[b-2],y:+E[b-1]}}else{if(b-4==g){R[3]={x:+E[0],y:+E[1]}}else{if(b-2==g){R[2]={x:+E[0],y:+E[1]};R[3]={x:+E[2],y:+E[3]}}}}}else{if(b-4==g){R[3]=R[2]}else{if(!g){R[0]={x:+E[g],y:+E[g+1]}}}}S.push(["C",(-R[0].x+6*R[1].x+R[2].x)/6,(-R[0].y+6*R[1].y+R[2].y)/6,(R[1].x+6*R[2].x-R[3].x)/6,(R[1].y+6*R[2].y-R[3].y)/6,R[2].x,R[2].y])}return S}aR.parsePathString=function(b){if(!b){return null}var g=Y(b);if(g.arr){return aZ(g.arr)}var i={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},d=[];if(aR.is(b,bd)&&aR.is(b[0],bd)){d=aZ(b)}if(!d.length){bH(b).replace(a0,function(R,E,bM){var bL=[],S=E.toLowerCase();bM.replace(aP,function(bO,bN){bN&&bL.push(+bN)});if(S=="m"&&bL.length>2){d.push([E][bE](bL.splice(0,2)));S="l";E=E=="m"?"l":"L"}if(S=="r"){d.push([E][bE](bL))}else{while(bL.length>=i[S]){d.push([E][bE](bL.splice(0,i[S])));if(!i[S]){break}}}})}d.toString=aR._path2string;g.arr=aZ(d);return d};aR.parseTransformString=aG(function(d){if(!d){return null}var g={r:3,s:4,t:2,m:6},b=[];if(aR.is(d,bd)&&aR.is(d[0],bd)){b=aZ(d)}if(!b.length){bH(d).replace(ai,function(E,i,bL){var S=[],R=bK.call(i);bL.replace(aP,function(bN,bM){bM&&S.push(+bM)});b.push([i][bE](S))})}b.toString=aR._path2string;return b});var Y=function(d){var b=Y.ps=Y.ps||{};if(b[d]){b[d].sleep=100}else{b[d]={sleep:100}}setTimeout(function(){for(var g in b){if(b[ak](g)&&g!=d){b[g].sleep--;!b[g].sleep&&delete b[g]}}});return b[d]};aR.findDotsAtSegment=function(d,b,b2,b0,S,E,bN,bL,bV){var bS=1-bV,bX=bp(bS,3),bY=bp(bS,2),bP=bV*bV,bM=bP*bV,bR=bX*d+bY*3*bV*b2+bS*3*bV*bV*S+bM*bN,bO=bX*b+bY*3*bV*b0+bS*3*bV*bV*E+bM*bL,bW=d+2*bV*(b2-d)+bP*(S-2*b2+d),bU=b+2*bV*(b0-b)+bP*(E-2*b0+b),b1=b2+2*bV*(S-b2)+bP*(bN-2*S+b2),bZ=b0+2*bV*(E-b0)+bP*(bL-2*E+b0),bT=bS*d+bV*b2,bQ=bS*b+bV*b0,i=bS*S+bV*bN,g=bS*E+bV*bL,R=(90-au.atan2(bW-b1,bU-bZ)*180/aV);(bW>b1||bU=d.x&&b<=d.x2&&g>=d.y&&g<=d.y2};aR.isBBoxIntersect=function(g,d){var b=aR.isPointInsideBBox;return b(d,g.x,g.y)||b(d,g.x2,g.y)||b(d,g.x,g.y2)||b(d,g.x2,g.y2)||b(g,d.x,d.y)||b(g,d.x2,d.y)||b(g,d.x,d.y2)||b(g,d.x2,d.y2)||(g.xd.x||d.xg.x)&&(g.yd.y||d.yg.y)};function bj(b,S,R,E,i){var g=-3*S+9*R-9*E+3*i,d=b*g+6*S-12*R+6*E;return b*d-3*S+3*R}function q(bW,R,bV,g,bU,d,bR,b,bO){if(bO==null){bO=1}bO=bO>1?1:bO<0?0:bO;var bP=bO/2,bQ=12,bL=[-0.1252,0.1252,-0.3678,0.3678,-0.5873,0.5873,-0.7699,0.7699,-0.9041,0.9041,-0.9816,0.9816],bT=[0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],E=0;for(var bS=0;bSS){i/=2;R+=(Em(b,bS)||m(bQ,bO)m(bN,bM)){return}var bL=(i*bO-bQ*g)*(b-bS)-(i-g)*(b*bM-bN*bS),S=(i*bO-bQ*g)*(bN-bM)-(bQ-bO)*(b*bM-bN*bS),E=(i-g)*(bN-bM)-(bQ-bO)*(b-bS);if(!E){return}var bR=bL/E,bP=S/E,R=+bR.toFixed(2),d=+bP.toFixed(2);if(R<+bm(i,g).toFixed(2)||R>+m(i,g).toFixed(2)||R<+bm(b,bS).toFixed(2)||R>+m(b,bS).toFixed(2)||d<+bm(bQ,bO).toFixed(2)||d>+m(bQ,bO).toFixed(2)||d<+bm(bN,bM).toFixed(2)||d>+m(bN,bM).toFixed(2)){return}return{x:bR,y:bP}}function ay(d,b){return af(d,b)}function t(d,b){return af(d,b,1)}function af(b2,b1,b0){var E=aR.bezierBBox(b2),d=aR.bezierBBox(b1);if(!aR.isBBoxIntersect(E,d)){return b0?0:[]}var bV=q.apply(0,b2),bU=q.apply(0,b1),bM=~~(bV/5),bL=~~(bU/5),bS=[],bR=[],g={},b3=b0?0:[];for(var bX=0;bX=0&&bO<=1&&bN>=0&&bN<=1){if(b0){b3++}else{b3.push({x:R.x,y:R.y,t1:bO,t2:bN})}}}}}return b3}aR.pathIntersection=function(d,b){return D(d,b)};aR.pathIntersectionNumber=function(d,b){return D(d,b,1)};function D(g,b,bW){g=aR._path2curve(g);b=aR._path2curve(b);var bU,S,bT,E,bR,bL,d,bO,b0,bZ,b1=bW?0:[];for(var bS=0,bM=g.length;bS1){ch=au.sqrt(ch);b1=ch*b1;bZ=ch*bZ}var g=b1*b1,ca=bZ*bZ,cc=(bN==E?-1:1)*au.sqrt(aw((g*ca-g*b6*b6-ca*b7*b7)/(g*b6*b6+ca*b7*b7))),bW=cc*b1*b6/bZ+(bS+bR)/2,bV=cc*-bZ*b7/b1+(cn+cm)/2,bM=au.asin(((cn-bV)/bZ).toFixed(9)),bL=au.asin(((cm-bV)/bZ).toFixed(9));bM=bSbL){bM=bM-aV*2}if(!E&&bL>bM){bL=bL-aV*2}}else{bM=bU[0];bL=bU[1];bW=bU[2];bV=bU[3]}var bQ=bL-bM;if(aw(bQ)>bY){var bX=bL,b0=bR,bO=cm;bL=bM+bY*(E&&bL>bM?1:-1);bR=bW+b1*au.cos(bL);cm=bV+bZ*au.sin(bL);b5=ae(bR,cm,b1,bZ,bT,0,E,b0,bO,[bL,bX,bW,bV])}bQ=bL-bM;var S=au.cos(bM),cl=au.sin(bM),R=au.cos(bL),ck=au.sin(bL),b8=au.tan(bQ/4),cb=4/3*b1*b8,b9=4/3*bZ*b8,ci=[bS,cn],cg=[bS+cb*cl,cn-b9*S],cf=[bR+cb*ck,cm-b9*R],cd=[bR,cm];cg[0]=2*ci[0]-cg[0];cg[1]=2*ci[1]-cg[1];if(bU){return[cg,cf,cd][bE](b5)}else{b5=[cg,cf,cd][bE](b5).join()[F](",");var b3=[];for(var ce=0,b4=b5.length;ce"1e12"&&(bL=0.5);aw(S)>"1e12"&&(S=0.5);if(bL>0&&bL<1){g=ag(i,d,R,E,bU,bT,bQ,bN,bL);bR.push(g.x);bO.push(g.y)}if(S>0&&S<1){g=ag(i,d,R,E,bU,bT,bQ,bN,S);bR.push(g.x);bO.push(g.y)}bS=(bT-2*E+d)-(bN-2*bT+E);bP=2*(E-d)-2*(bT-E);bM=d-E;bL=(-bP+au.sqrt(bP*bP-4*bS*bM))/2/bS;S=(-bP-au.sqrt(bP*bP-4*bS*bM))/2/bS;aw(bL)>"1e12"&&(bL=0.5);aw(S)>"1e12"&&(S=0.5);if(bL>0&&bL<1){g=ag(i,d,R,E,bU,bT,bQ,bN,bL);bR.push(g.x);bO.push(g.y)}if(S>0&&S<1){g=ag(i,d,R,E,bU,bT,bQ,bN,S);bR.push(g.x);bO.push(g.y)}return{min:{x:bm[bG](0,bR),y:bm[bG](0,bO)},max:{x:m[bG](0,bR),y:m[bG](0,bO)}}}),W=aR._path2curve=aG(function(bU,bP){var bN=!bP&&Y(bU);if(!bP&&bN.curve){return aZ(bN.curve)}var E=w(bU),bQ=bP&&w(bP),bR={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},d={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},S=function(bV,bW){var i,bX;if(!bV){return["C",bW.x,bW.y,bW.x,bW.y,bW.x,bW.y]}!(bV[0] in {T:1,Q:1})&&(bW.qx=bW.qy=null);switch(bV[0]){case"M":bW.X=bV[1];bW.Y=bV[2];break;case"A":bV=["C"][bE](ae[bG](0,[bW.x,bW.y][bE](bV.slice(1))));break;case"S":i=bW.x+(bW.x-(bW.bx||bW.x));bX=bW.y+(bW.y-(bW.by||bW.y));bV=["C",i,bX][bE](bV.slice(1));break;case"T":bW.qx=bW.x+(bW.x-(bW.qx||bW.x));bW.qy=bW.y+(bW.y-(bW.qy||bW.y));bV=["C"][bE](bn(bW.x,bW.y,bW.qx,bW.qy,bV[1],bV[2]));break;case"Q":bW.qx=bV[1];bW.qy=bV[2];bV=["C"][bE](bn(bW.x,bW.y,bV[1],bV[2],bV[3],bV[4]));break;case"L":bV=["C"][bE](bI(bW.x,bW.y,bV[1],bV[2]));break;case"H":bV=["C"][bE](bI(bW.x,bW.y,bV[1],bW.y));break;case"V":bV=["C"][bE](bI(bW.x,bW.y,bW.x,bV[1]));break;case"Z":bV=["C"][bE](bI(bW.x,bW.y,bW.X,bW.Y));break}return bV},b=function(bV,bW){if(bV[bW].length>7){bV[bW].shift();var bX=bV[bW];while(bX.length){bV.splice(bW++,0,["C"][bE](bX.splice(0,6)))}bV.splice(bW,1);bS=m(E.length,bQ&&bQ.length||0)}},g=function(bZ,bY,bW,bV,bX){if(bZ&&bY&&bZ[bX][0]=="M"&&bY[bX][0]!="M"){bY.splice(bX,0,["M",bV.x,bV.y]);bW.bx=0;bW.by=0;bW.x=bZ[bX][1];bW.y=bZ[bX][2];bS=m(E.length,bQ&&bQ.length||0)}};for(var bM=0,bS=m(E.length,bQ&&bQ.length||0);bMR){if(d&&!bS.start){bQ=k(bP,bO,g[1],g[2],g[3],g[4],g[5],g[6],R-bN);E+=["C"+bQ.start.x,bQ.start.y,bQ.m.x,bQ.m.y,bQ.x,bQ.y];if(S){return E}bS.start=E;E=["M"+bQ.x,bQ.y+"C"+bQ.n.x,bQ.n.y,bQ.end.x,bQ.end.y,g[5],g[6]].join();bN+=bL;bP=+g[5];bO=+g[6];continue}if(!b&&!d){bQ=k(bP,bO,g[1],g[2],g[3],g[4],g[5],g[6],R-bN);return{x:bQ.x,y:bQ.y,alpha:bQ.alpha}}}bN+=bL;bP=+g[5];bO=+g[6]}E+=g.shift()+g}bS.end=E;bQ=b?bN:d?bS:aR.findDotsAtSegment(bP,bO,g[0],g[1],g[2],g[3],g[4],g[5],1);bQ.alpha&&(bQ={x:bQ.x,y:bQ.y,alpha:bQ.alpha});return bQ}};var aS=a6(1),J=a6(),ad=a6(0,1);aR.getTotalLength=aS;aR.getPointAtLength=J;aR.getSubpath=function(d,i,g){if(this.getTotalLength(d)-g<0.000001){return ad(d,i).end}var b=ad(d,g,1);return i?ad(b,i).end:b};bh.getTotalLength=function(){if(this.type!="path"){return}if(this.node.getTotalLength){return this.node.getTotalLength()}return aS(this.attrs.path)};bh.getPointAtLength=function(b){if(this.type!="path"){return}return J(this.attrs.path,b)};bh.getSubpath=function(d,b){if(this.type!="path"){return}return aR.getSubpath(this.attrs.path,d,b)};var o=aR.easing_formulas={linear:function(b){return b},"<":function(b){return bp(b,1.7)},">":function(b){return bp(b,0.48)},"<>":function(bL){var i=0.48-bL/1.04,g=au.sqrt(0.1734+i*i),b=g-i,S=bp(aw(b),1/3)*(b<0?-1:1),R=-g-i,E=bp(aw(R),1/3)*(R<0?-1:1),d=S+E+0.5;return(1-d)*3*d*d+d*d*d},backIn:function(d){var b=1.70158;return d*d*((b+1)*d-b)},backOut:function(d){d=d-1;var b=1.70158;return d*d*((b+1)*d+b)+1},elastic:function(b){if(b==!!b){return b}return bp(2,-10*b)*au.sin((b-0.075)*(2*aV)/0.3)+1},bounce:function(i){var d=7.5625,g=2.75,b;if(i<(1/g)){b=d*i*i}else{if(i<(2/g)){i-=(1.5/g);b=d*i*i+0.75}else{if(i<(2.5/g)){i-=(2.25/g);b=d*i*i+0.9375}else{i-=(2.625/g);b=d*i*i+0.984375}}}return b}};o.easeIn=o["ease-in"]=o["<"];o.easeOut=o["ease-out"]=o[">"];o.easeInOut=o["ease-in-out"]=o["<>"];o["back-in"]=o.backIn;o["back-out"]=o.backOut;var ab=[],aN=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){setTimeout(b,16)},bC=function(){var bL=+new Date,bT=0;for(;bT1&&!bZ.next){for(b1 in d){if(d[ak](b1)){bX[b1]=bZ.totalOrigin[b1]}}bZ.el.attr(bX);aM(bZ.anim,bZ.el,bZ.anim.percents[0],null,bZ.totalOrigin,bZ.repeat-1)}if(bZ.next&&!bZ.stop){aM(bZ.anim,bZ.el,bZ.next,null,bZ.totalOrigin,bZ.repeat)}}}aR.svg&&S&&S.paper&&S.paper.safari();ab.length&&aN(bC)},H=function(b){return b>255?255:b<0?0:b};bh.animateWith=function(d,E,g,b,bL,bQ){var S=this;if(S.removed){bQ&&bQ.call(S);return S}var bO=g instanceof bA?g:aR.animation(g,b,bL,bQ),bN,bM;aM(bO,S,bO.percents[0],null,S.attr());for(var R=0,bP=ab.length;RbY){return bY}while(bZbU){bZ=bW}else{bY=bW}bW=(bY-bZ)/2+bZ}return bW}return g(bR,1/(200*bL))}bh.onAnimation=function(b){b?eve.on("raphael.anim.frame."+this.id,b):eve.unbind("raphael.anim.frame."+this.id);return this};function bA(E,g){var d=[],i={};this.ms=g;this.times=1;if(E){for(var b in E){if(E[ak](b)){i[an(b)]=E[b];d.push(an(b))}}d.sort(u)}this.anim=i;this.top=d[d.length-1];this.percents=d}bA.prototype.delay=function(d){var b=new bA(this.anim,this.ms);b.times=this.times;b.del=+d||0;return b};bA.prototype.repeat=function(d){var b=new bA(this.anim,this.ms);b.del=this.del;b.times=au.floor(m(d,0))||1;return b};function aM(b3,g,b,b1,bL,bP){b=an(b);var ca,S,bO,cb=[],bV,bU,R,bX=b3.ms,b2={},E={},bR={};if(b1){for(b6=0,bQ=ab.length;b6b1*b3.top){b=b3.percents[b6];bU=b3.percents[b6-1]||0;bX=bX/b3.top*(b-bU);bV=b3.percents[b6+1];ca=b3.anim[b];break}else{if(b1){g.attr(b3.anim[b3.percents[b6]])}}}if(!ca){return}if(!S){for(var bZ in ca){if(ca[ak](bZ)){if(ar[ak](bZ)||g.paper.customAttributes[ak](bZ)){b2[bZ]=g.attr(bZ);(b2[bZ]==null)&&(b2[bZ]=r[bZ]);E[bZ]=ca[bZ];switch(ar[bZ]){case aL:bR[bZ]=(E[bZ]-b2[bZ])/bX;break;case"colour":b2[bZ]=aR.getRGB(b2[bZ]);var b0=aR.getRGB(E[bZ]);bR[bZ]={r:(b0.r-b2[bZ].r)/bX,g:(b0.g-b2[bZ].g)/bX,b:(b0.b-b2[bZ].b)/bX};break;case"path":var bM=W(b2[bZ],E[bZ]),bT=bM[1];b2[bZ]=bM[0];bR[bZ]=[];for(b6=0,bQ=b2[bZ].length;b61?G.opacity/100:G.opacity});case"stroke":G=l.getRGB(R);T.setAttribute(S,G.hex);S=="stroke"&&G[d]("opacity")&&i(T,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity});if(S=="stroke"&&P._.arrows){"startString" in P._.arrows&&c(P,P._.arrows.startString);"endString" in P._.arrows&&c(P,P._.arrows.endString,1)}break;case"gradient":(P.type=="circle"||P.type=="ellipse"||B(R).charAt()!="r")&&a(P,R);break;case"opacity":if(Q.gradient&&!Q[d]("stroke-opacity")){i(T,{"stroke-opacity":R>1?R/100:R})}case"fill-opacity":if(Q.gradient){D=l._g.doc.getElementById(T.getAttribute("fill").replace(/^url\(#|\)$/g,r));if(D){J=D.getElementsByTagName("stop");i(J[J.length-1],{"stop-opacity":R})}break}case"shape-rendering":T.setAttribute(S,R);break;case"text-decoration":T.setAttribute(S,R);break;case"word-wrap":T.setAttribute(S,R);break;default:S=="font-size"&&(R=q(R,10)+"px");var K=S.replace(/(\-.)/g,function(Y){return Y.substring(1).toUpperCase()});T.style[K]=R;P._.dirty=1;T.setAttribute(S,R);break}}}p(P,X,N);T.style.visibility=M},A=1.2,p=function(D,H,S){if(D.type!="text"||!(H[d]("text")||H[d]("font")||H[d]("font-size")||H[d]("x")||H[d]("y"))){return}var O=D.attrs,G=D.node,R=G.firstChild?q(l._g.doc.defaultView.getComputedStyle(G.firstChild,r).getPropertyValue("font-size"),10):10;if(H[d]("text")){O.text=H.text;while(G.firstChild){G.removeChild(G.firstChild)}var E=[],J=[],M;var P=H["font-size"];P=P?P:12;var F=parseInt(S[0]/(P/2));function L(Z,aa){var U=Z.split("\n"),ab;var af=[];var V=false;var W=function(ag){var ah=new RegExp(/^\s$/);return ah.test(ag.charAt(0))};for(var ac=0;ac=0;I--){if(W(ab.charAt(I))){Y=Y+ab.slice(0,I);ab=ab.slice(I+1);ae=true;af.push(Y);break}}if(!ae){Y=Y+ab.slice(0,aa);ab=ab.slice(aa);af.push(Y)}}}while(!V)}var ad=[];for(var T=0,X=af.length;T0){ad.push(af[T])}}if(!af.length){af.push("")}return af}if(!H.text){J=[];J.push("")}if(!F||isNaN(F)){J=[];J.push(H.text)}else{if(H["word-wrap"]=="none"){J=H.text.split("\n")}else{J=L(H.text,F)}}for(var I=0,Q=J.length;I"));var U=ag.getBoundingClientRect();aq.W=an.w=(U.right-U.left)/ab;aq.H=an.h=(U.bottom-U.top)/ab;aq.X=an.x;aq.Y=an.y+aq.H/2;("x" in aj||"y" in aj)&&(aq.path.v=l.format("m{0},{1}l{2},{1}",B(an.x*b),B(an.y*b),B(an.x*b)+1));var T=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var ai=0,ak=T.length;ai0.25&&(W=h.sqrt(0.25-L(Y-0.5,2))*((W>0.5)*2-1)+0.5);Q=Y+k+W}return q});R=R.split(/\s*\-\s*/);if(P=="linear"){var J=R.shift();J=-n(J);if(isNaN(J)){return null}}var O=l._parseDots(R);if(!O){return null}E=E.shape||E.node;if(O.length){E.removeChild(U);U.on=true;U.method="none";U.color=O[0].color;U.color2=O[O.length-1].color;var V=[];for(var K=0,T=O.length;K')}}catch(E){G=function(L){return J.createElement("<"+L+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}};l._engine.initWin(l._g.win);l._engine.create=function(){var K=l._getContainer.apply(0,arguments),E=K.container,Q=K.height,R,J=K.width,P=K.x,O=K.y;if(!E){throw new Error("VML container not found.")}var M=new l._Paper,N=M.canvas=l._g.doc.createElement("div"),L=N.style;P=P||0;O=O||0;J=J||512;Q=Q||342;M.width=J;M.height=Q;J==+J&&(J+="px");Q==+Q&&(Q+="px");M.coordsize=b*1000+k+b*1000;M.coordorigin="0 0";M.span=l._g.doc.createElement("span");M.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;";N.appendChild(M.span);L.cssText=l.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",J,Q);if(E==1){l._g.doc.body.appendChild(N);L.left=P+"px";L.top=O+"px";L.position="absolute"}else{if(E.firstChild){E.insertBefore(N,E.firstChild)}else{E.appendChild(N)}}M.renderfix=function(){};return M};l.prototype.clear=function(){l.eve("raphael.clear",this);this.canvas.innerHTML=q;this.span=l._g.doc.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas.appendChild(this.span);this.bottom=this.top=null};l.prototype.remove=function(){l.eve("raphael.remove",this);this.canvas.parentNode.removeChild(this.canvas);for(var E in this){this[E]=typeof this[E]=="function"?l._removedFactory(E):null}return true};var y=l.st;for(var g in m){if(m[e](g)&&!y[e](g)){y[g]=(function(E){return function(){var J=arguments;return this.forEach(function(K){K[E].apply(K,J)})}})(g)}}}(window.Raphael);var OG=window.OG||{};OG.common={};OG.geometry={};OG.graph={};OG.handler={};OG.layout={};OG.renderer={};OG.marker={};OG.pattern={};OG.shape={};OG.shape.bpmn={};OG.shape.elec={};OG.shape.dids={};OG.shape.component={};OG.shape.essencia={};OG.common.Constants={CANVAS_SUFFIX:"OG-CANVAS",GEOM_TYPE:{NULL:0,POINT:1,LINE:2,POLYLINE:3,POLYGON:4,RECTANGLE:5,CIRCLE:6,ELLIPSE:7,CURVE:8,BEZIER_CURVE:9,COLLECTION:10},GEOM_NAME:["","Point","Line","PolyLine","Polygon","Rectangle","Circle","Ellipse","Curve","BezierCurve","Collection"],NUM_PRECISION:0,NODE_TYPE:{ROOT:"ROOT",SHAPE:"SHAPE",ETC:"ETC"},SHAPE_TYPE:{GEOM:"GEOM",TEXT:"TEXT",HTML:"HTML",IMAGE:"IMAGE",SVG:"SVG",EDGE:"EDGE",GROUP:"GROUP"},EDGE_TYPE:{STRAIGHT:"straight",PLAIN:"plain",BEZIER:"bezier"},LABEL_SUFFIX:"_LABEL",LABEL_EDITOR_SUFFIX:"_LABEL_EDITOR",FROM_LABEL_SUFFIX:"_FROMLABEL",TO_LABEL_SUFFIX:"_TOLABEL",RUBBER_BAND_ID:"OG_R_BAND",RUBBER_BAND_TOLERANCE:3,GUIDE_SUFFIX:{ONRESIZE:"ONRESIZE",GUIDE:"_GUIDE",BBOX:"_GUIDE_BBOX",UL:"_GUIDE_UL",UR:"_GUIDE_UR",LWL:"_GUIDE_LWL",LWR:"_GUIDE_LWR",LC:"_GUIDE_LC",UC:"_GUIDE_UC",RC:"_GUIDE_RC",LWC:"_GUIDE_LWC",FROM:"_GUIDE_FROM",TO:"_GUIDE_TO",CTL:"_GUIDE_CTL_",CTL_H:"_GUIDE_CTL_H_",CTL_V:"_GUIDE_CTL_V_",LINE:"_GUIDE_LINE",LINE_TEXT:"_GUIDE_LINE_TEXT",LINE_CONNECT_MODE:"LINE_CONNECT_MODE",LINE_CONNECT_TEXT:"LINE_CONNECT_TEXT",LINE_CONNECT_SHAPE:"LINE_CONNECT_SHAPE",LINE_CONNECT_LABEL:"LINE_CONNECT_LABEL",LINE_VIRTUAL_EDGE:"LINE_VIRTUAL_EDGE",RECT_CONNECT_MODE:"RECT_CONNECT_MODE",TRASH:"_GUIDE_TRASH",RECT:"_GUIDE_RECT",QUARTER_UPPER:"QUARTER_UPPER",QUARTER_LOW:"QUARTER_LOW",QUARTER_BISECTOR:"QUARTER_BISECTOR",QUARTER_THIRDS:"QUARTER_THIRDS"},COLLAPSE_SUFFIX:"_COLLAPSE",COLLAPSE_BBOX_SUFFIX:"_COLLAPSE_BBOX",LOOPTYPE_SUFFIX:"_LOOPTYPE",LOOPTYPE_BBOX_SUFFIX:"_LOOPTYPE_BBOX",TASKTYPE_SUFFIX:"_TASKTYPE",TASKTYPE_BBOX_SUFFIX:"_TASKTYPE_BBOX",INCLUSION_SUFFIX:"_INCLUSION",INCLUSION_BBOX_SUFFIX:"_INCLUSION_BBOX",STATUS_SUFFIX:"_STATUS",STATUS_BBOX_SUFFIX:"_STATUS_BBOX",EXCEPTIONTYPE_SUFFIX:"_EXCEPTIONTYPE",EXCEPTIONTYPE_BBOX_SUFFIX:"_EXCEPTIONTYPE_BBOX",MOVE_SNAP_SIZE:5,DROP_OVER_BBOX_SUFFIX:"_DROP_OVER",TERMINAL_SUFFIX:{GROUP:"_TERMINAL",BOX:"_TERMINAL_BOX"},TERMINAL:"_TERMINAL",MARKER_TEMP_NODE:"MARKER_TEMP_NODE",PATTERN_TEMP_NODE:"PATTERN_TEMP_NODE",MARKER_DEFS_SUFFIX:"_MARKER",ORIGINAL_NODE:"ORIGINAL_NODE",CONNECT_GUIDE_EVENT_AREA:{NAME:"CONNECT_GUIDE"},CONNECT_GUIDE_SUFFIX:{SPOT:"_CONNECT_SPOT",VIRTUAL_SPOT:"_CONNECT_VIRTUAL_SPOT",BBOX:"_CONNECT_GUIDE_BBOX",SPOT_CIRCLE:"CIRCLE",SPOT_RECT:"RECT",SPOT_EVENT_DRAG:"SPOT_EVENT_DRAG",SPOT_EVENT_MOUSEROVER:"SPOT_EVENT_MOUSEROVER",CONNECTABLE_SPOT_DRAG:"CONNECTABLE_SPOT_DRAG",CONNECT_FOCUS_SHAPE:"CONNECT_FOCUS_SHAPE"},BACKDOOR_SUFFIX:"backdoor"};OG.Constants=OG.common.Constants;if(typeof KeyEvent==="undefined"){var KeyEvent={DOM_VK_CANCEL:3,DOM_VK_HELP:6,DOM_VK_BACK_SPACE:8,DOM_VK_TAB:9,DOM_VK_CLEAR:12,DOM_VK_RETURN:13,DOM_VK_ENTER:14,DOM_VK_SHIFT:16,DOM_VK_CONTROL:17,DOM_VK_ALT:18,DOM_VK_PAUSE:19,DOM_VK_CAPS_LOCK:20,DOM_VK_ESCAPE:27,DOM_VK_SPACE:32,DOM_VK_PAGE_UP:33,DOM_VK_PAGE_DOWN:34,DOM_VK_END:35,DOM_VK_HOME:36,DOM_VK_LEFT:37,DOM_VK_UP:38,DOM_VK_RIGHT:39,DOM_VK_DOWN:40,DOM_VK_PRINTSCREEN:44,DOM_VK_INSERT:45,DOM_VK_DELETE:46,DOM_VK_0:48,DOM_VK_1:49,DOM_VK_2:50,DOM_VK_3:51,DOM_VK_4:52,DOM_VK_5:53,DOM_VK_6:54,DOM_VK_7:55,DOM_VK_8:56,DOM_VK_9:57,DOM_VK_SEMICOLON:59,DOM_VK_EQUALS:61,DOM_VK_A:65,DOM_VK_B:66,DOM_VK_C:67,DOM_VK_D:68,DOM_VK_E:69,DOM_VK_F:70,DOM_VK_G:71,DOM_VK_H:72,DOM_VK_I:73,DOM_VK_J:74,DOM_VK_K:75,DOM_VK_L:76,DOM_VK_M:77,DOM_VK_N:78,DOM_VK_O:79,DOM_VK_P:80,DOM_VK_Q:81,DOM_VK_R:82,DOM_VK_S:83,DOM_VK_T:84,DOM_VK_U:85,DOM_VK_V:86,DOM_VK_W:87,DOM_VK_X:88,DOM_VK_Y:89,DOM_VK_Z:90,DOM_VK_COMMAND:91,DOM_VK_CONTEXT_MENU:93,DOM_VK_NUMPAD0:96,DOM_VK_NUMPAD1:97,DOM_VK_NUMPAD2:98,DOM_VK_NUMPAD3:99,DOM_VK_NUMPAD4:100,DOM_VK_NUMPAD5:101,DOM_VK_NUMPAD6:102,DOM_VK_NUMPAD7:103,DOM_VK_NUMPAD8:104,DOM_VK_NUMPAD9:105,DOM_VK_MULTIPLY:106,DOM_VK_ADD:107,DOM_VK_SEPARATOR:108,DOM_VK_SUBTRACT:109,DOM_VK_DECIMAL:110,DOM_VK_DIVIDE:111,DOM_VK_F1:112,DOM_VK_F2:113,DOM_VK_F3:114,DOM_VK_F4:115,DOM_VK_F5:116,DOM_VK_F6:117,DOM_VK_F7:118,DOM_VK_F8:119,DOM_VK_F9:120,DOM_VK_F10:121,DOM_VK_F11:122,DOM_VK_F12:123,DOM_VK_F13:124,DOM_VK_F14:125,DOM_VK_F15:126,DOM_VK_F16:127,DOM_VK_F17:128,DOM_VK_F18:129,DOM_VK_F19:130,DOM_VK_F20:131,DOM_VK_F21:132,DOM_VK_F22:133,DOM_VK_F23:134,DOM_VK_F24:135,DOM_VK_NUM_LOCK:144,DOM_VK_SCROLL_LOCK:145,DOM_VK_COMMA:188,DOM_VK_PERIOD:190,DOM_VK_SLASH:191,DOM_VK_BACK_QUOTE:192,DOM_VK_OPEN_BRACKET:219,DOM_VK_BACK_SLASH:220,DOM_VK_CLOSE_BRACKET:221,DOM_VK_QUOTE:222,DOM_VK_META:224}};OG.common.Util={isEmpty:function(b,a){return b===null||b===undefined||((OG.Util.isArray(b)&&!b.length))||(!a?b==="":false)},isArray:function(a){return Object.prototype.toString.apply(a)==="[object Array]"},isDate:function(a){return Object.prototype.toString.apply(a)==="[object Date]"},isObject:function(a){return !!a&&Object.prototype.toString.call(a)==="[object Object]"},isPrimitive:function(a){return OG.Util.isString(a)||OG.Util.isNumber(a)||OG.Util.isBoolean(a)},isFunction:function(a){return Object.prototype.toString.apply(a)==="[object Function]"},isNumber:function(a){return typeof a==="number"&&isFinite(a)},isString:function(a){return typeof a==="string"},isBoolean:function(a){return typeof a==="boolean"},isElement:function(a){return !!a&&a.tagName?true:false},isDefined:function(a){return typeof a!=="undefined"},isWebKit:function(){return(/webkit/).test(navigator.userAgent.toLowerCase())},isGecko:function(){return !OG.Util.isWebKit()&&(/gecko/).test(navigator.userAgent.toLowerCase())},isOpera:function(){return(/opera/).test(navigator.userAgent.toLowerCase())},isChrome:function(){return(/\bchrome\b/).test(navigator.userAgent.toLowerCase())},isSafari:function(){return !OG.Util.isChrome()&&(/safari/).test(navigator.userAgent.toLowerCase())},isFirefox:function(){return(/firefox/).test(navigator.userAgent.toLowerCase())},isIE:function(){if(navigator.appName=="Microsoft Internet Explorer"||!!(navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/rv 11/))){return true}else{return false}},isIE6:function(){return OG.Util.isIE()&&(/msie 6/).test(navigator.userAgent.toLowerCase())},isIE7:function(){return OG.Util.isIE()&&((/msie 7/).test(navigator.userAgent.toLowerCase())||document.documentMode===7)},isIE8:function(){return OG.Util.isIE()&&((/msie 8/).test(navigator.userAgent.toLowerCase())||document.documentMode===8)},isIE9:function(){return OG.Util.isIE()&&((/msie 9/).test(navigator.userAgent.toLowerCase())||document.documentMode===9)},isWindows:function(){return(/windows|win32/).test(navigator.userAgent.toLowerCase())},isMac:function(){return(/macintosh|mac os x/).test(navigator.userAgent.toLowerCase())},isLinux:function(){return(/linux/).test(navigator.userAgent.toLowerCase())},trim:function(a){return a===null||a===undefined?a:a.replace(/^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g,"")},clone:function(g){if(g===null||g===undefined){return g}if(g.nodeType&&g.cloneNode){return g.cloneNode(true)}var e,c,b,h,d,f=Object.prototype.toString.call(g),a=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];if(f==="[object Date]"){return new Date(g.getTime())}if(f==="[object Array]"){e=g.length;h=[];while(e--){h[e]=this.clone(g[e])}}else{if(f==="[object Object]"&&g.constructor===Object){h={};for(d in g){h[d]=this.clone(g[d])}if(a){for(c=a.length;c--;){b=a[c];h[b]=g[b]}}}}return h||g},round:function(a){return this.roundPrecision(a,OG.Constants.NUM_PRECISION)},roundPrecision:function(c,a){var b=Math.pow(10,a);return Math.round(c*b)/b},roundGrid:function(a,b){b=b||OG.Constants.MOVE_SNAP_SIZE;return OG.Util.round(a/b)*b},apply:function(d,a,c){var b;if(c){this.apply(d,c)}if(d&&a&&typeof a==="object"){for(b in a){d[b]=a[b]}}return d},extend:(function(){var b=function(d){var c;for(c in d){this[c]=d[c]}},a=Object.prototype.constructor;return function(h,e,g){if(OG.Util.isObject(e)){g=e;e=h;h=g.constructor!==a?g.constructor:function(){e.apply(this,arguments)}}var d=function(){},f,c=e.prototype;d.prototype=c;f=h.prototype=new d();f.constructor=h;h.superclass=c;if(c.constructor===a){c.constructor=e}h.override=function(i){OG.Util.override(h,i)};f.superclass=f.supr=(function(){return c}());f.override=b;OG.Util.override(h,g);h.extend=function(i){return OG.Util.extend(h,i)};return h}}()),override:function(a,c){if(c){var b=a.prototype;OG.Util.apply(b,c);if((/msie/).test(navigator.userAgent.toLowerCase())&&c.hasOwnProperty("toString")){b.toString=c.toString}}},xmlToJson:function(c){var b={},a=function(f){var e={};for(var g in f){if(f.hasOwnProperty(g)){e[g]=f[g]}}return e},d=function(g,m,r){if(g.nodeType===3){if(!g.nodeValue.match(/[\S]+/)){return}if(m["$"] instanceof Array){m["$"].push(g.nodeValue)}else{if(m["$"] instanceof Object){m["$"]=[m["$"],g.nodeValue]}else{m["$"]=g.nodeValue}}}else{if(g.nodeType===1){var f={};var s=g.nodeName;for(var n=0;g.attributes&&n"+m+"":f+h+"/>"}}};for(var a in d){if(d.hasOwnProperty(a)&&a.indexOf("@")==-1){return''+c(a,d[a],{})}}return null},parseXML:function(b){var a,c;if(window.ActiveXObject){a=new ActiveXObject("Microsoft.XMLDOM");a.async="false";a.loadXML(b)}else{c=new DOMParser();a=c.parseFromString(b,"text/xml")}return a}};OG.Util=OG.common.Util;OG.common.CurveUtil={CatmullRomSpline:function(c){var b=[],e,f={},d={},a=function(g){return function(j,i){var h=c.length,k,l;if(h<2){return NaN}j=j-1;if(!i&&b[g]){i=true}if(!i){f[g]=2*c[0][g]-c[1][g];d[g]=2*c[h-1][g]-c[h-2][g];e=[f].concat(c,[d]);b[g]=[];for(k=0;k=h-3){return e[h-2][g]}}k=Math.floor(j);if(k===j){return e[k][g]}j-=k;l=b[g][k];return 0.5*(((l[3]*j+l[2])*j+l[1])*j+l[0])}};return{getX:a(0),getY:a(1),maxT:c.length+1}},Bezier:function(c){var a,b=function(d){return function(f,e){var i=Math.floor(f)*3,h=f,g=1-h;if(!e&&a){e=true}if(!e){a=Math.floor(c.length/3)}if(f<0){return c[0][d]}if(f>=a){return c[c.length-1][d]}if(isNaN(f)){return NaN}return g*g*(g*c[i][d]+3*h*c[i+1][d])+(3*g*c[i+2][d]+h*c[i+3][d])*h*h}};return{getX:b(0),getY:b(1),maxT:Math.floor(c.length/3)+0.01}},BSpline:function(d,a){var e,g=[],f=function(m,h){var i,l=[];for(i=0;i=w){q=0}else{q=p[m+1]}u=x[m+o-1]-x[m];if(u===0){p[m]=0}else{p[m]=(v-x[m])/u*r}u=x[m+o]-x[m+1];if(u!==0){p[m]+=(x[m+o]-v)/u*q}}}return p},b=function(h){return function(p,l){var i=d.length,u,o,q,r=i-1,m=a;if(r<=0){return NaN}if(r+2<=m){m=r+1}if(p<=0){return d[0][h]}if(p>=r-m+2){return d[r][h]}e=f(r,m);q=Math.floor(p)+m-1;g=c(p,e,r,m,q);u=0;for(o=q-m+1;o<=q;o++){if(o=0){u+=d[o][h]*g[o]}}return u}};return{getX:b(0),getY:b(1),maxT:d.length-2}}};OG.CurveUtil=OG.common.CurveUtil;OG.common.NotSupportedException=function(a){this.name="OG.NotSupportedException";this.message=a||"Not Supported!"};OG.NotSupportedException=OG.common.NotSupportedException;OG.common.NotImplementedException=function(a){this.name="OG.NotImplementedException";this.message=a||"Not Implemented!"};OG.NotImplementedException=OG.common.NotImplementedException;OG.common.ParamError=function(a){this.name="OG.ParamError";this.message=a||"Invalid Parameter Error!"};OG.ParamError=OG.common.ParamError;OG.common.HashMap=function(a){this.map=a||{}};OG.common.HashMap.prototype={put:function(a,b){this.map[a]=b},get:function(a){return this.map[a]},containsKey:function(a){return this.map.hasOwnProperty(a)},containsValue:function(a){var b;for(b in this.map){if(this.map[b]===a){return true}}return false},isEmpty:function(){return this.size()===0},clear:function(){var a;for(a in this.map){delete this.map[a]}},remove:function(a){if(this.map[a]){delete this.map[a]}},keys:function(){var a=[],b;for(b in this.map){a.push(b)}return a},values:function(){var a=[],b;for(b in this.map){a.push(this.map[b])}return a},size:function(){var a=0,b;for(b in this.map){a++}return a},toString:function(){var a=[],b;for(b in this.map){a.push("'"+b+"':'"+this.map[b]+"'")}return"{"+a.join()+"}"}};OG.common.HashMap.prototype.constructor=OG.common.HashMap;OG.HashMap=OG.common.HashMap;OG.common.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty,USE_NATIVE_JSON=false,isNative=(function(){var useNative=null;return function(){if(useNative===null){useNative=USE_NATIVE_JSON&&window.JSON&&JSON.toString()==="[object JSON]"}return useNative}}()),m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},pad=function(n){return n<10?"0"+n:n},doDecode=function(json){return eval("("+json+")")},encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i=this._upperLeft.x&&a[0]<=this.getLowerRight().x&&a[1]>=this._upperLeft.y&&a[1]<=this.getLowerRight().y}else{return a.x>=this._upperLeft.x&&a.x<=this.getLowerRight().x&&a.y>=this._upperLeft.y&&a.y<=this.getLowerRight().y}},isContainsAll:function(c){for(var b=0,a=c.length;bc?h[g].x:c;a=h[g].y>a?h[g].y:a}b=new OG.geometry.Coordinate(f,e);d=c-f;j=a-e;this.boundary=new OG.geometry.Envelope(b,d,j)}return this.boundary},getCentroid:function(){return this.getBoundary().getCentroid()},getVertices:function(){throw new OG.NotImplementedException()},minDistance:function(d){var e=Number.MAX_VALUE,f=0,b=this.getVertices(),c;d=this.convertCoordinate(d);if(b.length===1){return d.distance(b[0])}for(var c=0,a=b.length-1;c=1){return e.distance(f)}c=((a.y-e.y)*(f.x-a.x)-(a.x-e.x)*(f.y-a.y))/((f.x-a.x)*(f.x-a.x)+(f.y-a.y)*(f.y-a.y));return OG.Util.round(Math.abs(c)*Math.sqrt(((f.x-a.x)*(f.x-a.x)+(f.y-a.y)*(f.y-a.y))))},distanceLineToLine:function(i,g){var f=this.convertCoordinate(i[0]),e=this.convertCoordinate(i[1]),d=this.convertCoordinate(g[0]),b=this.convertCoordinate(g[1]),c,k,j,h,l,a;if(f.isEquals(e)){return this.distanceToLine(f,[d,b])}if(d.isEquals(b)){return this.distanceToLine(b,[f,e])}c=(f.y-d.y)*(b.x-d.x)-(f.x-d.x)*(b.y-d.y);k=(e.x-f.x)*(b.y-d.y)-(e.y-f.y)*(b.x-d.x);j=(f.y-d.y)*(e.x-f.x)-(f.x-d.x)*(e.y-f.y);h=(e.x-f.x)*(b.y-d.y)-(e.y-f.y)*(b.x-d.x);if((k===0)||(h===0)){return Math.min(this.distanceToLine(f,[d,b]),Math.min(this.distanceToLine(e,[d,b]),Math.min(this.distanceToLine(d,[f,e]),this.distanceToLine(b,[f,e]))))}l=j/h;a=c/k;if((a<0)||(a>1)||(l<0)||(l>1)){return Math.min(this.distanceToLine(f,[d,b]),Math.min(this.distanceToLine(e,[d,b]),Math.min(this.distanceToLine(d,[f,e]),this.distanceToLine(b,[f,e]))))}return 0},intersectToLine:function(c){var e=this.getVertices(),b=[],a,g,f=function(j,l){for(var i=0,h=j.length;if){e=f;b=d[c]}}}return b},intersectLineToLine:function(k,h,j){var f=this.convertCoordinate(k[0]),e=this.convertCoordinate(k[1]),d=this.convertCoordinate(h[0]),c=this.convertCoordinate(h[1]),o,g,b,m,l,i,a,n;if(f.isEquals(e)){return this.distanceToLine(f,[d,c])===0?f:undefined}if(d.isEquals(c)){return this.distanceToLine(d,[f,e])===0?d:undefined}b=(f.y-d.y)*(c.x-d.x)-(f.x-d.x)*(c.y-d.y);m=(e.x-f.x)*(c.y-d.y)-(e.y-f.y)*(c.x-d.x);l=(f.y-d.y)*(e.x-f.x)-(f.x-d.x)*(e.y-f.y);i=(e.x-f.x)*(c.y-d.y)-(e.y-f.y)*(c.x-d.x);if(m!==0&&i!==0){a=b/m;n=l/i;if(0<=a&&a<=1&&0<=n&&n<=1){g="Intersection";o=new OG.Coordinate(OG.Util.round(f.x+a*(e.x-f.x)),OG.Util.round(f.y+a*(e.y-f.y)))}else{g="No Intersection";if(j){o=new OG.Coordinate(OG.Util.round(f.x+a*(e.x-f.x)),OG.Util.round(f.y+a*(e.y-f.y)))}}}else{if(b===0||l===0){g="Coincident"}else{g="Parallel"}}return o},intersectCircleToLine:function(c,j,o,p){var q=[],n=(p.x-o.x)*(p.x-o.x)+(p.y-o.y)*(p.y-o.y),m=2*((p.x-o.x)*(o.x-c.x)+(p.y-o.y)*(o.y-c.y)),i=c.x*c.x+c.y*c.y+o.x*o.x+o.y*o.y-2*(c.x*o.x+c.y*o.y)-j*j,d=m*m-4*n*i,l,h=function(e,b,a){return new OG.Coordinate(OG.Util.round(e.x+(b.x-e.x)*a),OG.Util.round(e.y+(b.y-e.y)*a))},k,g,f;if(d<0){l="Outside"}else{if(d===0){l="Tangent"}else{k=Math.sqrt(d);g=(-m+k)/(2*n);f=(-m-k)/(2*n);if((g<0||g>1)&&(f<0||f>1)){if((g<0&&f<0)||(g>1&&f>1)){l="Outside"}else{l="Inside"}}else{l="Intersection";if(0<=g&&g<=1){q.push(h(o,p,g))}if(0<=f&&f<=1){q.push(h(o,p,f))}}}}return q},intersectPointToLine:function(h,k){var c=this.convertCoordinate(k[0]),a=this.convertCoordinate(k[1]),b=this.convertCoordinate(h),j,g,i,e,f,d;if(a.y===c.y){return this.convertCoordinate([b.x,c.y])}if(a.x===c.x){return this.convertCoordinate([c.x,b.y])}j=(a.y-c.y)/(a.x-c.x);g=c.y-(j*c.x);i=(1/j)*-1;e=b.y-(i*b.x);f=(e-g)/(j-i);d=(f*j)+g;return this.convertCoordinate([f,d])},getPercentageDistanceFromPoint:function(g){var c,h,e,f,a,d,b;g=this.convertCoordinate(g);h=this.getBoundary();if(h&&h._upperLeft){e=h._upperLeft;f=h._width;a=h._height;d=Math.round(((g.x-e.x)/f)*100);b=Math.round(((g.y-e.y)/a)*100);c={px:d,py:b}}return c},isContainsPoint:function(e){var f,c,d,a,b;e=this.convertCoordinate(e);f=this.getBoundary();b=false;if(f&&f._upperLeft){c=f._upperLeft;d=f._width;a=f._height;if(e.x>=c.x&&e.x<=c.x+d&&e.y>=c.y&&e.y<=c.y+a){b=true}}return b},getPointFromPercentageDistance:function(b){var i,d,h,g,a,c,j,f,e;d=this.getBoundary();if(d&&d._upperLeft){h=b[0];g=b[1];a=d._upperLeft;c=d._width;j=d._height;f=a.x+(c*(h/100));e=a.y+(j*(g/100));i=this.convertCoordinate([Math.round(f),Math.round(e)])}return i},getParallelLine:function(o,c,f){var s=this;var r="plus";var j=0;var i=0;var b=this.convertCoordinate(o);var a=this.convertCoordinate(c);var g=function(u,m){u.y=u.y*-1;m.y=m.y*-1;j=0-u.x;i=0-u.y;u.x=u.x+j;m.x=m.x+j;u.y=u.y+i;m.y=m.y+i;return[u,m]};var t=function(u,m){u=s.convertCoordinate(u);m=s.convertCoordinate(m);u.x=u.x-j;m.x=m.x-j;u.y=u.y-i;m.y=m.y-i;u.y=u.y*-1;m.y=m.y*-1;return[u,m]};g(b,a);var q=b.x;var p=a.x;var e=b.y;var d=a.y;if(e==d&&q==p){return t(b,a)}if(e==d&&q==p){return t(b,a)}if(q==p){if(d>e){f=f*-1;r="minus"}}else{if(pz){J=I;F=A}else{J=E;F=z}}return[J,F]};return t(h(q,e,n,l,f),h(p,d,n,k,f))},getParallelPath:function(k,a){var h=this;var l=[];var f=[];for(var d=0,j=k.length;d0){for(var c=0,a=b.length;c0){for(var i=0,leni=controlPoints.length;i0&&!this.vertices[0].isEquals(this.vertices[this.vertices.length-1])){this.vertices.push(new OG.geometry.Coordinate(this.vertices[0].x,this.vertices[0].y))}this.TYPE=OG.Constants.GEOM_TYPE.POLYGON;this.IS_CLOSED=true;this.style=new OG.geometry.Style()};OG.geometry.Polygon.prototype=new OG.geometry.PolyLine();OG.geometry.Polygon.superclass=OG.geometry.PolyLine;OG.geometry.Polygon.prototype.constructor=OG.geometry.Polygon;OG.Polygon=OG.geometry.Polygon;OG.geometry.Rectangle=function(c,d,a){var b=this.convertCoordinate(c),e=this.convertCoordinate([b.x+d,b.y+a]);if(b.x>e.x||b.y>e.y){throw new OG.ParamError()}OG.geometry.Rectangle.superclass.call(this,[[b.x,b.y],[b.x+(e.x-b.x),b.y],[e.x,e.y],[b.x,b.y+(e.y-b.y)],[b.x,b.y]]);this.TYPE=OG.Constants.GEOM_TYPE.RECTANGLE;this.style=new OG.geometry.Style()};OG.geometry.Rectangle.prototype=new OG.geometry.Polygon();OG.geometry.Rectangle.superclass=OG.geometry.Polygon;OG.geometry.Rectangle.prototype.constructor=OG.geometry.Rectangle;OG.Rectangle=OG.geometry.Rectangle;OG.geometry.Rectangle.prototype.toString=function(){var a=[],b=OG.Util.round(Math.atan2(this.vertices[1].y-this.vertices[0].y,this.vertices[1].x-this.vertices[0].x)*180/Math.PI);a.push("type:'"+OG.Constants.GEOM_NAME[this.TYPE]+"'");a.push("upperLeft:"+this.vertices[0]);a.push("width:"+(this.vertices[0].distance(this.vertices[1])));a.push("height:"+(this.vertices[0].distance(this.vertices[3])));a.push("angle:"+b);return"{"+a.join()+"}"};OG.marker.IMarker=function(){this.MARKER_ID=null;this.geom=null};OG.marker.IMarker.prototype={createMarker:function(){throw new OG.NotImplementedException("OG.shape.IMarker.createMarker")}};OG.marker.IMarker.prototype.constructor=OG.marker.IMarker;OG.IMarker=OG.marker.IMarker;OG.marker.ArrowMarker=function(){OG.marker.ArrowMarker.superclass.call(this);this.MARKER_ID="OG.marker.ArrowMarker"};OG.marker.ArrowMarker.prototype=new OG.marker.IMarker();OG.marker.ArrowMarker.superclass=OG.marker.IMarker;OG.marker.ArrowMarker.prototype.constructor=OG.marker.ArrowMarker;OG.ArrowMarker=OG.marker.ArrowMarker;OG.marker.ArrowMarker.prototype.createMarker=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,0],[30,20],[0,40],[0,0]]);this.geom.style=new OG.geometry.Style({"fill-opacity":1,fill:"black"});return this.geom};OG.marker.CircleMarker=function(){OG.marker.CircleMarker.superclass.call(this);this.MARKER_ID="OG.marker.CircleMarker"};OG.marker.CircleMarker.prototype=new OG.marker.IMarker();OG.marker.CircleMarker.superclass=OG.marker.IMarker;OG.marker.CircleMarker.prototype.constructor=OG.marker.CircleMarker;OG.CircleMarker=OG.marker.CircleMarker;OG.marker.CircleMarker.prototype.createMarker=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);return this.geom};OG.marker.RectangleMarker=function(){OG.marker.RectangleMarker.superclass.call(this);this.MARKER_ID="OG.marker.RectangleMarker"};OG.marker.RectangleMarker.prototype=new OG.marker.IMarker();OG.marker.RectangleMarker.superclass=OG.marker.IMarker;OG.marker.RectangleMarker.prototype.constructor=OG.marker.RectangleMarker;OG.RectangleMarker=OG.marker.RectangleMarker;OG.marker.RectangleMarker.prototype.createMarker=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":4});b=new OG.geometry.Polygon([[20,75],[40,30],[60,60],[80,20],[60,75],[40,50]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.marker.SwitchLMarker=function(){OG.marker.SwitchLMarker.superclass.call(this);this.MARKER_ID="OG.marker.SwitchLMarker"};OG.marker.SwitchLMarker.prototype=new OG.marker.IMarker();OG.marker.SwitchLMarker.superclass=OG.marker.IMarker;OG.marker.SwitchLMarker.prototype.constructor=OG.marker.SwitchLMarker;OG.SwitchLMarker=OG.marker.SwitchLMarker;OG.marker.SwitchLMarker.prototype.createMarker=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.PolyLine([[0,0],[20,5]]);this.geom.style=new OG.geometry.Style({"fill-opacity":1});return this.geom};OG.marker.SwitchRMarker=function(){OG.marker.SwitchRMarker.superclass.call(this);this.MARKER_ID="OG.marker.SwitchRMarker"};OG.marker.SwitchRMarker.prototype=new OG.marker.IMarker();OG.marker.SwitchRMarker.superclass=OG.marker.IMarker;OG.marker.SwitchRMarker.prototype.constructor=OG.marker.SwitchRMarker;OG.SwitchRMarker=OG.marker.SwitchRMarker;OG.marker.SwitchRMarker.prototype.createMarker=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.PolyLine([[0,5],[20,0]]);this.geom.style=new OG.geometry.Style({"fill-opacity":1});return this.geom};OG.marker.SwitchXMarker=function(){OG.marker.SwitchXMarker.superclass.call(this);this.MARKER_ID="OG.marker.SwitchXMarker"};OG.marker.SwitchXMarker.prototype=new OG.marker.IMarker();OG.marker.SwitchXMarker.superclass=OG.marker.IMarker;OG.marker.SwitchXMarker.prototype.constructor=OG.marker.SwitchXMarker;OG.SwitchXMarker=OG.marker.SwitchXMarker;OG.marker.SwitchXMarker.prototype.createMarker=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Line([-10,10],[10,-10]);b=new OG.geometry.Line([-10,-10],[10,10]);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.pattern.IPattern=function(){this.PATTERN_ID=null;this.geom=null};OG.pattern.IPattern.prototype={createPattern:function(){throw new OG.NotImplementedException("OG.shape.IPattern.createPattern")}};OG.pattern.IPattern.prototype.constructor=OG.pattern.IPattern;OG.IPattern=OG.pattern.IPattern;OG.pattern.HatchedPattern=function(){OG.pattern.HatchedPattern.superclass.call(this);this.PATTERN_ID="OG.pattern.HatchedPattern"};OG.pattern.HatchedPattern.prototype=new OG.pattern.IPattern();OG.pattern.HatchedPattern.superclass=OG.pattern.IPattern;OG.pattern.HatchedPattern.prototype.constructor=OG.pattern.HatchedPattern;OG.HatchedPattern=OG.pattern.HatchedPattern;OG.pattern.HatchedPattern.prototype.createPattern=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Line([-1,1],[1,-1]);c=new OG.geometry.Line([0,4],[4,0]);b=new OG.geometry.Line([3,5],[5,3]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.pattern.RectPattern=function(){OG.pattern.RectPattern.superclass.call(this);this.PATTERN_ID="OG.pattern.RectPattern"};OG.pattern.RectPattern.prototype=new OG.pattern.IPattern();OG.pattern.RectPattern.superclass=OG.pattern.IPattern;OG.pattern.RectPattern.prototype.constructor=OG.pattern.RectPattern;OG.RectPattern=OG.pattern.RectPattern;OG.pattern.RectPattern.prototype.createPattern=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);return this.geom};OG.shape.IShape=function(){this.TYPE=null;this.SHAPE_ID=null;this.geom=null;this.label=null;this.isCollapsed=false;this.SELECTABLE=true;this.MOVABLE=true;this.RESIZABLE=true;this.RESIZEX=true;this.RESIZEY=true;this.CONNECTABLE=true;this.ENABLE_FROM=true;this.ENABLE_TO=true;this.SELF_CONNECTABLE=false;this.CONNECT_CLONEABLE=true;this.CONNECT_REQUIRED=true;this.CONNECT_STYLE_CHANGE=true;this.DELETABLE=true;this.LABEL_EDITABLE=true;this.COPYABLE=true;this.exceptionType="";this.data=null;this.textList=[];this.contextMenu=null;this.customContextMenu=null;this.currentElement=null;this.currentCanvas=null;this.ignoreExport=false;this.AXIS="none"};OG.shape.IShape.prototype={createShape:function(){throw new OG.NotImplementedException("OG.shape.IShape.createShape")},clone:function(){throw new OG.NotImplementedException("OG.shape.IShape.clone")},addEve:function(){},drawCustomControl:function(){},setData:function(a){this.data=a},getData:function(){return this.data},onResize:function(a){},onDrawLabel:function(a){},onLabelChanged:function(b,a){},onBeforeRemoveShape:function(){},onRemoveShape:function(){},onDrawShape:function(){},onBeforeLabelChange:function(){},onRedrawShape:function(){},onBeforeConnectShape:function(b,a,c){},onConnectShape:function(b,a,c){},onDisconnectShape:function(b,a,c){},onGroup:function(a){},onUnGroup:function(){},onMoveShape:function(a){},onRotateShape:function(a){},onDuplicated:function(b,a){},onPasteShape:function(a,b){},onAddToGroup:function(a,c,b){},onAddedToGroup:function(b,a,c){},onSelectShape:function(){},onDeSelectShape:function(){}};OG.shape.IShape.prototype.constructor=OG.shape.IShape;OG.IShape=OG.shape.IShape;OG.shape.GeomShape=function(){OG.shape.GeomShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.GEOM};OG.shape.GeomShape.prototype=new OG.shape.IShape();OG.shape.GeomShape.superclass=OG.shape.IShape;OG.shape.GeomShape.prototype.constructor=OG.shape.GeomShape;OG.GeomShape=OG.shape.GeomShape;OG.shape.GeomShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.label=this.label;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.TextShape=function(a){OG.shape.TextShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.TEXT;this.SHAPE_ID="OG.shape.TextShape";this.text=a||"Text Here";this.angle=0};OG.shape.TextShape.prototype=new OG.shape.IShape();OG.shape.TextShape.superclass=OG.shape.IShape;OG.shape.TextShape.prototype.constructor=OG.shape.TextShape;OG.TextShape=OG.shape.TextShape;OG.shape.TextShape.prototype.createShape=function(){return this.text};OG.shape.TextShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.text=this.text;shape.angle=this.angle;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.ImageShape=function(b,a){OG.shape.ImageShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.IMAGE;this.SHAPE_ID="OG.shape.ImageShape";this.label=a;this.image=b;this.angle=0};OG.shape.ImageShape.prototype=new OG.shape.IShape();OG.shape.ImageShape.superclass=OG.shape.IShape;OG.shape.ImageShape.prototype.constructor=OG.shape.ImageShape;OG.ImageShape=OG.shape.ImageShape;OG.shape.ImageShape.prototype.createShape=function(){return this.image};OG.shape.ImageShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.image=this.image;shape.label=this.label;shape.angle=this.angle;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.EdgeShape=function(e,d,a,b,c){OG.shape.EdgeShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.EDGE;this.SHAPE_ID="OG.shape.EdgeShape";this.from=e;this.to=d;this.label=a;this.fromLabel=b;this.toLabel=c};OG.shape.EdgeShape.prototype=new OG.shape.IShape();OG.shape.EdgeShape.superclass=OG.shape.IShape;OG.shape.EdgeShape.prototype.constructor=OG.shape.EdgeShape;OG.EdgeShape=OG.shape.EdgeShape;OG.shape.EdgeShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.PolyLine([this.from||[0,0],this.to||[70,0]]);return this.geom};OG.shape.EdgeShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.from=this.from;shape.to=this.to;shape.label=this.label;shape.fromLabel=this.fromLabel;shape.toLabel=this.toLabel;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.SvgShape=function(b,a){OG.shape.SvgShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.IMAGE;this.SHAPE_ID="OG.shape.SvgShape";this.label=a;this.xml=b;this.angle=0};OG.shape.SvgShape.prototype=new OG.shape.IShape();OG.shape.SvgShape.superclass=OG.shape.IShape;OG.shape.SvgShape.prototype.constructor=OG.shape.SvgShape;OG.SvgShape=OG.shape.SvgShape;OG.shape.SvgShape.prototype.createShape=function(){return this.xml};OG.shape.SvgShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.xml=this.xml;shape.label=this.label;shape.angle=this.angle;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.CircleShape=function(a){OG.shape.CircleShape.superclass.call(this);this.SHAPE_ID="OG.shape.CircleShape";this.label=a};OG.shape.CircleShape.prototype=new OG.shape.GeomShape();OG.shape.CircleShape.superclass=OG.shape.GeomShape;OG.shape.CircleShape.prototype.constructor=OG.shape.CircleShape;OG.CircleShape=OG.shape.CircleShape;OG.shape.CircleShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);return this.geom};OG.shape.EllipseShape=function(a){OG.shape.EllipseShape.superclass.call(this);this.SHAPE_ID="OG.shape.EllipseShape";this.label=a};OG.shape.EllipseShape.prototype=new OG.shape.GeomShape();OG.shape.EllipseShape.superclass=OG.shape.GeomShape;OG.shape.EllipseShape.prototype.constructor=OG.shape.EllipseShape;OG.EllipseShape=OG.shape.EllipseShape;OG.shape.EllipseShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Ellipse([50,50],50,30);return this.geom};OG.shape.From=function(a){OG.shape.From.superclass.call(this);this.SHAPE_ID="OG.shape.From";this.label=a;this.MOVABLE=false;this.RESIZABLE=false;this.SELF_CONNECTABLE=false;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.DELETABLE=false;this.CONNECT_STYLE_CHANGE=false;this.ENABLE_TO=false};OG.shape.From.prototype=new OG.shape.GeomShape();OG.shape.From.superclass=OG.shape.GeomShape;OG.shape.From.prototype.constructor=OG.shape.From;OG.From=OG.shape.From;OG.shape.From.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([10,10],10);return this.geom};OG.shape.GroupShape=function(a){OG.shape.GroupShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.GROUP;this.SHAPE_ID="OG.shape.GroupShape";this.label=a;this.CONNECTABLE=false;this.SELF_CONNECTABLE=false;this.GROUP_DROPABLE=true;this.GROUP_COLLAPSIBLE=false};OG.shape.GroupShape.prototype=new OG.shape.IShape();OG.shape.GroupShape.superclass=OG.shape.IShape;OG.shape.GroupShape.prototype.constructor=OG.shape.GroupShape;OG.GroupShape=OG.shape.GroupShape;OG.shape.GroupShape.prototype.layoutChild=function(){};OG.shape.GroupShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({fill:"#ffffff","fill-opacity":0,stroke:"none"});return this.geom};OG.shape.GroupShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.label=this.label;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.HorizontalLaneShape=function(a){OG.shape.HorizontalLaneShape.superclass.call(this,a);this.SHAPE_ID="OG.shape.HorizontalLaneShape"};OG.shape.HorizontalLaneShape.prototype=new OG.shape.GroupShape();OG.shape.HorizontalLaneShape.superclass=OG.shape.GroupShape;OG.shape.HorizontalLaneShape.prototype.constructor=OG.shape.HorizontalLaneShape;OG.HorizontalLaneShape=OG.shape.HorizontalLaneShape;OG.shape.HorizontalLaneShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"vertical","vertical-align":"top",fill:"#ffffff","fill-opacity":0});return this.geom};OG.shape.HorizontalPoolShape=function(a){OG.shape.HorizontalPoolShape.superclass.call(this,a);this.SHAPE_ID="OG.shape.HorizontalPoolShape";this.label=a;this.CONNECTABLE=true;this.LoopType="None";this.GROUP_COLLAPSIBLE=false};OG.shape.HorizontalPoolShape.prototype=new OG.shape.GroupShape();OG.shape.HorizontalPoolShape.superclass=OG.shape.GroupShape;OG.shape.HorizontalPoolShape.prototype.constructor=OG.shape.HorizontalPoolShape;OG.HorizontalPoolShape=OG.shape.HorizontalPoolShape;OG.shape.HorizontalPoolShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"vertical","vertical-align":"top",fill:"#ffffff","fill-opacity":0,"title-size":32});return this.geom};OG.shape.HorizontalPoolShape.prototype.createSubShape=function(){this.sub=[];var a;switch(this.LoopType){case"Standard":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"loop_standard.png");break;case"MIParallel":a=new OG.MIParallel();break;case"MISequential":a=new OG.MISequential();break}if(a){this.sub.push({shape:a,width:"15px",height:"15px",bottom:"5px",align:"center",style:{}})}return this.sub};OG.shape.HtmlShape=function(b,a){OG.shape.HtmlShape.superclass.call(this);this.TYPE=OG.Constants.SHAPE_TYPE.HTML;this.SHAPE_ID="OG.shape.HtmlShape";this.label=a;this.html=b||"";this.angle=0};OG.shape.HtmlShape.prototype=new OG.shape.IShape();OG.shape.HtmlShape.superclass=OG.shape.IShape;OG.shape.HtmlShape.prototype.constructor=OG.shape.HtmlShape;OG.HtmlShape=OG.shape.HtmlShape;OG.shape.HtmlShape.prototype.createShape=function(){return this.html};OG.shape.HtmlShape.prototype.clone=function(){var shape=eval("new "+this.SHAPE_ID+"()");shape.html=this.html;shape.label=this.label;shape.angle=this.angle;shape.setData(JSON.parse(JSON.stringify(this.getData())));return shape};OG.shape.RectangleShape=function(a){OG.shape.RectangleShape.superclass.call(this);this.SHAPE_ID="OG.shape.RectangleShape";this.label=a};OG.shape.RectangleShape.prototype=new OG.shape.GeomShape();OG.shape.RectangleShape.superclass=OG.shape.GeomShape;OG.shape.RectangleShape.prototype.constructor=OG.shape.RectangleShape;OG.RectangleShape=OG.shape.RectangleShape;OG.shape.RectangleShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);return this.geom};OG.shape.SpotShape=function(a){OG.shape.SpotShape.superclass.call(this);this.SHAPE_ID="OG.shape.SpotShape";this.label=a};OG.shape.SpotShape.prototype=new OG.shape.GeomShape();OG.shape.SpotShape.superclass=OG.shape.GeomShape;OG.shape.SpotShape.prototype.constructor=OG.shape.SpotShape;OG.SpotShape=OG.shape.SpotShape;OG.shape.SpotShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([10,10],10);return this.geom};OG.shape.To=function(a){OG.shape.To.superclass.call(this);this.SHAPE_ID="OG.shape.To";this.label=a;this.MOVABLE=false;this.RESIZABLE=false;this.SELF_CONNECTABLE=false;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.DELETABLE=false;this.CONNECT_STYLE_CHANGE=false;this.ENABLE_FROM=false};OG.shape.To.prototype=new OG.shape.GeomShape();OG.shape.To.superclass=OG.shape.GeomShape;OG.shape.To.prototype.constructor=OG.shape.To;OG.To=OG.shape.To;OG.shape.To.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([10,10],10);return this.geom};OG.shape.Transformer=function(a){OG.shape.Transformer.superclass.call(this);this.SHAPE_ID="OG.shape.Transformer";this.label=a;this.CONNECTABLE=false;this.MOVABLE=true;this.RESIZABLE=false;this.SELF_CONNECTABLE=false;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false};OG.shape.Transformer.prototype=new OG.shape.GroupShape();OG.shape.Transformer.superclass=OG.shape.GroupShape;OG.shape.Transformer.prototype.constructor=OG.shape.Transformer;OG.Transformer=OG.shape.Transformer;OG.shape.Transformer.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"horizontal","vertical-align":"top",fill:"#ffffff","fill-opacity":0});return this.geom};OG.shape.VerticalLaneShape=function(a){OG.shape.VerticalLaneShape.superclass.call(this,a);this.SHAPE_ID="OG.shape.VerticalLaneShape"};OG.shape.VerticalLaneShape.prototype=new OG.shape.GroupShape();OG.shape.VerticalLaneShape.superclass=OG.shape.GroupShape;OG.shape.VerticalLaneShape.prototype.constructor=OG.shape.VerticalLaneShape;OG.VerticalLaneShape=OG.shape.VerticalLaneShape;OG.shape.VerticalLaneShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"horizontal","vertical-align":"top","title-size":24,fill:"#ffffff","fill-opacity":0});return this.geom};OG.shape.VerticalPoolShape=function(a){OG.shape.VerticalPoolShape.superclass.call(this,a);this.SHAPE_ID="OG.shape.VerticalPoolShape";this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false};OG.shape.VerticalPoolShape.prototype=new OG.shape.GroupShape();OG.shape.VerticalPoolShape.superclass=OG.shape.GroupShape;OG.shape.VerticalPoolShape.prototype.constructor=OG.shape.VerticalPoolShape;OG.VerticalPoolShape=OG.shape.VerticalPoolShape;OG.shape.VerticalPoolShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"horizontal","vertical-align":"top",fill:"#ffffff","fill-opacity":0});return this.geom};OG.shape.bpmn.A_Task=function(a){OG.shape.bpmn.A_Task.superclass.call(this);this.GROUP_DROPABLE=false;this.SHAPE_ID="OG.shape.bpmn.A_Task";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="None";this.status="None";this.Events=[]};OG.shape.bpmn.A_Task.prototype=new OG.shape.GroupShape();OG.shape.bpmn.A_Task.superclass=OG.shape.GroupShape;OG.shape.bpmn.A_Task.prototype.constructor=OG.shape.bpmn.A_Task;OG.A_Task=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_Task.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"fill-r":1,"fill-cx":0.1,"fill-cy":0.1,"stroke-width":1.2,fill:"r(.1, .1)#FFFFFF-#FFFFCC","fill-opacity":1,r:"10"});return this.geom};OG.shape.bpmn.A_Task.prototype.createSubShape=function(){this.sub=[];var b;switch(this.LoopType){case"Standard":b=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"loop_standard.png");break;case"MIParallel":b=new OG.MIParallel();break;case"MISequential":b=new OG.MISequential();break}if(b){this.sub.push({shape:b,width:"15px",height:"15px",bottom:"5px",align:"center",style:{}})}var a;switch(this.TaskType){case"User":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"User.png");break;case"Send":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Send.png");break;case"Receive":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Receive.png");break;case"Manual":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Manual.png");break;case"Service":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Service.png");break;case"BusinessRule":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"BusinessRule.png");break;case"Script":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Script.png");break;case"Mapper":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"Mapper.png");break;case"WebService":a=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"WebService.png");break}if(a){this.sub.push({shape:a,width:"20px",height:"20px",top:"5px",left:"5px",style:{}})}var d,c;switch(this.status){case"Completed":d=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png");break;case"Running":d=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"running.png");c=new OG.RectangleShape();break}if(d){this.sub.push({shape:d,width:"20px",height:"20px",right:"25px",top:"5px",style:{}})}if(c){this.sub.push({shape:c,"z-index":-1,width:"120%",height:"120%",left:"-10%",top:"-10%",style:{"fill-opacity":1,animation:[{start:{fill:"white"},to:{fill:"#C9E2FC"},ms:1000},{start:{fill:"#C9E2FC"},to:{fill:"white"},ms:1000,delay:1000}],"animation-repeat":true,fill:"#C9E2FC","stroke-width":"0.2",r:"10","stroke-dasharray":"--"}})}return this.sub};OG.shape.bpmn.A_Task.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,changeshape:{name:"변경",items:{A_Task:{name:"추상",type:"radio",radio:"changeshape",value:"OG.shape.bpmn.A_Task",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},A_HumanTask:{name:"사용자",type:"radio",radio:"changeshape",value:"OG.shape.bpmn.A_HumanTask",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},A_WebServiceTask:{name:"서비스",type:"radio",radio:"changeshape",value:"OG.shape.bpmn.A_WebServiceTask",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},A_ManualTask:{name:"수동",type:"radio",radio:"changeshape",value:"OG.shape.bpmn.A_ManualTask",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}}}},addEvent:{name:"이벤트 추가",items:{Message:{name:"메시지",type:"radio",radio:"addEvent",value:"Message",events:{change:function(b){a.currentCanvas.getEventHandler().setAddEventSelectedShape(b.target.value)}}},Timer:{name:"타이머",type:"radio",radio:"addEvent",value:"Timer",events:{change:function(b){a.currentCanvas.getEventHandler().setAddEventSelectedShape(b.target.value)}}},Error:{name:"에러",type:"radio",radio:"addEvent",value:"Error",events:{change:function(b){a.currentCanvas.getEventHandler().setAddEventSelectedShape(b.target.value)}}},Conditional:{name:"조건부",type:"radio",radio:"addEvent",value:"Conditional",events:{change:function(b){a.currentCanvas.getEventHandler().setAddEventSelectedShape(b.target.value)}}}}},property:{name:"속성",callback:function(){a.currentCanvas.getEventHandler().showProperty()}}};return this.contextMenu};OG.shape.bpmn.Event=function(a){OG.shape.bpmn.Event.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.Event";this.label=a};OG.shape.bpmn.Event.prototype=new OG.shape.GeomShape();OG.shape.bpmn.Event.superclass=OG.shape.GeomShape;OG.shape.bpmn.Event.prototype.constructor=OG.shape.bpmn.Event;OG.Event=OG.shape.bpmn.Event;OG.shape.bpmn.Event.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,change:{name:"변경",items:{start:{name:"시작",items:{start:{name:"시작",type:"radio",radio:"start",value:"OG.shape.bpmn.E_Start",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},start_message:{name:"메시지 시작",type:"radio",radio:"start",value:"OG.shape.bpmn.E_Start_Message",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},start_timer:{name:"타이머 시작",type:"radio",radio:"start",value:"OG.shape.bpmn.E_Start_Timer",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},start_conditional:{name:"조건부 시작",type:"radio",radio:"start",value:"OG.shape.bpmn.E_Start_Rule",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}}}},intermediate:{name:"중간",items:{intermediate:{name:"중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},intermediate_openMessage:{name:"열린 메시지 중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate_Message",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},intermediate_closeMessage:{name:"닫힌 메시지 중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate_MessageFill",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},intermediate_timer:{name:"타이머 중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate_Timer",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},intermediate_conditional:{name:"조건부 중간",type:"radio",radio:"intermediate",value:"OG.shape.bpmn.E_Intermediate_Rule",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}}}},end:{name:"종료",items:{end:{name:"종료",type:"radio",radio:"end",value:"OG.shape.bpmn.E_End",events:{change:function(b){a.changeShape(b.target.value)}}},end_message:{name:"메시지 종료",type:"radio",radio:"end",value:"OG.shape.bpmn.E_End_Message",events:{change:function(b){a.changeShape(b.target.value)}}},end_process:{name:"프로세스 종료",type:"radio",radio:"end",value:"OG.shape.bpmn.E_Terminate",events:{change:function(b){a.changeShape(b.target.value)}}}}}}}};return this.contextMenu};OG.shape.bpmn.E_End=function(a){OG.shape.bpmn.E_End.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End";this.label=a;this.inclusion=false};OG.shape.bpmn.E_End.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End.prototype.constructor=OG.shape.bpmn.E_End;OG.E_End=OG.shape.bpmn.E_End;OG.shape.bpmn.E_End.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);this.geom.style=new OG.geometry.Style({"stroke-width":3,"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End.prototype.createSubShape=function(){this.sub=[];if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}return this.sub};OG.shape.bpmn.E_Intermediate=function(a){OG.shape.bpmn.E_Intermediate.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate";this.label=a};OG.shape.bpmn.E_Intermediate.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate.prototype.constructor=OG.shape.bpmn.E_Intermediate;OG.E_Intermediate=OG.shape.bpmn.E_Intermediate;OG.shape.bpmn.E_Intermediate.prototype.createShape=function(){var a=[];if(this.geom){return this.geom}a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start=function(a){OG.shape.bpmn.E_Start.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start";this.label=a;this.inclusion=false};OG.shape.bpmn.E_Start.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start.prototype.constructor=OG.shape.bpmn.E_Start;OG.E_Start=OG.shape.bpmn.E_Start;OG.shape.bpmn.E_Start.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5});return this.geom};OG.shape.bpmn.E_Start.prototype.createSubShape=function(){this.sub=[];if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}return this.sub};OG.shape.bpmn.G_Gateway=function(a){OG.shape.bpmn.G_Gateway.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Gateway";this.label=a};OG.shape.bpmn.G_Gateway.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.G_Gateway.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.G_Gateway.prototype.constructor=OG.shape.bpmn.G_Gateway;OG.G_Gateway=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Gateway.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);return this.geom};OG.shape.bpmn.G_Gateway.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,changegateway:{name:"변경",items:{G_Gateway:{name:"베타적",type:"radio",radio:"changegateway",value:"OG.shape.bpmn.G_Gateway",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},G_Parallel:{name:"병렬",type:"radio",radio:"changegateway",value:"OG.shape.bpmn.G_Parallel",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}},G_Inclusive:{name:"포괄적",type:"radio",radio:"changegateway",value:"OG.shape.bpmn.G_Inclusive",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value)}}}}}};return this.contextMenu};OG.shape.bpmn.A_HumanTask=function(a){OG.shape.bpmn.A_HumanTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_HumanTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="User";this.status="None"};OG.shape.bpmn.A_HumanTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_HumanTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_HumanTask.prototype.constructor=OG.shape.bpmn.A_HumanTask;OG.A_HumanTask=OG.shape.bpmn.A_HumanTask;OG.shape.bpmn.A_LoopTask=function(a){OG.shape.bpmn.A_LoopTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_LoopTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="Standard";this.TaskType="None";this.status="None"};OG.shape.bpmn.A_LoopTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_LoopTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_LoopTask.prototype.constructor=OG.shape.bpmn.A_LoopTask;OG.A_LoopTask=OG.shape.bpmn.A_LoopTask;OG.shape.bpmn.A_ManualTask=function(a){OG.shape.bpmn.A_ManualTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_ManualTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="Manual";this.status="None"};OG.shape.bpmn.A_ManualTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_ManualTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_ManualTask.prototype.constructor=OG.shape.bpmn.A_ManualTask;OG.A_ManualTask=OG.shape.bpmn.A_ManualTask;OG.shape.bpmn.A_MapperTask=function(a){OG.shape.bpmn.A_MapperTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_MapperTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="Mapper";this.status="None"};OG.shape.bpmn.A_MapperTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_MapperTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_MapperTask.prototype.constructor=OG.shape.bpmn.A_MapperTask;OG.A_MapperTask=OG.shape.bpmn.A_MapperTask;OG.shape.bpmn.A_ServiceTask=function(a){OG.shape.bpmn.A_HumanTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_ServiceTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="Service"};OG.shape.bpmn.A_ServiceTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_ServiceTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_ServiceTask.prototype.constructor=OG.shape.bpmn.A_ServiceTask;OG.A_ServiceTask=OG.shape.bpmn.A_ServiceTask;OG.shape.bpmn.A_Subprocess=function(a){OG.shape.bpmn.A_Subprocess.superclass.call(this);this.label=a;this.SHAPE_ID="OG.shape.bpmn.A_Subprocess";this.GROUP_COLLAPSIBLE=false;this.HaveButton=true;this.status="None";this.inclusion=false};OG.shape.bpmn.A_Subprocess.prototype=new OG.shape.GeomShape();OG.shape.bpmn.A_Subprocess.superclass=OG.shape.GeomShape;OG.shape.bpmn.A_Subprocess.prototype.constructor=OG.shape.bpmn.A_Subprocess;OG.A_Subprocess=OG.shape.bpmn.A_Subprocess;OG.shape.bpmn.A_Subprocess.prototype.createShape=function(){if(this.geom){return this.geom}this.CONNECTABLE=true;this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"stroke-width":1.2,r:6,fill:"#FFFFFF - #FFFFCC","fill-opacity":1});return this.geom};OG.shape.bpmn.A_Subprocess.prototype.createSubShape=function(){this.sub=[];var b,a;switch(this.status){case"Completed":b=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png");break;case"Running":b=new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"running.png");a=new OG.RectangleShape();break}if(b){this.sub.push({shape:b,width:"20px",height:"20px",right:"25px",top:"5px",style:{}})}if(a){this.sub.push({shape:a,"z-index":-1,width:"120%",height:"120%",left:"-10%",top:"-10%",style:{"fill-opacity":1,animation:[{start:{fill:"white"},to:{fill:"#C9E2FC"},ms:1000},{start:{fill:"#C9E2FC"},to:{fill:"white"},ms:1000,delay:1000}],"animation-repeat":true,fill:"#C9E2FC","stroke-width":"0.2",r:"10","stroke-dasharray":"--"}})}if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}if(this.HaveButton){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"subprocess.png"),width:"20px",height:"20px",align:"center",bottom:"5px",style:{"stroke-width":1,fill:"white","fill-opacity":0,"shape-rendering":"crispEdges"}})}return this.sub};OG.shape.bpmn.A_Subprocess.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"속성",callback:function(){a.currentCanvas.getEventHandler().showProperty()}}};return this.contextMenu};OG.shape.bpmn.A_WebServiceTask=function(a){OG.shape.bpmn.A_WebServiceTask.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.A_WebServiceTask";this.label=a;this.CONNECTABLE=true;this.GROUP_COLLAPSIBLE=false;this.LoopType="None";this.TaskType="WebService"};OG.shape.bpmn.A_WebServiceTask.prototype=new OG.shape.bpmn.A_Task();OG.shape.bpmn.A_WebServiceTask.superclass=OG.shape.bpmn.A_Task;OG.shape.bpmn.A_WebServiceTask.prototype.constructor=OG.shape.bpmn.A_WebServiceTask;OG.A_WebServiceTask=OG.shape.bpmn.A_WebServiceTask;OG.shape.bpmn.C_Association=function(c,b,a){OG.shape.bpmn.C_Association.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_Association"};OG.shape.bpmn.C_Association.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_Association.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_Association.prototype.constructor=OG.shape.bpmn.C_Association;OG.C_Association=OG.shape.bpmn.C_Association;OG.shape.bpmn.C_Association.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[70,0]);this.geom.style=new OG.geometry.Style({"edge-type":"straight","arrow-start":"none","arrow-end":"none","stroke-dasharray":". "});return this.geom};OG.shape.bpmn.C_Conditional=function(c,b,a){OG.shape.bpmn.C_Conditional.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_Conditional"};OG.shape.bpmn.C_Conditional.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_Conditional.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_Conditional.prototype.constructor=OG.shape.bpmn.C_Conditional;OG.C_Conditional=OG.shape.bpmn.C_Conditional;OG.shape.bpmn.C_Conditional.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[70,0]);this.geom.style=new OG.geometry.Style({"edge-type":"straight","arrow-start":"open_diamond-wide-long","arrow-end":"open_block-wide-long"});return this.geom};OG.shape.bpmn.C_DataAssociation=function(c,b,a){OG.shape.bpmn.C_DataAssociation.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_DataAssociation"};OG.shape.bpmn.C_DataAssociation.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_DataAssociation.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_DataAssociation.prototype.constructor=OG.shape.bpmn.C_DataAssociation;OG.C_DataAssociation=OG.shape.bpmn.C_DataAssociation;OG.shape.bpmn.C_DataAssociation.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[70,0]);this.geom.style=new OG.geometry.Style({"edge-type":"straight","arrow-start":"none","arrow-end":"classic-wide-long","stroke-dasharray":". "});return this.geom};OG.shape.bpmn.C_Message=function(c,b,a){OG.shape.bpmn.C_Message.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_Message"};OG.shape.bpmn.C_Message.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_Message.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_Message.prototype.constructor=OG.shape.bpmn.C_Message;OG.C_Message=OG.shape.bpmn.C_Message;OG.shape.bpmn.C_Message.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[80,0]);this.geom.style=new OG.geometry.Style({"edge-type":"straight","arrow-start":"open_oval-wide-long","arrow-end":"open_block-wide-long","stroke-dasharray":"--"});return this.geom};OG.shape.bpmn.C_Sequence=function(c,b,a){OG.shape.bpmn.C_Sequence.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.bpmn.C_Sequence"};OG.shape.bpmn.C_Sequence.prototype=new OG.shape.EdgeShape();OG.shape.bpmn.C_Sequence.superclass=OG.shape.EdgeShape;OG.shape.bpmn.C_Sequence.prototype.constructor=OG.shape.bpmn.C_Sequence;OG.C_Sequence=OG.shape.bpmn.C_Sequence;OG.shape.bpmn.C_Sequence.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[80,0]);this.geom.style=new OG.geometry.Style({"edge-type":"plain","arrow-start":"none","arrow-end":"block-wide-long"});return this.geom};OG.shape.bpmn.D_Data=function(a){OG.shape.bpmn.D_Data.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.D_Data";this.label=a};OG.shape.bpmn.D_Data.prototype=new OG.shape.GeomShape();OG.shape.bpmn.D_Data.superclass=OG.shape.GeomShape;OG.shape.bpmn.D_Data.prototype.constructor=OG.shape.bpmn.D_Data;OG.D_Data=OG.shape.bpmn.D_Data;OG.shape.bpmn.D_Data.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.PolyLine([[0,0],[0,100],[100,100],[100,20],[80,0],[0,0],[80,0],[80,20],[100,20]]);return this.geom};OG.shape.bpmn.D_Store=function(a){OG.shape.bpmn.D_Store.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.D_Store";this.label=a};OG.shape.bpmn.D_Store.prototype=new OG.shape.GeomShape();OG.shape.bpmn.D_Store.superclass=OG.shape.GeomShape;OG.shape.bpmn.D_Store.prototype.constructor=OG.shape.bpmn.D_Store;OG.D_Store=OG.shape.bpmn.D_Store;OG.shape.bpmn.D_Store.prototype.createShape=function(){var f,e,d,c,a,b=[];if(this.geom){return this.geom}f=new OG.geometry.Ellipse([50,10],50,10);e=new OG.geometry.Line([0,10],[0,90]);d=new OG.geometry.Line([100,10],[100,90]);c=new OG.geometry.Curve([[100,90],[96,94],[85,97],[50,100],[15,97],[4,94],[0,90]]);a=new OG.geometry.Rectangle([0,10],100,80);a.style=new OG.geometry.Style({stroke:"none"});b.push(f);b.push(e);b.push(d);b.push(c);b.push(a);this.geom=new OG.geometry.GeometryCollection(b);return this.geom};OG.shape.bpmn.E_End_Cancel=function(a){OG.shape.bpmn.E_End_Cancel.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Cancel";this.label=a};OG.shape.bpmn.E_End_Cancel.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Cancel.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Cancel.prototype.constructor=OG.shape.bpmn.E_End_Cancel;OG.E_End_Cancel=OG.shape.bpmn.E_End_Cancel;OG.shape.bpmn.E_End_Cancel.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":3});c=new OG.geometry.Line([25,25],[75,75]);c.style=new OG.geometry.Style({"stroke-width":5});b=new OG.geometry.Line([25,75],[75,25]);b.style=new OG.geometry.Style({"stroke-width":5});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Compensation=function(a){OG.shape.bpmn.E_End_Compensation.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Compensation";this.label=a};OG.shape.bpmn.E_End_Compensation.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Compensation.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Compensation.prototype.constructor=OG.shape.bpmn.E_End_Compensation;OG.E_End_Compensation=OG.shape.bpmn.E_End_Compensation;OG.shape.bpmn.E_End_Compensation.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":3});c=new OG.geometry.Polygon([[15,50],[45,70],[45,30]]);c.style=new OG.geometry.Style({fill:"black","fill-opacity":1});b=new OG.geometry.Polygon([[45,50],[75,70],[75,30]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Connector=function(a){OG.shape.bpmn.E_End_Connector.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Connector";this.label=a};OG.shape.bpmn.E_End_Connector.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Connector.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Connector.prototype.constructor=OG.shape.bpmn.E_End_Connector;OG.E_End_Connector=OG.shape.bpmn.E_End_Connector;OG.shape.bpmn.E_End_Connector.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,34],[20,65],[60,65],[60,80],[85,50],[60,20],[60,34]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Error=function(a){OG.shape.bpmn.E_End_Error.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Error";this.label=a};OG.shape.bpmn.E_End_Error.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Error.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Error.prototype.constructor=OG.shape.bpmn.E_End_Error;OG.E_End_Error=OG.shape.bpmn.E_End_Error;OG.shape.bpmn.E_End_Error.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":4});b=new OG.geometry.Polygon([[20,75],[40,30],[60,60],[80,20],[60,75],[40,50]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Link=function(a){OG.shape.bpmn.E_End_Link.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Link";this.label=a};OG.shape.bpmn.E_End_Link.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Link.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Link.prototype.constructor=OG.shape.bpmn.E_End_Link;OG.E_End_Link=OG.shape.bpmn.E_End_Link;OG.shape.bpmn.E_End_Link.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,35],[20,65],[60,65],[60,80],[85,50],[60,20],[60,35]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Message=function(a){OG.shape.bpmn.E_End_Message.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Message";this.label=a};OG.shape.bpmn.E_End_Message.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Message.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Message.prototype.constructor=OG.shape.bpmn.E_End_Message;OG.E_End_Message=OG.shape.bpmn.E_End_Message;OG.shape.bpmn.E_End_Message.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":3});c=new OG.geometry.PolyLine([[20,25],[50,45],[80,25],[20,25]]);c.style=new OG.geometry.Style({fill:"black","fill-opacity":1});b=new OG.geometry.PolyLine([[20,35],[20,70],[80,70],[80,35],[50,55],[20,35]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_End_Multiple=function(a){OG.shape.bpmn.E_End_Multiple.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_End_Multiple";this.label=a};OG.shape.bpmn.E_End_Multiple.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_End_Multiple.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_End_Multiple.prototype.constructor=OG.shape.bpmn.E_End_Multiple;OG.E_End_Multiple=OG.shape.bpmn.E_End_Multiple;OG.shape.bpmn.E_End_Multiple.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":3});b=new OG.geometry.Polygon([[50,15],[39,33],[20,33],[29,50],[19,67],[40,67],[50,85],[60,68],[80,68],[70,50],[79,33],[60,33]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Intermediate_Compensation=function(a){OG.shape.bpmn.E_Intermediate_Compensation.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Compensation";this.label=a;this.selectable=true;this.movable=true};OG.shape.bpmn.E_Intermediate_Compensation.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Compensation.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Compensation.prototype.constructor=OG.shape.bpmn.E_Intermediate_Compensation;OG.E_Intermediate_Compensation=OG.shape.bpmn.E_Intermediate_Compensation;OG.shape.bpmn.E_Intermediate_Compensation.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Polygon([[15,50],[45,70],[45,30]]);b=new OG.geometry.Polygon([[45,50],[75,70],[75,30]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],40));a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"#969149","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Error=function(a){OG.shape.bpmn.E_Intermediate_Error.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Error";this.label=a};OG.shape.bpmn.E_Intermediate_Error.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Error.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Error.prototype.constructor=OG.shape.bpmn.E_Intermediate_Error;OG.E_Intermediate_Error=OG.shape.bpmn.E_Intermediate_Error;OG.shape.bpmn.E_Intermediate_Error.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,75],[40,30],[60,60],[80,20],[60,75],[40,50]]);b.style=new OG.geometry.Style({fill:"#ffffff"});a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Escalation=function(a){OG.shape.bpmn.E_Intermediate_Escalation.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Escalation";this.label=a};OG.shape.bpmn.E_Intermediate_Escalation.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Escalation.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Escalation.prototype.constructor=OG.shape.bpmn.E_Intermediate_Escalation;OG.E_Intermediate_Escalation=OG.shape.bpmn.E_Intermediate_Escalation;OG.shape.bpmn.E_Intermediate_Escalation.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,80],[50,20],[80,80],[50,50]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],40));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Link=function(a){OG.shape.bpmn.E_Intermediate_Link.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Link";this.label=a};OG.shape.bpmn.E_Intermediate_Link.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Link.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Link.prototype.constructor=OG.shape.bpmn.E_Intermediate_Link;OG.E_Intermediate_Link=OG.shape.bpmn.E_Intermediate_Link;OG.shape.bpmn.E_Intermediate_Link.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,0],[80,0],[100,50],[80,100],[0,100],[20,50]]);return this.geom};OG.shape.bpmn.E_Intermediate_Message=function(a){OG.shape.bpmn.E_Intermediate_Message.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Message";this.label=a};OG.shape.bpmn.E_Intermediate_Message.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Message.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Message.prototype.constructor=OG.shape.bpmn.E_Intermediate_Message;OG.E_Intermediate_Message=OG.shape.bpmn.E_Intermediate_Message;OG.shape.bpmn.E_Intermediate_Message.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.PolyLine([[20,25],[50,45],[80,25],[20,25]]);b=new OG.geometry.PolyLine([[20,35],[20,70],[80,70],[80,35],[50,55],[20,35]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],45));a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"black","stroke-width":1,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_MessageFill=function(a){OG.shape.bpmn.E_Intermediate_MessageFill.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_MessageFill";this.label=a};OG.shape.bpmn.E_Intermediate_MessageFill.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_MessageFill.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_MessageFill.prototype.constructor=OG.shape.bpmn.E_Intermediate_MessageFill;OG.E_Intermediate_MessageFill=OG.shape.bpmn.E_Intermediate_MessageFill;OG.shape.bpmn.E_Intermediate_MessageFill.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.PolyLine([[20,25],[50,45],[80,25],[20,25]]);c.style=new OG.geometry.Style({fill:"black","fill-opacity":1});b=new OG.geometry.PolyLine([[20,35],[20,70],[80,70],[80,35],[50,55],[20,35]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],45));a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"black","stroke-width":1,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Multiple=function(a){OG.shape.bpmn.E_Intermediate_Multiple.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Multiple";this.label=a};OG.shape.bpmn.E_Intermediate_Multiple.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Multiple.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Multiple.prototype.constructor=OG.shape.bpmn.E_Intermediate_Multiple;OG.E_Intermediate_Multiple=OG.shape.bpmn.E_Intermediate_Multiple;OG.shape.bpmn.E_Intermediate_Multiple.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,50],[50,20],[80,50],[65,75],[35,75]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],40));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"#969149","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Rule=function(a){OG.shape.bpmn.E_Intermediate_Rule.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Rule";this.label=a};OG.shape.bpmn.E_Intermediate_Rule.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Rule.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Rule.prototype.constructor=OG.shape.bpmn.E_Intermediate_Rule;OG.E_Intermediate_Rule=OG.shape.bpmn.E_Intermediate_Rule;OG.shape.bpmn.E_Intermediate_Rule.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Rectangle([25,20],50,60);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);a.push(new OG.geometry.Line([30,30],[70,30]));a.push(new OG.geometry.Line([30,45],[70,45]));a.push(new OG.geometry.Line([30,60],[70,60]));a.push(new OG.geometry.Line([30,70],[70,70]));this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"black","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Intermediate_Timer=function(a){OG.shape.bpmn.E_Intermediate_Timer.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Intermediate_Timer";this.label=a};OG.shape.bpmn.E_Intermediate_Timer.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Intermediate_Timer.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Intermediate_Timer.prototype.constructor=OG.shape.bpmn.E_Intermediate_Timer;OG.E_Intermediate_Timer=OG.shape.bpmn.E_Intermediate_Timer;OG.shape.bpmn.E_Intermediate_Timer.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],32);b=new OG.geometry.PolyLine([[50,30],[50,50],[70,50]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(c);a.push(new OG.geometry.Line([50,18],[50,25]));a.push(new OG.geometry.Line([50,82],[50,75]));a.push(new OG.geometry.Line([18,50],[25,50]));a.push(new OG.geometry.Line([82,50],[75,50]));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom",stroke:"black","stroke-width":1.5,fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.E_Start_Connector=function(a){OG.shape.bpmn.E_Start_Connector.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Connector";this.label=a};OG.shape.bpmn.E_Start_Connector.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Connector.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Connector.prototype.constructor=OG.shape.bpmn.E_Start_Connector;OG.E_Start_Connector=OG.shape.bpmn.E_Start_Connector;OG.shape.bpmn.E_Start_Connector.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,34],[20,65],[60,65],[60,80],[85,50],[60,20],[60,34]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Error=function(a){OG.shape.bpmn.E_Start_Error.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Error";this.label=a};OG.shape.bpmn.E_Start_Error.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Error.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Error.prototype.constructor=OG.shape.bpmn.E_Start_Error;OG.E_Start_Error=OG.shape.bpmn.E_Start_Error;OG.shape.bpmn.E_Start_Error.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);b=new OG.geometry.Polygon([[20,75],[40,30],[60,60],[80,20],[60,75],[40,50]]);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5});return this.geom};OG.shape.bpmn.E_Start_Link=function(a){OG.shape.bpmn.E_Start_Link.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Link";this.label=a};OG.shape.bpmn.E_Start_Link.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Link.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Link.prototype.constructor=OG.shape.bpmn.E_Start_Link;OG.E_Start_Link=OG.shape.bpmn.E_Start_Link;OG.shape.bpmn.E_Start_Link.prototype.createShape=function(){var b,a=[];if(this.geom){return this.geom}b=new OG.geometry.Polygon([[20,35],[20,65],[60,65],[60,80],[85,50],[60,20],[60,35]]);a.push(new OG.geometry.Circle([50,50],50));a.push(new OG.geometry.Circle([50,50],42));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Message=function(a){OG.shape.bpmn.E_Start_Message.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Message";this.label=a};OG.shape.bpmn.E_Start_Message.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Message.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Message.prototype.constructor=OG.shape.bpmn.E_Start_Message;OG.E_Start_Message=OG.shape.bpmn.E_Start_Message;OG.shape.bpmn.E_Start_Message.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":1.5});c=new OG.geometry.PolyLine([[20,25],[50,45],[80,25],[20,25]]);b=new OG.geometry.PolyLine([[20,35],[20,70],[80,70],[80,35],[50,55],[20,35]]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Multiple=function(a){OG.shape.bpmn.E_Start_Multiple.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Multiple";this.label=a};OG.shape.bpmn.E_Start_Multiple.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Multiple.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Multiple.prototype.constructor=OG.shape.bpmn.E_Start_Multiple;OG.E_Start_Multiple=OG.shape.bpmn.E_Start_Multiple;OG.shape.bpmn.E_Start_Multiple.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);b=new OG.geometry.Polygon([[50,15],[39,33],[20,33],[29,50],[19,67],[40,67],[50,85],[60,68],[80,68],[70,50],[79,33],[60,33]]);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Rule=function(a){OG.shape.bpmn.E_Start_Rule.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Rule";this.label=a};OG.shape.bpmn.E_Start_Rule.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Rule.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Rule.prototype.constructor=OG.shape.bpmn.E_Start_Rule;OG.E_Start_Rule=OG.shape.bpmn.E_Start_Rule;OG.shape.bpmn.E_Start_Rule.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":1.5});b=new OG.geometry.Rectangle([25,20],50,60);a.push(c);a.push(b);a.push(new OG.geometry.Line([30,30],[70,30]));a.push(new OG.geometry.Line([30,45],[70,45]));a.push(new OG.geometry.Line([30,60],[70,60]));a.push(new OG.geometry.Line([30,70],[70,70]));this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Start_Timer=function(a){OG.shape.bpmn.E_Start_Timer.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.E_Start_Timer";this.label=a};OG.shape.bpmn.E_Start_Timer.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.E_Start_Timer.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.E_Start_Timer.prototype.constructor=OG.shape.bpmn.E_Start_Timer;OG.E_Start_Timer=OG.shape.bpmn.E_Start_Timer;OG.shape.bpmn.E_Start_Timer.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);d.style=new OG.geometry.Style({"stroke-width":1.5});c=new OG.geometry.Circle([50,50],32);b=new OG.geometry.PolyLine([[50,30],[50,50],[70,50]]);a.push(d);a.push(c);a.push(new OG.geometry.Line([50,18],[50,25]));a.push(new OG.geometry.Line([50,82],[50,75]));a.push(new OG.geometry.Line([18,50],[25,50]));a.push(new OG.geometry.Line([82,50],[75,50]));a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.E_Terminate=function(a){OG.shape.bpmn.E_Terminate.superclass.call(this,a);this.SHAPE_ID="OG.shape.bpmn.E_Terminate"};OG.shape.bpmn.E_Terminate.prototype=new OG.shape.bpmn.E_End();OG.shape.bpmn.E_Terminate.superclass=OG.shape.bpmn.E_End;OG.shape.bpmn.E_Terminate.prototype.constructor=OG.shape.bpmn.E_Terminate;OG.E_Terminate=OG.shape.bpmn.E_Terminate;OG.shape.bpmn.E_Terminate.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":3});b=new OG.geometry.Circle([50,50],30);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom"});return this.geom};OG.shape.bpmn.G_Complex=function(a){OG.shape.bpmn.G_Complex.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Complex";this.label=a};OG.shape.bpmn.G_Complex.prototype=new OG.shape.bpmn.G_Gateway();OG.shape.bpmn.G_Complex.superclass=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Complex.prototype.constructor=OG.shape.bpmn.G_Complex;OG.G_Complex=OG.shape.bpmn.G_Complex;OG.shape.bpmn.G_Complex.prototype.createShape=function(){var f,e,d,c,a,b=[];if(this.geom){return this.geom}f=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);e=new OG.geometry.Line([30,30],[70,70]);e.style=new OG.geometry.Style({"stroke-width":3});d=new OG.geometry.Line([30,70],[70,30]);d.style=new OG.geometry.Style({"stroke-width":3});c=new OG.geometry.Line([20,50],[80,50]);c.style=new OG.geometry.Style({"stroke-width":3});a=new OG.geometry.Line([50,20],[50,80]);a.style=new OG.geometry.Style({"stroke-width":3});b.push(f);b.push(e);b.push(d);b.push(c);b.push(a);this.geom=new OG.geometry.GeometryCollection(b);return this.geom};OG.shape.bpmn.G_Exclusive=function(a){OG.shape.bpmn.G_Exclusive.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Exclusive";this.label=a};OG.shape.bpmn.G_Exclusive.prototype=new OG.shape.bpmn.G_Gateway();OG.shape.bpmn.G_Exclusive.superclass=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Exclusive.prototype.constructor=OG.shape.bpmn.G_Exclusive;OG.G_Exclusive=OG.shape.bpmn.G_Exclusive;OG.shape.bpmn.G_Exclusive.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);c=new OG.geometry.Line([30,30],[70,70]);c.style=new OG.geometry.Style({"stroke-width":5});b=new OG.geometry.Line([30,70],[70,30]);b.style=new OG.geometry.Style({"stroke-width":5});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.G_Inclusive=function(a){OG.shape.bpmn.G_Inclusive.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Inclusive";this.label=a};OG.shape.bpmn.G_Inclusive.prototype=new OG.shape.bpmn.G_Gateway();OG.shape.bpmn.G_Inclusive.superclass=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Inclusive.prototype.constructor=OG.shape.bpmn.G_Inclusive;OG.G_Inclusive=OG.shape.bpmn.G_Inclusive;OG.shape.bpmn.G_Inclusive.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);b=new OG.geometry.Circle([50,50],25);b.style=new OG.geometry.Style({"stroke-width":3});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.G_Parallel=function(a){OG.shape.bpmn.G_Parallel.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.G_Parallel";this.label=a};OG.shape.bpmn.G_Parallel.prototype=new OG.shape.bpmn.G_Gateway();OG.shape.bpmn.G_Parallel.superclass=OG.shape.bpmn.G_Gateway;OG.shape.bpmn.G_Parallel.prototype.constructor=OG.shape.bpmn.G_Parallel;OG.G_Parallel=OG.shape.bpmn.G_Parallel;OG.shape.bpmn.G_Parallel.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Polygon([[0,50],[50,100],[100,50],[50,0]]);c=new OG.geometry.Line([20,50],[80,50]);c.style=new OG.geometry.Style({"stroke-width":5});b=new OG.geometry.Line([50,20],[50,80]);b.style=new OG.geometry.Style({"stroke-width":5});a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.MIParallel=function(a){OG.shape.bpmn.MIParallel.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.MIParallel";this.label=a};OG.shape.bpmn.MIParallel.prototype=new OG.shape.GeomShape();OG.shape.bpmn.MIParallel.superclass=OG.shape.GeomShape;OG.shape.bpmn.MIParallel.prototype.constructor=OG.shape.bpmn.MIParallel;OG.MIParallel=OG.shape.bpmn.MIParallel;OG.shape.bpmn.MIParallel.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Line([0,30],[0,0]);c=new OG.geometry.Line([15,30],[15,0]);b=new OG.geometry.Line([30,30],[30,0]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.MISequential=function(a){OG.shape.bpmn.MISequential.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.MISequential";this.label=a};OG.shape.bpmn.MISequential.prototype=new OG.shape.GeomShape();OG.shape.bpmn.MISequential.superclass=OG.shape.GeomShape;OG.shape.bpmn.MISequential.prototype.constructor=OG.shape.bpmn.MISequential;OG.MISequential=OG.shape.bpmn.MISequential;OG.shape.bpmn.MISequential.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Line([0,30],[30,30]);c=new OG.geometry.Line([0,15],[30,15]);b=new OG.geometry.Line([0,0],[30,0]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);return this.geom};OG.shape.bpmn.M_Annotation=function(a){OG.shape.bpmn.M_Annotation.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.M_Annotation";this.label=a};OG.shape.bpmn.M_Annotation.prototype=new OG.shape.GeomShape();OG.shape.bpmn.M_Annotation.superclass=OG.shape.GeomShape;OG.shape.bpmn.M_Annotation.prototype.constructor=OG.shape.bpmn.M_Annotation;OG.M_Annotation=OG.shape.bpmn.M_Annotation;OG.shape.bpmn.M_Annotation.prototype.createShape=function(){if(this.geom){return this.geom}var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Rectangle([0,0],100,100);c.style=new OG.geometry.Style({stroke:"none"});b=new OG.geometry.PolyLine([[10,0],[0,0],[0,100],[10,100]]);b.style=new OG.geometry.Style({stroke:"black"});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({});return this.geom};OG.shape.bpmn.M_Group=function(a){OG.shape.bpmn.M_Group.superclass.call(this);this.CONNECTABLE=true;this.SHAPE_ID="OG.shape.bpmn.M_Group";this.label=a};OG.shape.bpmn.M_Group.prototype=new OG.shape.GroupShape();OG.shape.bpmn.M_Group.superclass=OG.shape.GroupShape;OG.shape.bpmn.M_Group.prototype.constructor=OG.shape.bpmn.M_Group;OG.M_Group=OG.shape.bpmn.M_Group;OG.shape.bpmn.M_Group.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({r:6,fill:"#ffffff","fill-opacity":0,"vertical-align":"top","text-anchor":"start"});return this.geom};OG.shape.bpmn.M_Text=function(a){OG.shape.bpmn.M_Text.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.M_Text";this.label=a||"Text"};OG.shape.bpmn.M_Text.prototype=new OG.shape.GeomShape();OG.shape.bpmn.M_Text.superclass=OG.shape.GeomShape;OG.shape.bpmn.M_Text.prototype.constructor=OG.shape.bpmn.M_Text;OG.M_Text=OG.shape.bpmn.M_Text;OG.shape.bpmn.M_Text.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({stroke:"none"});return this.geom};OG.shape.bpmn.ParallelMultiple=function(a){OG.shape.bpmn.ParallelMultiple.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.ParallelMultiple";this.label=a};OG.shape.bpmn.ParallelMultiple.prototype=new OG.shape.GeomShape();OG.shape.bpmn.ParallelMultiple.superclass=OG.shape.GeomShape;OG.shape.bpmn.ParallelMultiple.prototype.constructor=OG.shape.bpmn.ParallelMultiple;OG.ParallelMultiple=OG.shape.bpmn.ParallelMultiple;OG.shape.bpmn.ParallelMultiple.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);b=new OG.geometry.Circle([50,50],40);geom3=new OG.Polygon([[20,40],[20,60],[40,60],[40,80],[60,80],[60,60],[80,60],[80,40],[60,40],[60,20],[40,20],[40,40]]);a.push(c);a.push(b);a.push(geom3);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5,stroke:"#969149",fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.ScopeActivity=function(a){OG.shape.bpmn.ScopeActivity.superclass.call(this);this.GROUP_COLLAPSIBLE=false;this.CONNECTABLE=true;this.Events=[];this.SHAPE_ID="OG.shape.bpmn.ScopeActivity";this.label=a};OG.shape.bpmn.ScopeActivity.prototype=new OG.shape.bpmn.M_Group();OG.shape.bpmn.ScopeActivity.superclass=OG.shape.bpmn.M_Group;OG.shape.bpmn.ScopeActivity.prototype.constructor=OG.shape.bpmn.ScopeActivity;OG.ScopeActivity=OG.shape.bpmn.ScopeActivity;OG.shape.bpmn.ScopeActivity.prototype.layoutChild=function(){for(var a in this.Events){}};OG.shape.bpmn.Signal=function(a){OG.shape.bpmn.Signal.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.Signal";this.label=a};OG.shape.bpmn.Signal.prototype=new OG.shape.bpmn.Event();OG.shape.bpmn.Signal.superclass=OG.shape.bpmn.Event;OG.shape.bpmn.Signal.prototype.constructor=OG.shape.bpmn.Signal;OG.Signal=OG.shape.bpmn.Signal;OG.shape.bpmn.Signal.prototype.createShape=function(){var d,c,b,a=[];if(this.geom){return this.geom}d=new OG.geometry.Circle([50,50],50);c=new OG.geometry.Circle([50,50],40);b=new OG.Polygon([[20,75],[50,10],[80,75]]);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","stroke-width":1.5,stroke:"#969149",fill:"white","fill-opacity":1});return this.geom};OG.shape.bpmn.Value_Chain=function(a){OG.shape.bpmn.Value_Chain.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.Value_Chain";this.label=a;this.HaveButton=true;this.LoopType="None";this.inclusion=false};OG.shape.bpmn.Value_Chain.prototype=new OG.shape.GeomShape();OG.shape.bpmn.Value_Chain.superclass=OG.shape.GeomShape;OG.shape.bpmn.Value_Chain.prototype.constructor=OG.shape.bpmn.Value_Chain;OG.Value_Chain=OG.shape.bpmn.Value_Chain;OG.shape.bpmn.Value_Chain.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,0],[10,50],[0,100],[90,100],[100,50],[90,0]]);this.geom.style=new OG.geometry.Style({fill:"#FFFFFF-#9FD7FF","fill-opacity":1,stroke:"#9FD7FF"});return this.geom};OG.shape.bpmn.Value_Chain.prototype.createSubShape=function(){this.sub=[];if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}if(this.HaveButton){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"subprocess.png"),width:"20px",height:"20px",align:"center",bottom:"5px",style:{"stroke-width":1,fill:"white","fill-opacity":0,"shape-rendering":"crispEdges"}})}return this.sub};OG.shape.bpmn.Value_Chain.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,copy:true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"속성",callback:function(){a.currentCanvas.getEventHandler().showProperty()}}};return this.contextMenu};OG.shape.bpmn.Value_Chain_Module=function(a){OG.shape.bpmn.Value_Chain_Module.superclass.call(this);this.SHAPE_ID="OG.shape.bpmn.Value_Chain_Module";this.label=a;this.HaveButton=true;this.LoopType="None";this.inclusion=false};OG.shape.bpmn.Value_Chain_Module.prototype=new OG.shape.bpmn.Value_Chain();OG.shape.bpmn.Value_Chain_Module.superclass=OG.shape.bpmn.Value_Chain;OG.shape.bpmn.Value_Chain_Module.prototype.constructor=OG.shape.bpmn.Value_Chain_Module;OG.Value_Chain_Module=OG.shape.bpmn.Value_Chain_Module;OG.shape.bpmn.Value_Chain_Module.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Polygon([[0,0],[0,100],[90,100],[100,50],[90,0]]);this.geom.style=new OG.geometry.Style({fill:"#FFFFFF-#9FD7FF","fill-opacity":1,stroke:"#9FD7FF"});return this.geom};OG.shape.bpmn.Value_Chain.prototype.createSubShape=function(){this.sub=[];if(this.inclusion){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"complete.png"),width:"20px",height:"20px",right:"0px",bottom:"20px",style:{}})}if(this.HaveButton){this.sub.push({shape:new OG.ImageShape(this.currentCanvas._CONFIG.IMAGE_BASE+"subprocess.png"),width:"20px",height:"20px",align:"center",bottom:"5px",style:{"stroke-width":1,fill:"white","fill-opacity":0,"shape-rendering":"crispEdges"}})}return this.sub};OG.shape.elec.WireShape=function(c,b,a){OG.shape.elec.WireShape.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.elec.WireShape"};OG.shape.elec.WireShape.prototype=new OG.shape.EdgeShape();OG.shape.elec.WireShape.superclass=OG.shape.EdgeShape;OG.shape.elec.WireShape.prototype.constructor=OG.shape.elec.WireShape;OG.WireShape=OG.shape.elec.WireShape;OG.shape.elec.WireShape.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}},changeShape:{name:"변경",items:{Wire:{name:"Cable",type:"radio",radio:"changeShape",value:"OG.shape.elec.CableShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,null)}}},IPB:{name:"IPB",type:"radio",radio:"changeShape",value:"OG.shape.elec.BusductShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,"IPB")}}},SPB:{name:"SPB",type:"radio",radio:"changeShape",value:"OG.shape.elec.BusductShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,"SPB")}}},NSPB:{name:"NSPB",type:"radio",radio:"changeShape",value:"OG.shape.elec.BusductShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,"NSPB")}}},CRB:{name:"CRB",type:"radio",radio:"changeShape",value:"OG.shape.elec.BusductShape",events:{change:function(b){a.currentCanvas.getEventHandler().changeShape(b.target.value,"CRB")}}}}}};return this.contextMenu};OG.shape.elec.Load=function(a){OG.shape.elec.Load.superclass.call(this);this.SHAPE_ID="OG.shape.elec.Load";this.label=a};OG.shape.elec.Load.prototype=new OG.shape.GeomShape();OG.shape.elec.Load.superclass=OG.shape.GeomShape;OG.shape.elec.Load.prototype.constructor=OG.shape.elec.Load;OG.Load=OG.shape.elec.Load;OG.shape.elec.Load.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.BLDG=function(a){OG.shape.elec.BLDG.superclass.call(this);this.SHAPE_ID="OG.shape.elec.BLDG";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.CONNECTABLE=false};OG.shape.elec.BLDG.prototype=new OG.shape.HorizontalPoolShape();OG.shape.elec.BLDG.superclass=OG.shape.HorizontalPoolShape;OG.shape.elec.BLDG.prototype.constructor=OG.shape.elec.BLDG;OG.BLDG=OG.shape.elec.BLDG;OG.shape.elec.BLDG.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"horizontal","vertical-align":"top",fill:"#ffffff","fill-opacity":0,"title-size":26,"label-fill":"#428bca","label-fill-opacity":1,"font-weight":700,"font-color":"white"});return this.geom};OG.shape.elec.BLDG.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.BusductShape=function(c,b,a){OG.shape.elec.BusductShape.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.elec.BusductShape"};OG.shape.elec.BusductShape.prototype=new OG.shape.elec.WireShape();OG.shape.elec.BusductShape.superclass=OG.shape.elec.WireShape;OG.shape.elec.BusductShape.prototype.constructor=OG.shape.elec.BusductShape;OG.BusductShape=OG.shape.elec.BusductShape;OG.shape.elec.BusductShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.PolyLine([this.from||[0,0],this.to||[70,0]]);this.geom.style=new OG.geometry.Style({multi:[{top:-10,from:"20px",to:"end-20px",style:{marker:{start:{id:"OG.marker.SwitchRMarker",size:[8,8],ref:[8,0]},end:{id:"OG.marker.SwitchLMarker",size:[8,8],ref:[1,0]}}}},{top:10,from:"20px",to:"end-20px",style:{marker:{start:{id:"OG.marker.SwitchLMarker",size:[8,8],ref:[7,8]},end:{id:"OG.marker.SwitchRMarker",size:[8,8],ref:[0,8]}}}},{top:0,from:"start",to:"end",style:{}}]});return this.geom};OG.shape.elec.CableShape=function(c,b,a){OG.shape.elec.CableShape.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.elec.CableShape"};OG.shape.elec.CableShape.prototype=new OG.shape.elec.WireShape();OG.shape.elec.CableShape.superclass=OG.shape.elec.WireShape;OG.shape.elec.CableShape.prototype.constructor=OG.shape.elec.CableShape;OG.CableShape=OG.shape.elec.CableShape;OG.shape.elec.CableShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.PolyLine([this.from||[0,0],this.to||[70,0]]);this.geom.style=new OG.geometry.Style({multi:[{top:0,from:"start",to:"center",style:{marker:{end:{id:"OG.marker.SwitchLMarker",size:[20,8],ref:[3,0]}}}},{top:0,from:"center",to:"end",style:{marker:{start:{id:"OG.marker.SwitchXMarker",size:[6,6]}}}}]});return this.geom};OG.shape.elec.EHLoad=function(a){OG.shape.elec.EHLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.EHLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.EHLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.EHLoad.superclass=OG.shape.elec.Load;OG.shape.elec.EHLoad.prototype.constructor=OG.shape.elec.EHLoad;OG.EHLoad=OG.shape.elec.EHLoad;OG.shape.elec.EHLoad.prototype.createShape=function(){var e,d,c,b,a=[];if(this.geom){return this.geom}e=new OG.geometry.Circle([30,30],30);d=new OG.geometry.Curve([[0,0],[40,10],[20,20]]);c=new OG.geometry.Curve([[20,20],[40,30],[20,40]]);b=new OG.geometry.Curve([[20,40],[40,50],[0,60]]);a.push(e);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.EHLoad.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.EHSLoad=function(a){OG.shape.elec.EHSLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.EHSLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.EHSLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.EHSLoad.superclass=OG.shape.elec.Load;OG.shape.elec.EHSLoad.prototype.constructor=OG.shape.elec.EHSLoad;OG.EHSLoad=OG.shape.elec.EHSLoad;OG.shape.elec.EHSLoad.prototype.createShape=function(){var e,d,c,b,a=[];if(this.geom){return this.geom}e=new OG.geometry.Circle([30,30],30);d=new OG.geometry.Curve([[0,0],[40,10],[20,20]]);c=new OG.geometry.Curve([[20,20],[40,30],[20,40]]);b=new OG.geometry.Curve([[20,40],[40,50],[0,60]]);a.push(e);a.push(d);a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.EHSLoad.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.HierarchyBldg=function(a){OG.shape.elec.HierarchyBldg.superclass.call(this);this.SHAPE_ID="OG.shape.elec.HierarchyBldg";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.CONNECTABLE=false};OG.shape.elec.HierarchyBldg.prototype=new OG.shape.HorizontalPoolShape();OG.shape.elec.HierarchyBldg.superclass=OG.shape.HorizontalPoolShape;OG.shape.elec.HierarchyBldg.prototype.constructor=OG.shape.elec.HierarchyBldg;OG.HierarchyBldg=OG.shape.elec.HierarchyBldg;OG.shape.elec.HierarchyBldg.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"vertical","vertical-align":"top",fill:"#ffffff","fill-opacity":0,"title-size":26,"label-fill":"#428bca","label-fill-opacity":1,"font-weight":700,"font-color":"white"});return this.geom};OG.shape.elec.HierarchyBldg.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.HierarchyFeeder=function(a){OG.shape.elec.HierarchyFeeder.superclass.call(this);this.SHAPE_ID="OG.shape.elec.HierarchyFeeder";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.textList=[{text:"cable",label:"",shape:"OG.CableShape"},{text:"IPB",label:"IPB",shape:"OG.BusductShape"},{text:"SPB",label:"SPB",shape:"OG.BusductShape"},{text:"NSPB",label:"NSPB",shape:"OG.BusductShape"},{text:"CRB",label:"CRB",shape:"OG.BusductShape"}]};OG.shape.elec.HierarchyFeeder.prototype=new OG.shape.GeomShape();OG.shape.elec.HierarchyFeeder.superclass=OG.shape.GeomShape;OG.shape.elec.HierarchyFeeder.prototype.constructor=OG.shape.elec.HierarchyFeeder;OG.HierarchyFeeder=OG.shape.elec.HierarchyFeeder;OG.shape.elec.HierarchyFeeder.prototype.createShape=function(){var c,b,a=[];if(this.geom){return this.geom}c=new OG.geometry.Circle([50,50],50);c.style=new OG.geometry.Style({"stroke-width":4});b=new OG.geometry.Polygon([[30,80],[30,20],[70,20],[70,30],[40,30],[40,40],[70,40],[70,50],[40,50],[40,80],[30,80]]);b.style=new OG.geometry.Style({fill:"black","fill-opacity":1});a.push(c);a.push(b);this.geom=new OG.geometry.GeometryCollection(a);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200});return this.geom};OG.shape.elec.HierarchyFeeder.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.SWGR_TYPE+" Swgr"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.HierarchyFloor=function(a){OG.shape.elec.HierarchyFloor.superclass.call(this);this.SHAPE_ID="OG.shape.elec.HierarchyFloor";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.CONNECTABLE=false};OG.shape.elec.HierarchyFloor.prototype=new OG.shape.HorizontalPoolShape();OG.shape.elec.HierarchyFloor.superclass=OG.shape.HorizontalPoolShape;OG.shape.elec.HierarchyFloor.prototype.constructor=OG.shape.elec.HierarchyFloor;OG.HierarchyFloor=OG.shape.elec.HierarchyFloor;OG.shape.elec.HierarchyFloor.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"label-direction":"vertical","vertical-align":"top",fill:"#ffffff","fill-opacity":0,"title-size":26,"label-fill":"#428bca","label-fill-opacity":1,"font-weight":700,"font-color":"white"});return this.geom};OG.shape.elec.HierarchyFloor.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.HierarchyFloor.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.Location=function(a){OG.shape.elec.Location.superclass.call(this);this.SHAPE_ID="OG.shape.elec.Location";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.textList=[{text:"Raceway",label:"",shape:"OG.RacewayShape"}]};OG.shape.elec.Location.prototype=new OG.shape.GeomShape();OG.shape.elec.Location.superclass=OG.shape.GeomShape;OG.shape.elec.Location.prototype.constructor=OG.shape.elec.Location;OG.Location=OG.shape.elec.Location;OG.shape.elec.Location.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({"fill-r":1,"fill-cx":0.1,"fill-cy":0.1,"stroke-width":1.2,fill:"r(.1, .1)#428bca-#ffffff","fill-opacity":1,r:"10"});return this.geom};OG.shape.elec.Location.prototype.createSubShape=function(){if(!this.data){return}this.sub=[];return this.sub};OG.shape.elec.Location.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.MILoad=function(a){OG.shape.elec.MILoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.MILoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.MILoad.prototype=new OG.shape.elec.Load();OG.shape.elec.MILoad.superclass=OG.shape.elec.Load;OG.shape.elec.MILoad.prototype.constructor=OG.shape.elec.MILoad;OG.MILoad=OG.shape.elec.MILoad;OG.shape.elec.MILoad.prototype.createShape=function(){var l,k,j,i,h,g,f,e,d,c,b,a,m=[];if(this.geom){return this.geom}l=new OG.geometry.Polygon([[10,0],[27,10],[10,20]]);k=new OG.geometry.Polygon([[44,0],[27,10],[44,20]]);j=new OG.geometry.Line([27,10],[27,20]);i=new OG.geometry.Circle([27,27],7);h=new OG.geometry.PolyLine([[24,30],[24,24],[27,28],[30,24],[30,30]]);g=new OG.geometry.Polygon([[10,40],[27,50],[10,60]]);f=new OG.geometry.Polygon([[44,40],[27,50],[44,60]]);e=new OG.geometry.Line([27,50],[27,60]);d=new OG.geometry.Circle([27,67],7);c=new OG.geometry.PolyLine([[24,70],[24,64],[27,68],[30,64],[30,70]]);b=new OG.geometry.PolyLine([[10,10],[0,10],[0,34],[10,34],[10,40]]);a=new OG.geometry.PolyLine([[44,10],[54,10],[54,34],[44,34],[44,40]]);m.push(l);m.push(k);m.push(j);m.push(i);m.push(h);m.push(g);m.push(f);m.push(e);m.push(d);m.push(c);m.push(b);m.push(a);this.geom=new OG.geometry.GeometryCollection(m);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.MILoad.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.MKLoad=function(a){OG.shape.elec.MKLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.MKLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.MKLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.MKLoad.superclass=OG.shape.elec.Load;OG.shape.elec.MKLoad.prototype.constructor=OG.shape.elec.MKLoad;OG.MKLoad=OG.shape.elec.MKLoad;OG.shape.elec.MKLoad.prototype.createShape=function(){var f,e,d,c,a,b=[];if(this.geom){return this.geom}f=new OG.geometry.Polygon([[10,0],[27,10],[10,20]]);e=new OG.geometry.Polygon([[44,0],[27,10],[44,20]]);d=new OG.geometry.Line([27,10],[27,20]);c=new OG.geometry.Circle([27,27],7);a=new OG.geometry.PolyLine([[24,30],[24,24],[27,28],[30,24],[30,30]]);b.push(f);b.push(e);b.push(d);b.push(c);b.push(a);this.geom=new OG.geometry.GeometryCollection(b);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.MKLoad.prototype.createSubShape=function(){if(!this.data){return}this.sub=[{shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}}];return this.sub};OG.shape.elec.MOLoad=function(a){OG.shape.elec.MOLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.MOLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.MOLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.MOLoad.superclass=OG.shape.elec.Load;OG.shape.elec.MOLoad.prototype.constructor=OG.shape.elec.MOLoad;OG.MOLoad=OG.shape.elec.MOLoad;OG.shape.elec.MOLoad.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Circle([50,50],50);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.MOLoad.prototype.createSubShape=function(){this.sub=[{shape:new OG.TextShape("M"),width:"100%",height:"50%",align:"center","vertical-align":"middle",style:{"font-size":20,"font-color":"black","text-anchor":"middle"}}];if(this.data){this.sub.push({shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}})}return this.sub};OG.shape.elec.Manhole=function(b,a){OG.shape.elec.Manhole.superclass.call(this,b,a);this.SHAPE_ID="OG.shape.elec.Manhole";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;if(!b){this.image="resources/images/elec/manhole.svg"}this.textList=[{text:"Raceway",label:"",shape:"OG.RacewayShape"}]};OG.shape.elec.Manhole.prototype=new OG.shape.ImageShape();OG.shape.elec.Manhole.superclass=OG.shape.ImageShape;OG.shape.elec.Manhole.prototype.constructor=OG.shape.elec.Manhole;OG.Manhole=OG.shape.elec.Manhole;OG.shape.elec.Manhole.prototype.createSubShape=function(){if(!this.data){return}this.sub=[];return this.sub};OG.shape.elec.Manhole.prototype.createContextMenu=function(){var a=this;this.contextMenu={"delete":true,format:true,text:true,bringToFront:true,sendToBack:true,property:{name:"정보보기",callback:function(){$(a.currentCanvas.getRootElement()).trigger("showProperty",[a.currentElement])}}};return this.contextMenu};OG.shape.elec.NMLoad=function(a){OG.shape.elec.NMLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.NMLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.NMLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.NMLoad.superclass=OG.shape.elec.Load;OG.shape.elec.NMLoad.prototype.constructor=OG.shape.elec.NMLoad;OG.NMLoad=OG.shape.elec.NMLoad;OG.shape.elec.NMLoad.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,80);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.NMLoad.prototype.createSubShape=function(){this.sub=[{shape:new OG.TextShape("NM"),width:"100%",height:"50%",align:"center","vertical-align":"middle",style:{"font-size":20,"font-color":"black","text-anchor":"middle"}}];if(this.data){this.sub.push({shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}})}return this.sub};OG.shape.elec.PKGLoad=function(a){OG.shape.elec.PKGLoad.superclass.call(this);this.SHAPE_ID="OG.shape.elec.PKGLoad";this.label=a;this.CONNECT_CLONEABLE=false;this.LABEL_EDITABLE=false;this.ENABLE_FROM=false};OG.shape.elec.PKGLoad.prototype=new OG.shape.elec.Load();OG.shape.elec.PKGLoad.superclass=OG.shape.elec.Load;OG.shape.elec.PKGLoad.prototype.constructor=OG.shape.elec.PKGLoad;OG.PKGLoad=OG.shape.elec.PKGLoad;OG.shape.elec.PKGLoad.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,80);this.geom.style=new OG.geometry.Style({"label-position":"bottom","label-width":200,"stroke-width":2});return this.geom};OG.shape.elec.PKGLoad.prototype.createSubShape=function(){this.sub=[{shape:new OG.TextShape("PKG"),width:"100%",height:"50%",align:"center","vertical-align":"middle",style:{"font-size":20,"font-color":"black","text-anchor":"middle"}}];if(this.data){this.sub.push({shape:new OG.TextShape(this.data.LO_TYPE+" Load"),width:"200%",height:"15%",left:"-50%",top:"-20%",style:{"font-size":8,"font-color":"red","text-anchor":"middle"}})}return this.sub};OG.shape.elec.RacewayShape=function(c,b,a){OG.shape.elec.RacewayShape.superclass.call(this,c,b,a);this.SHAPE_ID="OG.shape.elec.RacewayShape"};OG.shape.elec.RacewayShape.prototype=new OG.shape.EdgeShape();OG.shape.elec.RacewayShape.superclass=OG.shape.EdgeShape;OG.shape.elec.RacewayShape.prototype.constructor=OG.shape.elec.RacewayShape;OG.RacewayShape=OG.shape.elec.RacewayShape;OG.shape.elec.RacewayShape.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.Line(this.from||[0,0],this.to||[70,0]);var a={multi:[{top:-10,from:"start",to:"end",style:{}},{top:10,from:"start",to:"end",style:{}},{top:0,from:"start",to:"end",style:{pattern:{id:"OG.pattern.HatchedPattern",thickness:10,"unit-width":12,"unit-height":12,"pattern-width":8,"pattern-height":8,style:{stroke:"black"}},stroke:"none",}},{top:0,from:"start",to:"end",style:{"fill-opacity":1,animation:[{start:{stroke:"white"},to:{stroke:"#d9534f"},ms:1000},{start:{stroke:"#d9534f"},to:{stroke:"white"},ms:1000,delay:1000}],"animation-repeat":true,stroke:"#d9534f","stroke-width":"5"}}]};if(this.data&&this.data.selected){a.stroke="#d9534f";a["stroke-width"]=2;a.multi[2]["style"]["pattern"]["style"]["stroke"]="#d9534f"}this.geom.style=new OG.geometry.Style(a);return this.geom};OG.shape.elec.RacewayShape.prototype.createContextMenu=function(){var c=this;var a={"":""};if(this.data&&this.data.pathList){for(var b=0;b=c[0]&&b[1]<=c[1]&&b[1]+g>=c[1]){j=f}}}});for(var e in d.data.viewData.columns){f=d.data.viewData.columns[e];b=f.offset;a=f.width;g=f.height;if(b[0]<=c[0]&&b[0]+a>=c[0]&&b[1]<=c[1]&&b[1]+g>=c[1]){j=f}}return j};OG.shape.component.DataTable.prototype.getCellViewFromContent=function(e){var b=this;var d,a,c=null;if(e&&e.nodeType==1&&b.currentCanvas.getRenderer().isShape(e)){d=b.data.viewData.rows;$.each(d,function(f,h){for(var g in h.cells){c=h.cells[g];if(c.contents&&c.contents.length){$.each(c.contents,function(i,j){if(j==e.id){a=c}})}}})}return a};OG.shape.component.DataTable.prototype.emptyCell=function(d,a){var b=this;var c=b.getCellInformation(d);b.data.viewData.rows[c.rowIndex].cells[c.column]["value"]=null;b.data.tableData[c.rowDataIndex][c.column]=null;if(c.contents&&c.contents.length){$.each(c.contents,function(e,f){if(!a){b.currentCanvas.removeShape(f,true)}})}b.data.viewData.rows[c.rowIndex].cells[c.column]["contents"]=[];b.drawCell(d,true)};OG.shape.component.DataTable.prototype.addCellContent=function(e,f,d){var a=this;if(f&&f.nodeType==1&&a.currentCanvas.getRenderer().isShape(f)){var c=a.getCellInformation(e);if(!c.contents){c.contents=[];a.data.viewData.rows[c.rowIndex].cells[c.column]["contents"]=[]}var b=false;$.each(c.contents,function(h,j){if(j==f.id){b=true}});if(b){return}var g=a.removeCellContent(f,true);if(!d&&g){d=g}if(!d){d=f.shape.data?f.shape.data:{}}a.data.viewData.rows[c.rowIndex].cells[c.column]["contents"].push(f.id);if(!a.data.viewData.rows[c.rowIndex].cells[c.column]["value"]){a.data.viewData.rows[c.rowIndex].cells[c.column]["value"]=[];a.data.tableData[c.rowDataIndex][c.column]=[]}if(typeof a.data.viewData.rows[c.rowIndex].cells[c.column]["value"]=="object"){a.data.viewData.rows[c.rowIndex].cells[c.column]["value"].push(d);a.data.tableData[c.rowDataIndex][c.column].push(d)}a.drawCell(e,true)}};OG.shape.component.DataTable.prototype.removeCellContent=function(e,a){var b=this;var d=b.getCellViewFromContent(e);if(!d){return null}var c=b.getCellInformation(d);var f;if(c.contents&&c.contents.length){$.each(c.contents,function(g,h){if(h==e.id){if(!a){b.currentCanvas.removeShape(e,true)}b.data.viewData.rows[c.rowIndex].cells[c.column]["contents"].splice(g,1);var j=b.data.viewData.rows[c.rowIndex].cells[c.column]["value"];if(j&&typeof j=="object"){var k=JSON.parse(JSON.stringify(j));j.splice(g,1);b.data.tableData[c.rowDataIndex][c.column]=j;f=k[g]}b.drawCell(d,true)}})}return f};OG.shape.component.DataTable.prototype.redrawCell=function(b){var a=this;a.drawCell(b,"saved")};OG.shape.component.DataTable.prototype.reconnectEdgesToContent=function(m){var h=this;var b,j,c,g,o,k,f,l;var e=h.getCellInformation(m);var a=h.data.viewData.rows[e.rowDataIndex].cells[e.column]["connection"];if(a&&a.length&&e.contentElements){for(var d=0,n=a.length;df){o=true}else{if(g.indexOf(n)!=-1){o=true}}if(o){if(j.currentCanvas.getElementById(c)){j.currentCanvas.removeShape(c)}if(k&&j.currentCanvas.getElementById(k)){j.currentCanvas.removeShape(k)}}}}j.data.viewData.rows.splice(f,m)};OG.shape.component.DataTable.prototype.draw=function(n){var g=new Date();var o=this;o.grid=[];var y=o.currentCanvas.getBoundary(o.currentElement);if(!o.options.columns){throw new Error("No column options to render")}if(!o.data||!o.data.tableData){throw new Error("No table data to render")}var w=y.getUpperLeft();var u=0;var t=0;var B;var l=o.options.columns;var H;if(!n){}var C,j,K;for(var M=0,A=l.length;M0){g[D].left=r+C;r=r+l+C}else{g[D].left=r;r=r+l}if(u0){g[D].top=u+C;u=u+z+C}else{g[D].top=u;u=u+z}if(r=this.length){var c=b-this.length;while((c--)+1){this.push(undefined)}}this.splice(b,0,this.splice(d,1)[0]);return this}};OG.shape.component.DataTable.prototype=new OG.shape.GroupShape();OG.shape.component.DataTable.superclass=OG.shape.GroupShape;OG.shape.component.DataTable.prototype.constructor=OG.shape.component.DataTable;OG.DataTable=OG.shape.component.DataTable;OG.shape.component.DataTable.prototype.createShape=function(){if(this.geom){return this.geom}this.geom=new OG.geometry.Rectangle([0,0],100,100);this.geom.style=new OG.geometry.Style({fill:"#ffffff","fill-opacity":0,"font-size":10,"font-color":"white",stroke:"none"});return this.geom};OG.shape.component.DataTable.prototype.createSubShape=function(){if(!this.geom.style.map){return}this.sub=[];var grid,gridData;if(this.data.viewData.grid){for(var i=0,leni=this.data.viewData.grid.length;ig){n=true}else{if(i.indexOf(m)==-1){n=true}}if(n){if(c&&c.length){$.each(c,function(q,l){if(h.currentCanvas.getElementById(l)){h.currentCanvas.removeShape(l)}})}delete p.cells[m]}}}h.data.viewData.rows.splice(g,j)};OG.shape.component.DataTable.prototype.getCellViewFromOffset=function(c){var d=this;var i,h,f,j,b,a,g;i=d.data.viewData.rows;$.each(i,function(k,m){h=m.cells;if(h){for(var l in h){f=h[l];b=f.offset;a=f.width;g=f.height;if(b[0]<=c[0]&&b[0]+a>=c[0]&&b[1]<=c[1]&&b[1]+g>=c[1]){j=f}}}});for(var e in d.data.viewData.columns){f=d.data.viewData.columns[e];b=f.offset;a=f.width;g=f.height;if(b[0]<=c[0]&&b[0]+a>=c[0]&&b[1]<=c[1]&&b[1]+g>=c[1]){j=f}}return j};OG.shape.component.DataTable.prototype.getCellViewFromContent=function(e){var b=this;var d,a,c=null;if(e&&e.nodeType==1&&b.currentCanvas.getRenderer().isShape(e)){d=b.data.viewData.rows;$.each(d,function(f,h){for(var g in h.cells){c=h.cells[g];if(c.contents&&c.contents.length){$.each(c.contents,function(i,j){if(j==e.id){a=c}})}}})}return a};OG.shape.component.DataTable.prototype.emptyCell=function(d,a){var b=this;var c=b.getCellInformation(d);b.data.viewData.rows[c.rowIndex].cells[c.column]["value"]=null;b.data.tableData[c.rowDataIndex][c.column]=null;if(c.contents&&c.contents.length){$.each(c.contents,function(e,f){if(!a){b.currentCanvas.removeShape(f,true)}})}b.data.viewData.rows[c.rowIndex].cells[c.column]["contents"]=[];b.drawCell(d,true)};OG.shape.component.DataTable.prototype.addCellContent=function(o,p){var l=this,n,j,b,r,a,m;var h=l.getCellInformation(o);if(!h.contents){h.contents=[];l.data.viewData.rows[h.rowIndex].cells[h.column]["contents"]=[]}if(!h.contentsPosition){h.contentsPosition={}}if(!h.contentsPosition.arrangement){h.contentsPosition.arrangement="horizontal"}var d=function(t,s){var w=[],c;for(var u=0;ub){r=r-1}l.data.viewData.rows[h.rowIndex].cells[h.column]["contents"].move(b,r);l.data.viewData.rows[h.rowIndex].cells[h.column]["value"].move(b,r);l.data.tableData[h.rowDataIndex][h.column]=JSON.parse(JSON.stringify(l.data.viewData.rows[h.rowIndex].cells[h.column]["value"]));l.redrawCell(l.refreshCellView(o))}}}};OG.shape.component.DataTable.prototype.removeCellContent=function(e,a){var b=this;var d=b.getCellViewFromContent(e);if(!d){return null}var c=b.getCellInformation(d);var f;if(c.contents&&c.contents.length){$.each(c.contents,function(g,h){if(h==e.id){if(!a){b.currentCanvas.removeShape(e,true)}b.data.viewData.rows[c.rowIndex].cells[c.column]["contents"].splice(g,1);var j=b.data.viewData.rows[c.rowIndex].cells[c.column]["value"];if(j&&typeof j=="object"){var k=JSON.parse(JSON.stringify(j));j.splice(g,1);b.data.tableData[c.rowDataIndex][c.column]=j;f=k[g]}b.drawCell(d,true)}})}return f};OG.shape.component.DataTable.prototype.redrawCell=function(b){var a=this;a.drawCell(b,"saved")};OG.shape.component.DataTable.prototype.reconnectEdgesToContent=function(m){var h=this;var b,j,c,g,o,k,f,l;var e=h.getCellInformation(m);var a=h.data.viewData.rows[e.rowDataIndex].cells[e.column]["connection"];if(a&&a.length&&e.contentElements){for(var d=0,n=a.length;d0){y[F].left=A+x;A=A+L+x}else{y[F].left=A;A=A+L}if(H0){y[F].top=H+x;H=H+p+x}else{y[F].top=H;H=H+p}if(AMath.abs(d.y-a.y)){c="e";b="w"}else{c="s";b="n"}}else{if(a.x<=d.x&&a.y>d.y){if(Math.abs(d.x-a.x)>Math.abs(d.y-a.y)){c="e";b="w"}else{c="n";b="s"}}else{if(a.x>d.x&&a.y<=d.y){if(Math.abs(d.x-a.x)>Math.abs(d.y-a.y)){c="w";b="e"}else{c="s";b="n"}}else{if(a.x>d.x&&a.y>d.y){if(Math.abs(d.x-a.x)>Math.abs(d.y-a.y)){c="w";b="e"}else{c="n";b="s"}}}}}return[c,b]},_getShapeFromTerminal:function(b){var a;if(b){var c=b.substring(0,b.indexOf(OG.Constants.TERMINAL));a=this.getElementById(c)}return a},drawShape:function(a,b,c,d,e){throw new OG.NotImplementedException()},drawGeom:function(b,a,c){throw new OG.NotImplementedException()},drawText:function(a,d,b,c,e){throw new OG.NotImplementedException()},drawImage:function(a,d,b,c,e){throw new OG.NotImplementedException()},drawEdge:function(a,c,d,b){throw new OG.NotImplementedException()},drawLabel:function(a,c,b){throw new OG.NotImplementedException()},drawEdgeLabel:function(a,c,b){throw new OG.NotImplementedException()},redrawShape:function(a,b){throw new OG.NotImplementedException()},redrawConnectedEdge:function(a){throw new OG.NotImplementedException()},connect:function(f,b,e,d,c,a){throw new OG.NotImplementedException()},disconnect:function(a){throw new OG.NotImplementedException()},drawDropOverGuide:function(a){throw new OG.NotImplementedException()},drawGuide:function(a){throw new OG.NotImplementedException()},removeGuide:function(a){throw new OG.NotImplementedException()},removeAllGuide:function(){throw new OG.NotImplementedException()},removeConnectGuide:function(){throw new OG.NotImplementedException()},removeAllConnectGuide:function(){throw new OG.NotImplementedException()},removeOtherConnectGuide:function(){throw new OG.NotImplementedException()},removeAllVirtualEdge:function(){throw new OG.NotImplementedException()},drawEdgeGuide:function(a){throw new OG.NotImplementedException()},drawRubberBand:function(a,b,c){throw new OG.NotImplementedException()},removeRubberBand:function(a){throw new OG.NotImplementedException()},drawDraggableGuide:function(a){throw new OG.NotImplementedException()},drawCollapseGuide:function(a){throw new OG.NotImplementedException()},removeCollapseGuide:function(a){throw new OG.NotImplementedException()},group:function(a){throw new OG.NotImplementedException()},ungroup:function(a){throw new OG.NotImplementedException()},addToGroup:function(a,c,b){throw new OG.NotImplementedException()},collapse:function(a){throw new OG.NotImplementedException()},expand:function(a){throw new OG.NotImplementedException()},clear:function(){throw new OG.NotImplementedException()},removeShape:function(a){throw new OG.NotImplementedException()},remove:function(a){throw new OG.NotImplementedException()},removeChild:function(a){throw new OG.NotImplementedException()},getRootElement:function(){throw new OG.NotImplementedException()},getRootGroup:function(){return this._ROOT_GROUP.node},getElementByPoint:function(a){throw new OG.NotImplementedException()},getElementsByBBox:function(b){var a=[];$(this.getRootElement()).find("[_type="+OG.Constants.NODE_TYPE.SHAPE+"]").each(function(c,d){if(d.shape.geom&&b.isContainsAll(d.shape.geom.getVertices())){a.push(d)}});return a},setAttr:function(a,b){throw new OG.NotImplementedException()},getAttr:function(b,a){throw new OG.NotImplementedException()},setShapeStyle:function(a,b){throw new OG.NotImplementedException()},toFront:function(a){throw new OG.NotImplementedException()},toBack:function(a){throw new OG.NotImplementedException()},bringForward:function(a){throw new OG.NotImplementedException()},sendBackward:function(a){throw new OG.NotImplementedException()},getCanvasSize:function(){throw new OG.NotImplementedException()},setCanvasSize:function(a){throw new OG.NotImplementedException()},fitCanvasSize:function(b,a){throw new OG.NotImplementedException()},setViewBox:function(a,b,c){throw new OG.NotImplementedException()},getScale:function(){throw new OG.NotImplementedException()},setScale:function(a){throw new OG.NotImplementedException()},show:function(a){throw new OG.NotImplementedException()},hide:function(a){throw new OG.NotImplementedException()},appendChild:function(a,b){throw new OG.NotImplementedException()},insertAfter:function(a,b){throw new OG.NotImplementedException()},insertBefore:function(a,b){throw new OG.NotImplementedException()},move:function(a,b){throw new OG.NotImplementedException()},moveCentroid:function(b,a){throw new OG.NotImplementedException()},rotate:function(a,b){throw new OG.NotImplementedException()},resize:function(a,b){throw new OG.NotImplementedException()},resizeBox:function(b,a){throw new OG.NotImplementedException()},clone:function(a){throw new OG.NotImplementedException()},getElementById:function(a){throw new OG.NotImplementedException()},getElementsByType:function(c,a){var b=this.getRootGroup();if(c&&a){return $(b).find("[_type=SHAPE][_shape="+c+"][_shape!="+a+"]")}else{if(c){return $(b).find("[_type=SHAPE][_shape="+c+"]")}else{if(a){return $(b).find("[_type=SHAPE][_shape!="+a+"]")}else{return $(b).find("[_type=SHAPE]")}}}},getBBox:function(a){throw new OG.NotImplementedException()},getRootBBox:function(){throw new OG.NotImplementedException()},getRealRootBBox:function(){var f=Number.MAX_VALUE,d=Number.MAX_VALUE,c=Number.MIN_VALUE,a=Number.MIN_VALUE,e=this.getElementsByType(),j,k,b,h,g,l={width:0,height:0,x:0,y:0,x2:0,y2:0};for(var g=0,m=e.length;gb.x?b.x:f;d=d>b.y?b.y:d;c=c=0;b--){this._remove(this._getREleById(c[b].id))}this._ELE_MAP.remove(a.id);a.remove()}};OG.renderer.RaphaelRenderer.prototype._removeChild=function(a){var c,b;if(a){c=a.node.childNodes;for(b=c.length-1;b>=0;b--){if(c[b].tagName=="svg"){c[b].parentNode.removeChild(c[b])}else{this._remove(this._getREleById(c[b].id))}}}};OG.renderer.RaphaelRenderer.prototype._getREleById=function(a){return this._ELE_MAP.get(a)};OG.renderer.RaphaelRenderer.prototype._drawSubShape=function(f){var H=this,g,y,s,q,d,o,G,j,x,a,E,h,r,w,B,p,A,m,C,n,u,D=[];if(!f.shape.createSubShape){return}g=f.shape.createSubShape();if(!g||!g.length){return}for(var z=0,c=g.length;z=0){f.appendChild(i)}else{if(!k){f.appendChild(i)}else{f.insertBefore(i,k)}}});H._remove(H._getREleById($(t).attr("id")))}};OG.renderer.RaphaelRenderer.prototype._drawGeometry=function(groupElement,geometry,style,parentStyle,isEdge){var me=this,i=0,pathStr="",vertices,element,geomObj,_style={},connectGuideElement;var svg=me.getRootElement();var getRoundedPath=function(rectangle,radius){var rectObj,rectVert,offset1,offset2,angle,array=[],getRoundedOffset=function(coord,dist,deg){var theta=Math.PI/180*deg;return new OG.geometry.Coordinate(OG.Util.round(coord.x+dist*Math.cos(theta)),OG.Util.round(coord.y+dist*Math.sin(theta)))};rectObj=OG.JSON.decode(rectangle.toString());rectVert=rectangle.getVertices();angle=rectObj.angle;offset1=getRoundedOffset(rectVert[0],radius,90+angle);offset2=getRoundedOffset(rectVert[0],radius,angle);array=array.concat(["M",offset1.x,offset1.y,"Q",rectVert[0].x,rectVert[0].y,offset2.x,offset2.y]);offset1=getRoundedOffset(rectVert[1],radius,180+angle);offset2=getRoundedOffset(rectVert[1],radius,90+angle);array=array.concat(["L",offset1.x,offset1.y,"Q",rectVert[1].x,rectVert[1].y,offset2.x,offset2.y]);offset1=getRoundedOffset(rectVert[2],radius,270+angle);offset2=getRoundedOffset(rectVert[2],radius,180+angle);array=array.concat(["L",offset1.x,offset1.y,"Q",rectVert[2].x,rectVert[2].y,offset2.x,offset2.y]);offset1=getRoundedOffset(rectVert[3],radius,angle);offset2=getRoundedOffset(rectVert[3],radius,270+angle);array=array.concat(["L",offset1.x,offset1.y,"Q",rectVert[3].x,rectVert[3].y,offset2.x,offset2.y,"Z"]);return array.toString()},getConnectGuideStyle=function(){return me._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_EVENT_AREA},setConnectGuideAttr=function(ele){ele.attr(getConnectGuideStyle())};if(parentStyle){OG.Util.apply(_style,(style instanceof OG.geometry.Style)?style.map:style||{},OG.Util.apply({},geometry.style.map,OG.Util.apply({},parentStyle,me._CONFIG.DEFAULT_STYLE.GEOM)))}else{OG.Util.apply(_style,(style instanceof OG.geometry.Style)?style.map:style||{},OG.Util.apply({},geometry.style.map,me._CONFIG.DEFAULT_STYLE.GEOM))}var multi=_style.multi;var rootMarker=_style.marker;var rootPattern=_style.pattern;var rootAnimation=_style.animation;var marker,pattern;var drawMulti=function(vertices){var multiData,top,from,to,nodeId,multiStyle;var getSubDistance=function(nodePath,distance){var totalLenth=Raphael.getTotalLength(nodePath);var length;if(typeof distance=="number"){length=distance}else{if(typeof distance=="string"){if(distance.indexOf("px")!=-1){length=parseInt(distance.replace("px",""))}if(distance.indexOf("%")!=-1){distance=parseInt(distance.replace("%",""));length=totalLenth*(distance/100)}else{if(distance=="start"){length=0}else{if(distance=="center"){length=totalLenth/2}else{if(distance=="end"){length=totalLenth}else{if(distance.indexOf("end-")!=-1){length=totalLenth-getSubDistance(nodePath,distance.replace("end-",""))}else{distance=parseInt(distance);length=distance}}}}}}}return length};for(var m=0,lenm=multi.length;m");me._remove(me._getREleById(tempNode.id));cloneNode.removeAttr("_type");cloneNode.removeAttr("_shape");cloneNode.removeAttr("id");cloneNode.children().each(function(){$(this).removeAttr("_type");$(this).removeAttr("_shape");$(this).removeAttr("id");$(this).removeAttr("marker-end");$(this).removeAttr("marker-start");$(this).removeAttr("marker-mid")});var data={id:patternId,x:0,y:0,width:patternWidth,height:patternHeight,patternUnits:"userSpaceOnUse"};if(patternTransform){data.patternTransform=patternTransform}var el=document.createElementNS("http://www.w3.org/2000/svg","pattern");el.appendChild(cloneNode.get(0));for(var k in data){el.setAttribute(k,data[k])}$(svg).find("defs").get(0).appendChild(el);if(isEdge){if(!thickness||thickness==0){return}var pathStr;var topVertices=geometry.getParallelPath(vertices,thickness);var bottomVertices=geometry.getParallelPath(vertices,-thickness);bottomVertices=bottomVertices.reverse();var newVertices=topVertices.concat(bottomVertices);for(var l=0,lenl=newVertices.length;l");me._remove(me._getREleById(tempNode.id));if(key=="start"){cloneNode.attr("transform","rotate(180,"+size[0]/2+","+size[1]/2+")")}cloneNode.removeAttr("_type");cloneNode.removeAttr("_shape");cloneNode.removeAttr("id");cloneNode.children().each(function(){$(this).removeAttr("_type");$(this).removeAttr("_shape");$(this).removeAttr("id");$(this).removeAttr("marker-end");$(this).removeAttr("marker-start");$(this).removeAttr("marker-mid")});var data={id:markerId,refX:ref[0],refY:ref[1],markerWidth:size[0],markerHeight:size[1],orient:"auto"};var el=document.createElementNS("http://www.w3.org/2000/svg","marker");el.appendChild(cloneNode.get(0));for(var k in data){el.setAttribute(k,data[k])}$(svg).find("defs").get(0).appendChild(el);makerData[key]=data}rElement.attr("stroke-opacity","0");var totalLenth=Raphael.getTotalLength(nodePath);var from,to;if(makerData.start&&makerData.end){from=makerData.start["markerWidth"]*1.5;to=totalLenth-makerData.end["markerWidth"]*1.5}else{if(makerData.start&&!makerData.end){from=makerData.start["markerWidth"]*1.5;to=totalLenth}else{if(!makerData.start&&makerData.end){from=0;to=totalLenth-makerData.end["markerWidth"]*1.5}else{from=0;to=totalLenth}}}var subPath=Raphael.getSubpath(nodePath,from,to);var virtualNode=me._PAPER.path(subPath);virtualNode.attr(nodeStyle);for(var key in makerData){$(virtualNode.node).attr("marker-"+key,"url(#"+makerData[key].id+")")}me._add(virtualNode);groupElement.appendChild(virtualNode.node)};var drawAnimation=function(rElement,nodeStyle){var animationData=nodeStyle.animation;var animationRepeat=nodeStyle["animation-repeat"];var maxDuration=0;var monitorAnimationIndex;var delay,ms;for(var i=0,leni=animationData.length;iv._CONFIG.LABEL_MAX_SIZE){o[0]=v._CONFIG.LABEL_MAX_SIZE}}c=this._PAPER.text(w[0],w[1],m,o);c.attr(h);g=c.getBBox();r=r?(r>g.width?r:g.width):g.width;p=p?(p>g.height?p:g.height):g.height;d=OG.Util.round(w[0]-r/2);n=OG.Util.round(w[1]-p/2);s=new OG.Rectangle([d,n],r,p);if(h["label-direction"]==="vertical"){switch(j){case"start":k=s.getBoundary().getLowerCenter().y;break;case"end":k=s.getBoundary().getUpperCenter().y;break;case"middle":k=s.getBoundary().getCentroid().y;break;default:k=s.getBoundary().getCentroid().y;break}switch(h["vertical-align"]){case"top":l=OG.Util.round(s.getBoundary().getLeftCenter().x+g.height/2);break;case"bottom":l=OG.Util.round(s.getBoundary().getRightCenter().x-g.height/2);break;case"middle":l=s.getBoundary().getCentroid().x;break;default:l=s.getBoundary().getCentroid().x;break}u=-90}else{switch(j){case"start":l=s.getBoundary().getLeftCenter().x;break;case"end":l=s.getBoundary().getRightCenter().x;break;case"middle":l=s.getBoundary().getCentroid().x;break;default:l=s.getBoundary().getCentroid().x;break}switch(h["vertical-align"]){case"top":k=OG.Util.round(s.getBoundary().getUpperCenter().y+g.height/2);break;case"bottom":k=OG.Util.round(s.getBoundary().getLowerCenter().y-g.height/2);break;case"middle":k=s.getBoundary().getCentroid().y;break;default:k=s.getBoundary().getCentroid().y;break}}c.attr({x:l,y:k,stroke:"none",fill:h["font-color"]||v._CONFIG.DEFAULT_STYLE.LABEL["font-color"],"font-size":h["font-size"]||v._CONFIG.DEFAULT_STYLE.LABEL["font-size"],"fill-opacity":1});if(m!=""){$(c.node).css({"background-color":h.fill||v._CONFIG.DEFAULT_STYLE.LABEL.fill})}$(c.node).css({cursor:"move"});if(u||h["label-angle"]){if(u===0){u=parseInt(h["label-angle"],10)}c.rotate(u)}c.attr({"text-anchor":j});if(f&&m){g=c.getBBox();b=this._PAPER.rect(g.x-e/2,g.y-e/2,g.width+e,g.height+e);var a=this._CANVAS_COLOR;if(a=="transparent"){a="white"}b.attr({stroke:"none",fill:a,"fill-opacity":1});this._add(b);i.node.appendChild(b.node)}this._add(c,q+"FO");i.node.appendChild(c.node);return i.node};OG.renderer.RaphaelRenderer.prototype.drawShape=function(i,j,p,b,d,m,a){var e=p?p[0]:100,o=p?p[1]:100,c,l,n,f,h,g,k=this;j.currentCanvas=this._CANVAS;if(j instanceof OG.shape.GeomShape){l=j.createShape();l.moveCentroid(i);l.resizeBox(e,o);c=this.drawGeom(l,b,d);j.geom=c.geom}else{if(j instanceof OG.shape.TextShape){n=j.createShape();c=this.drawText(i,n,p,b,d);j.text=c.text;j.angle=c.angle;j.geom=c.geom}else{if(j instanceof OG.shape.ImageShape){f=j.createShape();c=this.drawImage(i,f,p,b,d);j.image=c.image;j.angle=c.angle;j.geom=c.geom}else{if(j instanceof OG.shape.SvgShape){g=j.createShape();c=this.drawSvg(i,g,p,b,d);j.xml=c.xml;j.angle=c.angle;j.geom=c.geom}else{if(j instanceof OG.shape.HtmlShape){h=j.createShape();c=this.drawHtml(i,h,p,b,d);j.html=c.html;j.angle=c.angle;j.geom=c.geom}else{if(j instanceof OG.shape.EdgeShape){l=j.geom||j.createShape();c=this.drawEdge(l,b,d);j.geom=c.geom}else{if(j instanceof OG.shape.GroupShape){l=j.createShape();l.moveCentroid(i);l.resizeBox(e,o);c=this.drawGroup(l,b,d);j.geom=c.geom}}}}}}}if(j.geom){c.shape=j}c.shapeStyle=(b instanceof OG.geometry.Style)?b.map:b;$(c).attr("_shape_id",j.SHAPE_ID);k._drawSubShape(c);if(!(j instanceof OG.shape.TextShape)){this.drawLabel(c);if(j instanceof OG.shape.EdgeShape){this.drawEdgeLabel(c,null,"FROM");this.drawEdgeLabel(c,null,"TO")}}if(c.geom){if(OG.Util.isIE7()){c.removeAttribute("geom")}else{delete c.geom}}if(c.text){if(OG.Util.isIE7()){c.removeAttribute("text")}else{delete c.text}}if(c.image){if(OG.Util.isIE7()){c.removeAttribute("image")}else{delete c.image}}if(c.angle){if(OG.Util.isIE7()){c.removeAttribute("angle")}else{delete c.angle}}j.currentElement=c;if(!m){j.onDrawShape();$(this._PAPER.canvas).trigger("drawShape",[c])}if(k._CONFIG.POOL_DROP_EVENT&&!d&&!a&&k.isTopGroup(c)&&(k.isLane(c)||k.isPool(c))){k.setDropablePool(c)}return c};OG.renderer.RaphaelRenderer.prototype.drawGeom=function(e,b,f){var c=this,d,a={};OG.Util.apply(a,(b instanceof OG.geometry.Style)?b.map:b||{});if(f===0||f){d=this._getREleById(f);if(d){this._removeChild(d)}else{d=this._PAPER.group();this._add(d,f,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.GEOM);this._ROOT_GROUP.node.appendChild(d.node)}}else{d=this._PAPER.group();this._add(d,f,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.GEOM);this._ROOT_GROUP.node.appendChild(d.node)}this._drawGeometry(d.node,e,a);d.node.geom=e;d.attr(c._CONFIG.DEFAULT_STYLE.SHAPE);if(d.node.shape){d.node.shape.geom=e;if(d.node.geom){if(OG.Util.isIE7()){d.node.removeAttribute("geom")}else{delete d.node.geom}}}return d.node};OG.renderer.RaphaelRenderer.prototype.drawText=function(r,h,j,o,l){var q=this,m=j?j[0]:null,k=j?j[1]:null,p=j?j[2]||0:0,e,a,d={},n,c,b,i,g,f;OG.Util.apply(d,(o instanceof OG.geometry.Style)?o.map:o||{},q._CONFIG.DEFAULT_STYLE.TEXT);if(l===0||l){e=this._getREleById(l);if(e){this._removeChild(e)}else{e=this._PAPER.group();this._add(e,l,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.TEXT);this._ROOT_GROUP.node.appendChild(e.node)}}else{e=this._PAPER.group();this._add(e,l,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.TEXT);this._ROOT_GROUP.node.appendChild(e.node)}a=this._PAPER.text(r[0],r[1],h,j);a.attr(d);c=a.getBBox();m=m?(m>c.width?m:c.width):c.width;k=k?(k>c.height?k:c.height):c.height;b=OG.Util.round(r[0]-m/2);i=OG.Util.round(r[1]-k/2);n=new OG.Rectangle([b,i],m,k);n.style.map=d;switch(d["text-anchor"]){case"start":g=n.getBoundary().getLeftCenter().x;break;case"end":g=n.getBoundary().getRightCenter().x;break;case"middle":g=n.getBoundary().getCentroid().x;break;default:g=n.getBoundary().getCentroid().x;break}switch(d["vertical-align"]){case"top":f=OG.Util.round(n.getBoundary().getUpperCenter().y+c.height/2);break;case"bottom":f=OG.Util.round(n.getBoundary().getLowerCenter().y-c.height/2);break;case"middle":f=n.getBoundary().getCentroid().y;break;default:f=n.getBoundary().getCentroid().y;break}a.attr({x:g,y:f});a.attr({stroke:"none",fill:d["font-color"]||q._CONFIG.DEFAULT_STYLE.LABEL["font-color"],"font-size":d["font-size"]||q._CONFIG.DEFAULT_STYLE.LABEL["font-size"]});if(p){a.rotate(p)}this._add(a);e.node.appendChild(a.node);e.node.text=h;e.node.angle=p;e.node.geom=n;e.attr(q._CONFIG.DEFAULT_STYLE.SHAPE);if(e.node.shape){e.node.shape.text=h;e.node.shape.angle=p;e.node.shape.geom=n;if(e.node.text){if(OG.Util.isIE7()){e.node.removeAttribute("text")}else{delete e.node.text}}if(e.node.angle){if(OG.Util.isIE7()){e.node.removeAttribute("angle")}else{delete e.node.angle}}if(e.node.geom){if(OG.Util.isIE7()){e.node.removeAttribute("geom")}else{delete e.node.geom}}}return e.node};OG.renderer.RaphaelRenderer.prototype.drawHtml=function(i,h,p,a,b){var j=this,c=p?p[0]:null,n=p?p[1]:null,f=p?p[2]||0:0,m,g,e={},o,l,d,k;OG.Util.apply(e,(a instanceof OG.geometry.Style)?a.map:a||{},j._CONFIG.DEFAULT_STYLE.HTML);if(b===0||b){m=this._getREleById(b);if(m){this._removeChild(m)}else{m=this._PAPER.group();this._add(m,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.HTML);this._ROOT_GROUP.node.appendChild(m.node)}}else{m=this._PAPER.group();this._add(m,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.HTML);this._ROOT_GROUP.node.appendChild(m.node)}g=this._PAPER.foreignObject(h,i[0],i[1],c,n);g.attr(e);o=g.getBBox();c=c||o.width;n=n||o.height;d=OG.Util.round(i[0]-c/2);k=OG.Util.round(i[1]-n/2);g.attr({x:d,y:k});l=new OG.Rectangle([d,k],c,n);if(f){g.rotate(f)}l.style.map=e;this._add(g);m.node.appendChild(g.node);m.node.html=h;m.node.angle=f;m.node.geom=l;m.attr(j._CONFIG.DEFAULT_STYLE.SHAPE);if(m.node.shape){m.node.shape.html=h;m.node.shape.angle=f;m.node.shape.geom=l;if(m.node.html){if(OG.Util.isIE7()){m.node.removeAttribute("html")}else{delete m.node.html}}if(m.node.angle){if(OG.Util.isIE7()){m.node.removeAttribute("angle")}else{delete m.node.angle}}if(m.node.geom){if(OG.Util.isIE7()){m.node.removeAttribute("geom")}else{delete m.node.geom}}}return m.node};OG.renderer.RaphaelRenderer.prototype.drawImage=function(h,o,p,a,b){var i=this,c=p?p[0]:null,m=p?p[1]:null,f=p?p[2]||0:0,l,g,e={},n,k,d,j;OG.Util.apply(e,(a instanceof OG.geometry.Style)?a.map:a||{},i._CONFIG.DEFAULT_STYLE.IMAGE);if(b===0||b){l=this._getREleById(b);if(l){this._removeChild(l)}else{l=this._PAPER.group();this._add(l,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.IMAGE);this._ROOT_GROUP.node.appendChild(l.node)}}else{l=this._PAPER.group();this._add(l,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.IMAGE);this._ROOT_GROUP.node.appendChild(l.node)}g=this._PAPER.image(o,h[0],h[1],c,m);g.attr(e);n=g.getBBox();c=c||n.width;m=m||n.height;d=OG.Util.round(h[0]-c/2);j=OG.Util.round(h[1]-m/2);g.attr({x:d,y:j});k=new OG.Rectangle([d,j],c,m);if(f){g.rotate(f)}k.style.map=e;this._add(g);l.node.appendChild(g.node);l.node.image=o;l.node.angle=f;l.node.geom=k;l.attr(i._CONFIG.DEFAULT_STYLE.SHAPE);if(l.node.shape){l.node.shape.image=o;l.node.shape.angle=f;l.node.shape.geom=k;if(l.node.image){if(OG.Util.isIE7()){l.node.removeAttribute("image")}else{delete l.node.image}}if(l.node.angle){if(OG.Util.isIE7()){l.node.removeAttribute("angle")}else{delete l.node.angle}}if(l.node.geom){if(OG.Util.isIE7()){l.node.removeAttribute("geom")}else{delete l.node.geom}}}return l.node};OG.renderer.RaphaelRenderer.prototype.drawSvg=function(i,h,q,a,b){var j=this,c=q?q[0]:null,o=q?q[1]:null,f=q?q[2]||0:0,n,g,e={},p,l,d,k;OG.Util.apply(e,(a instanceof OG.geometry.Style)?a.map:a||{},j._CONFIG.DEFAULT_STYLE.SVG);if(b===0||b){n=this._getREleById(b);if(n){this._removeChild(n)}else{n=this._PAPER.group();this._add(n,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.SVG);this._ROOT_GROUP.node.appendChild(n.node)}}else{n=this._PAPER.group();this._add(n,b,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.SVG);this._ROOT_GROUP.node.appendChild(n.node)}g=$(h);for(var m in e){g.attr(m,e[m])}d=OG.Util.round(i[0]-c/2);k=OG.Util.round(i[1]-o/2);g.attr("x",d+"px");g.attr("y",k+"px");g.attr("width",c+"px");g.attr("height",o+"px");l=new OG.Rectangle([d,k],c,o);if(f){g.rotate(f)}l.style.map=e;$(n.node).append(g);n.node.xml=h;n.node.angle=f;n.node.geom=l;n.attr(j._CONFIG.DEFAULT_STYLE.SHAPE);if(n.node.shape){n.node.shape.xml=h;n.node.shape.angle=f;n.node.shape.geom=l;if(n.node.image){if(OG.Util.isIE7()){n.node.removeAttribute("image")}else{delete n.node.image}}if(n.node.angle){if(OG.Util.isIE7()){n.node.removeAttribute("angle")}else{delete n.node.angle}}if(n.node.geom){if(OG.Util.isIE7()){n.node.removeAttribute("geom")}else{delete n.node.geom}}}return n.node};OG.renderer.RaphaelRenderer.prototype._getPointOfInflectionFromEdge=function(c){var h=null,g,e,f,d,b,a;if(c instanceof OG.geometry.PolyLine){d=c.getVertices();if(d.length!=4){return h}g=d[0];e=d[d.length-1];f=d[1];h={x:f.x-g.x,y:f.y-g.y};b=OG.Util.round((e.x-g.x)/2);a=OG.Util.round((e.y-g.y)/2);h.x=(h.x==b)?0:h.x;h.y=(h.y==a)?0:h.y}return h};OG.renderer.RaphaelRenderer.prototype.drawEdge=function(n,b,c,f,a){var h=this,m,e={},g=n.getVertices(),k=g[0],j=g[g.length-1],l=[],d,i;OG.Util.apply(e,(b instanceof OG.geometry.Style)?b.map:b||{},OG.Util.apply({},n.style.map,h._CONFIG.DEFAULT_STYLE.EDGE));if(c===0||c){m=this._getREleById(c);if(m){this._removeEdgeChild(m)}else{m=this._PAPER.group();this._add(m,c,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.EDGE);this._ROOT_GROUP.node.appendChild(m.node)}}else{m=this._PAPER.group();this._add(m,c,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.EDGE);this._ROOT_GROUP.node.appendChild(m.node)}if(f){l=[[k.x,k.y-h._CONFIG.GUIDE_RECT_SIZE/2],[k.x+h._CONFIG.GUIDE_RECT_SIZE*2,k.y-h._CONFIG.GUIDE_RECT_SIZE],[k.x+h._CONFIG.GUIDE_RECT_SIZE*2,k.y+h._CONFIG.GUIDE_RECT_SIZE],[k.x,k.y+h._CONFIG.GUIDE_RECT_SIZE/2]]}else{if(n instanceof OG.geometry.Line){switch(e["edge-type"].toLowerCase()){case OG.Constants.EDGE_TYPE.STRAIGHT:l=[k,j];break;case OG.Constants.EDGE_TYPE.PLAIN:i=this._adjustEdgeDirection([k.x,k.y],[j.x,j.y]);l=[k,j];break;case OG.Constants.EDGE_TYPE.BEZIER:i=this._adjustEdgeDirection([k.x,k.y],[j.x,j.y]);l=this._bezierCurve([k.x,k.y],[j.x,j.y],i[0],i[1]);break}}else{if(n instanceof OG.geometry.Curve){l=n.getControlPoints()}else{if(n instanceof OG.geometry.BezierCurve){l=n.getControlPoints()}else{l=g}}}}if(f){d=new OG.Curve(l)}else{if(n instanceof OG.geometry.Curve){d=new OG.Curve(l)}else{if(n instanceof OG.geometry.BezierCurve){d=new OG.BezierCurve(l)}else{if(e["edge-type"].toLowerCase()===OG.Constants.EDGE_TYPE.BEZIER){d=new OG.BezierCurve(l)}else{d=new OG.PolyLine(l)}}}}this._drawGeometry(m.node,d,e,null,true);m.node.geom=d;m.attr(h._CONFIG.DEFAULT_STYLE.SHAPE);if(m.node.shape){m.node.shape.geom=d;if(m.node.geom){if(OG.Util.isIE7()){m.node.removeAttribute("geom")}else{delete m.node.geom}}}return m.node};OG.renderer.RaphaelRenderer.prototype.drawGroup=function(m,b,c){var k=this,n,p,e={},o,h,d,a,g,j={},f;OG.Util.apply(e,(b instanceof OG.geometry.Style)?b.map:b||{});if(c===0||c){n=this._getREleById(c);if(n){o=n.node.childNodes;for(h=o.length-1;h>=0;h--){if($(o[h]).attr("_type")!==OG.Constants.NODE_TYPE.SHAPE){this._remove(this._getREleById(o[h].id))}}}else{n=this._PAPER.group();this._add(n,c,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.GROUP);this._ROOT_GROUP.node.appendChild(n.node)}}else{n=this._PAPER.group();this._add(n,c,OG.Constants.NODE_TYPE.SHAPE,OG.Constants.SHAPE_TYPE.GROUP);this._ROOT_GROUP.node.appendChild(n.node)}p=this._drawGeometry(n.node,m,e);n.node.geom=m;n.attr(k._CONFIG.DEFAULT_STYLE.SHAPE);d=m.getBoundary();g=new OG.geometry.Rectangle(d.getUpperLeft(),(d.getUpperRight().x-d.getUpperLeft().x),(d.getLowerLeft().y-d.getUpperLeft().y));OG.Util.apply(j,m.style.map,e);if(j["label-direction"]&&j["vertical-align"]==="top"){if(j["label-direction"]==="vertical"){if(j["title-size"]){a=new OG.geometry.Line([d.getUpperLeft().x+j["title-size"],d.getUpperLeft().y],[d.getLowerLeft().x+j["title-size"],d.getLowerLeft().y]);g=new OG.geometry.Rectangle(d.getUpperLeft(),j["title-size"],(d.getLowerLeft().y-d.getUpperLeft().y))}else{a=new OG.geometry.Line([d.getUpperLeft().x+20,d.getUpperLeft().y],[d.getLowerLeft().x+20,d.getLowerLeft().y]);g=new OG.geometry.Rectangle(d.getUpperLeft(),20,(d.getLowerLeft().y-d.getUpperLeft().y))}}else{if(j["title-size"]){a=new OG.geometry.Line([d.getUpperLeft().x,d.getUpperLeft().y+j["title-size"]],[d.getUpperRight().x,d.getUpperRight().y+j["title-size"]]);g=new OG.geometry.Rectangle(d.getUpperLeft(),(d.getUpperRight().x-d.getUpperLeft().x),j["title-size"])}else{a=new OG.geometry.Line([d.getUpperLeft().x,d.getUpperLeft().y+20],[d.getUpperRight().x,d.getUpperRight().y+20]);g=new OG.geometry.Rectangle(d.getUpperLeft(),(d.getUpperRight().x-d.getUpperLeft().x),20)}}this._drawGeometry(n.node,a,e);var l=JSON.parse(JSON.stringify(k._CONFIG.DEFAULT_STYLE.GROUP_HIDDEN));if(j["label-fill"]){l.fill=j["label-fill"]}if(j["label-fill-opacity"]){l["fill-opacity"]=j["label-fill-opacity"]}this._drawGeometry(n.node,g,l)}if(p.id!==n.node.firstChild.id){n.node.insertBefore(p,n.node.firstChild)}if(n.node.shape){if(!n.node.shape.isCollapsed||n.node.shape.isCollapsed===false){n.node.shape.geom=m}if(n.node.geom){if(OG.Util.isIE7()){n.node.removeAttribute("geom")}else{delete n.node.geom}}}return n.node};OG.renderer.RaphaelRenderer.prototype.drawLabel=function(k,n,b){var g=this._getREleById(OG.Util.isElement(k)?k.id:k),e,i,j,c={},o,d,m,f,l=function(r){var t,v,w,q,p=0,s,u;if(r.shape.geom.style.get("edge-type")===OG.Constants.EDGE_TYPE.BEZIER){t=r.shape.geom.getControlPoints();v=t[0];w=t[t.length-1];return new OG.geometry.Coordinate(OG.Util.round((v.x+w.x)/2),OG.Util.round((v.y+w.y)/2))}else{t=r.shape.geom.getVertices();q=r.shape.geom.getLength();for(var s=0,x=t.length-1;sq/2){u=r.shape.geom.intersectCircleToLine(t[s+1],p-q/2,t[s+1],t[s]);break}}return u[0]}};OG.Util.apply(c,(b instanceof OG.geometry.Style)?b.map:b||{});if(g&&g.node.shape){n=OG.Util.trim(n);e=g.node;j=e.shape.geom.getBoundary();d=e.shape.label;if(n!==undefined&&n!==d){var h=e.shape.onBeforeLabelChange(n,d);if(typeof h=="boolean"&&!h){return false}m=jQuery.Event("beforeLabelChange",{element:e,afterText:n,beforeText:d});$(this._PAPER.canvas).trigger(m);if(m.isPropagationStopped()){return false}n=m.afterText}OG.Util.apply(e.shape.geom.style.map,c);e.shape.label=n===undefined?e.shape.label:n;if(e.shape.label!==undefined){switch(e.shape.geom.style.get("label-position")){case"left":f=[j.getCentroid().x-j.getWidth(),j.getCentroid().y];break;case"right":f=[j.getCentroid().x+j.getWidth(),j.getCentroid().y];break;case"top":f=[j.getCentroid().x,j.getCentroid().y-j.getHeight()];break;case"bottom":f=[j.getCentroid().x,j.getCentroid().y+j.getHeight()];break;default:f=[j.getCentroid().x,j.getCentroid().y];break}o=[j.getWidth(),j.getHeight()];if(e.shape instanceof OG.shape.EdgeShape){var a=l(e);f=[a.x,a.y]}i=this._drawLabel(f,e.shape.label,o,e.shape.geom.style,e.id+OG.Constants.LABEL_SUFFIX,e.shape instanceof OG.shape.EdgeShape);e.appendChild(i);if(n!==undefined){e.shape.onDrawLabel(n);$(this._PAPER.canvas).trigger("drawLabel",[e,n])}if(n!==undefined&&d!==undefined&&n!==d){e.shape.onLabelChanged(n,d);$(this._PAPER.canvas).trigger("labelChanged",[e,n,d])}}}return i};OG.renderer.RaphaelRenderer.prototype.drawEdgeLabel=function(i,k,h){var g=this,d=this._getREleById(OG.Util.isElement(i)?i.id:i),b,e,f,c,a,j;if(d&&d.node.shape){k=OG.Util.trim(k);b=d.node;if(b.shape instanceof OG.shape.EdgeShape){e=b.shape.geom.getVertices();if(h==="FROM"){c=[e[0].x,e[0].y+g._CONFIG.FROMTO_LABEL_OFFSET_TOP];b.shape.fromLabel=k||b.shape.fromLabel;a=b.shape.fromLabel;j=OG.Constants.FROM_LABEL_SUFFIX}else{c=[e[e.length-1].x,e[e.length-1].y+g._CONFIG.FROMTO_LABEL_OFFSET_TOP];b.shape.toLabel=k||b.shape.toLabel;a=b.shape.toLabel;j=OG.Constants.TO_LABEL_SUFFIX}if(a){f=this._drawLabel(c,a,[0,0],b.shape.geom.style,b.id+j,false);b.appendChild(f)}}}return f};OG.renderer.RaphaelRenderer.prototype.redrawShape=function(e,h,i){var g=this,f,b,c,j,a;var d=function(s,n){var t,r,p,l=n.childNodes,k,q,o,m;for(q=l.length-1;q>=0;q--){if(!g.isShape(n)){return}d(s,l[q]);m=false;t=$(l[q]).attr("_fromedge");if(t){t=t.split(",");for(var o=0,u=t.length;o3){ap=at.substring(0,3)+".."}p=z._PAPER.rect(ak.x+v,ak.y,ae,ae);E=z._PAPER.path(V(0,0));D=z._PAPER.text(0,0,ap,ae);p.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);if(!Z){E.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE)}if(Z){E.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_ESSENSIA)}F.appendChild(E);F.appendChild(D);F.appendChild(p);z._add(p,h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ar);z._add(E,h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ar+"1");z._add(D,h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ar+"2");if(!an.line){an.line=[]}an.line.push({node:p.node,text:at,label:aq?aq:"",shape:av});I.push(p)}function R(ap,aq){if(!C){return}p=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ap);E=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ap+"1");D=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT+ap+"2");I.push(p)}function K(){if(!B){return}M=z._PAPER.rect(ak.x+v,ak.y,ae,ae);M.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_RECT_AREA);F.appendChild(M);z._add(M,h.id+OG.Constants.GUIDE_SUFFIX.RECT);an.rect=M.node;I.push(M)}function q(){if(!B){return}M=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.RECT);I.push(M)}function c(ap){i=z._PAPER.image(z._CONFIG.IMAGE_BASE+"quarter-upper.png",0,0,ae,ae);i.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);F.appendChild(i);z._add(i,h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_UPPER);an.qUpper=i.node;$(i.node).click(function(){z.divideLane(t,OG.Constants.GUIDE_SUFFIX.QUARTER_UPPER)});aa=z._PAPER.image(z._CONFIG.IMAGE_BASE+"quarter-bisector.png",0,0,ae,ae);aa.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);F.appendChild(aa);z._add(aa,h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_BISECTOR);an.qBisector=aa.node;$(aa.node).click(function(){z.divideLane(t,OG.Constants.GUIDE_SUFFIX.QUARTER_BISECTOR)});Q=z._PAPER.image(z._CONFIG.IMAGE_BASE+"quarter-thirds.png",0,0,ae,ae);Q.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);F.appendChild(Q);z._add(Q,h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_THIRDS);an.qThirds=Q.node;$(Q.node).click(function(){z.divideLane(t,OG.Constants.GUIDE_SUFFIX.QUARTER_THIRDS)});g=z._PAPER.image(z._CONFIG.IMAGE_BASE+"quarter-low.png",0,0,ae,ae);g.attr(z._CONFIG.DEFAULT_STYLE.GUIDE_LINE_AREA);F.appendChild(g);z._add(g,h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_LOW);an.qLow=g.node;$(g.node).click(function(){z.divideLane(t,OG.Constants.GUIDE_SUFFIX.QUARTER_LOW)});if(ap===0){af(aa);af(Q);I.push(i);I.push(g)}if(ap===1){af(Q);I.push(i);I.push(aa);I.push(g)}if(ap===2){I.push(i);I.push(aa);I.push(Q);I.push(g)}}function s(ap){i=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_UPPER);aa=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_BISECTOR);Q=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_THIRDS);g=z._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.QUARTER_LOW);if(ap===0){af(aa);af(Q);I.push(i);I.push(g)}if(ap===1){af(Q);I.push(i);I.push(aa);I.push(g)}if(ap===2){I.push(i);I.push(aa);I.push(Q);I.push(g)}$.each(I,function(aq,ar){U(ar)})}function af(ap){ap.attr({opacity:"0",x:-100,y:-100})}function U(ap){ap.attr({opacity:"1"})}function Y(){var au=4,ap,at,ar,aq;$.each(I,function(aw,av){ar=parseInt(aw/au);aq=parseInt(aw%au);ap=ak.x+((ar+1)*(v+ae)-ae);at=ak.y+(aq*(v+ae));av.attr({x:ap,y:at});if(av.id===h.id+OG.Constants.GUIDE_SUFFIX.LINE){if(z._CONFIG.GUIDE_CONTROL_LINE_NUM==2){z._getREleById(av.id+"1").attr({path:ao(ap,at,0,8)});z._getREleById(av.id+"2").attr({path:ao(ap,at,8,8)})}else{z._getREleById(av.id+"1").attr({path:ao(ap,at,0,4)})}}if(av.id.indexOf(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT)!=-1){var aw=av.id.replace(h.id+OG.Constants.GUIDE_SUFFIX.LINE_TEXT,"");z._getREleById(av.id+"1").attr({path:V(ap,at)});z._getREleById(av.id+"2").attr({x:ap+10,y:at+16})}})}var ad=z.getTextListInController(t);if(!ad){ad=[]}if(this._getREleById(h.id+OG.Constants.GUIDE_SUFFIX.GUIDE)){if(!ab){d();aj();if(W){s(z.enableDivideCount(t))}if(!W){q();if(ad.length){$.each(ad,function(ap,aq){R(ap,aq)})}else{ah()}}f()}if(ab){d();f()}Y();return null}else{if(ab){e();y();ai()}if(!ab){e();y();S();if(W){c(z.enableDivideCount(t))}if(!W){K();if(ad.length){$.each(ad,function(ap,aq){l(ap,aq)})}else{j()}}ai()}Y();if(n){n.insertBefore(h)}if(F){z.getRootGroup().appendChild(F.node)}$(h.node).attr("_selected","true");return an}};OG.renderer.RaphaelRenderer.prototype.drawStickGuide=function(a){if(!this._CONFIG.STICK_GUIDE){return}var d=this,e,c,b;if(!a){return}if(a.x){c=a.x*d._CONFIG.SCALE;this.removeStickGuide("vertical");e=this._PAPER.path("M"+c+",0L"+c+",10000");this._stickGuideX=e}if(a.y){b=a.y*d._CONFIG.SCALE;this.removeStickGuide("horizontal");e=this._PAPER.path("M0,"+b+"L10000,"+b);this._stickGuideY=e}if(e){e.attr("stroke-width","2");e.attr("stroke","#FFCC50");e.attr("opacity","0.7")}};OG.renderer.RaphaelRenderer.prototype.removeStickGuide=function(a){if(!this._CONFIG.STICK_GUIDE){return}if(!a){return}if(a==="vertical"){if(this._stickGuideX){this._remove(this._stickGuideX);this._stickGuideX=null}}if(a==="horizontal"){if(this._stickGuideY){this._remove(this._stickGuideY);this._stickGuideY=null}}};OG.renderer.RaphaelRenderer.prototype.removeAllStickGuide=function(){if(!this._CONFIG.STICK_GUIDE){return}this.removeStickGuide("vertical");this.removeStickGuide("horizontal")};OG.renderer.RaphaelRenderer.prototype.removeGuide=function(c){var b=this._getREleById(OG.Util.isElement(c)?c.id:c),a,d;if(b){a=this._getREleById(b.id+OG.Constants.GUIDE_SUFFIX.GUIDE);d=this._getREleById(b.id+OG.Constants.GUIDE_SUFFIX.BBOX);b.node.removeAttribute("_selected");this._remove(a);this._remove(d);this.removeAllStickGuide()}};OG.renderer.RaphaelRenderer.prototype.removeAllGuide=function(){var a=this;$(a.getRootElement()).find("[_type="+OG.Constants.NODE_TYPE.SHAPE+"][_selected=true]").each(function(b,c){if(OG.Util.isElement(c)&&c.id){a.removeGuide(c)}})};OG.renderer.RaphaelRenderer.prototype.drawEdgeGuide=function(a){return null;var s=this,m=this._getREleById(OG.Util.isElement(a)?a.id:a),e=m?m.node.shape.geom:null,f,o,h,u,p,q,t,j,k,n=[],d=s._CONFIG.GUIDE_RECT_SIZE,l=OG.Util.round(d/2),g={},r;var c=a.shape.GUIDE_BBOX?a.shape.GUIDE_BBOX:s._CONFIG.DEFAULT_STYLE.GUIDE_BBOX;if(m&&e){OG.Util.apply(g,e.style.map,s._CONFIG.DEFAULT_STYLE.EDGE);f=g["edge-type"]===OG.Constants.EDGE_TYPE.BEZIER?e.getControlPoints():e.getVertices();o=$(a).attr("_from")&&$(a).attr("_to")&&$(a).attr("_from")===$(a).attr("_to");if(this._getREleById(m.id+OG.Constants.GUIDE_SUFFIX.GUIDE)){this._remove(this._getREleById(m.id+OG.Constants.GUIDE_SUFFIX.BBOX));p="";if(g["edge-type"]===OG.Constants.EDGE_TYPE.BEZIER){for(var r=0,b=f.length;r1){for(var f=0,m=a.length;f0){for(var f=0,l=h.length;fd.shape.geom.boundary._leftCenter.x?d.shape.geom.boundary._leftCenter.x:a}});$(b.getRootElement()).find("[_selected=true]").each(function(c,d){if(d.shape.TYPE=="EDGE"){return}b.move(d,[a-d.shape.geom.boundary._leftCenter.x,0]);b.drawGuide(d)});b._CANVAS._HANDLER.selectShapes(b._CANVAS._HANDLER._getSelectedElement())};OG.renderer.RaphaelRenderer.prototype.alignRight=function(){var b=0,a=this;$(a.getRootElement()).find("[_selected=true]").each(function(c,d){if(d.shape.TYPE=="EDGE"){return}if(b==0){b=d.shape.geom.boundary._rightCenter.x}else{b=bd.shape.geom.boundary._rightCenter.y?d.shape.geom.boundary._rightCenter.y:b}});$(a.getRootElement()).find("[_selected=true]").each(function(c,d){if(d.shape.TYPE=="EDGE"){return}a.move(d,[0,b-d.shape.geom.boundary._rightCenter.y]);a.drawGuide(d)});a._CANVAS._HANDLER.selectShapes(a._CANVAS._HANDLER._getSelectedElement())};OG.renderer.RaphaelRenderer.prototype.removeShape=function(f,b){var c=this._getREleById(OG.Util.isElement(f)?f.id:f),h,e,d,g;h=c.node.childNodes;e=jQuery.Event("beforeRemoveShape",{element:c.node});if(!b){if(f.shape){var a=f.shape.onBeforeRemoveShape();if(typeof a=="boolean"&&!a){return false}}$(this._PAPER.canvas).trigger(e);if(e.isPropagationStopped()){return false}}this.removeAllConnectGuide();for(d=h.length-1;d>=0;d--){if(h[d].tagName=="svg"){h[d].parentNode.removeChild(h[d])}else{if($(h[d]).attr("_type")===OG.Constants.NODE_TYPE.SHAPE){this.removeShape(h[d])}}}this.disconnect(c.node);this.removeGuide(c.node);this.removeCollapseGuide(c.node);g=OG.Util.clone(c.node);if(!b){if(f.shape){f.shape.onRemoveShape()}}this.remove(c.node);if(!b){$(this._PAPER.canvas).trigger("removeShape",[g])}};OG.renderer.RaphaelRenderer.prototype.remove=function(b){var c=OG.Util.isElement(b)?b.id:b,a=this._getREleById(c);this._remove(a)};OG.renderer.RaphaelRenderer.prototype.removeChild=function(b){var c=OG.Util.isElement(b)?b.id:b,a=this._getREleById(c);this._removeChild(a)};OG.renderer.RaphaelRenderer.prototype.getRootElement=function(){return this._PAPER.canvas};OG.renderer.RaphaelRenderer.prototype.getElementByPoint=function(a){var b=this._PAPER.getElementByPoint(a[0],a[1]);return b?b.node.parentNode:null};OG.renderer.RaphaelRenderer.prototype.setAttr=function(b,c){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a){a.attr(c)}};OG.renderer.RaphaelRenderer.prototype.getAttr=function(c,b){var a=this._getREleById(OG.Util.isElement(c)?c.id:c);if(a){return a.attr(b)}return null};OG.renderer.RaphaelRenderer.prototype.setShapeStyle=function(b,c){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a&&b.shape&&b.shape.geom){OG.Util.apply(b.shape.geom.style.map,c||{});b.shapeStyle=b.shapeStyle||{};OG.Util.apply(b.shapeStyle,c||{});this.redrawShape(b)}};OG.renderer.RaphaelRenderer.prototype.setTextListInController=function(b,c){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a&&b.shape&&b.shape.geom){b.shape.textList=c}};OG.renderer.RaphaelRenderer.prototype.getTextListInController=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a&&b.shape&&b.shape.geom){return b.shape.textList}};OG.renderer.RaphaelRenderer.prototype.toFront=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a){a.toFront()}};OG.renderer.RaphaelRenderer.prototype.toBack=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b);if(a){a.toBack()}};OG.renderer.RaphaelRenderer.prototype.bringForward=function(c){var b=this._getREleById(OG.Util.isElement(c)?c.id:c);if(!b){return}c=b.node;var e=this,a=$(e.getRootGroup());if(e.isLane(c)){c=e._RENDERER.getRootLane(c)}var d=$(c).prevAll().length;a[0].insertBefore(c,OG.Util.isIE()?a[0].childNodes[d+1]:a[0].children[d+1])};OG.renderer.RaphaelRenderer.prototype.sendBackward=function(c){var b=this._getREleById(OG.Util.isElement(c)?c.id:c);if(!b){return}c=b.node;var e=this,a=$(e.getRootGroup());if(e.isLane(c)){c=e.getRootLane(c)}var d=$(c).prevAll().length;var f=d-2;if(f<0){f=0}a[0].insertBefore(c,OG.Util.isIE()?a[0].childNodes[f]:a[0].children[f])};OG.renderer.RaphaelRenderer.prototype.getCanvasSize=function(){return[this._PAPER.width,this._PAPER.height]};OG.renderer.RaphaelRenderer.prototype.setCanvasSize=function(a){this._PAPER.setSize(a[0],a[1])};OG.renderer.RaphaelRenderer.prototype.fitCanvasSize=function(a,c){var g=this,h=this.getRealRootBBox(),f,e,d=1,b=h.width+g._CONFIG.FIT_CANVAS_PADDING*2,i=h.height+g._CONFIG.FIT_CANVAS_PADDING*2;if(h.width!==0&&h.height!==0){f=h.x>g._CONFIG.FIT_CANVAS_PADDING?-1*(h.x-g._CONFIG.FIT_CANVAS_PADDING):g._CONFIG.FIT_CANVAS_PADDING-h.x;e=h.y>g._CONFIG.FIT_CANVAS_PADDING?-1*(h.y-g._CONFIG.FIT_CANVAS_PADDING):g._CONFIG.FIT_CANVAS_PADDING-h.y;this.move(this.getRootGroup(),[f,e]);this.removeAllGuide();if(a&&a.length===2){if(OG.Util.isDefined(c)&&c===true){d=a[0]/b>a[1]/i?a[1]/i:a[0]/b}b=b=0;c--){if($("#"+e[c].id)&&$("#"+e[c].id).attr("name")==OG.Constants.CONNECT_GUIDE_EVENT_AREA.NAME){b.push(e[c])}}}return b};OG.renderer.RaphaelRenderer.prototype.getNotConnectGuideElements=function(c){var e,b,d=[];var a=this._getREleById(OG.Util.isElement(c)?c.id:c);if(a){e=a.node.childNodes;for(b=e.length-1;b>=0;b--){if($("#"+e[b].id)&&$("#"+e[b].id).attr("name")!==OG.Constants.CONNECT_GUIDE_EVENT_AREA.NAME){d.push(e[b])}}}return d};OG.renderer.RaphaelRenderer.prototype.drawConnectGuide=function(e){var i=this,f=this._getREleById(OG.Util.isElement(e)?e.id:e),k=f?f.node.shape.geom:null,h,d,c,o,m,j=i._CONFIG.GUIDE_RECT_SIZE;var b=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_CIRCLE;var a=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var l=function(){var q=k.getVertices();var s=[];for(var r=0,p=q.length;r0){var B=k.isRightAngleBetweenPoints(q[v-1],q[v]);if(B.flag){var y={x:(q[v-1].x+q[v].x)/2,y:(q[v-1].y+q[v].y)/2};if(B.type==="vertical"){var A=q[v-1].y-q[v].y;if(Math.abs(A)<50){return}var x=a.w;var u=a.h;m={x:y.x-(u/2),y:y.y-(x/2),width:u,height:x};a.cursor="ew-resize"}else{var A=q[v-1].x-q[v].x;if(Math.abs(A)<50){return}var x=a.w;var u=a.h;m={x:y.x-(x/2),y:y.y-(u/2),width:x,height:u};a.cursor="ns-resize"}var w=i._PAPER.rect(m.x,m.y,m.width,m.height);w.attr(a);i._add(w);f.appendChild(w);$(w.node).data("prev",v-1);$(w.node).data("next",v);$(w.node).data("parent",f);$(w.node).data("vertice",y);$(w.node).attr("name",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT);$(w.node).data("type",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT);$(w.node).data("direction",B.type);i.toFront(w);s.push(w.node)}}});return s};if(i.getSpots(e).length>0){return null}if(!i._CANVAS._HANDLER._isSelectable(e.shape)){return null}if(f&&k){h=k.getBoundary();o=h.getUpperLeft();var n={x:o.x-i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX_EXPEND,y:o.y-i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX_EXPEND,width:h.getWidth()+i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX_EXPEND*2,height:h.getHeight()+i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX_EXPEND*2};this._remove(this._getREleById(f.id+OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX));c=this._PAPER.rect(n.x,n.y,n.width,n.height);c.attr(i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_BBOX);this._add(c,f.id+OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX);if($(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){var g=l();d={bBox:c.node,spots:g}}else{d={bBox:c.node}}c.insertBefore(f);return d}return null};OG.renderer.RaphaelRenderer.prototype.removeConnectGuide=function(b){var d=this;var a=d._getREleById(OG.Util.isElement(b)?b.id:b);if(!a){return}var c=d._getREleById(a.id+OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX);$(d.getSpots(b)).each(function(e,f){d._remove(d._getREleById(f.id))});d._remove(c)};OG.renderer.RaphaelRenderer.prototype.removeAllConnectGuide=function(){var a=this;$(a.getRootElement()).find("[_type="+OG.Constants.NODE_TYPE.SHAPE+"]").each(function(b,c){if(OG.Util.isElement(c)&&c.id){a.removeConnectGuide(c);a.removeVirtualSpot(c)}})};OG.renderer.RaphaelRenderer.prototype.removeOtherConnectGuide=function(a){var b=this;$(b.getRootElement()).find("[_type="+OG.Constants.NODE_TYPE.SHAPE+"]").each(function(c,d){if(OG.Util.isElement(d)&&d.id&&a.id!==d.id){b.removeConnectGuide(d);b.removeVirtualSpot(d)}})};OG.renderer.RaphaelRenderer.prototype.getSpots=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),c=[];if(a){$("#"+a.id).find("[name="+OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT+"]").each(function(d,e){c.push(e)})}return c};OG.renderer.RaphaelRenderer.prototype.getCircleSpots=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),c=[];if(a){$("#"+a.id).find("[name="+OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT+"]").each(function(d,e){if($(e).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){c.push(e)}})}return c};OG.renderer.RaphaelRenderer.prototype.createVirtualSpot=function(m,k,c){var j=this,e=this._getREleById(OG.Util.isElement(c)?c.id:c),l=e?e.node.shape.geom:null,h,i=[],n=0,b=[],f,d,o,a,g;j.removeVirtualSpot(c);if($(c).attr("_shape")!==OG.Constants.SHAPE_TYPE.EDGE){return null}if(e&&l){h=l.getVertices();i=[];b=[];n=0;$.each(h,function(p,q){if(p>0){var r=l.distanceToLine([m,k],[h[p-1],h[p]]);if(p==1){n=r;i=[h[p-1],h[p]];b=[p-1,p]}else{if(r=v){d=false}}if(s===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){var r=$(t).attr("width");if($(t).attr("height")>$(t).attr("width")){r=$(t).attr("height")}var u=a.r+parseInt(r);if(u>=v){d=false}}});if(!d){return null}g=j._PAPER.circle(o.x,o.y,a.r);g.attr(a);j._add(g);e.appendChild(g);$(g.node).data("prev",b[0]);$(g.node).data("next",b[1]);$(g.node).data("vertice",o);$(g.node).data("parent",e);$(g.node).data("type",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE);$(g.node).attr("name",OG.Constants.CONNECT_GUIDE_SUFFIX.VIRTUAL_SPOT);j.toFront(g);return g.node}return null};OG.renderer.RaphaelRenderer.prototype.getVirtualSpot=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),d,c;if(a){c=$("#"+a.id).find("[name="+OG.Constants.CONNECT_GUIDE_SUFFIX.VIRTUAL_SPOT+"]");d=c.attr("id")}return this.getElementById(d)};OG.renderer.RaphaelRenderer.prototype.removeVirtualSpot=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),d,c;if(a){c=$("#"+a.id).find("[name="+OG.Constants.CONNECT_GUIDE_SUFFIX.VIRTUAL_SPOT+"]");d=c.attr("id")}return this.remove(d)};OG.renderer.RaphaelRenderer.prototype.selectSpot=function(c){var d=this;var b=this._getREleById(OG.Util.isElement(c)?c.id:c);if(b){var a=$(b.node).data("parent");this._remove(this._getREleById(a.id+OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX));$(d.getSpots(a.node)).each(function(f,e){if(e.id!==b.node.id){d.remove(e)}})}};OG.renderer.RaphaelRenderer.prototype._removeEdgeChild=function(b){var d,c;if(b){d=b.node.childNodes;for(c=d.length-1;c>=0;c--){var a=false;if($(d[c]).attr("name")===OG.Constants.CONNECT_GUIDE_SUFFIX.VIRTUAL_SPOT){a=true}if($(d[c]).attr("name")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT){a=true}if(!a){this._remove(this._getREleById(d[c].id))}}}};OG.renderer.RaphaelRenderer.prototype.getChildNodes=function(c){var a=this._getREleById(OG.Util.isElement(c)?c.id:c);var d,b;if(a){d=a.node.childNodes}if(!d){return[]}else{return d}};OG.renderer.RaphaelRenderer.prototype.trimEdge=function(d){var f=this,a=this._getREleById(OG.Util.isElement(d)?d.id:d),h=a?a.node.shape.geom:null;var b=h.getVertices();var e=b.length;for(var c=b.length;c--;){if(c=f._CONFIG.TRIM_EDGE_ANGLE_SIZE){b.splice(c,1)}}}}}if(e!==b.length){d.shape.geom.setVertices(b);d=f.drawEdge(new OG.PolyLine(b),d.shape.geom.style,d.id);f.drawLabel(d);f.drawEdgeLabel(d,null,"FROM");f.drawEdgeLabel(d,null,"TO")}};OG.renderer.RaphaelRenderer.prototype.trimConnectInnerVertice=function(a){var t=this,j=this._getREleById(OG.Util.isElement(a)?a.id:a),e=j?j.node.shape.geom:null,o,b,v,h,l,p;var f=e.getVertices();o=$(a).attr("_from");b=$(a).attr("_to");if(o){v=this._getShapeFromTerminal(o);l=this._getPositionFromTerminal(o)}if(b){h=this._getShapeFromTerminal(b);p=this._getPositionFromTerminal(b)}var g;var u;var r;var k;var s;var m;var d=function(){if(r){if(k>0&&k=0;q--){if(q==f.length-1){g=f[q];u=q;continue}var n=h.shape.geom.isContainsPoint(f[q]);if(n){if(q==0){r=f[q];k=q;s=f[q+1];m=q+1}else{r=f[q-1];k=q-1;s=f[q];m=q}}}d()}if(f.length===2){a=t.drawEdge(new OG.Line(f[0],f[1]),a.shape.geom.style,a.id);a=t.trimEdgeDirection(a,v,h)}else{a.shape.geom.setVertices(f);a=t.drawEdge(new OG.PolyLine(f),a.shape.geom.style,a.id)}t.drawLabel(a);t.drawEdgeLabel(a,null,"FROM");t.drawEdgeLabel(a,null,"TO");return a};OG.renderer.RaphaelRenderer.prototype.trimConnectIntersection=function(d){var h=this,e=this._getREleById(OG.Util.isElement(d)?d.id:d),i=e?e.node.shape.geom:null,j,k,l,c,g,b,a;var f=i.getVertices();j=$(d).attr("_from");k=$(d).attr("_to");if(j){l=this._getShapeFromTerminal(j);g=this._getPositionFromTerminal(j)}if(k){c=this._getShapeFromTerminal(k);b=this._getPositionFromTerminal(k)}if(j){a=l.shape.geom.shortestIntersectToLine([f[1],[g.x,g.y]]);if(a){f[0].x=a.x;f[0].y=a.y}else{f[0].x=g.x;f[0].y=g.y}}if(k){a=c.shape.geom.shortestIntersectToLine([f[f.length-2],[b.x,b.y]]);if(a){f[f.length-1].x=a.x;f[f.length-1].y=a.y}else{f[f.length-1].x=b.x;f[f.length-1].y=b.y}}d.shape.geom.setVertices(f);d=h.drawEdge(new OG.PolyLine(f),d.shape.geom.style,d.id);h.drawLabel(d);h.drawEdgeLabel(d,null,"FROM");h.drawEdgeLabel(d,null,"TO");return d};OG.renderer.RaphaelRenderer.prototype.getBoundary=function(b){var a=this._getREleById(OG.Util.isElement(b)?b.id:b),c;if(a&&a.node&&a.node.shape&&a.node.shape.geom){c=a.node.shape.geom.getBoundary()}return c};OG.renderer.RaphaelRenderer.prototype.setHighlight=function(c,b){var a=this._getREleById(OG.Util.isElement(c)?c.id:c);var d=this;if(a){c=a.node;var e=d.getNotConnectGuideElements(c);$.each(e,function(f,i){var j={};for(var h in b){var g=d.getAttr(i,h);if(g){j[h]=g}}$(i).data("orgAttrGroup",j);d.setAttr(i,b)})}};OG.renderer.RaphaelRenderer.prototype.removeHighlight=function(c,b){var a=this._getREleById(OG.Util.isElement(c)?c.id:c);var d=this;if(a){c=a.node;var e=d.getNotConnectGuideElements(c);$.each(e,function(f,i){var j=$(i).data("orgAttrGroup");if(!j){return}for(var h in b){var g=j[h];if(!g){j[h]=null}}$(i).removeData("orgAttrGroup");d.setAttr(i,j)})}};OG.renderer.RaphaelRenderer.prototype.createTerminalString=function(e,a){var d;var b=this._getREleById(OG.Util.isElement(e)?e.id:e);if(b){var c=b.node.shape.geom.getPercentageDistanceFromPoint(a);if(c){d=b.node.id+OG.Constants.TERMINAL+"_"+c.px+"_"+c.py}}return d};OG.renderer.RaphaelRenderer.prototype.createDefaultTerminalString=function(d){var c;var a=this._getREleById(OG.Util.isElement(d)?d.id:d);if(a){var b={px:50,py:50};if(b){c=a.node.id+OG.Constants.TERMINAL+"_"+b.px+"_"+b.py}}return c};OG.renderer.RaphaelRenderer.prototype._getPercentageFromTerminal=function(c){var d;if(c){var e=c.substring(0,c.indexOf(OG.Constants.TERMINAL));var b=c.replace(e+OG.Constants.TERMINAL+"_","");var a=b.split("_");d=[parseInt(a[0]),parseInt(a[1])]}return d};OG.renderer.RaphaelRenderer.prototype._getPositionFromTerminal=function(d){var e=this;var g,f;var b={px:50,py:50};if(d){var h=d.substring(0,d.indexOf(OG.Constants.TERMINAL));var c=d.replace(h+OG.Constants.TERMINAL+"_","");f=c.split("_");var a=this._getREleById(h);if(a){g=a.node.shape.geom.getPointFromPercentageDistance(f);if(!g||isNaN(g.x)||isNaN(g.y)){g=a.node.shape.geom.getPointFromPercentageDistance([b.px,b.py])}g.x=e._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(g.x,e._CONFIG.MOVE_SNAP_SIZE/2):g.x;g.y=e._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(g.y,e._CONFIG.MOVE_SNAP_SIZE/2):g.y}}return g};OG.renderer.RaphaelRenderer.prototype.toFrontEdges=function(){var e=this;var a=e.getRootGroup();var c=e.getAllEdges();for(var d=0,b=c.length;dx[0]){w.x=t[0]-s}if(t[0]x[1]){w.y=t[1]-r}if(t[1]=0){b=b-1;a._CANVAS.loadJSON(c[b])}a._CONFIG.HISTORY_INDEX=b;$(this._PAPER.canvas).trigger("undo")};OG.renderer.RaphaelRenderer.prototype.redo=function(){var a=this;var c=a._CONFIG.HISTORY;var b=a._CONFIG.HISTORY_INDEX;if(b(f*3)){return 2}if(a>(f*2)){return 1}}if(this.isVerticalLane(c)){if(d>(f*3)){return 2}if(d>(f*2)){return 1}}return 0};OG.renderer.RaphaelRenderer.prototype.getExceptTitleLaneArea=function(h){var j=this;var i=j._getREleById(OG.Util.isElement(h)?h.id:h);var k=i?i.node.shape.geom:null;if(!i||!k){return null}var f=k.getBoundary();var d=k.style.map;var c=d["title-size"]?d["title-size"]:20;var b=f.getUpperLeft();var e=f.getWidth();var l=f.getHeight();var m,g,a;if(!j.isLane(h)&&!j.isPool(h)){return f}if(j.isHorizontalLane(h)||j.isHorizontalPool(h)){m=new OG.geometry.Coordinate(b.x+c,b.y);g=e-c;a=l}if(j.isVerticalLane(h)||j.isVerticalPool(h)){m=new OG.geometry.Coordinate(b.x,b.y+c);g=e;a=l-c}if(m){return new OG.geometry.Envelope(m,g,a)}return f};OG.renderer.RaphaelRenderer.prototype.divideLane=function(d,z){var w=[];var F=this;var u=F._getREleById(OG.Util.isElement(d)?d.id:d);var l=u?u.node.shape.geom:null;if(!u||!l){return}d=u.node;if(!F.isLane(d)){return}var D=z===OG.Constants.GUIDE_SUFFIX.QUARTER_UPPER;var h=z===OG.Constants.GUIDE_SUFFIX.QUARTER_LOW;var e=z===OG.Constants.GUIDE_SUFFIX.QUARTER_BISECTOR;var g=z===OG.Constants.GUIDE_SUFFIX.QUARTER_THIRDS;if(e||g){var r=e?2:3;var m=F.getExceptTitleLaneArea(d);var t=m.getUpperLeft();for(var B=0;By.y){v=H}}if(F.isVerticalLane(d)&&D){if(x.x>y.x){v=H}}if(F.isVerticalLane(d)&&h){if(x.xk){E.push(i)}}});var q=F._CANVAS.drawShape([p+(j/2),o+(G/2)],b,[j,G],null,null,n.id,true,true);w.push(q);$.each(E,function(x,i){F.move(i,a)});F.reEstablishLane(v);F.fitLaneOrder(v)}}if(w.length){for(var B=0,f=w.length;B0){var r=g.getParent(p);if(r&&r.id){m[r.id]=r}}});for(var l in m){n.push(m[l])}b(n)}b(d)};OG.renderer.RaphaelRenderer.prototype.getBoundaryOfElements=function(d){var b=[],f,e,c;if(d&&d.length>0){for(var c=0,a=d.length;cMath.abs(n-a)){h=Math.abs(n-a);g=p}});return g};OG.renderer.RaphaelRenderer.prototype.getBoundaryOfInnerShapesGroup=function(b){var c=this;var f=[];var a=c._getREleById(OG.Util.isElement(b)?b.id:b);if(!a){return null}b=a.node;var e;var d=[];if(c.isLane(b)){d=c.getInnerShapesOfLane(b)}else{d=c.getChilds(b)}$.each(d,function(g,h){if(!c.isLane(h)){f.push(h)}});if(!f.length){return null}return c.getBoundaryOfElements(f)};OG.renderer.RaphaelRenderer.prototype.getSmallestBaseLane=function(c){var e=this;var b=e._getREleById(OG.Util.isElement(c)?c.id:c);if(!b){return null}c=b.node;if(!e.isLane(c)){return null}var a=e.getBaseLanes(c);var f;var d;$.each(a,function(i,h){var g;var j=e.getBoundary(h);if(e.isHorizontalLane(h)){g=j.getWidth()}if(e.isVerticalLane(h)){g=j.getHeight()}if(g){if(!d){d=h;f=g}if(g0){k.resize(d[j-1],[0,(a*-1),0,0])}if(j0){k.resize(d[j-1],[0,0,(c*-1),0])}if(j0){n=e[g-1]}if(c0){f=e[b-1]}if(al){n.push([m.x,m.y]);n.push([l+((a-l)/2),m.y]);n.push([l+((a-l)/2),d.y]);n.push([d.x,d.y])}else{if(i>j){n.push([m.x,m.y]);n.push([i+((j-i)/2),m.y]);n.push([i+((j-i)/2),d.y]);n.push([d.x,d.y])}else{n.push([m.x,m.y]);n.push([m.x,m.y+((d.y-m.y)/2)]);n.push([d.x,m.y+((d.y-m.y)/2)]);n.push([d.x,d.y])}}if(p._CONFIG.DRAG_GRIDABLE){$.each(n,function(t,s){s[0]=OG.Util.roundGrid(s[0],p._CONFIG.MOVE_SNAP_SIZE/2);s[1]=OG.Util.roundGrid(s[1],p._CONFIG.MOVE_SNAP_SIZE/2);n[t]=s})}return p.drawEdge(new OG.PolyLine(n),f.shape.geom.style,f.id)};OG.renderer.RaphaelRenderer.prototype.putInnerShapeToPool=function(b){var c=this;var a=c.getRootGroup();var e;if(!c.isLane(b)&&!c.isPool(b)){return b}if(c.isLane(b)){e=c.getRootLane(b)}else{e=b}var h=e.shape.geom;var f=h.getBoundary();var g=[];var d=c.getChilds(a);$.each(d,function(i,j){if(!c.isEdge(j)&&j.id!=b.id){g.push(j)}});$.each(g,function(j,i){var k=i.shape.geom.getBoundary();if(f.isContainsAll(k.getVertices())){e.appendChild(i)}})};OG.renderer.RaphaelRenderer.prototype.setDropablePool=function(h){var k=this;var m=k.getRootGroup();if(!k.isLane(h)&&!k.isPool(h)){return h}var l=h.shape.geom;var i=[];var j=k.getChilds(m);$.each(j,function(o,p){if(!k.isLane(p)&&!k.isPool(p)&&!k.isEdge(p)){i.push(p)}});var d=k._CONFIG.POOL_DEFAULT_SIZE;var a=30;var g=l.getBoundary();var f=g.getCentroid();var e={};var c=function(){var t=[];if(!i.length){return t}var s=k.getBoundaryOfElements(i);var q=k.getBoundary(h);var o=s.getCentroid();var r=(q.getWidth()/2)-((s.getWidth()/2)+a);var p=(q.getHeight()/2)-((s.getHeight()/2)+a);if(r<0){r=0}if(p<0){p=0}t.push({condition:{maxX:o.x+r},fixedPosition:{x:o.x+r}});t.push({condition:{minX:o.x-r},fixedPosition:{x:o.x-r}});t.push({condition:{maxY:o.y+p},fixedPosition:{y:o.y+p}});t.push({condition:{minY:o.y-p},fixedPosition:{y:o.y-p}});return t};if(k.isVerticalLane(h)||k.isVerticalPool(h)){e.width=d[1];e.height=d[0]}else{e.width=d[0];e.height=d[1]}if(i.length){var n=k.getBoundaryOfElements(i);f=n.getCentroid();if(e.widthy/2){C=z.shape.geom.intersectCircleToLine(B[A+1],x-y/2,B[A+1],B[A]);break}}return C[0]}},v;var w=b._getOffset(q);var s=c.getFrontForCoordinate([w.x,w.y]);if(!s){q.stopImmediatePropagation();return}if(s.id!==a.id){q.stopImmediatePropagation();return}if(a.shape.isCollapsed===false){$(k).append("");o=$("#"+p);switch(a.shape.geom.style.get("text-anchor")){case"start":g="left";break;case"middle":g="center";break;case"end":g="right";break;default:g="center";break}if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.HTML){$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":"left",overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.html);u=a.shape.html;$(o).bind({focusout:function(){a.shape.html=this.value;i=this.value;if(a.shape.html){c.redrawShape(a);this.parentNode.removeChild(this)}else{c.removeShape(a);this.parentNode.removeChild(this)}if(u!==i){c.addHistory()}}})}else{if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.TEXT){$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":g,overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.text);u=a.shape.text;$(o).bind({focusout:function(){a.shape.text=this.value;i=this.value;if(a.shape.text){c.redrawShape(a);this.parentNode.removeChild(this)}else{c.removeShape(a);this.parentNode.removeChild(this)}if(u!==i){c.addHistory()}}})}else{if($(a).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){if(a.shape.label&&c.isSVG()){$(a).children("[id$=_LABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height})})}else{v=t(a);f=v.x-b._CONFIG.LABEL_EDITOR_WIDTH/2;l=v.y-b._CONFIG.LABEL_EDITOR_HEIGHT/2;n=b._CONFIG.LABEL_EDITOR_WIDTH;m=b._CONFIG.LABEL_EDITOR_HEIGHT}$(q.srcElement).parents("[id$=_FROMLABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height;h=a.shape.fromLabel})});$(q.srcElement).parents("[id$=_TOLABEL]").each(function(x,y){$(y).find("text").each(function(A,z){j=c.getBBox(z);f=j.x-10;l=j.y;n=j.width+20;m=j.height;r=a.shape.toLabel})});$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f*b._CONFIG.SCALE,top:l*b._CONFIG.SCALE,width:n*b._CONFIG.SCALE,height:m*b._CONFIG.SCALE,overflow:"hidden",resize:"none"}));$(o).focus();if(h||r){$(o).val(h?a.shape.fromLabel:a.shape.toLabel)}else{$(o).val(a.shape.label);u=a.shape.label}$(o).bind({focusout:function(){if(h){c.drawEdgeLabel(a,this.value,"FROM")}else{if(r){c.drawEdgeLabel(a,this.value,"TO")}else{c.drawLabel(a,this.value);i=this.value;if(u!==i){c.addHistory()}}}this.parentNode.removeChild(this)}})}else{$(o).css(OG.Util.apply(b._CONFIG.DEFAULT_STYLE.LABEL_EDITOR,{left:f,top:l,width:n,height:m,"text-align":g,overflow:"hidden",resize:"none"}));$(o).focus();$(o).val(a.shape.label);u=a.shape.label;$(o).bind({focusout:function(){c.drawLabel(a,this.value);this.parentNode.removeChild(this);i=this.value;if(u!==i){c.addHistory()}}})}}}}}})},setMovable:function(f,g){var i=this,c;var h=i._RENDERER;var k=h.getRootGroup();if(!f){return}var j=$(f).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var m=h.isLane(f);if(j){return}var b=function(x){var u=i._CONFIG.EDGE_MOVE_DELAY_SIZE;var p=[];if(!i._CONFIG.AUTOMATIC_GUIDANCE){return p}if(!x){return p}if(x.length!==1){return p}var r=h.getBoundary(f);var w=r.getCentroid();var v=r.getHeight();var o=r.getWidth();var t=h.getAllShapes();$.each(t,function(z,A){if(h.isEdge(A)){return}if(A.id===f.id){return}var D=h.getBoundary(A);var y=D.getCentroid();var B=D.getUpperLeft();var C=D.getLowerRight();p.push({condition:{minY:(B.y-v/2)-u,maxY:(B.y-v/2)+u},fixedPosition:{y:(B.y-v/2)},guidePosition:{y:B.y},id:z});p.push({condition:{minY:(B.y+v/2)-u,maxY:(B.y+v/2)+u},fixedPosition:{y:(B.y+v/2)},guidePosition:{y:B.y},id:z});p.push({condition:{minY:(C.y+v/2)-u,maxY:(C.y+v/2)+u},fixedPosition:{y:(C.y+v/2)},guidePosition:{y:C.y},id:z});p.push({condition:{minY:(C.y-v/2)-u,maxY:(C.y-v/2)+u},fixedPosition:{y:(C.y-v/2)},guidePosition:{y:C.y},id:z});p.push({condition:{minX:(B.x-o/2)-u,maxX:(B.x-o/2)+u},fixedPosition:{x:(B.x-o/2)},guidePosition:{x:B.x},id:z});p.push({condition:{minX:(B.x+o/2)-u,maxX:(B.x+o/2)+u},fixedPosition:{x:(B.x+o/2)},guidePosition:{x:B.x},id:z});p.push({condition:{minX:(C.x+o/2)-u,maxX:(C.x+o/2)+u},fixedPosition:{x:(C.x+o/2)},guidePosition:{x:C.x},id:z});p.push({condition:{minX:(C.x-o/2)-u,maxX:(C.x-o/2)+u},fixedPosition:{x:(C.x-o/2)},guidePosition:{x:C.x},id:z});p.push({condition:{minX:y.x-u,maxX:y.x+u},fixedPosition:{x:y.x},guidePosition:{x:y.x},id:z});p.push({condition:{minY:y.y-u,maxY:y.y+u,},fixedPosition:{y:y.y},guidePosition:{y:y.y},id:z})});var s=[];var n=h.getPrevEdges(f);var q=h.getNextEdges(f);$.each(n,function(y,z){s.push({edge:z,type:"prev"})});$.each(q,function(y,z){s.push({edge:z,type:"next"})});$.each(s,function(G,D){var z=D.edge;var C=D.type;var E=$(z).attr("_from");var F=$(z).attr("_to");if(!E||!F){return}var J;var I;if(C==="prev"){J=F;I=E}else{J=E;I=F}var H=h._getPositionFromTerminal(J);var y=h._getPositionFromTerminal(I);var B=w.x-H.x;var A=w.y-H.y;p.push({condition:{minX:y.x+B-u,maxX:y.x+B+u},fixedPosition:{x:y.x+B},guidePosition:{x:y.x},id:G});p.push({condition:{minY:y.y+A-u,maxY:y.y+A+u},fixedPosition:{y:y.y+A},guidePosition:{y:y.y},id:G})});return p};var l=function(v,u){var s={dx:v,dy:u};if(!i._CONFIG.AUTOMATIC_GUIDANCE){return s}var o=h.getBoundary(f);var p=o.getCentroid();var n={x:p.x+v,y:p.y+u};var t=function(w){if(!w){return s}if(w.x&&!w.y){return{dx:w.x-p.x,dy:s.dy}}if(w.y&&!w.x){return{dx:s.dx,dy:w.y-p.y}}if(w.x&&w.y){return{dx:w.x-p.x,dy:w.y-p.y}}return s};var q=$(f).data("correctionConditions");if(!q){return s}var r=[];$.each(q,function(x,w){var z=w.condition;var y=true;if(z.minX){if(n.xz.maxX){y=false}}if(z.minY){if(n.yz.maxY){y=false}}if(y){r.push(w)}});$.each(r,function(w,x){s=t(x.fixedPosition);var y=x.guidePosition;h.drawStickGuide(y)});if(!r.length){h.removeAllStickGuide()}return s};var e=function(){var n=$("[id$="+OG.Constants.DROP_OVER_BBOX_SUFFIX+"]");$.each(n,function(o,p){h.remove(p.id)});$(k).removeData("groupTarget")};var d=function(){e();var w=$(k).data("bBoxArray");if(!w){return}var r=[];var o=[];$.each(w,function(x,y){o=h.getAttr(y.box,"transform")[0];r.push(h.getElementById(y.id))});if(!o.length){return}var p=h.getBoundaryOfElements(r);var q=p.getUpperCenter().y+o[2];var t=p.getLeftCenter().x+o[1];var v=new OG.geometry.Envelope([t,q],p.getWidth(),p.getHeight());var n=h.getFrontForBoundary(v);if(!n){return}if(!i._CONFIG.GROUP_DROPABLE||!n.shape.GROUP_DROPABLE){return}if(h.isLane(n)){n=h.getRootLane(n)}if(n.shape instanceof OG.shape.bpmn.A_Task){return}if(n.shape.isCollapsed===true){return}var s=false;$.each(w,function(x,y){if(n.id===y.id){s=true}});if(s){return}var u=false;$.each(w,function(x,y){if(h.isLane(y.id)){u=true}});if(u){return}$(k).data("groupTarget",n);h.drawDropOverGuide(n)};if(g===true){$(f).draggable({start:function(n){var q=i._getOffset(n),p;if(!i._isSelectedElement(f)){$.each(i._getSelectedElement(),function(w,x){if(OG.Util.isElement(x)&&x.id){h.removeGuide(x)}})}h.removeAllEdgeGuide();h.removeGuide(f);p=h.drawGuide(f);if(m){h.drawGuide(h.getRootLane(f))}var o=[];$(i._RENDERER.getRootElement()).find("[id$="+OG.Constants.GUIDE_SUFFIX.BBOX+"]").each(function(x,y){if(y.id&&y.id.indexOf(OG.Constants.CONNECT_GUIDE_SUFFIX.BBOX)==-1){var w=y.id.replace(OG.Constants.GUIDE_SUFFIX.BBOX,"");o.push({id:w})}});var s=false;var t;var r=function(x){if(x.id===f.id){s=true}var w=h.getChilds(x);$.each(w,function(y,z){h.removeGuide(z);if(x.id===f.id){s=true}if(h.isGroup(z)){r(z)}})};var u=function(w){if(!w){return}$.each(o,function(x,y){if(y.id===w.id){t=w}});u(h.getParent(w))};$.each(o,function(w,y){var x=h.getElementById(y.id);if(h.isGroup(x)){r(x)}});if(s){u(f);if(t){h.removeGuide(t);p=h.drawGuide(t)}}$(this).data("start",{x:q.x,y:q.y});$(this).data("offset",{x:q.x-i._num(h.getAttr(p.bBox,"x")),y:q.y-i._num(h.getAttr(p.bBox,"y"))});var v=i._getMoveTargets();$(k).data("bBoxArray",v);$(f).data("correctionConditions",b(v));h.removeRubberBand(h.getRootElement())},drag:function(q){var r=i._getOffset(q),u=$(this).data("start"),t=$(k).data("bBoxArray"),p=r.x-u.x,o=r.y-u.y,s=$(this).data("offset");var n=l(p,o);if("Y"==f.shape.AXIS){n.dx=0}else{if("X"==f.shape.AXIS){n.dy=0}}p=i._grid(n.dx,"move");o=i._grid(n.dy,"move");i._autoExtend(r.x,r.y,f);$(this).css({position:"",left:"",top:""});$.each(t,function(v,w){h.setAttr(w.box,{transform:"t"+p+","+o,"stroke-width":1})});d();h.removeAllConnectGuide()},stop:function(o){var r=i._getOffset(o),p=$(this).data("start"),v=$(k).data("bBoxArray"),x=r.x-p.x,w=r.y-p.y,t=$(k).data("groupTarget"),s=$(this).data("offset"),u;var q=l(x,w);if("Y"==f.shape.AXIS){q.dx=0}else{if("X"==f.shape.AXIS){q.dy=0}}x=i._grid(q.dx,"move");w=i._grid(q.dy,"move");$(this).css({position:"",left:"",top:""});u=i._moveElements(v,x,w);$(k).removeData("bBoxArray");h.removeAllGuide();if(t&&OG.Util.isElement(t)){h.addToGroup(t,u,r);h.remove(t.id+OG.Constants.DROP_OVER_BBOX_SUFFIX);$(k).removeData("groupTarget")}else{var n=[];$.each(u,function(z,A){var y=A.parentElement;if(!y){y=A.parentNode}if(y&&y.id!==k.id){n.push(A)}});h.addToGroup(k,n,r)}$.each(i._getSelectedElement(),function(y,z){c=h.drawGuide(z);if(c){i.setResizable(z,c,i._isResizable(z.shape));i.setConnectable(z,c,i._isConnectable(z.shape));h.toFront(c.group)}});h.removeAllConnectGuide();h.toFrontEdges();h.checkAllBridgeEdge();h.addHistory()}});h.setAttr(f,{cursor:"move"});OG.Util.apply(f.shape.geom.style.map,{cursor:"move"})}else{h.setAttr(f,{cursor:i._isSelectable(f.shape)?"pointer":i._CONFIG.DEFAULT_STYLE.SHAPE.cursor});OG.Util.apply(f.shape.geom.style.map,{cursor:i._isSelectable(f.shape)?"pointer":i._CONFIG.DEFAULT_STYLE.SHAPE.cursor});if(i._CONFIG.DRAG_PAGE_MOVABLE){var a=i._RENDERER._CANVAS._CONTAINER;$(f).bind("mousedown",function(o){if(o.button!=0){return}k=h.getRootGroup();var n=$(k).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);var p=$(k).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE);if(n==="active"||p==="active"){return}$(k).data("dragPageMove",{x:o.pageX,y:o.pageY});$(k).data("dragPageScroll",{x:a.scrollLeft,y:a.scrollTop})})}}},setConnectable:function(d,b,h){var e=this,c=e._RENDERER.getRootGroup(),a,g;var f=$(d).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE?true:false;if(!d||!b){return}if(h){if(!f){$.each(b.line,function(k,j){$(j.node).bind({click:function(i){g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);if(a){$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE,"created");$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_TEXT,j.text);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_LABEL,j.label);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_SHAPE,j.shape)}}});$(j.node).draggable({start:function(i){e.deselectAll();e._RENDERER.removeAllConnectGuide();e._RENDERER.removeAllVirtualEdge();g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE,"active");$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_TEXT,j.text);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_LABEL,j.label);$(c).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_SHAPE,j.shape)}})});$(b.rect).bind({click:function(i){g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);if(a){$(c).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE,"created")}}});$(b.rect).draggable({start:function(i){e.deselectAll();e._RENDERER.removeAllConnectGuide();e._RENDERER.removeAllVirtualEdge();g=e._getOffset(i);a=e._RENDERER.createVirtualEdge(g.x,g.y,d);$(c).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE,"active")}})}}},setResizable:function(j,y,k){var x=this;var s=x._RENDERER.getRootGroup();if(!j||!y){return}var o=$(j).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE?true:false;var r=x._RENDERER;var t=x._RENDERER.getBoundary(j);var m=t.getUpperCenter().y;var q=t.getLowerCenter().y;var g=t.getLeftCenter().x;var i=t.getRightCenter().x;var w=t.getWidth();var n=t.getHeight();var d=function(Q){var P=[];var z=x._CONFIG.GUIDE_MIN_SIZE;var N=x._CONFIG.LANE_MIN_SIZE;var C=x._CONFIG.GROUP_INNER_SAPCE;if(!x._CONFIG.AUTOMATIC_GUIDANCE){return P}var R=x._CONFIG.EDGE_MOVE_DELAY_SIZE;var J=r.getAllShapes();$.each(J,function(T,U){if(r.isEdge(U)){return}if(U.id===j.id){return}var X=r.getBoundary(U);var S=X.getCentroid();var V=X.getUpperLeft();var W=X.getLowerRight();P.push({condition:{maxY:V.y-R,minY:V.y+R},fixedPosition:{y:V.y},guidePosition:{y:V.y},id:T});P.push({condition:{maxY:W.y-R,minY:W.y+R},fixedPosition:{y:W.y},guidePosition:{y:W.y},id:T});P.push({condition:{maxX:V.x-R,minX:V.x+R},fixedPosition:{x:V.x},guidePosition:{x:V.x},id:T});P.push({condition:{maxX:W.x-R,minX:W.x+R},fixedPosition:{x:W.x},guidePosition:{x:W.x},id:T});P.push({condition:{maxX:S.x-R,minX:S.x+R},fixedPosition:{x:S.x},guidePosition:{x:S.x},id:T});P.push({condition:{maxY:S.y-R,minY:S.y+R,},fixedPosition:{y:S.y},guidePosition:{y:S.y},id:T})});function A(){P.push({condition:{minX:g+z},fixedPosition:{x:g+z}})}function I(){P.push({condition:{maxX:i-z},fixedPosition:{x:i-z}})}function F(){P.push({condition:{maxY:q-z},fixedPosition:{y:q-z}})}function B(){P.push({condition:{minY:m+z},fixedPosition:{y:m+z}})}function D(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var U=r.getNearestBaseLaneIndexAsDirection(j,"upper");if(U>0){var T=S[U-1];var V=r.getBoundary(T).getHeight()-N;P.push({condition:{minY:m-V},fixedPosition:{y:m-V}})}}}function H(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var W=r.getNearestBaseLaneIndexAsDirection(j,"upper");var T=S[W];var Y=r.getBoundary(T).getHeight()-N;P.push({condition:{maxY:m+Y},fixedPosition:{y:m+Y}});if(W===0){var V=r.getBoundaryOfInnerShapesGroup(j);if(V){P.push({condition:{maxY:V.getUpperCenter().y-C},fixedPosition:{y:V.getUpperCenter().y-C}})}}}if(r.isVerticalLane(j)){var X=r.getSmallestBaseLane(j);var Y=r.getExceptTitleLaneArea(X).getHeight()-N;P.push({condition:{maxY:m+Y},fixedPosition:{y:m+Y}});var V=r.getBoundaryOfInnerShapesGroup(j);if(V){var Z=r.getRootLane(j);var U=r.getBoundary(Z).getHeight()-r.getExceptTitleLaneArea(Z).getHeight();P.push({condition:{maxY:V.getUpperCenter().y-C-U},fixedPosition:{y:V.getUpperCenter().y-C-U}})}}}function O(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var V=r.getNearestBaseLaneIndexAsDirection(j,"low");var T=S[V];var X=r.getBoundary(T).getHeight()-N;P.push({condition:{minY:q-X},fixedPosition:{y:q-X}});if(V===S.length-1){var U=r.getBoundaryOfInnerShapesGroup(j);if(U){P.push({condition:{minY:U.getLowerCenter().y+C},fixedPosition:{y:U.getLowerCenter().y+C}})}}}if(r.isVerticalLane(j)){var W=r.getSmallestBaseLane(j);var X=r.getExceptTitleLaneArea(W).getHeight()-N;P.push({condition:{minY:q-X},fixedPosition:{y:q-X}});var U=r.getBoundaryOfInnerShapesGroup(j);if(U){P.push({condition:{minY:U.getLowerCenter().y+C},fixedPosition:{y:U.getLowerCenter().y+C}})}}}function E(){if(r.isHorizontalLane(j)){var S=r.getBaseLanes(j);var U=r.getNearestBaseLaneIndexAsDirection(j,"low");if(U0){var T=S[U-1];var V=r.getBoundary(T).getWidth()-N;P.push({condition:{maxX:i+V},fixedPosition:{x:i+V}})}}}if(b(Q)){F()}if(a(Q)){B()}if(f(Q)){I()}if(l(Q)){A()}if(r.isLane(j)){if(b(Q)){D();H()}if(a(Q)){O();E()}if(f(Q)){M();G()}if(l(Q)){K();L()}}return P};var c=function(A,D){var B={x:D.x,y:D.y};if(!x._CONFIG.AUTOMATIC_GUIDANCE){return B}var z=function(F){if(!F){return B}if(F.x&&!F.y){return{x:F.x,y:B.y}}if(F.y&&!F.x){return{x:B.x,y:F.y}}if(F.x&&F.y){return F}return B};var C=$(A).data("correctionConditions");if(!C){return B}var E=[];$.each(C,function(G,F){var I=F.condition;var H=true;if(I.minX){if(D.x>I.minX){H=false}}if(I.maxX){if(D.xI.minY){H=false}}if(I.maxY){if(D.y4){p=4}var h=d._CANVAS._CONTAINER;var g=m.x;var e=m.y;d.setScale(p);m=c._getOffset(f);var q=m.x;var o=m.y;var l=(g-q)*p;var k=(e-o)*p;var i=h.scrollLeft;var n=h.scrollTop;$(h).scrollLeft(i+l);$(h).scrollTop(n+k);d._CANVAS.updateNavigatior()};$(b).bind("mousewheel DOMMouseScroll",function(e){if(c._CONFIG.WHEEL_SCALABLE){e.preventDefault();e.stopPropagation();if(e.originalEvent.wheelDelta>0||e.deltaY>0){a(e,true)}else{a(e,false)}}})},setDragSelectable:function(isSelectable){var renderer=this._RENDERER;var me=this,rootEle=renderer.getRootElement(),root=renderer.getRootGroup();var correctionConditionAnalysis=function(correctionConditions,offset){var fixedPosition={x:offset.x,y:offset.y};var calculateFixedPosition=function(expectedPosition){if(!expectedPosition){return fixedPosition}if(expectedPosition.x&&!expectedPosition.y){return{x:expectedPosition.x,y:fixedPosition.y}}if(expectedPosition.y&&!expectedPosition.x){return{x:fixedPosition.x,y:expectedPosition.y}}if(expectedPosition.x&&expectedPosition.y){return expectedPosition}return fixedPosition};if(!correctionConditions||!correctionConditions.length){return fixedPosition}var conditionsPassCandidates=[];$.each(correctionConditions,function(index,correctionCondition){var condition=correctionCondition.condition;var conditionsPassToFix=true;if(condition.minX){if(offset.x>condition.minX){conditionsPassToFix=false}}if(condition.maxX){if(offset.xcondition.minY){conditionsPassToFix=false}}if(condition.maxY){if(offset.yOG.Constants.RUBBER_BAND_TOLERANCE&&Math.abs(height)>OG.Constants.RUBBER_BAND_TOLERANCE){$(this).data("rubber_band_status","start");x=width<=0?first.x+width:first.x;y=height<=0?first.y+height:first.y;renderer.drawRubberBand([x,y],[Math.abs(width),Math.abs(height)])}}});$(rootEle).bind("mouseup",function(event){var isConnectMode=$(root).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);var isRectMode=$(root).data(OG.Constants.GUIDE_SUFFIX.RECT_CONNECT_MODE);if(isConnectMode==="active"||isRectMode==="active"){return}if("start"==$(this).data("rubber_band_status")&&!me._CONFIG.DRAG_PAGE_MOVABLE){var first=$(this).data("dragBox_first"),eventOffset,width,height,x,y,envelope,guide,elements=[];renderer.removeRubberBand(rootEle);if(first){eventOffset=me._getOffset(event);width=eventOffset.x-first.x;height=eventOffset.y-first.y;x=width<=0?first.x+width:first.x;y=height<=0?first.y+height:first.y;envelope=new OG.Envelope([x,y],Math.abs(width),Math.abs(height));$.each(renderer.getAllShapes(),function(index,element){if(!element.shape.geom){return}if(!envelope.isContainsAll(element.shape.geom.getVertices())){return}if(renderer.isEdge(element)){return}elements.push(element)});me.selectShapes(elements);$(this).data("dragBox",{width:width,height:height,x:x,y:y})}$(this).data("rubber_band_status","none")}});$(rootEle).bind("contextmenu",function(event){renderer.removeRubberBand(rootEle)})}else{$(rootEle).unbind("mousedown");$(rootEle).unbind("mousemove");$(rootEle).unbind("mouseup");$(rootEle).unbind("contextmenu")}},setEnableHotKey:function(d){var b=this;var c=b._RENDERER;if(d===true){var a;if(b._CONFIG.FOCUS_CANVAS_ONSELECT){a=$(c.getContainer())}else{a=$(document)}a.bind("keydown",function(e){if(!/^textarea$/i.test(e.target.tagName)&&!/^input$/i.test(e.target.tagName)){if(b._CONFIG.ENABLE_HOTKEY_CTRL_Z&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_Z){if(e.shiftKey){e.preventDefault();c.redo()}else{e.preventDefault();c.undo()}}if(b._CONFIG.ENABLE_HOTKEY_DELETE&&(e.keyCode===KeyEvent.DOM_VK_DELETE||e.keyCode===KeyEvent.DOM_VK_BACK_SPACE)){e.preventDefault();b.deleteSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_A&&b._CONFIG.SELECTABLE&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_A){e.preventDefault();b.selectAll()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_C&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_C){e.preventDefault();b.copySelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_C&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_X){e.preventDefault();b.cutSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_V&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_V){e.preventDefault();b.pasteSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_D&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_D){e.preventDefault();b.duplicateSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_G&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_G){e.preventDefault();b.groupSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_CTRL_U&&(e.ctrlKey||e.metaKey)&&e.keyCode===KeyEvent.DOM_VK_U){e.preventDefault();b.ungroupSelectedShape()}if(b._CONFIG.ENABLE_HOTKEY_SHIFT_ARROW){if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_LEFT){e.preventDefault();b._moveElements(b._getMoveTargets(),-1*(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1),0);c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_RIGHT){e.preventDefault();b._moveElements(b._getMoveTargets(),(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1),0);c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_UP){e.preventDefault();b._moveElements(b._getMoveTargets(),0,-1*(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1));c.addHistory()}if(e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_DOWN){e.preventDefault();b._moveElements(b._getMoveTargets(),0,(b._CONFIG.DRAG_GRIDABLE?(b._CONFIG.MOVE_SNAP_SIZE/2):1));c.addHistory()}}if(b._CONFIG.ENABLE_HOTKEY_ARROW){if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_LEFT){e.preventDefault();b._moveElements(b._getMoveTargets(),-1*(b._CONFIG.MOVE_SNAP_SIZE/2),0);b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_RIGHT){e.preventDefault();b._moveElements(b._getMoveTargets(),(b._CONFIG.MOVE_SNAP_SIZE/2),0);b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_UP){e.preventDefault();b._moveElements(b._getMoveTargets(),0,-1*(b._CONFIG.MOVE_SNAP_SIZE/2));b.selectShapes(b._getSelectedElement());c.addHistory()}if(!e.shiftKey&&e.keyCode===KeyEvent.DOM_VK_DOWN){e.preventDefault();b._moveElements(b._getMoveTargets(),0,(b._CONFIG.MOVE_SNAP_SIZE/2));b.selectShapes(b._getSelectedElement());c.addHistory()}}}})}else{$(c.getContainer()).unbind("keydown")}},enableRootContextMenu:function(){var a=this;var b=a._RENDERER;$.contextMenu({position:function(d,c,e){d.$menu.css({top:e+10,left:c+10})},selector:"#"+a._RENDERER.getRootElement().id,build:function(c,g){var f=a._RENDERER.getRootGroup(),d=$(f).data("copied");if(a._CONFIG.FOCUS_CANVAS_ONSELECT){$(a._RENDERER.getContainer()).focus()}return{items:{selectAll:{name:"모두 선택",callback:function(){a.selectAll()}},sep1:"---------",paste:{name:"붙여넣기",callback:function(){a.pasteSelectedShape(g)},disabled:(d?false:true)},sep2:"---------",view:{name:"스케일",items:{view_actualSize:{name:"실제 사이즈",callback:function(){a._RENDERER.setScale(1);b.addHistory()}},sep2_1:"---------",view_fitWindow:{name:"윈도우에 맞추기",callback:function(){a.fitWindow()}},sep2_2:"---------",view_25:{name:"25%",callback:function(){a._RENDERER.setScale(0.25);b.addHistory()}},view_50:{name:"50%",callback:function(){a._RENDERER.setScale(0.5);b.addHistory()}},view_75:{name:"75%",callback:function(){a._RENDERER.setScale(0.75);b.addHistory()}},view_100:{name:"100%",callback:function(){a._RENDERER.setScale(1);b.addHistory()}},view_150:{name:"150%",callback:function(){a._RENDERER.setScale(1.5);b.addHistory()}},view_200:{name:"200%",callback:function(){a._RENDERER.setScale(2);b.addHistory()}},view_300:{name:"300%",callback:function(){a._RENDERER.setScale(3);b.addHistory()}},view_400:{name:"400%",callback:function(){a._RENDERER.setScale(4);b.addHistory()}},sep2_3:"---------",view_zoomin:{name:"확대",callback:function(){a.zoomIn()}},view_zoomout:{name:"축소",callback:function(){a.zoomOut()}}}}}}}})},makeRotate:function(){var a=this;return{rotate:{name:"회전",items:{rotate_select:{name:"선택",type:"select",options:{"0":"0","45":"45","90":"90","135":"135","180":"180","-45":"-45","-90":"-90","-135":"-135","-180":"-180"},selected:"0",events:{change:function(b){a.rotateSelectedShape(b.target.value)}}},sep8_8_1:"---------",rotate_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.rotateSelectedShape(b.target.value)}}}}}}}},makeFillColor:function(){var a=this;return{fillColor:{name:"색상",items:{fillColor_select:{name:"선택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFillColorSelectedShape(b.target.value)}}}},sep5_1_1:"---------",fillColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFillColorSelectedShape(b.target.value)}}}}}}}},makeFillOpacity:function(){var a=this;return{fillOpacity:{name:"투명도",items:{fillOpacity_select:{name:"선택",type:"select",options:{"":"","0.0":"0%","0.1":"10%","0.2":"20%","0.3":"30%","0.4":"40%","0.5":"50%","0.6":"60%","0.7":"70%","0.8":"80%","0.9":"90%","1.0":"100%"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFillOpacitySelectedShape(b.target.value)}}}}}}}},makeLineStyle:function(){var a=this;return{lineStyle:{name:"선 스타일",items:{lineStyle_1:{name:"──────",type:"radio",radio:"lineStyle",value:"",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_2:{name:"---------",type:"radio",radio:"lineStyle",value:"-",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_3:{name:"············",type:"radio",radio:"lineStyle",value:".",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_4:{name:"-·-·-·-·-·",type:"radio",radio:"lineStyle",value:"-.",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_5:{name:"-··-··-··-",type:"radio",radio:"lineStyle",value:"-..",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_6:{name:"· · · · · ·",type:"radio",radio:"lineStyle",value:". ",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_7:{name:"- - - - -",type:"radio",radio:"lineStyle",value:"- ",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_8:{name:"─ ─ ─ ─",type:"radio",radio:"lineStyle",value:"--",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_9:{name:"- ·- ·- ·-",type:"radio",radio:"lineStyle",value:"- .",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_10:{name:"--·--·--·-",type:"radio",radio:"lineStyle",value:"--.",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}},lineStyle_11:{name:"--··--··--",type:"radio",radio:"lineStyle",value:"--..",events:{change:function(b){a.setLineStyleSelectedShape(b.target.value)}}}}}}},makeLineColor:function(){var a=this;return{lineColor:{name:"선 색상",items:{lineColor_select:{name:"석택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setLineColorSelectedShape(b.target.value)}}}},sep5_4_1:"---------",lineColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLineColorSelectedShape(b.target.value)}}}}}}}},makeLineWidth:function(){var a=this;return{lineWidth:{name:"선 두께",items:{lineWidth_select:{name:"선택",type:"select",options:{0:"",1:"1px",2:"2px",3:"3px",4:"4px",5:"5px",6:"6px",8:"8px",10:"10px",12:"12px",16:"16px",24:"24px"},selected:0,events:{change:function(b){if(b.target.value!==0){a.setLineWidthSelectedShape(b.target.value)}}}},sep5_5_1:"---------",lineWidth_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLineWidthSelectedShape(b.target.value)}}}}}}}},makeFont:function(){var a=this;return{text:{name:"글꼴",items:{fontFamily:{name:"폰트",items:{fontFamily_1:{name:'Arial',type:"radio",radio:"fontFamily",value:"Arial",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_2:{name:"Comic Sans MS",type:"radio",radio:"fontFamily",value:"Comic Sans MS",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_3:{name:"Courier New",type:"radio",radio:"fontFamily",value:"Courier New",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_4:{name:'Garamond',type:"radio",radio:"fontFamily",value:"Garamond",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_5:{name:'Georgia',type:"radio",radio:"fontFamily",value:"Georgia",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_6:{name:"Lucida Console",type:"radio",radio:"fontFamily",value:"Lucida Console",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_7:{name:"MS Gothic",type:"radio",radio:"fontFamily",value:"MS Gothic",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_8:{name:"MS Sans Serif",type:"radio",radio:"fontFamily",value:"MS Sans Serif",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_9:{name:'Verdana',type:"radio",radio:"fontFamily",value:"Verdana",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},fontFamily_10:{name:"Times New Roman",type:"radio",radio:"fontFamily",value:"Times New Roman",events:{change:function(b){a.setFontFamilySelectedShape(b.target.value)}}},sep6_1_1:"---------",fontFamily_custom:{name:"Custom",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontFamilySelectedShape(b.target.value)}}}}}},fontColor:{name:"글 색상",items:{fontColor_select:{name:"선택",type:"select",options:{"":"",white:"하양",gray:"회색",blue:"파랑",red:"빨강",yellow:"노랑",orange:"오렌지",green:"녹색",black:"검정"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFontColorSelectedShape(b.target.value)}}}},sep6_1_2:"---------",fontColor_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontColorSelectedShape(b.target.value)}}}}}},fontSize:{name:"글 크기",items:{fontSize_select:{name:"선택",type:"select",options:{"":"","6":"6","8":"8","9":"9","10":"10","11":"11","12":"12","14":"14","18":"18","24":"24","36":"36","48":"48","72":"72"},selected:"",events:{change:function(b){if(b.target.value!==""){a.setFontSizeSelectedShape(b.target.value)}}}},sep6_1_3:"---------",fontSize_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setFontSizeSelectedShape(b.target.value)}}}}}},sep6_1:"---------",fontWeight_bold:{name:'굵게',type:"checkbox",events:{change:function(b){if(b.target.checked){a.setFontWeightSelectedShape("bold")}else{a.setFontWeightSelectedShape("normal")}}}},fontWeight_italic:{name:'이탤릭',type:"checkbox",events:{change:function(b){if(b.target.checked){a.setFontStyleSelectedShape("italic")}else{a.setFontStyleSelectedShape("normal")}}}},sep6_2:"---------",position:{name:"글 위치",items:{position_left:{name:"왼쪽",type:"radio",radio:"position",value:"left",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_center:{name:"가운데",type:"radio",radio:"position",value:"center",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_right:{name:"오른쪽",type:"radio",radio:"position",value:"right",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_top:{name:"위",type:"radio",radio:"position",value:"top",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}},position_bottom:{name:"아래",type:"radio",radio:"position",value:"bottom",events:{change:function(b){a.setLabelPositionSelectedShape(b.target.value)}}}}},vertical:{name:"수직 정렬",items:{vertical_top:{name:"위",type:"radio",radio:"vertical",value:"top",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}},vertical_middle:{name:"가운데",type:"radio",radio:"vertical",value:"middle",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}},vertical_bottom:{name:"아래",type:"radio",radio:"vertical",value:"bottom",events:{change:function(b){a.setLabelVerticalSelectedShape(b.target.value)}}}}},horizontal:{name:"수평 정렬",items:{vertical_start:{name:"왼쪽",type:"radio",radio:"horizontal",value:"start",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}},horizontal_middle:{name:"가운데",type:"radio",radio:"horizontal",value:"middle",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}},horizontal_end:{name:"오른쪽",type:"radio",radio:"horizontal",value:"end",events:{change:function(b){a.setLabelHorizontalSelectedShape(b.target.value)}}}}},sep6_5:"---------",textRotate:{name:"글 회전각",items:{textRotate_select:{name:"선택",type:"select",options:{"0":"0","45":"45","90":"90","135":"135","180":"180","-45":"-45","-90":"-90","-135":"-135","-180":"-180"},selected:"0",events:{change:function(b){a.setLabelAngleSelectedShape(b.target.value)}}},sep6_6_1:"---------",textRotate_custom:{name:"직접입력",type:"text",events:{keyup:function(b){if(b.target.value!==""){a.setLabelAngleSelectedShape(b.target.value)}}}}}}}}}},makeBring:function(){var a=this;return{bringToFront:{name:"맨 앞으로 가져오기",items:{bringToFront:{name:"맨 앞으로 가져오기",callback:function(){a.bringToFront()}},bringForward:{name:"앞으로 가져오기",callback:function(){a.bringForward()}}}}}},makeSend:function(){var a=this;return{sendToBack:{name:"맨 뒤로 보내기",items:{sendToBack:{name:"맨 뒤로 보내기",callback:function(){a.sendToBack()}},sendBackward:{name:"뒤로 보내기",callback:function(){a.sendBackward()}}}}}},makeDelete:function(){var a=this;return{"delete":{name:"삭제",callback:function(){a.deleteSelectedShape()}}}},makeCopy:function(){var a=this;return{copy:{name:"복사",callback:function(){a.copySelectedShape()}}}},makeAlign:function(){var a=this;return{align:{name:"도형 정렬",items:{Top:{name:"위로정렬",type:"radio",radio:"align",value:"Top",events:{change:function(b){a._RENDERER.alignTop();a._RENDERER.addHistory()}}},Left:{name:"왼쪽정렬",type:"radio",radio:"align",value:"Left",events:{change:function(b){a._RENDERER.alignLeft();a._RENDERER.addHistory()}}},Right:{name:"오른쪽정렬",type:"radio",radio:"align",value:"Right",events:{change:function(b){a._RENDERER.alignRight();a._RENDERER.addHistory()}}},Bottom:{name:"아래로정렬",type:"radio",radio:"align",value:"Bottom",events:{change:function(b){a._RENDERER.alignBottom();a._RENDERER.addHistory()}}}}}}},makeFormat:function(){return{format:{name:"형식",items:this.mergeContextMenu(this.makeFillColor(),this.makeFillOpacity(),this.makeRotate(),this.makeLineStyle(),this.makeLineColor(),this.makeLineWidth())}}},makeMultiContextMenu:function(){return this.mergeContextMenu(this.makeDelete(),this.makeCopy(),this.makeAlign())},mergeContextMenu:function(){var d={};for(var c=0,a=arguments.length;c=a._CONFIG.SCALE_MIN){a._RENDERER.setScale(a._CONFIG.SCALE-a._CONFIG.SCALE*0.1)}a._RENDERER.addHistory()},fitWindow:function(){var b=this,a=b._RENDERER.getContainer();b._RENDERER.fitCanvasSize([a.clientWidth,a.clientHeight],true);b._RENDERER.addHistory()},_isContainsConnectedShape:function(a,k){var g=this,e,l,h,b,f=false,d=false,c;e=$(a).attr("_from");l=$(a).attr("_to");if(e){h=g._getShapeFromTerminal(e)}if(l){b=g._getShapeFromTerminal(l)}for(var c=0,j=k.length;c0){c._copyChildren(h,i)}}})},_deselectChildren:function(b){var c=this,a=b.childNodes;$.each(a,function(d,e){if($(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE){if(e.childNodes.length>0){c._deselectChildren(e);c._delSelectedElement(e)}if($(e).attr("_selected")==="true"){c._RENDERER.removeGuide(e);$(e).draggable("destroy")}}})},_isParentSelected:function(b){var c=this,a=b.parentNode;if(a){if(c._isParentSelected(a)){return true}if($(a).attr("_type")===OG.Constants.NODE_TYPE.SHAPE&&$(a).attr("_selected")==="true"){return true}}return false},_num:function(a){return parseInt(a,10)},_grid:function(c,a){var b=this;if(a){return b._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(c,b._CONFIG.MOVE_SNAP_SIZE/2):c}else{return b._CONFIG.DRAG_GRIDABLE?OG.Util.roundGrid(c,b._CONFIG.MOVE_SNAP_SIZE):c}},_isSelectable:function(a){var b=this;return b._CONFIG.SELECTABLE&&a.SELECTABLE},_isConnectable:function(a){var b=this;return b._CONFIG.CONNECTABLE&&a.CONNECTABLE},_isConnectableFrom:function(a){var b=this;return a.ENABLE_FROM},_isConnectableTo:function(a){var b=this;return a.ENABLE_TO},_isSelfConnectable:function(a){var b=this;return b._CONFIG.SELF_CONNECTABLE&&a.SELF_CONNECTABLE},_isConnectCloneable:function(a){var b=this;return b._CONFIG.CONNECT_CLONEABLE&&a.CONNECT_CLONEABLE},_isMovable:function(a){var b=this;return(b._CONFIG.SELECTABLE&&a.SELECTABLE)&&(b._CONFIG.MOVABLE&&b._CONFIG.MOVABLE_[a.TYPE]&&a.MOVABLE)},_isDeletable:function(a){var b=this;return(b._CONFIG.DELETABLE&&a.DELETABLE)&&(b._CONFIG.DELETABLE&&b._CONFIG.DELETABLE_[a.TYPE]&&a.DELETABLE)},_isConnectStyleChangable:function(a){var b=this;return(b._CONFIG.CONNECT_STYLE_CHANGE&&a.CONNECT_STYLE_CHANGE)&&(b._CONFIG.CONNECT_STYLE_CHANGE&&b._CONFIG.CONNECT_STYLE_CHANGE_[a.TYPE]&&a.CONNECT_STYLE_CHANGE)},_isResizable:function(a){var b=this;return(b._CONFIG.SELECTABLE&&a.SELECTABLE)&&(b._CONFIG.RESIZABLE&&b._CONFIG.RESIZABLE_[a.TYPE]&&a.RESIZABLE)},_isLabelEditable:function(a){var b=this;return b._CONFIG.LABEL_EDITABLE&&b._CONFIG.LABEL_EDITABLE_[a.TYPE]&&a.LABEL_EDITABLE},_addSelectedElement:function(a){if(undefined==this.selectedElements){this.selectedElements={}}this.selectedElements[a.attributes.id.value]=a;if(a.shape){a.shape.onSelectShape()}},_delSelectedElement:function(a){if(this.selectedElements){delete this.selectedElements[a.attributes.id.value];if(a.shape){a.shape.onDeSelectShape()}}},_getSelectedElement:function(){var a,b=[];for(a in this.selectedElements){b.push(this.selectedElements[a])}return b},_isSelectedElement:function(c){var a=false;if(c&&c.id){for(var b in this.selectedElements){if(b===c.id){a=true}}}return a},_removeAllSelectedElement:function(){var b;for(b in this.selectedElements){var a=this.selectedElements[b];delete this.selectedElements[b];if(a&&a.shape){a.shape.onDeSelectShape()}}},setConnectGuide:function(e,d){var h=this._RENDERER;var i=this,m,g,f,c,b,j=h.getRootGroup();var j=h.getRootGroup();var l=function(u){var r=i._CONFIG.EDGE_MOVE_DELAY_SIZE;var p=[];var o=[];var v=$(u).data("type");var t=e.shape.geom.getVertices();var n;if(!i._CONFIG.AUTOMATIC_GUIDANCE){n=e.shape.geom.getVertices();$.each(n,function(w,x){o.push(x)})}else{var q=h.getAllEdges();$.each(q,function(w,x){n=x.shape.geom.getVertices();$.each(n,function(y,z){o.push(z)})})}if(v===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var s=$(u).data("index");if(s===0||s===t.length-1){$.each(j.childNodes,function(x,z){if($(z).attr("_type")===OG.Constants.NODE_TYPE.SHAPE&&$(z).attr("_shape")!==OG.Constants.SHAPE_TYPE.EDGE){var B=h.getBoundary(z);if(B&&B._upperLeft){var y=B._upperLeft;var A=B._width;var w=B._height;p.push({condition:{minX:y.x+(A/2)-r,maxX:y.x+(A/2)+r,minY:y.y,maxY:y.y+w,},fixedPosition:{x:y.x+(A/2)},id:x});p.push({condition:{minX:y.x,maxX:y.x+A,minY:y.y+(w/2)-r,maxY:y.y+(w/2)+r,},fixedPosition:{y:y.y+(w/2)},id:x})}}})}}$.each(o,function(x,w){p.push({condition:{minX:w.x-r,maxX:w.x+r,},fixedPosition:{x:w.x},id:x});p.push({condition:{minY:w.y-r,maxY:w.y+r,},fixedPosition:{y:w.y},id:x})});$(u).data("correctionConditions",p)};var k=function(q,r){var o={x:r.x,y:r.y};var n=function(t){if(!t){return o}if(t.x&&!t.y){return{x:t.x,y:o.y}}if(t.y&&!t.x){return{x:o.x,y:t.y}}if(t.x&&t.y){return t}return o};var p=$(q).data("correctionConditions");if(!p){return o}var s=[];$.each(p,function(u,t){var w=t.condition;var v=true;if(w.minX){if(r.xw.maxX){v=false}}if(w.minY){if(r.yw.maxY){v=false}}if(v){s.push(t)}});$.each(s,function(t,u){o=n(u.fixedPosition)});return o};var a=function(p){var q;var o=e.shape.geom.getVertices();if($(p).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var n=$(p).data("index");if(n||n===0){if(n===0){q="from"}if(n===o.length-1){q="to"}}}return q};$(e).bind({mousemove:function(r){if(!i._isConnectable(e.shape)){return}var p=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var s=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var n=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER);var q=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);var o=$(j).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);if(!p||n||q||o){return}if(s){if(i._CONFIG.SPOT_ON_SELECT&&$(e).attr("_selected")!="true"){return}c=i._getOffset(r);var t=h.createVirtualSpot(c.x,c.y,e);if(t){$(t).bind({mousedown:function(){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,true)},mouseup:function(){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false)}});$(t).draggable({start:function(v){h.removeAllGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,true);var x=i._getOffset(v);var I=$(this).data("vertice");var E=e.shape.geom;$(this).data("offset",{x:x.x-I.x,y:x.y-I.y});var w=$(this).data("prev");var A=$(this).data("next");var C=E.getVertices();var y=$(this).data("offset");var u=x.x-y.x;var K=x.y-y.y;var J=E.convertCoordinate([u,K]);f=h.getCircleSpots(e);$.each(f,function(N,L){var M=$(L).data("index");if(M>=A){$(L).data("index",M+1)}});C.splice(A,0,J);E.setVertices(C);$(this).attr("name",OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT);$(this).data("index",A);var D=true;if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var B=$(this).data("index");if(B===0&&B===C.length-1){D=false}}if(D){var G=$(e).attr("_from");var F=$(e).attr("_to");if(G){var z=h._getPositionFromTerminal(G);C[0]=E.convertCoordinate([z.x,z.y])}if(F){var H=h._getPositionFromTerminal(F);C[C.length-1]=E.convertCoordinate([H.x,H.y])}E.setVertices(C)}$(this).data("corrections",l(t));e=h.drawEdge(new OG.PolyLine(C),E.style,e.id);h.removeRubberBand(h.getRootElement());h.selectSpot(t)},drag:function(w){if(!h._getREleById(t.id)){h.removeAllConnectGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);return}var x=i._getOffset(w);var B=$(this).data("offset");var A=x.x-B.x;var z=x.y-B.y;var v=e.shape.geom.getVertices();var y=k(t,{x:A,y:z});A=y.x;z=y.y;h.setAttr(t,{cx:A});h.setAttr(t,{cy:z});var u=$(this).data("index");v[u].x=A;v[u].y=z;h.drawEdge(new OG.PolyLine(v),e.shape.geom.style,e.id);h.trimConnectIntersection(e)},stop:function(w){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);var x=i._getOffset(w);var B=$(this).data("offset");var v=$(this).data("index");var A=x.x-B.x;var z=x.y-B.y;var u=e.shape.geom.getVertices();var y=k(t,{x:A,y:z});y.x=i._grid(y.x,"move");y.y=i._grid(y.y,"move");A=y.x;z=y.y;u[v].x=A;u[v].y=z;h.drawEdge(new OG.PolyLine(u),e.shape.geom.style,e.id);h.removeConnectGuide(e);h.removeVirtualSpot(e);h.trimConnectInnerVertice(e);h.trimConnectIntersection(e);h.trimEdge(e);h.addHistory()}})}}},mouseout:function(p){if(!i._isConnectable(e.shape)){return}var n=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var q=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var o=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);if(!n){return}if(!q){if(o){return}h.removeConnectGuide(e)}if(q){if(o){return}b=false;c=i._getOffset(p);g=h.getSpots(e);$(g).each(function(s,t){m=h.getBBox(t);if(c.x>=m.x&&c.x<=m.x2&&c.y>=m.y&&c.y<=m.y2){b=true}});var r=h.getVirtualSpot(e);if(r){m=h.getBBox(r);if(c.x>=m.x&&c.x<=m.x2&&c.y>=m.y&&c.y<=m.y2){b=true}}if(!b){h.removeConnectGuide(e);h.removeVirtualSpot(e)}}p.stopImmediatePropagation()},mouseover:function(s){if(!i._isConnectable(e.shape)){return}var n;var o=i._CONFIG.DEFAULT_STYLE.CONNECTABLE_HIGHLIGHT;var q=$(e).attr("_type")===OG.Constants.NODE_TYPE.SHAPE;var t=$(e).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE;var r=$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG);var p=$(j).data(OG.Constants.GUIDE_SUFFIX.LINE_CONNECT_MODE);if(!q){return}if(!t){if(r){return}h.removeAllConnectGuide();h.drawConnectGuide(e)}if(t){if(i._CONFIG.SPOT_ON_SELECT&&$(e).attr("_selected")!="true"){return}if(p){return}if(r){return}h.removeOtherConnectGuide(e);n=h.drawConnectGuide(e);if(n&&n.spots){$(n.spots).each(function(u,v){$(v).bind({mouseover:function(){var w=false;if($(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG)){w=true}if(!w){h.selectSpot(v);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,true)}},mouseout:function(){var w=false;if($(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG)){w=true}if(!w){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false)}}});$(v).draggable({start:function(w){h.removeAllGuide();h.toFront(e);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,true);var z=i._getOffset(w);var K=$(this).data("vertice");var G=e.shape.geom;var E=G.getVertices();$(this).data("offset",{x:z.x-K.x,y:z.y-K.y});var F=true;if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){var D=$(this).data("index");if(D===0||D===E.length-1){F=false}}$(this).data("needToRedrawVertices",F);if(F){var I=$(e).attr("_from");var H=$(e).attr("_to");if(I){var B=h._getPositionFromTerminal(I);E[0]=G.convertCoordinate([B.x,B.y])}if(H){var J=h._getPositionFromTerminal(H);E[E.length-1]=G.convertCoordinate([J.x,J.y])}G.setVertices(E)}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){$(this).data("corrections",l(v));h.remove(n.bBox);h.removeRubberBand(h.getRootElement())}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){E=G.getVertices();var y=$(this).data("prev");var A=$(this).data("next");if(y===0){var C=e.shape.geom.convertCoordinate([E[0].x,E[0].y]);E.splice(y,0,C);$(this).data("prev",y+1);$(this).data("next",A+1);A=A+1}if(A===E.length-1){var x=G.convertCoordinate([E[E.length-1].x,E[E.length-1].y]);E.splice(A,0,x)}G.setVertices(E);$(this).data("corrections",l(v));h.remove(n.bBox);h.removeRubberBand(h.getRootElement())}},drag:function(z){if(!h._getREleById(v.id)){h.removeAllConnectGuide();$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);return}var B=i._getOffset(z);var C=$(this).data("offset");var y=B.x-C.x;var K=B.y-C.y;var F=e.shape.geom.getVertices();var G=k(v,{x:y,y:K});if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){y=G.x;K=G.y;h.setAttr(v,{cx:y});h.setAttr(v,{cy:K});var E=$(this).data("index");F[E].x=y;F[E].y=K}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){y=G.x;K=G.y;var x=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var J=x.h;var H=$(this).data("direction");var A=$(this).data("prev");var D=$(this).data("next");if(H==="vertical"){F[A].x=y;F[D].x=y;h.setAttr(v,{x:y-(J/2)})}if(H==="horizontal"){F[A].y=K;F[D].y=K;h.setAttr(v,{y:K-(J/2)})}}h.drawEdge(new OG.PolyLine(F),e.shape.geom.style,e.id);if($(this).data("needToRedrawVertices")){h.trimConnectIntersection(e)}var w=a(v);var I=h.getFrontForCoordinate([B.x,B.y]);$.each(h.getAllNotEdges(),function(L,M){if(I&&w){if(M.id===I.id){h.setHighlight(M,o);h.drawConnectGuide(M)}else{h.removeHighlight(M,o);h.removeConnectGuide(M)}}else{h.removeHighlight(M,o);h.removeConnectGuide(M)}})},stop:function(H){$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_DRAG,false);$(j).data(OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_EVENT_MOUSEROVER,false);var N=i._getOffset(H);var x=$(this).data("offset");var z=$(this).data("index");var L=N.x-x.x;var J=N.y-x.y;var y=e.shape.geom.getVertices();var B=k(v,{x:L,y:J});B.x=i._grid(B.x,"move");B.y=i._grid(B.y,"move");if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_CIRCLE){L=B.x;J=B.y;h.setAttr(v,{cx:L});h.setAttr(v,{cy:J});var z=$(this).data("index");y[z].x=L;y[z].y=J}if($(this).data("type")===OG.Constants.CONNECT_GUIDE_SUFFIX.SPOT_RECT){L=B.x;J=B.y;var w=i._CONFIG.DEFAULT_STYLE.CONNECT_GUIDE_SPOT_RECT;var C=w.h;var M=$(this).data("direction");var D=$(this).data("prev");var E=$(this).data("next");if(M==="vertical"){y[D].x=L;y[E].x=L;h.setAttr(v,{x:L-(C/2)})}if(M==="horizontal"){y[D].y=J;y[E].y=J;h.setAttr(v,{y:J-(C/2)})}}h.drawEdge(new OG.PolyLine(y),e.shape.geom.style,e.id);h.removeConnectGuide(e);h.removeVirtualSpot(e);var A=a(v);var I=h.getFrontForCoordinate([N.x,N.y]);if(I){h.removeHighlight(I,o)}if(A&&I){var F=[L,J];var K=h.createTerminalString(I,F);var G=i._isConnectable(I.shape);if(G){if(A==="from"){if(i._isConnectableFrom(I.shape)){h.connect(K,null,e,e.shape.geom.style)}}if(A==="to"){if(i._isConnectableTo(I.shape)){h.connect(null,K,e,e.shape.geom.style)}}}}if(A&&!I){h.disconnectOneWay(e,A)}h.trimConnectInnerVertice(e);h.trimConnectIntersection(e);h.trimEdge(e);h.addHistory()}})})}}s.stopImmediatePropagation()}})}};OG.handler.EventHandler.prototype.constructor=OG.handler.EventHandler;OG.EventHandler=OG.handler.EventHandler;OG.handler.RemoteUser=function(b,a,c){this.key=b;this.name=a;this.sessionId=c;this.isMaster=false;this.editable=false};OG.handler.RemoteUser.prototype={getKey:function(){return this.key},setKey:function(a){this.key=a},getName:function(){return this.name},setName:function(a){this.name=a},getSessionId:function(){return this.sessionId},setSessionId:function(a){this.sessionId=a},getIsMaster:function(){return this.isMaster},setIsMaster:function(a){this.isMaster=a},getEditable:function(){return this.editable},setEditable:function(a){this.editable=a}};OG.handler.RemoteUser.prototype.constructor=OG.handler.RemoteUser;OG.RemoteUser=OG.handler.RemoteUser();OG.handler.RemoteRepo={};OG.handler.RemoteHandler=function(){this._REPO=OG.handler.RemoteRepo;this._CLASSNAME="org.uengine.opengraph.RemoteService";this._SESSIONID=null;this._ENCODESUFFIX="_%$";this._SCHEDULER=null};OG.handler.RemoteHandler.prototype={encodeJson:function(a){return JSON.stringify(a).replace(/"/gi,this._ENCODESUFFIX)},getRepo:function(){return this._REPO},setCanvasForIdentifier:function(b,a){var c=this.getRepo();if(!c[a]){c[a]={canvas:null,users:[]}}c[a].canvas=b;return c[a]},getCanvasByIdentifier:function(a){var b=this.getRepo();if(!b[a]){return null}return b[a].canvas},getRemote:function(c){var b={__className:this._CLASSNAME};if(c){for(var a in c){b[a]=c[a]}}return new MetaworksObject(b,"body")},convertRemoteUser:function(b){var a=new OG.handler.RemoteUser();a.setKey(b.key);a.setName(b.name);a.setSessionId(b.sessionId);a.setIsMaster(b.isMaster);a.setEditable(b.editable);return a},closeRemote:function(b){var a=b.__objectId;$("#objDiv_"+a).remove();delete mw3.objects[a]},getCanvasId:function(a){return a._CONTAINER.id},startRemote:function(c,b,a,e){var d=this;if(!c||!b||!a){return}if(!a.key||!a.name){return}c.setRemotable(true);c.setIdentifier(b);d.setCanvasForIdentifier(c,b);d.registeToServer(b,a,function(f){e(f)})},getSelfSession:function(d){if(this._SESSIONID){d(this._SESSIONID);return}var b=this;var c=this.getRemote();var a=c.__objectId;c.selfSession(null,function(){var e=mw3.objects[a]["currentSessionId"];b.closeRemote(c);if(e){b._SESSIONID=e}d(e)})},registeToServer:function(d,c,g){var e=this,b;var f=this.getRemote({identifier:d,remoteUser:e.encodeJson(c)});var a=f.__objectId;f.registe(null,function(i){b=mw3.objects[a];e.closeRemote(f);var h=e.convertRemoteUser(JSON.parse(b.remoteUser));g(h)})},updateRemoteUser:function(e){var d=this;var g=JSON.parse(e);var b=g.identifier;var c=g.remoteUsers;if(!this.getRepo()[b]){return}var f=[];var a=this.getCanvasByIdentifier(b);this.getSelfSession(function(j){$.each(c,function(k,l){if(l.sessionId&&l.sessionId==j){a.setRemoteEditable(l.editable);a.setRemoteIsMaster(l.isMaster);$(a.getRootElement()).trigger("remoteStatusUpdated",[l])}if(l.isMaster){f.push(d.convertRemoteUser(l))}});$.each(c,function(k,l){if(!l.isMaster){f.push(d.convertRemoteUser(l))}});d.getRepo()[b]["users"]=f;var i=$("#"+d.getCanvasId(a));i.find(".userPanel").remove();var h=$('
      ');h.css({position:"absolute",top:"0px",left:"0px"});i.append(h);$.each(f,function(m,n){var l=$('
      ');if(n.isMaster){l.append(""+n.getName()+" (Master)")}else{l.append(""+n.getName()+" ");if(a.getRemoteIsMaster()){var k;if(!n.editable){k=$("");k.data("identifier",b);k.data("mode","readonly");k.data("user",n)}else{k=$("");k.data("identifier",b);k.data("mode","editable");k.data("user",n)}l.append(k);k.click(function(){var q=$(this).data("identifier");var p=$(this).data("mode");var o=$(this).data("user");if(p==="readonly"){o.setEditable(true)}else{o.setEditable(false)}d.updateUserState(q,o,function(){})})}}h.append(l)})})},updateUserState:function(d,c,g){var e=this,b;var f=this.getRemote({identifier:d,remoteUser:e.encodeJson(c)});var a=f.__objectId;f.updateUserState(null,function(){b=mw3.objects[a];e.closeRemote(f);var h=e.convertRemoteUser(JSON.parse(b.remoteUser));g(h)})},updateCanvas:function(d){var e=JSON.parse(d);var c=e.identifier;var b=e.canvasData;var a=this.getCanvasByIdentifier(c);if(!a||!a.getRemotable()){return}a.setRemoteDuring(true);a.loadJSON(b);a.setRemoteDuring(false);$(a.getRootElement()).trigger("updateCanvas",[b])},broadCastCanvas:function(d,g){if(!d.getRemotable()){g(null);return}if(!d.getRemoteEditable()){g(null);return}var c=d.getIdentifier();var e=this,b;var f=this.getRemote({identifier:c,canvasData:e.encodeJson(d.toJSON())});var a=f.__objectId;f.broadCastCanvas(null,function(){b=mw3.objects[a];e.closeRemote(f);g(d)})},remoteExit:function(c,f){var d=this,b;var e=this.getRemote({identifier:c});var a=e.__objectId;e.remoteUserExited(null,function(){b=mw3.objects[a];d.closeRemote(e);f(null)})},checkExpiredRemoteCanvas:function(){if(this._SCHEDULER){return}var d=this,c,b,a;this._SCHEDULER=setInterval(function(){c=d.getRepo();for(b in c){a=c[b].canvas;if(a&&d.getCanvasId(a)&&$("#"+d.getCanvasId(a)).length){return}delete c[b];d.remoteExit(b,function(){})}},1000)}};OG.handler.RemoteHandler.prototype.constructor=OG.handler.RemoteHandler;OG.RemoteHandler=new OG.handler.RemoteHandler();OG.RemoteHandler.checkExpiredRemoteCanvas();OG.graph.Canvas=function(a,d,b,c){this._CONFIG={POOL_DROP_EVENT:false,AUTOMATIC_GUIDANCE:true,SPOT_ON_SELECT:false,BACKDOOR:{url:null,scale:100,opacity:1,width:null,height:null,container:null,container_updated:false},FAST_LOADING:false,AUTO_SLIDER_UPDATE:true,AUTO_HISTORY:false,WHEEL_SCALABLE:false,DRAG_PAGE_MOVABLE:false,FOCUS_CANVAS_ONSELECT:true,CHECK_BRIDGE_EDGE:true,STICK_GUIDE:true,SLIDER:null,REMOTE_PERFORMED_DURING:false,REMOTE_IDENTIFIER:null,REMOTEABLE:false,REMOTE_EDITABLE:false,REMOTE_ISMASTER:false,HISTORY_INDEX:0,HISTORY:[],HISTORY_SIZE:100,USE_SLIDER:true,SELECTABLE:true,DRAG_SELECTABLE:true,MOVABLE:true,MOVABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},RESIZE_CANVAS_MARGIN:5,RESIZABLE:true,RESIZABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},CONNECTABLE:true,SELF_CONNECTABLE:true,CONNECT_CLONEABLE:true,CONNECT_STYLE_CHANGE:true,CONNECT_STYLE_CHANGE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},DELETABLE:true,DELETABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},LABEL_EDITABLE:true,LABEL_EDITABLE_:{GEOM:true,TEXT:true,HTML:true,IMAGE:true,EDGE:true,GROUP:true},GROUP_DROPABLE:true,DRAG_GRIDABLE:true,ENABLE_HOTKEY:true,ENABLE_HOTKEY_CTRL_Z:true,ENABLE_HOTKEY_DELETE:true,ENABLE_HOTKEY_CTRL_A:true,ENABLE_HOTKEY_CTRL_C:true,ENABLE_HOTKEY_CTRL_V:true,ENABLE_HOTKEY_CTRL_D:true,ENABLE_HOTKEY_CTRL_G:true,ENABLE_HOTKEY_CTRL_U:true,ENABLE_HOTKEY_ARROW:true,ENABLE_HOTKEY_SHIFT_ARROW:true,ENABLE_CONTEXTMENU:true,ENABLE_ROOT_CONTEXTMENU:true,SCALE:1,SCALE_MIN:0.1,SCALE_MAX:10,EDGE_PADDING:20,LABEL_PADDING:5,LABEL_EDITOR_WIDTH:500,LABEL_EDITOR_HEIGHT:16,FROMTO_LABEL_OFFSET_TOP:15,GUIDE_LINE_SIZE:20,GUIDE_LINE_MARGIN:10,GUIDE_RECT_SIZE:8,GUIDE_MIN_SIZE:18,GUIDE_CONTROL_LINE_NUM:2,COLLAPSE_SIZE:10,MOVE_SNAP_SIZE:8,TERMINAL_SIZE:5,COPY_PASTE_PADDING:20,FIT_CANVAS_PADDING:20,AUTO_EXTENSIONAL:true,AUTO_EXTENSION_SIZE:100,CANVAS_BACKGROUND:"#f9f9f9",IMAGE_BASE:"resources/images/symbol/",IMAGE_USER:"http://processcodi.com/images/opengraph/User.png",IMAGE_SEND:"http://processcodi.com/images/opengraph/Send.png",IMAGE_RECEIVE:"http://processcodi.com/images/opengraph/Receive.png",IMAGE_MANUAL:"http://processcodi.com/images/opengraph/Manual.png",IMAGE_SERVICE:"http://processcodi.com/images/opengraph/Service.png",IMAGE_RULE:"http://processcodi.com/images/opengraph/BusinessRule.png",IMAGE_SCRIPT:"http://processcodi.com/images/opengraph/Script.png",IMAGE_MAPPER:"http://processcodi.com/images/opengraph/mapper.png",IMAGE_WEB:"http://processcodi.com/images/opengraph/w_services.png",TRIM_EDGE_ANGLE_SIZE:170,EDGE_MOVE_DELAY_SIZE:14,LANE_MIN_SIZE:50,LANE_DEFAULT_SIZE:100,POOL_DEFAULT_SIZE:[300,200],GROUP_INNER_SAPCE:10,LABEL_MIN_SIZE:0,LABEL_MAX_SIZE:1000,DEFAULT_STYLE:{SHAPE:{cursor:"default"},GEOM:{stroke:"black","fill-r":".5","fill-cx":".5","fill-cy":".5",fill:"white","fill-opacity":0,"label-position":"center"},TEXT:{stroke:"none","text-anchor":"middle"},HTML:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},IMAGE:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},SVG:{"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},EDGE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.5,"stroke-opacity":1,"edge-type":"plain","arrow-start":"none","arrow-end":"block","stroke-dasharray":"","label-position":"center","stroke-linejoin":"round",cursor:"pointer"},EDGE_SHADOW:{stroke:"#00FF00",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,"arrow-start":"none","arrow-end":"none","stroke-dasharray":"- ","edge-type":"plain",cursor:"pointer"},EDGE_HIDDEN:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":10,"stroke-opacity":0,cursor:"pointer"},GROUP:{stroke:"black",fill:"none","fill-opacity":0,"label-position":"bottom","text-anchor":"middle","vertical-align":"top"},GROUP_HIDDEN:{stroke:"black",fill:"white","fill-opacity":0,"stroke-opacity":0,cursor:"move"},GROUP_SHADOW:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":15,"stroke-opacity":0,cursor:"pointer"},GROUP_SHADOW_MAPPER:{stroke:"white",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":0,cursor:"pointer"},GUIDE_BBOX:{stroke:"#00FF00",fill:"white","fill-opacity":0,"stroke-dasharray":"- ","shape-rendering":"crispEdges",cursor:"move"},GUIDE_UL:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nwse-resize","shape-rendering":"crispEdges"},GUIDE_UR:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nesw-resize","shape-rendering":"crispEdges"},GUIDE_LL:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nesw-resize","shape-rendering":"crispEdges"},GUIDE_LR:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"nwse-resize","shape-rendering":"crispEdges"},GUIDE_LC:{stroke:"#03689a",fill:"#03689a","fill-opacity":0.5,cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_UC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_RC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_LWC:{stroke:"black",fill:"#03689a","fill-opacity":0.5,cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_FROM:{stroke:"black",fill:"#00FF00",cursor:"move","shape-rendering":"crispEdges"},GUIDE_TO:{stroke:"black",fill:"#00FF00",cursor:"move","shape-rendering":"crispEdges"},GUIDE_CTL_H:{stroke:"black",fill:"#00FF00",cursor:"ew-resize","shape-rendering":"crispEdges"},GUIDE_CTL_V:{stroke:"black",fill:"#00FF00",cursor:"ns-resize","shape-rendering":"crispEdges"},GUIDE_SHADOW:{stroke:"black",fill:"none","stroke-dasharray":"- ","shape-rendering":"crispEdges"},GUIDE_LINE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.2,"stroke-opacity":1,"stroke-dasharray":"","arrow-end":"block","stroke-linejoin":"round",cursor:"pointer"},GUIDE_LINE_ESSENSIA:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1.2,"stroke-opacity":1,"stroke-dasharray":"","arrow-start":"diamond","arrow-end":"none","stroke-linejoin":"round",cursor:"pointer"},GUIDE_VIRTUAL_EDGE:{stroke:"black",fill:"none","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,"stroke-dasharray":"- ","stroke-linejoin":"round","arrow-start":"none","arrow-end":"none"},GUIDE_LINE_AREA:{stroke:"#ffffff",fill:"#ffffff","fill-opacity":0.1,"stroke-width":1,"stroke-opacity":0.2,cursor:"pointer"},GUIDE_RECT_AREA:{stroke:"black",fill:"#ffffff","fill-opacity":0,"stroke-width":1,"stroke-opacity":1,cursor:"pointer"},RUBBER_BAND:{stroke:"#0000FF",opacity:0.2,fill:"#0077FF"},DROP_OVER_BBOX:{stroke:"#0077FF",fill:"none",opacity:0.3,"shape-rendering":"crispEdges"},LABEL:{"font-size":12,"font-color":"black",fill:"none"},LABEL_EDITOR:{position:"absolute",overflow:"visible",resize:"none","text-align":"center",display:"block",padding:0},COLLAPSE:{stroke:"black",fill:"none","fill-opacity":0,cursor:"pointer","shape-rendering":"crispEdges"},COLLAPSE_BBOX:{stroke:"none",fill:"none","fill-opacity":0},BUTTON:{stroke:"#9FD7FF",fill:"white","fill-opacity":0,cursor:"pointer","shape-rendering":"crispEdges"},CONNECT_GUIDE_EVENT_AREA:{stroke:"#ffffff",fill:"none","fill-opacity":0,"stroke-width":20,"stroke-opacity":0},CONNECT_GUIDE_BBOX:{stroke:"#00FF00",fill:"none","stroke-dasharray":"- ","shape-rendering":"crispEdges"},CONNECT_GUIDE_BBOX_EXPEND:10,CONNECT_GUIDE_SPOT_CIRCLE:{r:7,stroke:"#A6A6A6","stroke-width":1,fill:"#FFE400","fill-opacity":0.5,cursor:"pointer"},CONNECT_GUIDE_SPOT_RECT:{stroke:"#A6A6A6","stroke-width":1,fill:"#FFE400","fill-opacity":0.2,cursor:"ns-resize",w:20,h:10},CONNECTABLE_HIGHLIGHT:{"stroke-width":2},NOT_CONNECTABLE_HIGHLIGHT:{fill:"#FAAFBE","fill-opacity":0.5}}};this._RENDERER=a?new OG.RaphaelRenderer(a,d,b,c,this._CONFIG):null;this._RENDERER._CANVAS=this;this._HANDLER=new OG.EventHandler(this._RENDERER,this._CONFIG);this._CONTAINER=OG.Util.isElement(a)?a:document.getElementById(a)};OG.graph.Canvas.prototype={fastLoadingON:function(){this._CONFIG.FAST_LOADING=true},fastLoadingOFF:function(){this._CONFIG.FAST_LOADING=false;this.updateSlider()},getEventHandler:function(){return this._HANDLER},setRemoteDuring:function(a){this._CONFIG.REMOTE_PERFORMED_DURING=a},getRemoteDuring:function(){return this._CONFIG.REMOTE_PERFORMED_DURING},setIdentifier:function(a){this._CONFIG.REMOTE_IDENTIFIER=a},getIdentifier:function(){return this._CONFIG.REMOTE_IDENTIFIER},getRemotable:function(){return this._CONFIG.REMOTEABLE},setRemotable:function(a){this._CONFIG.REMOTEABLE=a},setRemoteEditable:function(a){this._CONFIG.REMOTE_EDITABLE=a},getRemoteEditable:function(){return this._CONFIG.REMOTE_EDITABLE},setRemoteIsMaster:function(a){this._CONFIG.REMOTE_ISMASTER=a},getRemoteIsMaster:function(){return this._CONFIG.REMOTE_ISMASTER},setCurrentCanvas:function(a){this._RENDERER.setCanvas(a)},initConfig:function(a){if(a){this._CONFIG.REMOTEABLE=a.remoteable===undefined?this._CONFIG.REMOTEABLE:a.remoteable;this._CONFIG.SELECTABLE=a.selectable===undefined?this._CONFIG.SELECTABLE:a.selectable;this._CONFIG.DRAG_SELECTABLE=a.dragSelectable===undefined?this._CONFIG.DRAG_SELECTABLE:a.dragSelectable;this._CONFIG.MOVABLE=a.movable===undefined?this._CONFIG.MOVABLE:a.movable;this._CONFIG.RESIZABLE=a.resizable===undefined?this._CONFIG.RESIZABLE:a.resizable;this._CONFIG.CONNECTABLE=a.connectable===undefined?this._CONFIG.CONNECTABLE:a.connectable;this._CONFIG.SELF_CONNECTABLE=a.selfConnectable===undefined?this._CONFIG.SELF_CONNECTABLE:a.selfConnectable;this._CONFIG.CONNECT_CLONEABLE=a.connectCloneable===undefined?this._CONFIG.CONNECT_CLONEABLE:a.connectCloneable;this._CONFIG.LABEL_EDITABLE=a.labelEditable===undefined?this._CONFIG.LABEL_EDITABLE:a.labelEditable;this._CONFIG.GROUP_DROPABLE=a.groupDropable===undefined?this._CONFIG.GROUP_DROPABLE:a.groupDropable;this._CONFIG.ENABLE_HOTKEY=a.enableHotKey===undefined?this._CONFIG.ENABLE_HOTKEY:a.enableHotKey;this._CONFIG.ENABLE_CONTEXTMENU=a.enableContextMenu===undefined?this._CONFIG.ENABLE_CONTEXTMENU:a.enableContextMenu;this._CONFIG.AUTO_EXTENSIONAL=a.autoExtensional===undefined?this._CONFIG.AUTO_EXTENSIONAL:a.autoExtensional;this._CONFIG.USE_SLIDER=a.useSlider===undefined?this._CONFIG.USE_SLIDER:a.useSlider;this._CONFIG.STICK_GUIDE=a.stickGuide===undefined?this._CONFIG.STICK_GUIDE:a.stickGuide;this._CONFIG.CHECK_BRIDGE_EDGE=a.checkBridgeEdge===undefined?this._CONFIG.CHECK_BRIDGE_EDGE:a.checkBridgeEdge;this._CONFIG.AUTO_HISTORY=a.autoHistory===undefined?this._CONFIG.AUTO_HISTORY:a.autoHistory;this._CONFIG.AUTO_SLIDER_UPDATE=a.autoSliderUpdate===undefined?this._CONFIG.AUTO_SLIDER_UPDATE:a.autoSliderUpdate}this._HANDLER.setDragSelectable(this._CONFIG.SELECTABLE&&this._CONFIG.DRAG_SELECTABLE);this._HANDLER.setWheelScale();this._HANDLER.setDragPageMovable();this._HANDLER.setEnableHotKey(this._CONFIG.ENABLE_HOTKEY);if(this._CONFIG.ENABLE_CONTEXTMENU){if(this._CONFIG.ENABLE_ROOT_CONTEXTMENU){this._HANDLER.enableRootContextMenu()}this._HANDLER.enableShapeContextMenu()}this.CONFIG_INITIALIZED=true},getRenderer:function(){return this._RENDERER},getContainer:function(){return this._CONTAINER},getEventHandler:function(){return this._HANDLER},addBackDoor:function(b,e,a){var c=this;var d=new Image();d.src=b;d.onload=function(){var j=d.naturalWidth;var m=d.naturalHeight;c._CONFIG.BACKDOOR.url=b;c._CONFIG.BACKDOOR.scale=e?e:c._CONFIG.BACKDOOR.scale;c._CONFIG.BACKDOOR.opacity=a?a:c._CONFIG.BACKDOOR.opacity;c._CONFIG.BACKDOOR.width=j;c._CONFIG.BACKDOOR.height=m;c._CONFIG.BACKDOOR.container_updated=true;var i=c._CONTAINER;var l=i.id+OG.Constants.BACKDOOR_SUFFIX;var g=$("#"+i.id).find("#"+l);if(!g||g.length<1){g=$("");g.attr("id",l);g.css({position:"absolute",top:"0px",left:"0px"});$(c._RENDERER.getRootElement()).before(g);g.attr("src",b)}else{g.attr("src",b)}c._CONFIG.BACKDOOR.container=g;var k=c.getScale();var f=c.getCanvasSize();if(f[0]');d.append();d.unbind("click");d.bind("click",function(){if($(this).data("collape")){var n=$(this).data("collape");k.height(n);c.show();$(this).data("collape",false)}else{$(this).data("collape",k.height());c.hide();k.height(40)}});j=$('
      ');j.css({position:"relative",width:"100%"});l=$('
      ');b=$('');b.bind("change",function(){m.updateSlider($(this).val())});b.bind("input",function(){m.updateSlider($(this).val())});b.css({position:"relative",width:"100%",height:"8px"});f=$('
      ');f.css({position:"absolute",top:"50px",bottom:"5px",left:"5px",right:"5px","overflow-x":"hidden","overflow-y":"auto",background:"white"});h=$('');h.css({position:"absolute",top:"0px",left:"0px"});h.attr("width","100%");h.attr("id",a.id+"sliderImage");e=$('
      ');e.css({position:"absolute",top:"0px",left:"0px",width:"100px",height:"100px",background:"transparent"});g=function(){var r,n,u,v,p,s,q,t,o,x,w;r=m._RENDERER.getRootElement();v=h.width();p=h.height();n=$(r).attr("width");u=$(r).attr("height");s=v/n;q=p/u;if(s>1){s=1}if(q>1){q=1}t=e.offset().left-h.offset().left;if(t<0){t=0}o=e.offset().top-h.offset().top;if(o<0){o=0}x=t*(1/s);w=o*(1/q);a.scrollLeft=x;a.scrollTop=w};$(a).unbind("scroll");$(a).bind("scroll",function(n){if(e.data("drag")){return}m.updateNavigatior()});h.click(function(p){var o,n,r,q;o=p.pageX-h.offset().left;n=p.pageY-h.offset().top;r=o-(e.width()/2);q=n-(e.height()/2);if(r<0){r=0}if(q<0){q=0}if((r+e.width())>h.width()){r=h.width()-e.width()}if((q+e.height())>h.height()){q=h.height()-e.height()}e.css({left:r+"px",top:q+"px"});g()});e.draggable({containment:"#"+a.id+"sliderImage",scroll:false,start:function(n){e.data("drag",true)},drag:function(n){g()},stop:function(n){g();e.data("drag",false)}});c.append(j);j.append(l);j.append(b);c.append(f);f.append(h);f.append(e);$(a).on("remove",function(){m.removeSlider()});if(this._CONFIG.SLIDER){m.removeSlider()}this._CONFIG.SLIDER=c;this.updateSlider(this._CONFIG.SCALE*100)},updateNavigatior:function(){var m=this;var h=m._RENDERER.getRootElement();var p,i,o,n,j,f,k,d;var c=this._CONFIG.SLIDER;if(!c){return}var g=c.find(".sliderImage");var e=c.find(".sliderNavigator");var b=m._CONTAINER;p=$(h).attr("width");i=$(h).attr("height");o=b.scrollLeft;n=b.scrollTop;j=$(b).width()/p;f=$(b).height()/i;if(j>1){j=1}if(f>1){f=1}k=g.width()/p;d=g.height()/i;e.width(g.width()*j);e.height(g.height()*f);e.css({left:(o*k)+"px",top:(n*d)+"px"});var l=c.find(".scaleSliderText");var a=c.find(".scaleSlider");l.html(Math.round(this._CONFIG.SCALE*100));a.val(Math.round(this._CONFIG.SCALE*100))},updateSlider:function(v){if(this._CONFIG.AUTO_SLIDER_UPDATE&&!this._CONFIG.FAST_LOADING){var q=this;if(!this._CONFIG.SLIDER){return}if(!v){v=this._CONFIG.SCALE*100}var m=this._CONFIG.SLIDER;var f=m.find(".scaleSliderText");var k=m.find(".scaleSlider");var u=m.find(".sliderImage");var g=m.find(".sliderNavigator");var s=m.find(".sliderImageWrapper");f.html(Math.round(v));k.val(Math.round(v));q._RENDERER.setScale(v/100);var i=q._RENDERER.getRootElement();var p=new XMLSerializer().serializeToString(i);var a=this.getCanvasSize();if(OG.Util.isIE()){p=''+p.replace('xmlns="http://www.w3.org/2000/svg"',"").replace('xmlns:NS1=""',"").replace("NS1:","");var b=window.btoa(unescape(encodeURIComponent(p)));var j=document.createElement("img");$(j).css({position:"absolute",top:"0px",left:"0px",opacity:0});document.body.appendChild(j);j.src="data:image/svg+xml;base64,"+b;j.onload=function(){var w=document.getElementById(u.attr("id"));w.width=s.width();w.height=s.width()*j.height/j.width;var x=w.getContext("2d");try{x.drawImage(j,0,0,s.width(),s.width()*j.height/j.width);$(j).remove();q.updateNavigatior()}catch(y){$(j).remove()}}}else{var j=new Image();j.src="data:image/svg+xml;utf-8,"+p;j.onload=function(){var w=document.getElementById(u.attr("id"));w.width=s.width();w.height=s.width()*j.height/j.width;var x=w.getContext("2d");try{x.drawImage(j,0,0,s.width(),s.width()*j.height/j.width);$(j).remove();q.updateNavigatior()}catch(y){$(j).remove()}}}if(q._CONFIG.BACKDOOR.container){var t=q._CONFIG.BACKDOOR.scale;var c=q._CONFIG.BACKDOOR.opacity;var l=q._CONFIG.BACKDOOR.width;var h=q._CONFIG.BACKDOOR.height;var d=q.getScale();var r=s.width();var n=(l*(t/100)/a[0]*d)*r;var o=n*h/l;var e=s.find(".sliderBackDoorWrapper");if(!e||e.length<1){e=$('
      ');e.css({position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%"});s.data("backdoor",true);e.css({"background-image":"url("+q._CONFIG.BACKDOOR.url+")","background-repeat":"no-repeat","background-size":n+"px "+o+"px",opacity:c});u.before(e)}else{if(q._CONFIG.BACKDOOR.container_updated){q._CONFIG.BACKDOOR.container_updated=false;e.css({"background-image":"url("+q._CONFIG.BACKDOOR.url+")","background-repeat":"no-repeat","background-size":n+"px "+o+"px",opacity:c})}else{e.css({"background-size":n+"px "+o+"px",opacity:c})}}}}},removeSlider:function(){if(this._CONFIG.SLIDER){this._CONFIG.SLIDER.dialog("destroy");this._CONFIG.SLIDER.remove()}},drawShape:function(f,g,i,b,c,e,h,a){var d=this._RENDERER.drawShape(f,g,i,b,c,h,a);if(f&&(g.TYPE===OG.Constants.SHAPE_TYPE.EDGE)){d=this._RENDERER.move(d,f)}if(e&&this._RENDERER.getElementById(e)){this._RENDERER.appendChild(d,e)}if(!this.CONFIG_INITIALIZED){this.initConfig()}this._HANDLER.setClickSelectable(d,this._HANDLER._isSelectable(d.shape));this._HANDLER.setMovable(d,this._HANDLER._isMovable(d.shape));this._HANDLER.setGroupDropable(d);this._HANDLER.setConnectGuide(d,this._HANDLER._isConnectable(d.shape));if(this._HANDLER._isLabelEditable(d.shape)){this._HANDLER.enableEditLabel(d)}if(!c){this._RENDERER.addHistory()}this.updateSlider();return d},drawTransformer:function(s,j,f,g,b,n){var r=this,c,e,p,d,o,l,t,k,h,m,q;c=new OG.shape.Transformer(j);if(!Array.isArray(f)||!Array.isArray(g)){return null}var a=Math.max(f.length,g.length);e=r.drawShape(s,c,[120,30+(a*25)],p,n);d=e.shape.geom.getBoundary();$.each(f,function(i,u){m=new OG.shape.bpmn.M_Text(u);m.MOVABLE=false;m.SELECTABLE=false;m.CONNECTABLE=false;m.DELETABLE=false;q=r.drawShape([d.getUpperLeft().x+35,d.getUpperLeft().y+(i*25)+40],m,[50,20]);e.appendChild(q);l=new OG.shape.To();k=r.drawShape([d.getUpperLeft().x+15,d.getUpperLeft().y+(i*25)+40],l,[5,5],{r:5});e.appendChild(k);var v=JSON.parse(JSON.stringify(b));v.type="input";v.name=u;v.parentId=e.id;r.setCustomData(k,v)});$.each(g,function(i,u){m=new OG.shape.bpmn.M_Text(u);m.MOVABLE=false;m.SELECTABLE=false;m.CONNECTABLE=false;m.DELETABLE=false;q=r.drawShape([d.getUpperRight().x-35,d.getUpperRight().y+(i*25)+40],m,[50,20]);e.appendChild(q);t=new OG.shape.From();h=r.drawShape([d.getUpperRight().x-15,d.getUpperRight().y+(i*25)+40],t,[5,5],{r:5});e.appendChild(h);var v=JSON.parse(JSON.stringify(b));v.type="output";v.name=u;v.parentId=e.id;r.setCustomData(h,v)});if(!n){this._RENDERER.addHistory()}},setExceptionType:function(a,b){this._HANDLER.setExceptionType(a,b)},setInclusion:function(a,b){this._HANDLER.setInclusion(a,b)},setShapeStyle:function(a,b){this._RENDERER.setShapeStyle(a,b)},setTextListInController:function(a,b){this._RENDERER.setTextListInController(a,b)},getTextListInController:function(a){this._RENDERER.getTextListInController(a)},drawLabel:function(a,c,b){return this._RENDERER.drawLabel(a,c,b)},redrawConnectedEdge:function(a){this._RENDERER.redrawConnectedEdge(a)},reconnect:function(a){return this._RENDERER.reconnect(a)},connect:function(j,g,b,l,d,e,k,c,a){var i,n,f,h,m;if(d){i=this._RENDERER.createTerminalString(j,d)}else{i=this._RENDERER.createDefaultTerminalString(j)}if(e){n=this._RENDERER.createTerminalString(g,e)}else{n=this._RENDERER.createDefaultTerminalString(g)}h=this._RENDERER._getPositionFromTerminal(i);h=[h.x,h.y];m=this._RENDERER._getPositionFromTerminal(n);m=[m.x,m.y];a=a?a:new OG.EdgeShape();a.from=h;a.to=m;f=this._RENDERER.drawShape(null,a,null,b,c);f=this._RENDERER.trimEdgeDirection(f,j,g);l=l?l:undefined;f=this._RENDERER.connect(i,n,f,b,l,k);if(f){this._HANDLER.setClickSelectable(f,f.shape.SELECTABLE);this._HANDLER.setMovable(f,f.shape.SELECTABLE&&f.shape.MOVABLE);this._HANDLER.setConnectGuide(f,this._HANDLER._isConnectable(f.shape));if(f.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(f)}}this.updateSlider();return f},connectWithTerminalId:function(fromTerminal,toTerminal,style,label,id,shapeId,geom){var vertices,edge,fromPosition,toPosition,fromto,shape;fromPosition=this._RENDERER._getPositionFromTerminal(fromTerminal);fromPosition=[fromPosition.x,fromPosition.y];toPosition=this._RENDERER._getPositionFromTerminal(toTerminal);toPosition=[toPosition.x,toPosition.y];if(!geom){vertices=[fromPosition,toPosition]}else{vertices=geom.vertices}fromto=JSON.stringify(vertices[0])+","+JSON.stringify(vertices[vertices.length-1]);shape=eval("new "+shapeId+"("+fromto+")");label=label?label:undefined;if(label){shape.label=label}if(geom){if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.POLYLINE]){geom=new OG.geometry.PolyLine(geom.vertices);shape.geom=geom}else{if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.CURVE]){geom=new OG.geometry.Curve(geom.controlPoints);shape.geom=geom}}}edge=this.drawShape(null,shape,null,style,id,null);edge=this._RENDERER.connect(fromTerminal,toTerminal,edge,style,label,true);if(edge){this._HANDLER.setClickSelectable(edge,edge.shape.SELECTABLE);this._HANDLER.setMovable(edge,edge.shape.SELECTABLE&&edge.shape.MOVABLE);this._HANDLER.setConnectGuide(edge,this._HANDLER._isConnectable(edge.shape));if(edge.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(edge)}}this.updateSlider();return edge},disconnect:function(a){this._RENDERER.disconnect(a)},group:function(a){var b=this._RENDERER.group(a);this._HANDLER.setClickSelectable(b,b.shape.SELECTABLE);this._HANDLER.setMovable(b,b.shape.SELECTABLE&&b.shape.MOVABLE);if(b.shape.LABEL_EDITABLE){this._HANDLER.enableEditLabel(b)}return b},ungroup:function(a){return this._RENDERER.ungroup(a)},addToGroup:function(a,b){this._RENDERER.addToGroup(a,b)},collapse:function(a){this._RENDERER.collapse(a)},expand:function(a){this._RENDERER.expand(a)},clear:function(){this._RENDERER.clear()},removeShape:function(b,a){this._RENDERER.removeShape(b,a)},removeChild:function(a){this._RENDERER.removeChild(a)},removeGuide:function(a){this._RENDERER.removeGuide(a)},removeAllGuide:function(){this._RENDERER.removeAllGuide()},getRootElement:function(){return this._RENDERER.getRootElement()},getRootGroup:function(){return this._RENDERER.getRootGroup()},getElementByPoint:function(a){return this._RENDERER.getElementByPoint(a)},getElementsByBBox:function(a){return this._RENDERER.getElementsByBBox(a)},setAttr:function(a,b){this._RENDERER.setAttr(a,b)},getAttr:function(b,a){return this._RENDERER.getAttr(b,a)},toFront:function(a){this._RENDERER.toFront(a)},toBack:function(a){this._RENDERER.toBack(a)},bringForward:function(a){this._RENDERER.bringForward(a)},sendBackward:function(a){this._RENDERER.sendBackward(a)},getCanvasSize:function(){return this._RENDERER.getCanvasSize()},setCanvasSize:function(a){this._RENDERER.setCanvasSize(a)},fitCanvasSize:function(b,a){this._RENDERER.fitCanvasSize(b,a)},setViewBox:function(a,b,c){this._RENDERER.setViewBox(a,b,c)},getScale:function(){return this._RENDERER.getScale()},setScale:function(a){this._RENDERER.setScale(a)},show:function(a){this._RENDERER.show(a)},hide:function(a){this._RENDERER.hide(a)},appendChild:function(a,b){return this._RENDERER.appendChild(a,b)},insertAfter:function(a,b){return this._RENDERER.insertAfter(a,b)},insertBefore:function(a,b){return this._RENDERER.insertBefore(a,b)},move:function(a,b){return this._RENDERER.move(a,b)},moveCentroid:function(b,a){return this._RENDERER.moveCentroid(b,a)},rotate:function(a,b){return this._RENDERER.rotate(a,b)},resize:function(b,c,a){return this._RENDERER.resize(b,c,a)},resizeBox:function(c,b,a){return this._RENDERER.resizeBox(c,b,a)},clone:function(a){return this._RENDERER.clone(a)},getBoundary:function(a){return this._RENDERER.getBoundary(a)},getElementById:function(a){return this._RENDERER.getElementById(a)},getElementsByType:function(b,a){return this._RENDERER.getElementsByType(b,a)},getElementsByShapeId:function(b){var a=this.getRootGroup();return $(a).find("[_type=SHAPE][_shape_id='"+b+"']")},getRelatedEdgeFromShapes:function(a){return this._RENDERER.getRelatedEdgeFromShapes(a)},getRelatedElementsFromEdge:function(b){var d=this,c=OG.Util.isElement(b)?b:this.getElementById(b),a=function(e){if(e){return d._RENDERER.getElementById(e.substring(0,e.indexOf(OG.Constants.TERMINAL)))}else{return null}};if($(c).attr("_shape")===OG.Constants.SHAPE_TYPE.EDGE){return{from:a($(b).attr("_from")),to:a($(b).attr("_to"))}}else{return{from:null,to:null}}},getParent:function(a){return this._RENDERER.getParent(a)},getChilds:function(a){return this._RENDERER.getChilds(a)},getAllShapes:function(){return this._RENDERER.getAllShapes()},getAllEdges:function(){return this._RENDERER.getAllEdges()},getBBox:function(a){return this._RENDERER.getBBox(a)},getRootBBox:function(){return this._RENDERER.getRootBBox()},getRealRootBBox:function(){return this._RENDERER.getRealRootBBox()},isSVG:function(){return this._RENDERER.isSVG()},isVML:function(){return this._RENDERER.isVML()},setCustomData:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.data=c;a.shape.data=c},getCustomData:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);if(!a.data){a.data=a.shape.data}return a.data},setExtCustomData:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.dataExt=c},getExtCustomData:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);return a.dataExt},setCustomContextMenu:function(b,c){var a=OG.Util.isElement(b)?b:document.getElementById(b);a.shape.customContextMenu=c},getCustomContextMenu:function(b){var a=OG.Util.isElement(b)?b:document.getElementById(b);return a.shape.customContextMenu},toXML:function(){return OG.Util.jsonToXml(this.toJSON())},toJSON:function(){var j=this,k=this._RENDERER.getRootBBox(),h=this._RENDERER.getRootGroup(),c=this.getScale(),a=this.getCanvasSize()[0],g=this.getCanvasSize()[1],f=this._CONFIG.BACKDOOR,l={opengraph:{"@width":a,"@height":g,"@scale":c,cell:[],backdoor:[{"@url":f.url,"@scale":f.scale,"@opacity":f.opacity,"@width":f.width,"@height":f.height}]}},e,d,b;b={};e=function(i){$(i).find("[_type=SHAPE]").each(function(w,z){var q=z.shape,m=z.shape.geom.style.map,s=q.geom,r=s.getBoundary(),x={},p,v,u,n,t;if(q.ignoreExport){return}x["@id"]=$(z).attr("id");if($(z).parent().attr("id")===$(i).attr("id")){x["@parent"]=$(i).attr("id")}else{x["@parent"]=$(z).parent().attr("id")}x["@shapeType"]=q.TYPE;x["@shapeId"]=q.SHAPE_ID;x["@x"]=r.getCentroid().x;x["@y"]=r.getCentroid().y;x["@width"]=r.getWidth();x["@height"]=r.getHeight();if(m){x["@style"]=escape(OG.JSON.encode(m))}if(q.TYPE===OG.Constants.SHAPE_TYPE.EDGE){if($(z).attr("_from")){x["@from"]=$(z).attr("_from")}if($(z).attr("_to")){x["@to"]=$(z).attr("_to")}}else{n=j.getPrevShapeIds(z);t=j.getNextShapeIds(z);if(n.length>0){x["@from"]=n.toString()}if(t.length>0){x["@to"]=t.toString()}}if($(z).attr("_fromedge")){x["@fromEdge"]=$(z).attr("_fromedge")}if($(z).attr("_toedge")){x["@toEdge"]=$(z).attr("_toedge")}if(q.label){x["@label"]=escape(q.label)}if(q.fromLabel){x["@fromLabel"]=escape(q.fromLabel)}if(q.toLabel){x["@toLabel"]=escape(q.toLabel)}if(q.angle&&q.angle!==0){x["@angle"]=q.angle}if(q instanceof OG.shape.ImageShape){x["@value"]=q.image}else{if(q instanceof OG.shape.HtmlShape){x["@value"]=escape(q.html)}else{if(q instanceof OG.shape.TextShape){x["@value"]=escape(q.text)}else{if(q instanceof OG.shape.EdgeShape){p=s.getVertices();x["@value"]="";for(var o=0,y=p.length;o(x-width/2))?(x-width/2):minX;minY=(minY>(y-height/2))?(y-height/2):minY;maxX=(maxX<(x+width/2))?(x+width/2):maxX;maxY=(maxY<(y+height/2))?(y+height/2):maxY;switch(shapeType){case OG.Constants.SHAPE_TYPE.GEOM:case OG.Constants.SHAPE_TYPE.GROUP:shape=eval("new "+shapeId+"()");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height],OG.JSON.decode(style),id,parent);if(element.shape instanceof OG.shape.bpmn.A_Task){element.shape.LoopType=loopType;element.shape.TaskType=taskType}break;case OG.Constants.SHAPE_TYPE.EDGE:var list=JSON.parse("["+value+"]");var fromto=JSON.stringify(list[0])+","+JSON.stringify(list[list.length-1]);shape=eval("new "+shapeId+"("+fromto+")");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}if(fromLabel){shape.fromLabel=unescape(fromLabel)}if(toLabel){shape.toLabel=unescape(toLabel)}if(geom){geom=OG.JSON.decode(geom);if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.POLYLINE]){geom=new OG.geometry.PolyLine(geom.vertices);shape.geom=geom}else{if(geom.type===OG.Constants.GEOM_NAME[OG.Constants.GEOM_TYPE.CURVE]){geom=new OG.geometry.Curve(geom.controlPoints);shape.geom=geom}}}element=this.drawShape(null,shape,null,OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.HTML:shape=eval("new "+shapeId+"()");if(value){shape.html=unescape(value)}if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.IMAGE:shape=eval("new "+shapeId+"('"+value+"')");if(label){shape.label=label}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break;case OG.Constants.SHAPE_TYPE.TEXT:shape=eval("new "+shapeId+"()");if(value){shape.text=unescape(value)}if(data){shape.data=OG.JSON.decode(unescape(data))}if(textList){shape.textList=OG.JSON.decode(unescape(textList))}element=this.drawShape([x,y],shape,[width,height,angle],OG.JSON.decode(style),id,parent);break}if(from){$(element).attr("_from",from)}if(to){$(element).attr("_to",to)}if(fromEdge){$(element).attr("_fromedge",fromEdge)}if(toEdge){$(element).attr("_toedge",toEdge)}if(data){element.data=OG.JSON.decode(unescape(data))}if(dataExt){element.dataExt=OG.JSON.decode(unescape(dataExt))}cellCount++;$(renderer._PAPER.canvas).trigger("loading",[Math.round((cellCount/totalCount)*100)])}if(json.opengraph.backdoor&&OG.Util.isArray(json.opengraph.backdoor)&&json.opengraph.backdoor.length){var backdoor=json.opengraph.backdoor[0];if(backdoor["@url"]){this.addBackDoor(backdoor["@url"],backdoor["@scale"],backdoor["@opacity"])}}this.fastLoadingOFF();$(renderer._PAPER.canvas).trigger("loading",["end"]);return{width:maxX-minX,height:maxY-minY,x:minX,y:minY,x2:maxX,y2:maxY}}this.fastLoadingOFF();$(renderer._PAPER.canvas).trigger("loading",["end"]);return{width:0,height:0,x:0,y:0,x2:0,y2:0}},undo:function(){this._RENDERER.undo()},redo:function(){this._RENDERER.redo()},getPrevEdges:function(a){return this._RENDERER.getPrevEdges(a)},getNextEdges:function(a){return this._RENDERER.getNextEdges(a)},getPrevShapes:function(a){return this._RENDERER.getPrevShapes(a)},getPrevShapeIds:function(a){return this._RENDERER.getPrevShapeIds(a)},getNextShapes:function(a){return this._RENDERER.getNextShapes(a)},getNextShapeIds:function(a){return this._RENDERER.getNextShapeIds(a)},onDrawShape:function(a){$(this.getRootElement()).bind("drawShape",function(c,b){a(c,b)})},onUndo:function(a){$(this.getRootElement()).bind("undo",function(b){a(b)})},onRedo:function(a){$(this.getRootElement()).bind("redo",function(b){a(b)})},onDivideLane:function(a){$(this.getRootElement()).bind("divideLane",function(c,b){a(c,b)})},onDrawLabel:function(a){$(this.getRootElement()).bind("drawLabel",function(d,b,c){a(d,b,c)})},onLabelChanged:function(a){$(this.getRootElement()).bind("labelChanged",function(e,c,b,d){a(e,c,b,d)})},onBeforeLabelChange:function(a){$(this.getRootElement()).bind("beforeLabelChange",function(b){if(a(b,b.element,b.afterText,b.beforeText)===false){b.stopPropagation()}})},onRedrawShape:function(a){$(this.getRootElement()).bind("redrawShape",function(c,b){a(c,b)})},onRemoveShape:function(a){$(this.getRootElement()).bind("removeShape",function(c,b){a(c,b)})},onRotateShape:function(a){$(this.getRootElement()).bind("rotateShape",function(c,b,d){a(c,b,d)})},onMoveShape:function(a){$(this.getRootElement()).bind("moveShape",function(c,b,d){a(c,b,d)})},onResizeShape:function(a){$(this.getRootElement()).bind("resizeShape",function(c,b,d){a(c,b,d)})},onBeforeConnectShape:function(a){$(this.getRootElement()).bind("beforeConnectShape",function(b){if(a(b,b.edge,b.fromShape,b.toShape)===false){b.stopPropagation()}})},onBeforeRemoveShape:function(a){$(this.getRootElement()).bind("beforeRemoveShape",function(b){if(a(b,b.element)===false){b.stopPropagation()}})},onConnectShape:function(a){$(this.getRootElement()).bind("connectShape",function(d,c,e,b){a(d,c,e,b)})},onDisconnectShape:function(a){$(this.getRootElement()).bind("disconnectShape",function(d,c,e,b){a(d,c,e,b)})},onGroup:function(a){$(this.getRootElement()).bind("group",function(c,b){a(c,b)})},onUnGroup:function(a){$(this.getRootElement()).bind("ungroup",function(b,c){a(b,c)})},onCollapsed:function(a){$(this.getRootElement()).bind("collapsed",function(c,b){a(c,b)})},onExpanded:function(a){$(this.getRootElement()).bind("expanded",function(c,b){a(c,b)})},onLoading:function(a){$(this.getRootElement()).bind("loading",function(c,b){a(c,b)})}};OG.graph.Canvas.prototype.constructor=OG.graph.Canvas;OG.Canvas=OG.graph.Canvas; \ No newline at end of file diff --git a/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT.js b/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT.js index 86fae00..560981b 100644 --- a/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT.js +++ b/src/main/webapp/opengraph/OpenGraph-0.1.3-SNAPSHOT.js @@ -21989,7 +21989,7 @@ OG.renderer.RaphaelRenderer.prototype._drawLabel = function (position, text, siz * @return {Element} Group DOM Element with geometry * @override */ -OG.renderer.RaphaelRenderer.prototype.drawShape = function (position, shape, size, style, id, preventEvent) { +OG.renderer.RaphaelRenderer.prototype.drawShape = function (position, shape, size, style, id, preventEvent, preventDropEvent) { var width = size ? size[0] : 100, height = size ? size[1] : 100, groupNode, geometry, text, image, html, xml, @@ -22148,6 +22148,10 @@ OG.renderer.RaphaelRenderer.prototype.drawShape = function (position, shape, siz $(this._PAPER.canvas).trigger('drawShape', [groupNode]); } + if (me._CONFIG.POOL_DROP_EVENT && !id && !preventDropEvent && me.isTopGroup(groupNode) && (me.isLane(groupNode) || me.isPool(groupNode))) { + me.setDropablePool(groupNode); + } + return groupNode; }; @@ -26907,7 +26911,7 @@ OG.renderer.RaphaelRenderer.prototype.divideLane = function (element, quarterOrd if (i === quarterLength - 1) { _height = _height + (targetArea.getHeight() % quarterLength); } - var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], new OG.HorizontalLaneShape(), [_width, _height], null, null, element.id, true); + var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], new OG.HorizontalLaneShape(), [_width, _height], null, null, element.id, true, true); divedLanes.push(newLane); } @@ -26919,7 +26923,7 @@ OG.renderer.RaphaelRenderer.prototype.divideLane = function (element, quarterOrd if (i === quarterLength - 1) { _width = _width + (targetArea.getWidth() % quarterLength); } - var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], new OG.VerticalLaneShape(), [_width, _height], null, null, element.id, true); + var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], new OG.VerticalLaneShape(), [_width, _height], null, null, element.id, true, true); divedLanes.push(newLane); } me.fitLaneOrder(element); @@ -26951,7 +26955,7 @@ OG.renderer.RaphaelRenderer.prototype.divideLane = function (element, quarterOrd var x = targetUpperLeft.x; var y = targetUpperLeft.y; var shape = me.isHorizontalLane(element) ? new OG.HorizontalLaneShape() : new OG.VerticalLaneShape(); - standardLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], shape, [_width, _height], null, null, element.id, true); + standardLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], shape, [_width, _height], null, null, element.id, true, true); divedLanes.push(standardLane); } @@ -27053,7 +27057,7 @@ OG.renderer.RaphaelRenderer.prototype.divideLane = function (element, quarterOrd } } }); - var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], shape, [_width, _height], null, null, parent.id, true); + var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], shape, [_width, _height], null, null, parent.id, true, true); divedLanes.push(newLane); $.each(lanesToMove, function (index, laneToMove) { me.move(laneToMove, moveOffset); @@ -34723,6 +34727,10 @@ OG.graph.Canvas = function (container, containerSize, backgroundColor, backgroun this._CONFIG = { + /** + * 풀, 래인 도형의 드랍시 자동 위치 조정 기능 + */ + POOL_DROP_EVENT: false, /** * 도형, 스팟 이동시 이웃한 도형에 대해 자동보정이 이루어지는 여부. */ @@ -36132,11 +36140,12 @@ OG.graph.Canvas.prototype = { * @param {String} id Element ID 지정 (Optional) * @param {String} parentId 부모 Element ID 지정 (Optional) * @param {Boolean} preventEvent 이벤트 생성 방지 + * @param {Boolean} preventDropEvent 드랍 이벤트 방지 * @return {Element} Group DOM Element with geometry */ - drawShape: function (position, shape, size, style, id, parentId, preventEvent) { + drawShape: function (position, shape, size, style, id, parentId, preventEvent, preventDropEvent) { - var element = this._RENDERER.drawShape(position, shape, size, style, id, preventEvent); + var element = this._RENDERER.drawShape(position, shape, size, style, id, preventEvent, preventDropEvent); if (position && (shape.TYPE === OG.Constants.SHAPE_TYPE.EDGE)) { element = this._RENDERER.move(element, position); diff --git a/src/main/webapp/src/graph/Canvas.js b/src/main/webapp/src/graph/Canvas.js index ded25ca..6bb9b59 100644 --- a/src/main/webapp/src/graph/Canvas.js +++ b/src/main/webapp/src/graph/Canvas.js @@ -28,6 +28,10 @@ OG.graph.Canvas = function (container, containerSize, backgroundColor, backgroun this._CONFIG = { + /** + * 풀, 래인 도형의 드랍시 자동 위치 조정 기능 + */ + POOL_DROP_EVENT: false, /** * 도형, 스팟 이동시 이웃한 도형에 대해 자동보정이 이루어지는 여부. */ @@ -1437,11 +1441,12 @@ OG.graph.Canvas.prototype = { * @param {String} id Element ID 지정 (Optional) * @param {String} parentId 부모 Element ID 지정 (Optional) * @param {Boolean} preventEvent 이벤트 생성 방지 + * @param {Boolean} preventDropEvent 드랍 이벤트 방지 * @return {Element} Group DOM Element with geometry */ - drawShape: function (position, shape, size, style, id, parentId, preventEvent) { + drawShape: function (position, shape, size, style, id, parentId, preventEvent, preventDropEvent) { - var element = this._RENDERER.drawShape(position, shape, size, style, id, preventEvent); + var element = this._RENDERER.drawShape(position, shape, size, style, id, preventEvent, preventDropEvent); if (position && (shape.TYPE === OG.Constants.SHAPE_TYPE.EDGE)) { element = this._RENDERER.move(element, position); diff --git a/src/main/webapp/src/renderer/RaphaelRenderer.js b/src/main/webapp/src/renderer/RaphaelRenderer.js index 2b8f5df..d2aed0e 100644 --- a/src/main/webapp/src/renderer/RaphaelRenderer.js +++ b/src/main/webapp/src/renderer/RaphaelRenderer.js @@ -1272,7 +1272,7 @@ OG.renderer.RaphaelRenderer.prototype._drawLabel = function (position, text, siz * @return {Element} Group DOM Element with geometry * @override */ -OG.renderer.RaphaelRenderer.prototype.drawShape = function (position, shape, size, style, id, preventEvent) { +OG.renderer.RaphaelRenderer.prototype.drawShape = function (position, shape, size, style, id, preventEvent, preventDropEvent) { var width = size ? size[0] : 100, height = size ? size[1] : 100, groupNode, geometry, text, image, html, xml, @@ -1431,12 +1431,8 @@ OG.renderer.RaphaelRenderer.prototype.drawShape = function (position, shape, siz $(this._PAPER.canvas).trigger('drawShape', [groupNode]); } - if (!id && (me.isLane(groupNode) || me.isPool(groupNode))) { - if(me.isTopGroup(groupNode)){ - console.log('top'); - me.setDropablePool(groupNode); - } - //me.isTopGroup(element) + if (me._CONFIG.POOL_DROP_EVENT && !id && !preventDropEvent && me.isTopGroup(groupNode) && (me.isLane(groupNode) || me.isPool(groupNode))) { + me.setDropablePool(groupNode); } return groupNode; @@ -6198,7 +6194,7 @@ OG.renderer.RaphaelRenderer.prototype.divideLane = function (element, quarterOrd if (i === quarterLength - 1) { _height = _height + (targetArea.getHeight() % quarterLength); } - var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], new OG.HorizontalLaneShape(), [_width, _height], null, null, element.id, true); + var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], new OG.HorizontalLaneShape(), [_width, _height], null, null, element.id, true, true); divedLanes.push(newLane); } @@ -6210,7 +6206,7 @@ OG.renderer.RaphaelRenderer.prototype.divideLane = function (element, quarterOrd if (i === quarterLength - 1) { _width = _width + (targetArea.getWidth() % quarterLength); } - var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], new OG.VerticalLaneShape(), [_width, _height], null, null, element.id, true); + var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], new OG.VerticalLaneShape(), [_width, _height], null, null, element.id, true, true); divedLanes.push(newLane); } me.fitLaneOrder(element); @@ -6242,7 +6238,7 @@ OG.renderer.RaphaelRenderer.prototype.divideLane = function (element, quarterOrd var x = targetUpperLeft.x; var y = targetUpperLeft.y; var shape = me.isHorizontalLane(element) ? new OG.HorizontalLaneShape() : new OG.VerticalLaneShape(); - standardLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], shape, [_width, _height], null, null, element.id, true); + standardLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], shape, [_width, _height], null, null, element.id, true, true); divedLanes.push(standardLane); } @@ -6344,7 +6340,7 @@ OG.renderer.RaphaelRenderer.prototype.divideLane = function (element, quarterOrd } } }); - var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], shape, [_width, _height], null, null, parent.id, true); + var newLane = me._CANVAS.drawShape([x + (_width / 2), y + (_height / 2)], shape, [_width, _height], null, null, parent.id, true, true); divedLanes.push(newLane); $.each(lanesToMove, function (index, laneToMove) { me.move(laneToMove, moveOffset);