/**This notice must be untouched at all times. This is the COMPRESSED version of the Draw2D Library WebSite: http://www.draw2d.org Copyright: 2006 Andreas Herz. All rights reserved. Created: 5.11.2006 by Andreas Herz (Web: http://www.freegroup.de ) LICENSE: LGPL **/ var draw2d=new Object();draw2d.Event=function(){this.type=null;this.target=null;this.relatedTarget=null;this.cancelable=false;this.timeStamp=null;this.returnValue=true;};draw2d.Event.prototype.initEvent=function(sType,_60e2){this.type=sType;this.cancelable=_60e2;this.timeStamp=(new Date()).getTime();};draw2d.Event.prototype.preventDefault=function(){if(this.cancelable){this.returnValue=false;}};draw2d.Event.fireDOMEvent=function(_60e3,_60e4){if(document.createEvent){var evt=document.createEvent("Events");evt.initEvent(_60e3,true,true);_60e4.dispatchEvent(evt);}else{if(document.createEventObject){var evt=document.createEventObject();_60e4.fireEvent("on"+_60e3,evt);}}};draw2d.EventTarget=function(){this.eventhandlers=new Object();};draw2d.EventTarget.prototype.addEventListener=function(sType,_60e7){if(typeof this.eventhandlers[sType]=="undefined"){this.eventhandlers[sType]=new Array;}this.eventhandlers[sType][this.eventhandlers[sType].length]=_60e7;};draw2d.EventTarget.prototype.dispatchEvent=function(_60e8){_60e8.target=this;if(typeof this.eventhandlers[_60e8.type]!="undefined"){for(var i=0;i=0){return this.removeElementAt(index);}return null;};draw2d.ArrayList.prototype.insertElementAt=function(obj,index){if(this.size==this.capacity){this.resize();}for(var i=this.getSize();i>index;i--){this.data[i]=this.data[i-1];}this.data[index]=obj;this.size++;};draw2d.ArrayList.prototype.removeElementAt=function(index){var _5b0b=this.data[index];for(var i=index;i<(this.getSize()-1);i++){this.data[i]=this.data[i+1];}this.data[this.getSize()-1]=null;this.size--;return _5b0b;};draw2d.ArrayList.prototype.removeAllElements=function(){this.size=0;for(var i=0;i=0&&_5b1a>_5b17){this.data[j+1]=this.data[j];j--;if(j>=0){_5b19=this.data[j];_5b1a=_5b19[f];}}this.data[j+1]=_5b18;}};draw2d.ArrayList.prototype.clone=function(){var _5b1b=new draw2d.ArrayList(this.size);for(var i=0;i"+_5f18+"");}function openwindow(url,width,_5f1c){var left=(screen.width-width)/2;var top=(screen.height-_5f1c)/2;property="left="+left+", top="+top+", toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,alwaysRaised,width="+width+",height="+_5f1c;return window.open(url,"_blank",property);}function dumpObject(obj){trace("----------------------------------------------------------------------------");trace("- Object dump");trace("----------------------------------------------------------------------------");for(var i in obj){try{if(typeof obj[i]!="function"){trace(i+" --> "+obj[i]);}}catch(e){}}for(var i in obj){try{if(typeof obj[i]=="function"){trace(i+" --> "+obj[i]);}}catch(e){}}trace("----------------------------------------------------------------------------");}draw2d.Drag=function(){};draw2d.Drag.current=null;draw2d.Drag.currentTarget=null;draw2d.Drag.dragging=false;draw2d.Drag.isDragging=function(){return this.dragging;};draw2d.Drag.setCurrent=function(_4bc3){this.current=_4bc3;this.dragging=true;};draw2d.Drag.getCurrent=function(){return this.current;};draw2d.Drag.clearCurrent=function(){this.current=null;this.dragging=false;this.currentTarget=null;};draw2d.Draggable=function(_4bc4,_4bc5){draw2d.EventTarget.call(this);this.construct(_4bc4,_4bc5);this.diffX=0;this.diffY=0;this.targets=new draw2d.ArrayList();};draw2d.Draggable.prototype=new draw2d.EventTarget;draw2d.Draggable.prototype.construct=function(_4bc6,_4bc7){this.element=_4bc6;this.constraints=_4bc7;var oThis=this;var _4bc9=function(){var _4bca=new draw2d.DragDropEvent();_4bca.initDragDropEvent("dblclick",true);oThis.dispatchEvent(_4bca);var _4bcb=arguments[0]||window.event;_4bcb.cancelBubble=true;_4bcb.returnValue=false;};var _4bcc=function(){var _4bcd=arguments[0]||window.event;var _4bce=new draw2d.DragDropEvent();var _4bcf=oThis.node.workflow.getAbsoluteX();var _4bd0=oThis.node.workflow.getAbsoluteY();var _4bd1=oThis.node.workflow.getScrollLeft();var _4bd2=oThis.node.workflow.getScrollTop();_4bce.x=_4bcd.clientX-oThis.element.offsetLeft+_4bd1-_4bcf;_4bce.y=_4bcd.clientY-oThis.element.offsetTop+_4bd2-_4bd0;if(_4bcd.button==2){_4bce.initDragDropEvent("contextmenu",true);oThis.dispatchEvent(_4bce);}else{_4bce.initDragDropEvent("dragstart",true);if(oThis.dispatchEvent(_4bce)){oThis.diffX=_4bcd.clientX-oThis.element.offsetLeft;oThis.diffY=_4bcd.clientY-oThis.element.offsetTop;draw2d.Drag.setCurrent(oThis);if(oThis.isAttached==true){oThis.detachEventHandlers();}oThis.attachEventHandlers();}}_4bcd.cancelBubble=true;_4bcd.returnValue=false;};var _4bd3=function(){if(draw2d.Drag.getCurrent()==null){var _4bd4=arguments[0]||window.event;if(draw2d.Drag.currentHover!=null&&oThis!=draw2d.Drag.currentHover){var _4bd5=new draw2d.DragDropEvent();_4bd5.initDragDropEvent("mouseleave",false,oThis);draw2d.Drag.currentHover.dispatchEvent(_4bd5);}if(oThis!=null&&oThis!=draw2d.Drag.currentHover){var _4bd5=new draw2d.DragDropEvent();_4bd5.initDragDropEvent("mouseenter",false,oThis);oThis.dispatchEvent(_4bd5);}draw2d.Drag.currentHover=oThis;}else{}};if(this.element.addEventListener){this.element.addEventListener("mousemove",_4bd3,false);this.element.addEventListener("mousedown",_4bcc,false);this.element.addEventListener("dblclick",_4bc9,false);}else{if(this.element.attachEvent){this.element.attachEvent("onmousemove",_4bd3);this.element.attachEvent("onmousedown",_4bcc);this.element.attachEvent("ondblclick",_4bc9);}else{throw new Error("Drag not supported in this browser.");}}};draw2d.Draggable.prototype.attachEventHandlers=function(){var oThis=this;oThis.isAttached=true;this.tempMouseMove=function(){var _4bd7=arguments[0]||window.event;var _4bd8=new draw2d.Point(_4bd7.clientX-oThis.diffX,_4bd7.clientY-oThis.diffY);if(oThis.node.getCanSnapToHelper()){_4bd8=oThis.node.getWorkflow().snapToHelper(oThis.node,_4bd8);}oThis.element.style.left=_4bd8.x+"px";oThis.element.style.top=_4bd8.y+"px";var _4bd9=oThis.node.workflow.getScrollLeft();var _4bda=oThis.node.workflow.getScrollTop();var _4bdb=oThis.node.workflow.getAbsoluteX();var _4bdc=oThis.node.workflow.getAbsoluteY();var _4bdd=oThis.getDropTarget(_4bd7.clientX+_4bd9-_4bdb,_4bd7.clientY+_4bda-_4bdc);var _4bde=oThis.getCompartment(_4bd7.clientX+_4bd9-_4bdb,_4bd7.clientY+_4bda-_4bdc);if(draw2d.Drag.currentTarget!=null&&_4bdd!=draw2d.Drag.currentTarget){var _4bdf=new draw2d.DragDropEvent();_4bdf.initDragDropEvent("dragleave",false,oThis);draw2d.Drag.currentTarget.dispatchEvent(_4bdf);}if(_4bdd!=null&&_4bdd!=draw2d.Drag.currentTarget){var _4bdf=new draw2d.DragDropEvent();_4bdf.initDragDropEvent("dragenter",false,oThis);_4bdd.dispatchEvent(_4bdf);}draw2d.Drag.currentTarget=_4bdd;if(draw2d.Drag.currentCompartment!=null&&_4bde!=draw2d.Drag.currentCompartment){var _4bdf=new draw2d.DragDropEvent();_4bdf.initDragDropEvent("figureleave",false,oThis);draw2d.Drag.currentCompartment.dispatchEvent(_4bdf);}if(_4bde!=null&&_4bde.node!=oThis.node&&_4bde!=draw2d.Drag.currentCompartment){var _4bdf=new draw2d.DragDropEvent();_4bdf.initDragDropEvent("figureenter",false,oThis);_4bde.dispatchEvent(_4bdf);}draw2d.Drag.currentCompartment=_4bde;var _4be0=new draw2d.DragDropEvent();_4be0.initDragDropEvent("drag",false);oThis.dispatchEvent(_4be0);};oThis.tempMouseUp=function(){oThis.detachEventHandlers();var _4be1=arguments[0]||window.event;var _4be2=oThis.node.workflow.getScrollLeft();var _4be3=oThis.node.workflow.getScrollTop();var _4be4=oThis.node.workflow.getAbsoluteX();var _4be5=oThis.node.workflow.getAbsoluteY();var _4be6=oThis.getDropTarget(_4be1.clientX+_4be2-_4be4,_4be1.clientY+_4be3-_4be5);var _4be7=oThis.getCompartment(_4be1.clientX+_4be2-_4be4,_4be1.clientY+_4be3-_4be5);if(_4be6!=null){var _4be8=new draw2d.DragDropEvent();_4be8.initDragDropEvent("drop",false,oThis);_4be6.dispatchEvent(_4be8);}if(_4be7!=null&&_4be7.node!=oThis.node){var _4be8=new draw2d.DragDropEvent();_4be8.initDragDropEvent("figuredrop",false,oThis);_4be7.dispatchEvent(_4be8);}if(draw2d.Drag.currentTarget!=null){var _4be8=new draw2d.DragDropEvent();_4be8.initDragDropEvent("dragleave",false,oThis);draw2d.Drag.currentTarget.dispatchEvent(_4be8);draw2d.Drag.currentTarget=null;}var _4be9=new draw2d.DragDropEvent();_4be9.initDragDropEvent("dragend",false);oThis.dispatchEvent(_4be9);draw2d.Drag.currentCompartment=null;draw2d.Drag.clearCurrent();};if(document.body.addEventListener){document.body.addEventListener("mousemove",this.tempMouseMove,false);document.body.addEventListener("mouseup",this.tempMouseUp,false);}else{if(document.body.attachEvent){document.body.attachEvent("onmousemove",this.tempMouseMove);document.body.attachEvent("onmouseup",this.tempMouseUp);}else{throw new Error("Drag doesn't support this browser.");}}};draw2d.Draggable.prototype.detachEventHandlers=function(){this.isAttached=false;if(document.body.removeEventListener){document.body.removeEventListener("mousemove",this.tempMouseMove,false);document.body.removeEventListener("mouseup",this.tempMouseUp,false);}else{if(document.body.detachEvent){document.body.detachEvent("onmousemove",this.tempMouseMove);document.body.detachEvent("onmouseup",this.tempMouseUp);}else{throw new Error("Drag doesn't support this browser.");}}};draw2d.Draggable.prototype.getDropTarget=function(x,y){for(var i=0;i255){red=255;}}if(green<0){green=0;}else{if(green>255){green=255;}}if(blue<0){blue=0;}else{if(blue>255){blue=255;}}return new draw2d.Color(red,green,blue);};draw2d.Color.prototype.lighter=function(_4f1b){var red=parseInt(Math.round(this.getRed()*(1+_4f1b)));var green=parseInt(Math.round(this.getGreen()*(1+_4f1b)));var blue=parseInt(Math.round(this.getBlue()*(1+_4f1b)));if(red<0){red=0;}else{if(red>255){red=255;}}if(green<0){green=0;}else{if(green>255){green=255;}}if(blue<0){blue=0;}else{if(blue>255){blue=255;}}return new draw2d.Color(red,green,blue);};draw2d.Point=function(x,y){this.x=x;this.y=y;};draw2d.Point.prototype.type="draw2d.Point";draw2d.Point.prototype.getX=function(){return this.x;};draw2d.Point.prototype.getY=function(){return this.y;};draw2d.Point.prototype.getPosition=function(p){var dx=p.x-this.x;var dy=p.y-this.y;if(Math.abs(dx)>Math.abs(dy)){if(dx<0){return draw2d.PositionConstants.WEST;}return draw2d.PositionConstants.EAST;}if(dy<0){return draw2d.PositionConstants.NORTH;}return draw2d.PositionConstants.SOUTH;};draw2d.Point.prototype.equals=function(o){return this.x==o.x&&this.y==o.y;};draw2d.Point.prototype.getDistance=function(other){return Math.sqrt((this.x-other.x)*(this.x-other.x)+(this.y-other.y)*(this.y-other.y));};draw2d.Point.prototype.getTranslated=function(other){return new draw2d.Point(this.x+other.x,this.y+other.y);};draw2d.Point.prototype.getPersistentAttributes=function(){return {x:this.x,y:this.y};};draw2d.Dimension=function(x,y,w,h){draw2d.Point.call(this,x,y);this.w=w;this.h=h;};draw2d.Dimension.prototype=new draw2d.Point;draw2d.Dimension.prototype.type="draw2d.Dimension";draw2d.Dimension.prototype.translate=function(dx,dy){this.x+=dx;this.y+=dy;return this;};draw2d.Dimension.prototype.resize=function(dw,dh){this.w+=dw;this.h+=dh;return this;};draw2d.Dimension.prototype.setBounds=function(rect){this.x=rect.x;this.y=rect.y;this.w=rect.w;this.h=rect.h;return this;};draw2d.Dimension.prototype.isEmpty=function(){return this.w<=0||this.h<=0;};draw2d.Dimension.prototype.getWidth=function(){return this.w;};draw2d.Dimension.prototype.getHeight=function(){return this.h;};draw2d.Dimension.prototype.getRight=function(){return this.x+this.w;};draw2d.Dimension.prototype.getBottom=function(){return this.y+this.h;};draw2d.Dimension.prototype.getTopLeft=function(){return new draw2d.Point(this.x,this.y);};draw2d.Dimension.prototype.getCenter=function(){return new draw2d.Point(this.x+this.w/2,this.y+this.h/2);};draw2d.Dimension.prototype.getBottomRight=function(){return new draw2d.Point(this.x+this.w,this.y+this.h);};draw2d.Dimension.prototype.equals=function(o){return this.x==o.x&&this.y==o.y&&this.w==o.w&&this.h==o.h;};draw2d.SnapToHelper=function(_50db){this.workflow=_50db;};draw2d.SnapToHelper.NORTH=1;draw2d.SnapToHelper.SOUTH=4;draw2d.SnapToHelper.WEST=8;draw2d.SnapToHelper.EAST=16;draw2d.SnapToHelper.CENTER=32;draw2d.SnapToHelper.NORTH_EAST=draw2d.SnapToHelper.NORTH|draw2d.SnapToHelper.EAST;draw2d.SnapToHelper.NORTH_WEST=draw2d.SnapToHelper.NORTH|draw2d.SnapToHelper.WEST;draw2d.SnapToHelper.SOUTH_EAST=draw2d.SnapToHelper.SOUTH|draw2d.SnapToHelper.EAST;draw2d.SnapToHelper.SOUTH_WEST=draw2d.SnapToHelper.SOUTH|draw2d.SnapToHelper.WEST;draw2d.SnapToHelper.NORTH_SOUTH=draw2d.SnapToHelper.NORTH|draw2d.SnapToHelper.SOUTH;draw2d.SnapToHelper.EAST_WEST=draw2d.SnapToHelper.EAST|draw2d.SnapToHelper.WEST;draw2d.SnapToHelper.NSEW=draw2d.SnapToHelper.NORTH_SOUTH|draw2d.SnapToHelper.EAST_WEST;draw2d.SnapToHelper.prototype.snapPoint=function(_50dc,_50dd,_50de){return _50dd;};draw2d.SnapToHelper.prototype.snapRectangle=function(_50df,_50e0){return _50df;};draw2d.SnapToHelper.prototype.onSetDocumentDirty=function(){};draw2d.SnapToGrid=function(_51dc){draw2d.SnapToHelper.call(this,_51dc);};draw2d.SnapToGrid.prototype=new draw2d.SnapToHelper;draw2d.SnapToGrid.prototype.type="draw2d.SnapToGrid";draw2d.SnapToGrid.prototype.snapPoint=function(_51dd,_51de,_51df){_51df.x=this.workflow.gridWidthX*Math.floor(((_51de.x+this.workflow.gridWidthX/2)/this.workflow.gridWidthX));_51df.y=this.workflow.gridWidthY*Math.floor(((_51de.y+this.workflow.gridWidthY/2)/this.workflow.gridWidthY));return 0;};draw2d.SnapToGrid.prototype.snapRectangle=function(_51e0,_51e1){_51e1.x=_51e0.x;_51e1.y=_51e0.y;_51e1.w=_51e0.w;_51e1.h=_51e0.h;return 0;};draw2d.SnapToGeometryEntry=function(type,_5baf){this.type=type;this.location=_5baf;};draw2d.SnapToGeometryEntry.prototype.getLocation=function(){return this.location;};draw2d.SnapToGeometryEntry.prototype.getType=function(){return this.type;};draw2d.SnapToGeometry=function(_4ec2){draw2d.SnapToHelper.call(this,_4ec2);};draw2d.SnapToGeometry.prototype=new draw2d.SnapToHelper;draw2d.SnapToGeometry.THRESHOLD=5;draw2d.SnapToGeometry.prototype.snapPoint=function(_4ec3,_4ec4,_4ec5){if(this.rows==null||this.cols==null){this.populateRowsAndCols();}if((_4ec3&draw2d.SnapToHelper.EAST)!=0){var _4ec6=this.getCorrectionFor(this.cols,_4ec4.getX()-1,1);if(_4ec6!=draw2d.SnapToGeometry.THRESHOLD){_4ec3&=~draw2d.SnapToHelper.EAST;_4ec5.x+=_4ec6;}}if((_4ec3&draw2d.SnapToHelper.WEST)!=0){var _4ec7=this.getCorrectionFor(this.cols,_4ec4.getX(),-1);if(_4ec7!=draw2d.SnapToGeometry.THRESHOLD){_4ec3&=~draw2d.SnapToHelper.WEST;_4ec5.x+=_4ec7;}}if((_4ec3&draw2d.SnapToHelper.SOUTH)!=0){var _4ec8=this.getCorrectionFor(this.rows,_4ec4.getY()-1,1);if(_4ec8!=draw2d.SnapToGeometry.THRESHOLD){_4ec3&=~draw2d.SnapToHelper.SOUTH;_4ec5.y+=_4ec8;}}if((_4ec3&draw2d.SnapToHelper.NORTH)!=0){var _4ec9=this.getCorrectionFor(this.rows,_4ec4.getY(),-1);if(_4ec9!=draw2d.SnapToGeometry.THRESHOLD){_4ec3&=~draw2d.SnapToHelper.NORTH;_4ec5.y+=_4ec9;}}return _4ec3;};draw2d.SnapToGeometry.prototype.snapRectangle=function(_4eca,_4ecb){var _4ecc=_4eca.getTopLeft();var _4ecd=_4eca.getBottomRight();var _4ece=this.snapPoint(draw2d.SnapToHelper.NORTH_WEST,_4eca.getTopLeft(),_4ecc);_4ecb.x=_4ecc.x;_4ecb.y=_4ecc.y;var _4ecf=this.snapPoint(draw2d.SnapToHelper.SOUTH_EAST,_4eca.getBottomRight(),_4ecd);if(_4ece&draw2d.SnapToHelper.WEST){_4ecb.x=_4ecd.x-_4eca.getWidth();}if(_4ece&draw2d.SnapToHelper.NORTH){_4ecb.y=_4ecd.y-_4eca.getHeight();}return _4ece|_4ecf;};draw2d.SnapToGeometry.prototype.populateRowsAndCols=function(){this.rows=new Array();this.cols=new Array();var _4ed0=this.workflow.getDocument().getFigures();var index=0;for(var i=0;i<_4ed0.getSize();i++){var _4ed3=_4ed0.get(i);if(_4ed3!=this.workflow.getCurrentSelection()){var _4ed4=_4ed3.getBounds();this.cols[index*3]=new draw2d.SnapToGeometryEntry(-1,_4ed4.getX());this.rows[index*3]=new draw2d.SnapToGeometryEntry(-1,_4ed4.getY());this.cols[index*3+1]=new draw2d.SnapToGeometryEntry(0,_4ed4.x+(_4ed4.getWidth()-1)/2);this.rows[index*3+1]=new draw2d.SnapToGeometryEntry(0,_4ed4.y+(_4ed4.getHeight()-1)/2);this.cols[index*3+2]=new draw2d.SnapToGeometryEntry(1,_4ed4.getRight()-1);this.rows[index*3+2]=new draw2d.SnapToGeometryEntry(1,_4ed4.getBottom()-1);index++;}}};draw2d.SnapToGeometry.prototype.getCorrectionFor=function(_4ed5,value,side){var _4ed8=draw2d.SnapToGeometry.THRESHOLD;var _4ed9=draw2d.SnapToGeometry.THRESHOLD;for(var i=0;i<_4ed5.length;i++){var entry=_4ed5[i];var _4edc;if(entry.type==-1&&side!=0){_4edc=Math.abs(value-entry.location);if(_4edc<_4ed8){_4ed8=_4edc;_4ed9=entry.location-value;}}else{if(entry.type==0&&side==0){_4edc=Math.abs(value-entry.location);if(_4edc<_4ed8){_4ed8=_4edc;_4ed9=entry.location-value;}}else{if(entry.type==1&&side!=0){_4edc=Math.abs(value-entry.location);if(_4edc<_4ed8){_4ed8=_4edc;_4ed9=entry.location-value;}}}}}return _4ed9;};draw2d.SnapToGeometry.prototype.onSetDocumentDirty=function(){this.rows=null;this.cols=null;};draw2d.Border=function(){this.color=null;};draw2d.Border.prototype.type="draw2d.Border";draw2d.Border.prototype.dispose=function(){this.color=null;};draw2d.Border.prototype.getHTMLStyle=function(){return "";};draw2d.Border.prototype.setColor=function(c){this.color=c;};draw2d.Border.prototype.getColor=function(){return this.color;};draw2d.Border.prototype.refresh=function(){};draw2d.LineBorder=function(width){draw2d.Border.call(this);this.width=1;if(width){this.width=width;}this.figure=null;};draw2d.LineBorder.prototype=new draw2d.Border;draw2d.LineBorder.prototype.type="draw2d.LineBorder";draw2d.LineBorder.prototype.dispose=function(){draw2d.Border.prototype.dispose.call(this);this.figure=null;};draw2d.LineBorder.prototype.setLineWidth=function(w){this.width=w;if(this.figure!=null){this.figure.html.style.border=this.getHTMLStyle();}};draw2d.LineBorder.prototype.getHTMLStyle=function(){if(this.getColor()!=null){return this.width+"px solid "+this.getColor().getHTMLStyle();}return this.width+"px solid black";};draw2d.LineBorder.prototype.refresh=function(){this.setLineWidth(this.width);};draw2d.Figure=function(){this.construct();};draw2d.Figure.prototype.type="draw2d.Figure";draw2d.Figure.ZOrderBaseIndex=100;draw2d.Figure.setZOrderBaseIndex=function(index){draw2d.Figure.ZOrderBaseIndex=index;};draw2d.Figure.prototype.construct=function(){this.lastDragStartTime=0;this.x=0;this.y=0;this.border=null;this.setDimension(10,10);this.id=draw2d.UUID.create();this.html=this.createHTMLElement();this.canvas=null;this.workflow=null;this.draggable=null;this.parent=null;this.isMoving=false;this.canSnapToHelper=true;this.snapToGridAnchor=new draw2d.Point(0,0);this.timer=-1;this.model=null;this.setDeleteable(true);this.setCanDrag(true);this.setResizeable(true);this.setSelectable(true);this.properties=new Object();this.moveListener=new draw2d.ArrayList();};draw2d.Figure.prototype.dispose=function(){this.canvas=null;this.workflow=null;this.moveListener=null;if(this.draggable!=null){this.draggable.removeEventListener("mouseenter",this.tmpMouseEnter);this.draggable.removeEventListener("mouseleave",this.tmpMouseLeave);this.draggable.removeEventListener("dragend",this.tmpDragend);this.draggable.removeEventListener("dragstart",this.tmpDragstart);this.draggable.removeEventListener("drag",this.tmpDrag);this.draggable.removeEventListener("dblclick",this.tmpDoubleClick);this.draggable.node=null;this.draggable.target.removeAllElements();}this.draggable=null;if(this.border!=null){this.border.dispose();}this.border=null;if(this.parent!=null){this.parent.removeChild(this);}};draw2d.Figure.prototype.getProperties=function(){return this.properties;};draw2d.Figure.prototype.getProperty=function(key){return this.properties[key];};draw2d.Figure.prototype.setProperty=function(key,value){this.properties[key]=value;this.setDocumentDirty();};draw2d.Figure.prototype.getId=function(){return this.id;};draw2d.Figure.prototype.setId=function(id){this.id=id;if(this.html!=null){this.html.id=id;}};draw2d.Figure.prototype.setCanvas=function(_5aca){this.canvas=_5aca;};draw2d.Figure.prototype.getWorkflow=function(){return this.workflow;};draw2d.Figure.prototype.setWorkflow=function(_5acb){if(this.draggable==null){this.html.tabIndex="0";var oThis=this;this.keyDown=function(event){event.cancelBubble=true;event.returnValue=true;oThis.onKeyDown(event.keyCode,event.ctrlKey);};if(this.html.addEventListener){this.html.addEventListener("keydown",this.keyDown,false);}else{if(this.html.attachEvent){this.html.attachEvent("onkeydown",this.keyDown);}}this.draggable=new draw2d.Draggable(this.html,draw2d.Draggable.DRAG_X|draw2d.Draggable.DRAG_Y);this.draggable.node=this;this.tmpContextMenu=function(_5ace){oThis.onContextMenu(oThis.x+_5ace.x,_5ace.y+oThis.y);};this.tmpMouseEnter=function(_5acf){oThis.onMouseEnter();};this.tmpMouseLeave=function(_5ad0){oThis.onMouseLeave();};this.tmpDragend=function(_5ad1){oThis.onDragend();};this.tmpDragstart=function(_5ad2){var w=oThis.workflow;w.showMenu(null);if(w.toolPalette&&w.toolPalette.activeTool){_5ad2.returnValue=false;w.onMouseDown(oThis.x+_5ad2.x,_5ad2.y+oThis.y);w.onMouseUp(oThis.x+_5ad2.x,_5ad2.y+oThis.y);return;}if(!(oThis instanceof draw2d.ResizeHandle)&&!(oThis instanceof draw2d.Port)){var line=w.getBestLine(oThis.x+_5ad2.x,_5ad2.y+oThis.y);if(line!=null){_5ad2.returnValue=false;w.setCurrentSelection(line);w.showLineResizeHandles(line);w.onMouseDown(oThis.x+_5ad2.x,_5ad2.y+oThis.y);return;}else{if(oThis.isSelectable()){w.showResizeHandles(oThis);w.setCurrentSelection(oThis);}}}_5ad2.returnValue=oThis.onDragstart(_5ad2.x,_5ad2.y);};this.tmpDrag=function(_5ad5){oThis.onDrag();};this.tmpDoubleClick=function(_5ad6){oThis.onDoubleClick();};this.draggable.addEventListener("contextmenu",this.tmpContextMenu);this.draggable.addEventListener("mouseenter",this.tmpMouseEnter);this.draggable.addEventListener("mouseleave",this.tmpMouseLeave);this.draggable.addEventListener("dragend",this.tmpDragend);this.draggable.addEventListener("dragstart",this.tmpDragstart);this.draggable.addEventListener("drag",this.tmpDrag);this.draggable.addEventListener("dblclick",this.tmpDoubleClick);}this.workflow=_5acb;};draw2d.Figure.prototype.createHTMLElement=function(){var item=document.createElement("div");item.id=this.id;item.style.position="absolute";item.style.left=this.x+"px";item.style.top=this.y+"px";item.style.height=this.width+"px";item.style.width=this.height+"px";item.style.margin="0px";item.style.padding="0px";item.style.outline="none";item.style.zIndex=""+draw2d.Figure.ZOrderBaseIndex;return item;};draw2d.Figure.prototype.setParent=function(_5ad8){this.parent=_5ad8;};draw2d.Figure.prototype.getParent=function(){return this.parent;};draw2d.Figure.prototype.getZOrder=function(){return this.html.style.zIndex;};draw2d.Figure.prototype.setZOrder=function(index){this.html.style.zIndex=index;};draw2d.Figure.prototype.hasFixedPosition=function(){return false;};draw2d.Figure.prototype.getMinWidth=function(){return 5;};draw2d.Figure.prototype.getMinHeight=function(){return 5;};draw2d.Figure.prototype.getHTMLElement=function(){if(this.html==null){this.html=this.createHTMLElement();}return this.html;};draw2d.Figure.prototype.paint=function(){};draw2d.Figure.prototype.setBorder=function(_5ada){if(this.border!=null){this.border.figure=null;}this.border=_5ada;this.border.figure=this;this.border.refresh();this.setDocumentDirty();};draw2d.Figure.prototype.onContextMenu=function(x,y){var menu=this.getContextMenu();if(menu!=null){this.workflow.showMenu(menu,x,y);}};draw2d.Figure.prototype.getContextMenu=function(){return null;};draw2d.Figure.prototype.onDoubleClick=function(){};draw2d.Figure.prototype.onMouseEnter=function(){};draw2d.Figure.prototype.onMouseLeave=function(){};draw2d.Figure.prototype.onDrag=function(){this.x=this.draggable.getLeft();this.y=this.draggable.getTop();if(this.isMoving==false){this.isMoving=true;this.setAlpha(0.5);}this.fireMoveEvent();};draw2d.Figure.prototype.onDragend=function(){if(this.getWorkflow().getEnableSmoothFigureHandling()==true){var _5ade=this;var _5adf=function(){if(_5ade.alpha<1){_5ade.setAlpha(Math.min(1,_5ade.alpha+0.05));}else{window.clearInterval(_5ade.timer);_5ade.timer=-1;}};if(_5ade.timer>0){window.clearInterval(_5ade.timer);}_5ade.timer=window.setInterval(_5adf,20);}else{this.setAlpha(1);}this.command.setPosition(this.x,this.y);this.workflow.commandStack.execute(this.command);this.command=null;this.isMoving=false;this.workflow.hideSnapToHelperLines();this.fireMoveEvent();};draw2d.Figure.prototype.onDragstart=function(x,y){this.command=this.createCommand(new draw2d.EditPolicy(draw2d.EditPolicy.MOVE));return this.command!=null;};draw2d.Figure.prototype.setCanDrag=function(flag){this.canDrag=flag;if(flag){this.html.style.cursor="move";}else{this.html.style.cursor="";}};draw2d.Figure.prototype.setAlpha=function(_5ae3){if(this.alpha==_5ae3){return;}try{this.html.style.MozOpacity=_5ae3;}catch(exc){}try{this.html.style.opacity=_5ae3;}catch(exc){}try{var _5ae4=Math.round(_5ae3*100);if(_5ae4>=99){this.html.style.filter="";}else{this.html.style.filter="alpha(opacity="+_5ae4+")";}}catch(exc){}this.alpha=_5ae3;};draw2d.Figure.prototype.setDimension=function(w,h){this.width=Math.max(this.getMinWidth(),w);this.height=Math.max(this.getMinHeight(),h);if(this.html==null){return;}this.html.style.width=this.width+"px";this.html.style.height=this.height+"px";this.fireMoveEvent();if(this.workflow!=null&&this.workflow.getCurrentSelection()==this){this.workflow.showResizeHandles(this);}};draw2d.Figure.prototype.setPosition=function(xPos,yPos){this.x=xPos;this.y=yPos;if(this.html==null){return;}this.html.style.left=this.x+"px";this.html.style.top=this.y+"px";this.fireMoveEvent();if(this.workflow!=null&&this.workflow.getCurrentSelection()==this){this.workflow.showResizeHandles(this);}};draw2d.Figure.prototype.isResizeable=function(){return this.resizeable;};draw2d.Figure.prototype.setResizeable=function(flag){this.resizeable=flag;};draw2d.Figure.prototype.isSelectable=function(){return this.selectable;};draw2d.Figure.prototype.setSelectable=function(flag){this.selectable=flag;};draw2d.Figure.prototype.isStrechable=function(){return true;};draw2d.Figure.prototype.isDeleteable=function(){return this.deleteable;};draw2d.Figure.prototype.setDeleteable=function(flag){this.deleteable=flag;};draw2d.Figure.prototype.setCanSnapToHelper=function(flag){this.canSnapToHelper=flag;};draw2d.Figure.prototype.getCanSnapToHelper=function(){return this.canSnapToHelper;};draw2d.Figure.prototype.getSnapToGridAnchor=function(){return this.snapToGridAnchor;};draw2d.Figure.prototype.setSnapToGridAnchor=function(point){this.snapToGridAnchor=point;};draw2d.Figure.prototype.getBounds=function(){return new draw2d.Dimension(this.getX(),this.getY(),this.getWidth(),this.getHeight());};draw2d.Figure.prototype.getWidth=function(){return this.width;};draw2d.Figure.prototype.getHeight=function(){return this.height;};draw2d.Figure.prototype.getY=function(){return this.y;};draw2d.Figure.prototype.getX=function(){return this.x;};draw2d.Figure.prototype.getAbsoluteY=function(){return this.y;};draw2d.Figure.prototype.getAbsoluteX=function(){return this.x;};draw2d.Figure.prototype.onKeyDown=function(_5aee,ctrl){if(_5aee==46){this.workflow.getCommandStack().execute(this.createCommand(new draw2d.EditPolicy(draw2d.EditPolicy.DELETE)));}if(ctrl){this.workflow.onKeyDown(_5aee,ctrl);}};draw2d.Figure.prototype.getPosition=function(){return new draw2d.Point(this.x,this.y);};draw2d.Figure.prototype.isOver=function(iX,iY){var x=this.getAbsoluteX();var y=this.getAbsoluteY();var iX2=x+this.width;var iY2=y+this.height;return (iX>=x&&iX<=iX2&&iY>=y&&iY<=iY2);};draw2d.Figure.prototype.attachMoveListener=function(_5af6){if(_5af6==null||this.moveListener==null){return;}this.moveListener.add(_5af6);};draw2d.Figure.prototype.detachMoveListener=function(_5af7){if(_5af7==null||this.moveListener==null){return;}this.moveListener.remove(_5af7);};draw2d.Figure.prototype.fireMoveEvent=function(){this.setDocumentDirty();var size=this.moveListener.getSize();for(var i=0;ih){draw2d.Oval.prototype.setDimension.call(this,w,w);}else{draw2d.Oval.prototype.setDimension.call(this,h,h);}};draw2d.Circle.prototype.isStrechable=function(){return false;};draw2d.Rectangle=function(width,_5bd4){this.bgColor=null;this.lineColor=new draw2d.Color(0,0,0);this.lineStroke=1;draw2d.Figure.call(this);if(width&&_5bd4){this.setDimension(width,_5bd4);}};draw2d.Rectangle.prototype=new draw2d.Figure;draw2d.Rectangle.prototype.type="draw2d.Rectangle";draw2d.Rectangle.prototype.dispose=function(){draw2d.Figure.prototype.dispose.call(this);this.bgColor=null;this.lineColor=null;};draw2d.Rectangle.prototype.createHTMLElement=function(){var item=draw2d.Figure.prototype.createHTMLElement.call(this);item.style.width="auto";item.style.height="auto";item.style.margin="0px";item.style.padding="0px";item.style.border=this.lineStroke+"px solid "+this.lineColor.getHTMLStyle();item.style.fontSize="1px";item.style.lineHeight="1px";item.innerHTML=" ";if(this.bgColor!=null){item.style.backgroundColor=this.bgColor.getHTMLStyle();}return item;};draw2d.Rectangle.prototype.setBackgroundColor=function(color){this.bgColor=color;if(this.bgColor!=null){this.html.style.backgroundColor=this.bgColor.getHTMLStyle();}else{this.html.style.backgroundColor="transparent";}};draw2d.Rectangle.prototype.getBackgroundColor=function(){return this.bgColor;};draw2d.Rectangle.prototype.setColor=function(color){this.lineColor=color;if(this.lineColor!=null){this.html.style.border=this.lineStroke+"px solid "+this.lineColor.getHTMLStyle();}else{this.html.style.border=this.lineStroke+"0px";}};draw2d.Rectangle.prototype.getColor=function(){return this.lineColor;};draw2d.Rectangle.prototype.getWidth=function(){return draw2d.Figure.prototype.getWidth.call(this)+2*this.lineStroke;};draw2d.Rectangle.prototype.getHeight=function(){return draw2d.Figure.prototype.getHeight.call(this)+2*this.lineStroke;};draw2d.Rectangle.prototype.setDimension=function(w,h){return draw2d.Figure.prototype.setDimension.call(this,w-2*this.lineStroke,h-2*this.lineStroke);};draw2d.Rectangle.prototype.setLineWidth=function(w){var diff=w-this.lineStroke;this.setDimension(this.getWidth()-2*diff,this.getHeight()-2*diff);this.lineStroke=w;var c="transparent";if(this.lineColor!=null){c=this.lineColor.getHTMLStyle();}this.html.style.border=this.lineStroke+"px solid "+c;};draw2d.Rectangle.prototype.getLineWidth=function(){return this.lineStroke;};draw2d.ImageFigure=function(url){this.url=url;draw2d.Node.call(this);this.setDimension(40,40);};draw2d.ImageFigure.prototype=new draw2d.Node;draw2d.ImageFigure.prototype.type="draw2d.Image";draw2d.ImageFigure.prototype.createHTMLElement=function(){var item=draw2d.Node.prototype.createHTMLElement.call(this);item.style.width=this.width+"px";item.style.height=this.height+"px";item.style.margin="0px";item.style.padding="0px";item.style.border="0px";if(this.url!=null){item.style.backgroundImage="url("+this.url+")";}else{item.style.backgroundImage="";}return item;};draw2d.ImageFigure.prototype.setColor=function(color){};draw2d.ImageFigure.prototype.isResizeable=function(){return false;};draw2d.ImageFigure.prototype.setImage=function(url){this.url=url;if(this.url!=null){this.html.style.backgroundImage="url("+this.url+")";}else{this.html.style.backgroundImage="";}};draw2d.Port=function(_5193,_5194){Corona=function(){};Corona.prototype=new draw2d.Circle;Corona.prototype.setAlpha=function(_5195){draw2d.Circle.prototype.setAlpha.call(this,Math.min(0.3,_5195));};if(_5193==null){this.currentUIRepresentation=new draw2d.Circle();}else{this.currentUIRepresentation=_5193;}if(_5194==null){this.connectedUIRepresentation=new draw2d.Circle();this.connectedUIRepresentation.setColor(null);}else{this.connectedUIRepresentation=_5194;}this.disconnectedUIRepresentation=this.currentUIRepresentation;this.hideIfConnected=false;this.uiRepresentationAdded=true;this.parentNode=null;this.originX=0;this.originY=0;this.coronaWidth=10;this.corona=null;draw2d.Rectangle.call(this);this.setDimension(8,8);this.setBackgroundColor(new draw2d.Color(100,180,100));this.setColor(new draw2d.Color(90,150,90));draw2d.Rectangle.prototype.setColor.call(this,null);this.dropable=new draw2d.DropTarget(this.html);this.dropable.node=this;this.dropable.addEventListener("dragenter",function(_5196){_5196.target.node.onDragEnter(_5196.relatedTarget.node);});this.dropable.addEventListener("dragleave",function(_5197){_5197.target.node.onDragLeave(_5197.relatedTarget.node);});this.dropable.addEventListener("drop",function(_5198){_5198.relatedTarget.node.onDrop(_5198.target.node);});};draw2d.Port.prototype=new draw2d.Rectangle;draw2d.Port.prototype.type="draw2d.Port";draw2d.Port.ZOrderBaseIndex=5000;draw2d.Port.setZOrderBaseIndex=function(index){draw2d.Port.ZOrderBaseIndex=index;};draw2d.Port.prototype.setHideIfConnected=function(flag){this.hideIfConnected=flag;};draw2d.Port.prototype.dispose=function(){var size=this.moveListener.getSize();for(var i=0;i=x&&iX<=iX2&&iY>=y&&iY<=iY2);};draw2d.Port.prototype.showCorona=function(flag,_51bf){if(flag==true){this.corona=new Corona();this.corona.setAlpha(0.3);this.corona.setBackgroundColor(new draw2d.Color(0,125,125));this.corona.setColor(null);this.corona.setDimension(this.getWidth()+(this.getCoronaWidth()*2),this.getWidth()+(this.getCoronaWidth()*2));this.parentNode.getWorkflow().addFigure(this.corona,this.getAbsoluteX()-this.getCoronaWidth()-this.getWidth()/2,this.getAbsoluteY()-this.getCoronaWidth()-this.getHeight()/2);}else{if(flag==false&&this.corona!=null){this.parentNode.getWorkflow().removeFigure(this.corona);this.corona=null;}}};draw2d.Port.prototype.createCommand=function(_51c0){if(_51c0.getPolicy()==draw2d.EditPolicy.MOVE){return new draw2d.CommandMovePort(this);}if(_51c0.getPolicy()==draw2d.EditPolicy.CONNECT){if(_51c0.source.parentNode.id==_51c0.target.parentNode.id){return null;}else{return new draw2d.CommandConnect(_51c0.canvas,_51c0.source,_51c0.target);}}return null;};draw2d.InputPort=function(_5285){draw2d.Port.call(this,_5285);};draw2d.InputPort.prototype=new draw2d.Port;draw2d.InputPort.prototype.type="draw2d.InputPort";draw2d.InputPort.prototype.onDragEnter=function(port){if(port instanceof draw2d.OutputPort){draw2d.Port.prototype.onDragEnter.call(this,port);}else{if(port instanceof draw2d.LineStartResizeHandle){var line=this.workflow.currentSelection;if(line instanceof draw2d.Connection&&line.getSource() instanceof draw2d.InputPort){draw2d.Port.prototype.onDragEnter.call(this,line.getSource());}}else{if(port instanceof draw2d.LineEndResizeHandle){var line=this.workflow.currentSelection;if(line instanceof draw2d.Connection&&line.getTarget() instanceof draw2d.InputPort){draw2d.Port.prototype.onDragEnter.call(this,line.getTarget());}}}}};draw2d.InputPort.prototype.onDragLeave=function(port){if(port instanceof draw2d.OutputPort){draw2d.Port.prototype.onDragLeave.call(this,port);}else{if(port instanceof draw2d.LineStartResizeHandle){var line=this.workflow.currentSelection;if(line instanceof draw2d.Connection&&line.getSource() instanceof draw2d.InputPort){draw2d.Port.prototype.onDragLeave.call(this,line.getSource());}}else{if(port instanceof draw2d.LineEndResizeHandle){var line=this.workflow.currentSelection;if(line instanceof draw2d.Connection&&line.getTarget() instanceof draw2d.InputPort){draw2d.Port.prototype.onDragLeave.call(this,line.getTarget());}}}}};draw2d.InputPort.prototype.createCommand=function(_528a){if(_528a.getPolicy()==draw2d.EditPolicy.CONNECT){if(_528a.source.parentNode.id==_528a.target.parentNode.id){return null;}if(_528a.source instanceof draw2d.OutputPort){return new draw2d.CommandConnect(_528a.canvas,_528a.source,_528a.target);}return null;}return draw2d.Port.prototype.createCommand.call(this,_528a);};draw2d.OutputPort=function(_48cd){draw2d.Port.call(this,_48cd);this.maxFanOut=100;};draw2d.OutputPort.prototype=new draw2d.Port;draw2d.OutputPort.prototype.type="draw2d.OutputPort";draw2d.OutputPort.prototype.onDragEnter=function(port){if(this.getMaxFanOut()<=this.getFanOut()){return;}if(port instanceof draw2d.InputPort){draw2d.Port.prototype.onDragEnter.call(this,port);}else{if(port instanceof draw2d.LineStartResizeHandle){var line=this.workflow.currentSelection;if(line instanceof draw2d.Connection&&line.getSource() instanceof draw2d.OutputPort){draw2d.Port.prototype.onDragEnter.call(this,line.getSource());}}else{if(port instanceof draw2d.LineEndResizeHandle){var line=this.workflow.currentSelection;if(line instanceof draw2d.Connection&&line.getTarget() instanceof draw2d.OutputPort){draw2d.Port.prototype.onDragEnter.call(this,line.getTarget());}}}}};draw2d.OutputPort.prototype.onDragLeave=function(port){if(port instanceof draw2d.InputPort){draw2d.Port.prototype.onDragLeave.call(this,port);}else{if(port instanceof draw2d.LineStartResizeHandle){var line=this.workflow.currentSelection;if(line instanceof draw2d.Connection&&line.getSource() instanceof draw2d.OutputPort){draw2d.Port.prototype.onDragLeave.call(this,line.getSource());}}else{if(port instanceof draw2d.LineEndResizeHandle){var line=this.workflow.currentSelection;if(line instanceof draw2d.Connection&&line.getTarget() instanceof draw2d.OutputPort){draw2d.Port.prototype.onDragLeave.call(this,line.getTarget());}}}}};draw2d.OutputPort.prototype.onDragstart=function(x,y){if(this.maxFanOut==-1){return true;}if(this.getMaxFanOut()<=this.getFanOut()){return false;}return true;};draw2d.OutputPort.prototype.setMaxFanOut=function(count){this.maxFanOut=count;};draw2d.OutputPort.prototype.getMaxFanOut=function(){return this.maxFanOut;};draw2d.OutputPort.prototype.getFanOut=function(){if(this.getParent().workflow==null){return 0;}var count=0;var lines=this.getParent().workflow.getLines();var size=lines.getSize();for(var i=0;i=99){this.html.style.filter="";}else{this.html.style.filter="alpha(opacity="+_4d47+")";}}catch(exc){}this.alpha=_4d46;};draw2d.Line.prototype.setStartPoint=function(x,y){this.startX=x;this.startY=y;if(this.graphics!=null){this.paint();}this.setDocumentDirty();};draw2d.Line.prototype.setEndPoint=function(x,y){this.endX=x;this.endY=y;if(this.graphics!=null){this.paint();}this.setDocumentDirty();};draw2d.Line.prototype.getStartX=function(){return this.startX;};draw2d.Line.prototype.getStartY=function(){return this.startY;};draw2d.Line.prototype.getStartPoint=function(){return new draw2d.Point(this.startX,this.startY);};draw2d.Line.prototype.getEndX=function(){return this.endX;};draw2d.Line.prototype.getEndY=function(){return this.endY;};draw2d.Line.prototype.getEndPoint=function(){return new draw2d.Point(this.endX,this.endY);};draw2d.Line.prototype.isSelectable=function(){return this.selectable;};draw2d.Line.prototype.setSelectable=function(flag){this.selectable=flag;};draw2d.Line.prototype.isDeleteable=function(){return this.deleteable;};draw2d.Line.prototype.setDeleteable=function(flag){this.deleteable=flag;};draw2d.Line.prototype.getLength=function(){return Math.sqrt((this.startX-this.endX)*(this.startX-this.endX)+(this.startY-this.endY)*(this.startY-this.endY));};draw2d.Line.prototype.getAngle=function(){var _4d4e=this.getLength();var angle=-(180/Math.PI)*Math.asin((this.startY-this.endY)/_4d4e);if(angle<0){if(this.endX0)&&((yDiff*yDiff)0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){point=new draw2d.Point(toPt.x,_5a5b.y);}else{if(_5a5c==toDir){var pos=Math.min(_5a5b.x,toPt.x)-this.MINDIST;point=new draw2d.Point(pos,_5a5b.y);}else{point=new draw2d.Point(_5a5b.x-(xDiff/2),_5a5b.y);}}}if(yDiff>0){dir=UP;}else{dir=DOWN;}}}else{if(_5a5c==RIGHT){if((xDiff<0)&&((yDiff*yDiff)0){point=new draw2d.Point(_5a5b.x+this.MINDIST,_5a5b.y);}else{if(((yDiff>0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){point=new draw2d.Point(toPt.x,_5a5b.y);}else{if(_5a5c==toDir){var pos=Math.max(_5a5b.x,toPt.x)+this.MINDIST;point=new draw2d.Point(pos,_5a5b.y);}else{point=new draw2d.Point(_5a5b.x-(xDiff/2),_5a5b.y);}}}if(yDiff>0){dir=UP;}else{dir=DOWN;}}}else{if(_5a5c==DOWN){if(((xDiff*xDiff)0){point=new draw2d.Point(_5a5b.x,_5a5b.y+this.MINDIST);}else{if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){point=new draw2d.Point(_5a5b.x,toPt.y);}else{if(_5a5c==toDir){var pos=Math.max(_5a5b.y,toPt.y)+this.MINDIST;point=new draw2d.Point(_5a5b.x,pos);}else{point=new draw2d.Point(_5a5b.x,_5a5b.y-(yDiff/2));}}}if(xDiff>0){dir=LEFT;}else{dir=RIGHT;}}}else{if(_5a5c==UP){if(((xDiff*xDiff)0)&&(toDir==DOWN)){point=toPt;dir=toDir;}else{if(yDiff<0){point=new draw2d.Point(_5a5b.x,_5a5b.y-this.MINDIST);}else{if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){point=new draw2d.Point(_5a5b.x,toPt.y);}else{if(_5a5c==toDir){var pos=Math.min(_5a5b.y,toPt.y)-this.MINDIST;point=new draw2d.Point(_5a5b.x,pos);}else{point=new draw2d.Point(_5a5b.x,_5a5b.y-(yDiff/2));}}}if(xDiff>0){dir=LEFT;}else{dir=RIGHT;}}}}}}this._route(conn,point,dir,toPt,toDir);conn.addPoint(_5a5b);};draw2d.BezierConnectionRouter=function(_5a8c){if(!_5a8c){this.cheapRouter=new draw2d.ManhattanConnectionRouter();}else{this.cheapRouter=null;}this.iteration=5;};draw2d.BezierConnectionRouter.prototype=new draw2d.ConnectionRouter;draw2d.BezierConnectionRouter.prototype.type="draw2d.BezierConnectionRouter";draw2d.BezierConnectionRouter.prototype.drawBezier=function(_5a8d,_5a8e,t,iter){var n=_5a8d.length-1;var q=new Array();var _5a93=n+1;for(var i=0;i<_5a93;i++){q[i]=new Array();q[i][0]=_5a8d[i];}for(var j=1;j<=n;j++){for(var i=0;i<=(n-j);i++){q[i][j]=new draw2d.Point((1-t)*q[i][j-1].x+t*q[i+1][j-1].x,(1-t)*q[i][j-1].y+t*q[i+1][j-1].y);}}var c1=new Array();var c2=new Array();for(var i=0;i=0){this.drawBezier(c1,_5a8e,t,--iter);this.drawBezier(c2,_5a8e,t,--iter);}else{for(var i=0;i0)&&((yDiff*yDiff)0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){point=new draw2d.Point(toPt.x,_5aa0.y);}else{if(_5aa1==toDir){var pos=Math.min(_5aa0.x,toPt.x)-_5aa6;point=new draw2d.Point(pos,_5aa0.y);}else{point=new draw2d.Point(_5aa0.x-(xDiff/2),_5aa0.y);}}}if(yDiff>0){dir=UP;}else{dir=DOWN;}}}else{if(_5aa1==RIGHT){if((xDiff<0)&&((yDiff*yDiff)0){point=new draw2d.Point(_5aa0.x+_5aa6,_5aa0.y);}else{if(((yDiff>0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){point=new draw2d.Point(toPt.x,_5aa0.y);}else{if(_5aa1==toDir){var pos=Math.max(_5aa0.x,toPt.x)+_5aa6;point=new draw2d.Point(pos,_5aa0.y);}else{point=new draw2d.Point(_5aa0.x-(xDiff/2),_5aa0.y);}}}if(yDiff>0){dir=UP;}else{dir=DOWN;}}}else{if(_5aa1==DOWN){if(((xDiff*xDiff)0){point=new draw2d.Point(_5aa0.x,_5aa0.y+_5aa6);}else{if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){point=new draw2d.Point(_5aa0.x,toPt.y);}else{if(_5aa1==toDir){var pos=Math.max(_5aa0.y,toPt.y)+_5aa6;point=new draw2d.Point(_5aa0.x,pos);}else{point=new draw2d.Point(_5aa0.x,_5aa0.y-(yDiff/2));}}}if(xDiff>0){dir=LEFT;}else{dir=RIGHT;}}}else{if(_5aa1==UP){if(((xDiff*xDiff)0)&&(toDir==DOWN)){point=toPt;dir=toDir;}else{if(yDiff<0){point=new draw2d.Point(_5aa0.x,_5aa0.y-_5aa6);}else{if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){point=new draw2d.Point(_5aa0.x,toPt.y);}else{if(_5aa1==toDir){var pos=Math.min(_5aa0.y,toPt.y)-_5aa6;point=new draw2d.Point(_5aa0.x,pos);}else{point=new draw2d.Point(_5aa0.x,_5aa0.y-(yDiff/2));}}}if(xDiff>0){dir=LEFT;}else{dir=RIGHT;}}}}}}this._route(_5a9e,conn,point,dir,toPt,toDir);_5a9e.push(_5aa0);};draw2d.FanConnectionRouter=function(){};draw2d.FanConnectionRouter.prototype=new draw2d.NullConnectionRouter;draw2d.FanConnectionRouter.prototype.type="draw2d.FanConnectionRouter";draw2d.FanConnectionRouter.prototype.route=function(conn){var _5bb3=conn.getStartPoint();var toPt=conn.getEndPoint();var lines=conn.getSource().getConnections();var _5bb6=new draw2d.ArrayList();var index=0;for(var i=0;i1){this.routeCollision(conn,index);}else{draw2d.NullConnectionRouter.prototype.route.call(this,conn);}};draw2d.FanConnectionRouter.prototype.routeNormal=function(conn){conn.addPoint(conn.getStartPoint());conn.addPoint(conn.getEndPoint());};draw2d.FanConnectionRouter.prototype.routeCollision=function(conn,index){var start=conn.getStartPoint();var end=conn.getEndPoint();conn.addPoint(start);var _5bbf=10;var _5bc0=new draw2d.Point((end.x+start.x)/2,(end.y+start.y)/2);var _5bc1=end.getPosition(start);var ray;if(_5bc1==draw2d.PositionConstants.SOUTH||_5bc1==draw2d.PositionConstants.EAST){ray=new draw2d.Point(end.x-start.x,end.y-start.y);}else{ray=new draw2d.Point(start.x-end.x,start.y-end.y);}var _5bc3=Math.sqrt(ray.x*ray.x+ray.y*ray.y);var _5bc4=_5bbf*ray.x/_5bc3;var _5bc5=_5bbf*ray.y/_5bc3;var _5bc6;if(index%2==0){_5bc6=new draw2d.Point(_5bc0.x+(index/2)*(-1*_5bc5),_5bc0.y+(index/2)*_5bc4);}else{_5bc6=new draw2d.Point(_5bc0.x+(index/2)*_5bc5,_5bc0.y+(index/2)*(-1*_5bc4));}conn.addPoint(_5bc6);conn.addPoint(end);};draw2d.Graphics=function(_4b58,_4b59,_4b5a){this.jsGraphics=_4b58;this.xt=_4b5a.x;this.yt=_4b5a.y;this.radian=_4b59*Math.PI/180;this.sinRadian=Math.sin(this.radian);this.cosRadian=Math.cos(this.radian);};draw2d.Graphics.prototype.setStroke=function(x){this.jsGraphics.setStroke(x);};draw2d.Graphics.prototype.drawLine=function(x1,y1,x2,y2){var _x1=this.xt+x1*this.cosRadian-y1*this.sinRadian;var _y1=this.yt+x1*this.sinRadian+y1*this.cosRadian;var _x2=this.xt+x2*this.cosRadian-y2*this.sinRadian;var _y2=this.yt+x2*this.sinRadian+y2*this.cosRadian;this.jsGraphics.drawLine(_x1,_y1,_x2,_y2);};draw2d.Graphics.prototype.fillRect=function(x,y,w,h){var x1=this.xt+x*this.cosRadian-y*this.sinRadian;var y1=this.yt+x*this.sinRadian+y*this.cosRadian;var x2=this.xt+(x+w)*this.cosRadian-y*this.sinRadian;var y2=this.yt+(x+w)*this.sinRadian+y*this.cosRadian;var x3=this.xt+(x+w)*this.cosRadian-(y+h)*this.sinRadian;var y3=this.yt+(x+w)*this.sinRadian+(y+h)*this.cosRadian;var x4=this.xt+x*this.cosRadian-(y+h)*this.sinRadian;var y4=this.yt+x*this.sinRadian+(y+h)*this.cosRadian;this.jsGraphics.fillPolygon([x1,x2,x3,x4],[y1,y2,y3,y4]);};draw2d.Graphics.prototype.fillPolygon=function(_4b70,_4b71){var rotX=new Array();var rotY=new Array();for(var i=0;i<_4b70.length;i++){rotX[i]=this.xt+_4b70[i]*this.cosRadian-_4b71[i]*this.sinRadian;rotY[i]=this.yt+_4b70[i]*this.sinRadian+_4b71[i]*this.cosRadian;}this.jsGraphics.fillPolygon(rotX,rotY);};draw2d.Graphics.prototype.setColor=function(color){this.jsGraphics.setColor(color.getHTMLStyle());};draw2d.Graphics.prototype.drawPolygon=function(_4b76,_4b77){var rotX=new Array();var rotY=new Array();for(var i=0;i<_4b76.length;i++){rotX[i]=this.xt+_4b76[i]*this.cosRadian-_4b77[i]*this.sinRadian;rotY[i]=this.yt+_4b76[i]*this.sinRadian+_4b77[i]*this.cosRadian;}this.jsGraphics.drawPolygon(rotX,rotY);};draw2d.Connection=function(){draw2d.Line.call(this);this.sourcePort=null;this.targetPort=null;this.sourceDecorator=null;this.targetDecorator=null;this.sourceAnchor=new draw2d.ConnectionAnchor();this.targetAnchor=new draw2d.ConnectionAnchor();this.router=draw2d.Connection.defaultRouter;this.lineSegments=new draw2d.ArrayList();this.children=new draw2d.ArrayList();this.setColor(new draw2d.Color(0,0,115));this.setLineWidth(1);};draw2d.Connection.prototype=new draw2d.Line;draw2d.Connection.prototype.type="draw2d.Connection";draw2d.Connection.defaultRouter=new draw2d.ManhattanConnectionRouter();draw2d.Connection.setDefaultRouter=function(_5618){draw2d.Connection.defaultRouter=_5618;};draw2d.Connection.prototype.disconnect=function(){if(this.sourcePort!=null){this.sourcePort.detachMoveListener(this);this.fireSourcePortRouteEvent();}if(this.targetPort!=null){this.targetPort.detachMoveListener(this);this.fireTargetPortRouteEvent();}};draw2d.Connection.prototype.reconnect=function(){if(this.sourcePort!=null){this.sourcePort.attachMoveListener(this);this.fireSourcePortRouteEvent();}if(this.targetPort!=null){this.targetPort.attachMoveListener(this);this.fireTargetPortRouteEvent();}};draw2d.Connection.prototype.isResizeable=function(){return true;};draw2d.Connection.prototype.addFigure=function(_5619,_561a){var entry=new Object();entry.figure=_5619;entry.locator=_561a;this.children.add(entry);if(this.graphics!=null){this.paint();}var oThis=this;var _561d=function(){var _561e=arguments[0]||window.event;_561e.returnValue=false;oThis.getWorkflow().setCurrentSelection(oThis);oThis.getWorkflow().showLineResizeHandles(oThis);};if(_5619.getHTMLElement().addEventListener){_5619.getHTMLElement().addEventListener("mousedown",_561d,false);}else{if(this.html.attachEvent){_5619.getHTMLElement().attachEvent("onmouseup",mouseUp);}}};draw2d.Connection.prototype.setSourceDecorator=function(_561f){this.sourceDecorator=_561f;if(this.graphics!=null){this.paint();}};draw2d.Connection.prototype.setTargetDecorator=function(_5620){this.targetDecorator=_5620;if(this.graphics!=null){this.paint();}};draw2d.Connection.prototype.setSourceAnchor=function(_5621){this.sourceAnchor=_5621;this.sourceAnchor.setOwner(this.sourcePort);if(this.graphics!=null){this.paint();}};draw2d.Connection.prototype.setTargetAnchor=function(_5622){this.targetAnchor=_5622;this.targetAnchor.setOwner(this.targetPort);if(this.graphics!=null){this.paint();}};draw2d.Connection.prototype.setRouter=function(_5623){if(_5623!=null){this.router=_5623;}else{this.router=new draw2d.NullConnectionRouter();}if(this.graphics!=null){this.paint();}};draw2d.Connection.prototype.getRouter=function(){return this.router;};draw2d.Connection.prototype.setWorkflow=function(_5624){draw2d.Line.prototype.setWorkflow.call(this,_5624);for(var i=0;i0){window.clearInterval(_5a43.timer);}_5a43.timer=window.setInterval(_5a44,30);}_5a3f.setCanvas(this);if(xPos&&yPos){_5a3f.setPosition(xPos,yPos);}if(_5a3f instanceof draw2d.Line){this.canvasLines.add(_5a3f);this.html.appendChild(_5a3f.getHTMLElement());}else{var obj=this.canvasLines.getFirstElement();if(obj==null){this.html.appendChild(_5a3f.getHTMLElement());}else{this.html.insertBefore(_5a3f.getHTMLElement(),obj.getHTMLElement());}}if(!_5a42){_5a3f.paint();}};draw2d.Canvas.prototype.removeFigure=function(_5a46){if(this.enableSmoothFigureHandling==true){var oThis=this;var _5a48=_5a46;var _5a49=function(){if(_5a48.alpha>0){_5a48.setAlpha(Math.max(0,_5a48.alpha-0.05));}else{window.clearInterval(_5a48.timer);_5a48.timer=-1;oThis.html.removeChild(_5a48.html);_5a48.setCanvas(null);}};if(_5a48.timer>0){window.clearInterval(_5a48.timer);}_5a48.timer=window.setInterval(_5a49,20);}else{this.html.removeChild(_5a46.html);_5a46.setCanvas(null);}if(_5a46 instanceof draw2d.Line){this.canvasLines.remove(_5a46);}};draw2d.Canvas.prototype.getEnableSmoothFigureHandling=function(){return this.enableSmoothFigureHandling;};draw2d.Canvas.prototype.setEnableSmoothFigureHandling=function(flag){this.enableSmoothFigureHandling=flag;};draw2d.Canvas.prototype.getWidth=function(){return parseInt(this.html.style.width);};draw2d.Canvas.prototype.getHeight=function(){return parseInt(this.html.style.height);};draw2d.Canvas.prototype.setBackgroundImage=function(_5a4b,_5a4c){if(_5a4b!=null){if(_5a4c){this.html.style.background="transparent url("+_5a4b+") ";}else{this.html.style.background="transparent url("+_5a4b+") no-repeat";}}else{this.html.style.background="transparent";}};draw2d.Canvas.prototype.getY=function(){return this.y;};draw2d.Canvas.prototype.getX=function(){return this.x;};draw2d.Canvas.prototype.getAbsoluteY=function(){var el=this.html;var ot=el.offsetTop;while((el=el.offsetParent)!=null){ot+=el.offsetTop;}return ot;};draw2d.Canvas.prototype.getAbsoluteX=function(){var el=this.html;var ol=el.offsetLeft;while((el=el.offsetParent)!=null){ol+=el.offsetLeft;}return ol;};draw2d.Canvas.prototype.getScrollLeft=function(){return this.scrollArea.scrollLeft;};draw2d.Canvas.prototype.getScrollTop=function(){return this.scrollArea.scrollTop;};draw2d.Workflow=function(id){if(!id){return;}this.gridWidthX=10;this.gridWidthY=10;this.snapToGridHelper=null;this.verticalSnapToHelperLine=null;this.horizontalSnapToHelperLine=null;this.figures=new draw2d.ArrayList();this.lines=new draw2d.ArrayList();this.commonPorts=new draw2d.ArrayList();this.dropTargets=new draw2d.ArrayList();this.compartments=new draw2d.ArrayList();this.selectionListeners=new draw2d.ArrayList();this.dialogs=new draw2d.ArrayList();this.toolPalette=null;this.dragging=false;this.tooltip=null;this.draggingLine=null;this.draggingLineCommand=null;this.commandStack=new draw2d.CommandStack();this.oldScrollPosLeft=0;this.oldScrollPosTop=0;this.currentSelection=null;this.currentMenu=null;this.connectionLine=new draw2d.Line();this.resizeHandleStart=new draw2d.LineStartResizeHandle(this);this.resizeHandleEnd=new draw2d.LineEndResizeHandle(this);this.resizeHandle1=new draw2d.ResizeHandle(this,1);this.resizeHandle2=new draw2d.ResizeHandle(this,2);this.resizeHandle3=new draw2d.ResizeHandle(this,3);this.resizeHandle4=new draw2d.ResizeHandle(this,4);this.resizeHandle5=new draw2d.ResizeHandle(this,5);this.resizeHandle6=new draw2d.ResizeHandle(this,6);this.resizeHandle7=new draw2d.ResizeHandle(this,7);this.resizeHandle8=new draw2d.ResizeHandle(this,8);this.resizeHandleHalfWidth=parseInt(this.resizeHandle2.getWidth()/2);draw2d.Canvas.call(this,id);this.setPanning(false);if(this.html!=null){this.html.style.backgroundImage="url(grid_10.png)";oThis=this;this.html.tabIndex="0";var _4f2b=function(){var _4f2c=arguments[0]||window.event;var diffX=_4f2c.clientX;var diffY=_4f2c.clientY;var _4f2f=oThis.getScrollLeft();var _4f30=oThis.getScrollTop();var _4f31=oThis.getAbsoluteX();var _4f32=oThis.getAbsoluteY();if(oThis.getBestFigure(diffX+_4f2f-_4f31,diffY+_4f30-_4f32)!=null){return;}var line=oThis.getBestLine(diffX+_4f2f-_4f31,diffY+_4f30-_4f32,null);if(line!=null){line.onContextMenu(diffX+_4f2f-_4f31,diffY+_4f30-_4f32);}else{oThis.onContextMenu(diffX+_4f2f-_4f31,diffY+_4f30-_4f32);}};this.html.oncontextmenu=function(){return false;};var oThis=this;var _4f35=function(event){var ctrl=event.ctrlKey;oThis.onKeyDown(event.keyCode,ctrl);};var _4f38=function(){var _4f39=arguments[0]||window.event;if(_4f39.returnValue==false){return;}var diffX=_4f39.clientX;var diffY=_4f39.clientY;var _4f3c=oThis.getScrollLeft();var _4f3d=oThis.getScrollTop();var _4f3e=oThis.getAbsoluteX();var _4f3f=oThis.getAbsoluteY();oThis.onMouseDown(diffX+_4f3c-_4f3e,diffY+_4f3d-_4f3f);};var _4f40=function(){var _4f41=arguments[0]||window.event;if(oThis.currentMenu!=null){oThis.removeFigure(oThis.currentMenu);oThis.currentMenu=null;}if(_4f41.button==2){return;}var diffX=_4f41.clientX;var diffY=_4f41.clientY;var _4f44=oThis.getScrollLeft();var _4f45=oThis.getScrollTop();var _4f46=oThis.getAbsoluteX();var _4f47=oThis.getAbsoluteY();oThis.onMouseUp(diffX+_4f44-_4f46,diffY+_4f45-_4f47);};var _4f48=function(){var _4f49=arguments[0]||window.event;var diffX=_4f49.clientX;var diffY=_4f49.clientY;var _4f4c=oThis.getScrollLeft();var _4f4d=oThis.getScrollTop();var _4f4e=oThis.getAbsoluteX();var _4f4f=oThis.getAbsoluteY();oThis.currentMouseX=diffX+_4f4c-_4f4e;oThis.currentMouseY=diffY+_4f4d-_4f4f;var obj=oThis.getBestFigure(oThis.currentMouseX,oThis.currentMouseY);if(draw2d.Drag.currentHover!=null&&obj==null){var _4f51=new draw2d.DragDropEvent();_4f51.initDragDropEvent("mouseleave",false,oThis);draw2d.Drag.currentHover.dispatchEvent(_4f51);}else{var diffX=_4f49.clientX;var diffY=_4f49.clientY;var _4f4c=oThis.getScrollLeft();var _4f4d=oThis.getScrollTop();var _4f4e=oThis.getAbsoluteX();var _4f4f=oThis.getAbsoluteY();oThis.onMouseMove(diffX+_4f4c-_4f4e,diffY+_4f4d-_4f4f);}if(obj==null){draw2d.Drag.currentHover=null;}if(oThis.tooltip!=null){if(Math.abs(oThis.currentTooltipX-oThis.currentMouseX)>10||Math.abs(oThis.currentTooltipY-oThis.currentMouseY)>10){oThis.showTooltip(null);}}};var _4f52=function(_4f53){var _4f53=arguments[0]||window.event;var diffX=_4f53.clientX;var diffY=_4f53.clientY;var _4f56=oThis.getScrollLeft();var _4f57=oThis.getScrollTop();var _4f58=oThis.getAbsoluteX();var _4f59=oThis.getAbsoluteY();var line=oThis.getBestLine(diffX+_4f56-_4f58,diffY+_4f57-_4f59,null);if(line!=null){line.onDoubleClick();}};if(this.html.addEventListener){this.html.addEventListener("contextmenu",_4f2b,false);this.html.addEventListener("mousemove",_4f48,false);this.html.addEventListener("mouseup",_4f40,false);this.html.addEventListener("mousedown",_4f38,false);this.html.addEventListener("keydown",_4f35,false);this.html.addEventListener("dblclick",_4f52,false);}else{if(this.html.attachEvent){this.html.attachEvent("oncontextmenu",_4f2b);this.html.attachEvent("onmousemove",_4f48);this.html.attachEvent("onmousedown",_4f38);this.html.attachEvent("onmouseup",_4f40);this.html.attachEvent("onkeydown",_4f35);this.html.attachEvent("ondblclick",_4f52);}else{throw new Error("Open-jACOB Draw2D not supported in this browser.");}}}};draw2d.Workflow.prototype=new draw2d.Canvas;draw2d.Workflow.prototype.type="draw2d.Workflow";draw2d.Workflow.COLOR_GREEN=new draw2d.Color(0,255,0);draw2d.Workflow.prototype.clear=function(){this.scrollTo(0,0,true);this.gridWidthX=10;this.gridWidthY=10;this.snapToGridHelper=null;this.verticalSnapToHelperLine=null;this.horizontalSnapToHelperLine=null;var _4f5b=this.getDocument();var _4f5c=_4f5b.getLines().clone();for(var i=0;i<_4f5c.getSize();i++){new draw2d.CommandDelete(_4f5c.get(i)).execute();}var _4f5e=_4f5b.getFigures().clone();for(var i=0;i<_4f5e.getSize();i++){new draw2d.CommandDelete(_4f5e.get(i)).execute();}this.commonPorts.removeAllElements();this.dropTargets.removeAllElements();this.compartments.removeAllElements();this.selectionListeners.removeAllElements();this.dialogs.removeAllElements();this.commandStack=new draw2d.CommandStack();this.currentSelection=null;this.currentMenu=null;draw2d.Drag.clearCurrent();};draw2d.Workflow.prototype.onScroll=function(){var _4f5f=this.getScrollLeft();var _4f60=this.getScrollTop();var _4f61=_4f5f-this.oldScrollPosLeft;var _4f62=_4f60-this.oldScrollPosTop;for(var i=0;i=0){window.clearTimeout(this.tooltipTimer);this.tooltipTimer=-1;}}this.tooltip=_4f6f;if(this.tooltip!=null){this.currentTooltipX=this.currentMouseX;this.currentTooltipY=this.currentMouseY;this.addFigure(this.tooltip,this.currentTooltipX+10,this.currentTooltipY+10);var oThis=this;var _4f72=function(){oThis.tooltipTimer=-1;oThis.showTooltip(null);};if(_4f70==true){this.tooltipTimer=window.setTimeout(_4f72,5000);}}};draw2d.Workflow.prototype.showDialog=function(_4f73,xPos,yPos){if(xPos){this.addFigure(_4f73,xPos,yPos);}else{this.addFigure(_4f73,200,100);}this.dialogs.add(_4f73);};draw2d.Workflow.prototype.showMenu=function(menu,xPos,yPos){if(this.menu!=null){this.html.removeChild(this.menu.getHTMLElement());this.menu.setWorkflow();}this.menu=menu;if(this.menu!=null){this.menu.setWorkflow(this);this.menu.setPosition(xPos,yPos);this.html.appendChild(this.menu.getHTMLElement());this.menu.paint();}};draw2d.Workflow.prototype.onContextMenu=function(x,y){var menu=this.getContextMenu();if(menu!=null){this.showMenu(menu,x,y);}};draw2d.Workflow.prototype.getContextMenu=function(){return null;};draw2d.Workflow.prototype.setToolWindow=function(_4f7c,x,y){this.toolPalette=_4f7c;if(y){this.addFigure(_4f7c,x,y);}else{this.addFigure(_4f7c,20,20);}this.dialogs.add(_4f7c);};draw2d.Workflow.prototype.setSnapToGrid=function(flag){if(flag){this.snapToGridHelper=new draw2d.SnapToGrid(this);}else{this.snapToGridHelper=null;}};draw2d.Workflow.prototype.setSnapToGeometry=function(flag){if(flag){this.snapToGeometryHelper=new draw2d.SnapToGeometry(this);}else{this.snapToGeometryHelper=null;}};draw2d.Workflow.prototype.setGridWidth=function(dx,dy){this.gridWidthX=dx;this.gridWidthY=dy;};draw2d.Workflow.prototype.addFigure=function(_4f83,xPos,yPos){draw2d.Canvas.prototype.addFigure.call(this,_4f83,xPos,yPos,true);_4f83.setWorkflow(this);var _4f86=this;if(_4f83 instanceof draw2d.CompartmentFigure){this.compartments.add(_4f83);}if(_4f83 instanceof draw2d.Line){this.lines.add(_4f83);}else{this.figures.add(_4f83);_4f83.draggable.addEventListener("drag",function(_4f87){var _4f88=_4f86.getFigure(_4f87.target.element.id);if(_4f88==null){return;}if(_4f88.isSelectable()==false){return;}_4f86.moveResizeHandles(_4f88);});}_4f83.paint();this.setDocumentDirty();};draw2d.Workflow.prototype.removeFigure=function(_4f89){draw2d.Canvas.prototype.removeFigure.call(this,_4f89);this.figures.remove(_4f89);this.lines.remove(_4f89);this.dialogs.remove(_4f89);_4f89.setWorkflow(null);if(_4f89 instanceof draw2d.CompartmentFigure){this.compartments.remove(_4f89);}if(_4f89 instanceof draw2d.Connection){_4f89.disconnect();}if(this.currentSelection==_4f89){this.setCurrentSelection(null);}this.setDocumentDirty();};draw2d.Workflow.prototype.moveFront=function(_4f8a){this.html.removeChild(_4f8a.getHTMLElement());this.html.appendChild(_4f8a.getHTMLElement());};draw2d.Workflow.prototype.moveBack=function(_4f8b){this.html.removeChild(_4f8b.getHTMLElement());this.html.insertBefore(_4f8b.getHTMLElement(),this.html.firstChild);};draw2d.Workflow.prototype.getBestCompartmentFigure=function(x,y,_4f8e){var _4f8f=null;for(var i=0;i=0&&a<=b){return (a);}else{if(a>b){return (b);}else{if(a<0){return ("-"+oo);}}}};draw2d.ColorDialog.prototype.mouseDownH=function(e){this.slideHSV[0]=this.HSV[0];var oThis=this;this.H.onmousemove=function(e){oThis.dragH(e);};this.H.onmouseup=function(e){oThis.H.onmousemove="";oThis.H.onmouseup="";};this.dragH(e);};draw2d.ColorDialog.prototype.dragH=function(e){var y=this.XY(e,1)-this.getY()-40;this.Hslide.style.top=(this.ckHSV(y,this.wH)-5)+"px";this.slideHSV[0]=this.mkHSV(359,this.wH,this.Hslide.style.top);this.updateSV();this.showColor(this.commit());this.SV.style.backgroundColor="#"+this.hsv2hex(Array(this.HSV[0],100,100));};draw2d.ColorDialog.prototype.mouseDownSV=function(o,e){this.slideHSV[0]=this.HSV[0];var oThis=this;function reset(){oThis.SV.onmousemove="";oThis.SV.onmouseup="";oThis.SVslide.onmousemove="";oThis.SVslide.onmouseup="";}this.SV.onmousemove=function(e){oThis.dragSV(e);};this.SV.onmouseup=reset;this.SVslide.onmousemove=function(e){oThis.dragSV(e);};this.SVslide.onmouseup=reset;this.dragSV(e);};draw2d.ColorDialog.prototype.dragSV=function(e){var x=this.XY(e,0)-this.getX()-1;var y=this.XY(e,1)-this.getY()-20;this.SVslide.style.left=this.ckHSV(x,this.wSV)+"px";this.SVslide.style.top=this.ckHSV(y,this.wSV)+"px";this.slideHSV[1]=this.mkHSV(100,this.wSV,this.SVslide.style.left);this.slideHSV[2]=100-this.mkHSV(100,this.wSV,this.SVslide.style.top);this.updateSV();};draw2d.ColorDialog.prototype.commit=function(){var r="hsv";var z={};var j="";for(var i=0;i<=r.length-1;i++){j=r.substr(i,1);z[i]=(j=="h")?this.maxValue[j]-this.mkHSV(this.maxValue[j],this.wH,this.Hslide.style.top):this.HSV[i];}return (this.updateSV(this.hsv2hex(z)));};draw2d.ColorDialog.prototype.updateSV=function(v){this.HSV=v?this.hex2hsv(v):Array(this.slideHSV[0],this.slideHSV[1],this.slideHSV[2]);if(!v){v=this.hsv2hex(Array(this.slideHSV[0],this.slideHSV[1],this.slideHSV[2]));}this.showColor(v);return v;};draw2d.ColorDialog.prototype.loadSV=function(){var z="";for(var i=this.SVHeight;i>=0;i--){z+="

";}this.Hmodel.innerHTML=z;};draw2d.ColorDialog.prototype.updateH=function(v){this.plugHEX.innerHTML=v;this.HSV=this.hex2hsv(v);this.SV.style.backgroundColor="#"+this.hsv2hex(Array(this.HSV[0],100,100));this.SVslide.style.top=(parseInt(this.wSV-this.wSV*(this.HSV[1]/100))+20)+"px";this.SVslide.style.left=(parseInt(this.wSV*(this.HSV[1]/100))+5)+"px";this.Hslide.style.top=(parseInt(this.wH*((this.maxValue["h"]-this.HSV[0])/this.maxValue["h"]))-7)+"px";};draw2d.ColorDialog.prototype.toHex=function(v){v=Math.round(Math.min(Math.max(0,v),255));return ("0123456789ABCDEF".charAt((v-v%16)/16)+"0123456789ABCDEF".charAt(v%16));};draw2d.ColorDialog.prototype.hex2rgb=function(r){return ({0:parseInt(r.substr(0,2),16),1:parseInt(r.substr(2,2),16),2:parseInt(r.substr(4,2),16)});};draw2d.ColorDialog.prototype.rgb2hex=function(r){return (this.toHex(r[0])+this.toHex(r[1])+this.toHex(r[2]));};draw2d.ColorDialog.prototype.hsv2hex=function(h){return (this.rgb2hex(this.hsv2rgb(h)));};draw2d.ColorDialog.prototype.hex2hsv=function(v){return (this.rgb2hsv(this.hex2rgb(v)));};draw2d.ColorDialog.prototype.rgb2hsv=function(r){var max=Math.max(r[0],r[1],r[2]);var delta=max-Math.min(r[0],r[1],r[2]);var H;var S;var V;if(max!=0){S=Math.round(delta/max*100);if(r[0]==max){H=(r[1]-r[2])/delta;}else{if(r[1]==max){H=2+(r[2]-r[0])/delta;}else{if(r[2]==max){H=4+(r[0]-r[1])/delta;}}}var H=Math.min(Math.round(H*60),360);if(H<0){H+=360;}}return ({0:H?H:0,1:S?S:0,2:Math.round((max/255)*100)});};draw2d.ColorDialog.prototype.hsv2rgb=function(r){var R;var B;var G;var S=r[1]/100;var V=r[2]/100;var H=r[0]/360;if(S>0){if(H>=1){H=0;}H=6*H;F=H-Math.floor(H);A=Math.round(255*V*(1-S));B=Math.round(255*V*(1-(S*F)));C=Math.round(255*V*(1-(S*(1-F))));V=Math.round(255*V);switch(Math.floor(H)){case 0:R=V;G=C;B=A;break;case 1:R=B;G=V;B=A;break;case 2:R=A;G=V;B=C;break;case 3:R=A;G=B;B=V;break;case 4:R=C;G=A;B=V;break;case 5:R=V;G=A;B=B;break;}return ({0:R?R:0,1:G?G:0,2:B?B:0});}else{return ({0:(V=Math.round(V*255)),1:V,2:V});}};draw2d.LineColorDialog=function(_60b1){draw2d.ColorDialog.call(this);this.figure=_60b1;var color=_60b1.getColor();this.updateH(this.rgb2hex(color.getRed(),color.getGreen(),color.getBlue()));};draw2d.LineColorDialog.prototype=new draw2d.ColorDialog;draw2d.LineColorDialog.prototype.type="draw2d.LineColorDialog";draw2d.LineColorDialog.prototype.onOk=function(){var _60b3=this.workflow;draw2d.ColorDialog.prototype.onOk.call(this);if(typeof this.figure.setColor=="function"){_60b3.getCommandStack().execute(new draw2d.CommandSetColor(this.figure,this.getSelectedColor()));if(_60b3.getCurrentSelection()==this.figure){_60b3.setCurrentSelection(this.figure);}}};draw2d.BackgroundColorDialog=function(_4fe4){draw2d.ColorDialog.call(this);this.figure=_4fe4;var color=_4fe4.getBackgroundColor();if(color!=null){this.updateH(this.rgb2hex(color.getRed(),color.getGreen(),color.getBlue()));}};draw2d.BackgroundColorDialog.prototype=new draw2d.ColorDialog;draw2d.BackgroundColorDialog.prototype.type="draw2d.BackgroundColorDialog";draw2d.BackgroundColorDialog.prototype.onOk=function(){var _4fe6=this.workflow;draw2d.ColorDialog.prototype.onOk.call(this);if(typeof this.figure.setBackgroundColor=="function"){_4fe6.getCommandStack().execute(new draw2d.CommandSetBackgroundColor(this.figure,this.getSelectedColor()));if(_4fe6.getCurrentSelection()==this.figure){_4fe6.setCurrentSelection(this.figure);}}};draw2d.AnnotationDialog=function(_4b51){this.figure=_4b51;draw2d.Dialog.call(this);this.setDimension(400,100);};draw2d.AnnotationDialog.prototype=new draw2d.Dialog;draw2d.AnnotationDialog.prototype.type="draw2d.AnnotationDialog";draw2d.AnnotationDialog.prototype.createHTMLElement=function(){var item=draw2d.Dialog.prototype.createHTMLElement.call(this);var _4b53=document.createElement("form");_4b53.style.position="absolute";_4b53.style.left="10px";_4b53.style.top="30px";_4b53.style.width="375px";_4b53.style.font="normal 10px verdana";item.appendChild(_4b53);this.label=document.createTextNode("Text");_4b53.appendChild(this.label);this.input=document.createElement("input");this.input.style.border="1px solid gray";this.input.style.font="normal 10px verdana";this.input.type="text";var value=this.figure.getText();if(value){this.input.value=value;}else{this.input.value="";}this.input.style.width="100%";_4b53.appendChild(this.input);this.input.focus();return item;};draw2d.AnnotationDialog.prototype.onOk=function(){this.workflow.getCommandStack().execute(new draw2d.CommandSetText(this.figure,this.input.value));this.workflow.removeFigure(this);};draw2d.Command=function(label){this.label=label;};draw2d.Command.prototype.type="draw2d.Command";draw2d.Command.prototype.getLabel=function(){return this.label;};draw2d.Command.prototype.canExecute=function(){return true;};draw2d.Command.prototype.execute=function(){};draw2d.Command.prototype.cancel=function(){};draw2d.Command.prototype.undo=function(){};draw2d.Command.prototype.redo=function(){};draw2d.CommandStack=function(){this.undostack=new Array();this.redostack=new Array();this.maxundo=50;this.eventListeners=new draw2d.ArrayList();};draw2d.CommandStack.PRE_EXECUTE=1;draw2d.CommandStack.PRE_REDO=2;draw2d.CommandStack.PRE_UNDO=4;draw2d.CommandStack.POST_EXECUTE=8;draw2d.CommandStack.POST_REDO=16;draw2d.CommandStack.POST_UNDO=32;draw2d.CommandStack.POST_MASK=draw2d.CommandStack.POST_EXECUTE|draw2d.CommandStack.POST_UNDO|draw2d.CommandStack.POST_REDO;draw2d.CommandStack.PRE_MASK=draw2d.CommandStack.PRE_EXECUTE|draw2d.CommandStack.PRE_UNDO|draw2d.CommandStack.PRE_REDO;draw2d.CommandStack.prototype.type="draw2d.CommandStack";draw2d.CommandStack.prototype.setUndoLimit=function(count){this.maxundo=count;};draw2d.CommandStack.prototype.markSaveLocation=function(){this.undostack=new Array();this.redostack=new Array();};draw2d.CommandStack.prototype.execute=function(_4ef3){if(_4ef3==null){return;}if(_4ef3.canExecute()==false){return;}this.notifyListeners(_4ef3,draw2d.CommandStack.PRE_EXECUTE);this.undostack.push(_4ef3);_4ef3.execute();this.redostack=new Array();if(this.undostack.length>this.maxundo){this.undostack=this.undostack.slice(this.undostack.length-this.maxundo);}this.notifyListeners(_4ef3,draw2d.CommandStack.POST_EXECUTE);};draw2d.CommandStack.prototype.undo=function(){var _4ef4=this.undostack.pop();if(_4ef4){this.notifyListeners(_4ef4,draw2d.CommandStack.PRE_UNDO);this.redostack.push(_4ef4);_4ef4.undo();this.notifyListeners(_4ef4,draw2d.CommandStack.POST_UNDO);}};draw2d.CommandStack.prototype.redo=function(){var _4ef5=this.redostack.pop();if(_4ef5){this.notifyListeners(_4ef5,draw2d.CommandStack.PRE_REDO);this.undostack.push(_4ef5);_4ef5.redo();this.notifyListeners(_4ef5,draw2d.CommandStack.POST_REDO);}};draw2d.CommandStack.prototype.canRedo=function(){return this.redostack.length>0;};draw2d.CommandStack.prototype.canUndo=function(){return this.undostack.length>0;};draw2d.CommandStack.prototype.addCommandStackEventListener=function(_4ef6){this.eventListeners.add(_4ef6);};draw2d.CommandStack.prototype.removeCommandStackEventListener=function(_4ef7){this.eventListeners.remove(_4ef7);};draw2d.CommandStack.prototype.notifyListeners=function(_4ef8,state){var event=new draw2d.CommandStackEvent(_4ef8,state);var size=this.eventListeners.getSize();for(var i=0;i=this.m_atts.length))?null:this.m_atts[index][XMLP._ATT_NAME];};XMLP.prototype.getAttributeValue=function(index){return ((index<0)||(index>=this.m_atts.length))?null:__unescapeString(this.m_atts[index][XMLP._ATT_VAL]);};XMLP.prototype.getAttributeValueByName=function(name){return this.getAttributeValue(this._findAttributeIndex(name));};XMLP.prototype.getColumnNumber=function(){return SAXStrings.getColumnNumber(this.m_xml,this.m_iP);};XMLP.prototype.getContent=function(){return (this.m_cSrc==XMLP._CONT_XML)?this.m_xml:this.m_cAlt;};XMLP.prototype.getContentBegin=function(){return this.m_cB;};XMLP.prototype.getContentEnd=function(){return this.m_cE;};XMLP.prototype.getLineNumber=function(){return SAXStrings.getLineNumber(this.m_xml,this.m_iP);};XMLP.prototype.getName=function(){return this.m_name;};XMLP.prototype.next=function(){return this._checkStructure(this._parse());};XMLP.prototype._parse=function(){if(this.m_iP==this.m_xml.length){return XMLP._NONE;}if(this.m_iP==this.m_xml.indexOf("=iE)){return iNB;}iEq=this.m_xml.indexOf("=",iNB);if((iEq==-1)||(iEq>iE)){return this._setErr(XMLP.ERR_ATT_VALUES);}iNE=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,iNB,iEq);iVB=SAXStrings.indexOfNonWhitespace(this.m_xml,iEq+1,iE);if((iVB==-1)||(iVB>iE)){return this._setErr(XMLP.ERR_ATT_VALUES);}_5b57=this.m_xml.charAt(iVB);if(SAXStrings.QUOTES.indexOf(_5b57)==-1){return this._setErr(XMLP.ERR_ATT_VALUES);}iVE=this.m_xml.indexOf(_5b57,iVB+1);if((iVE==-1)||(iVE>iE)){return this._setErr(XMLP.ERR_ATT_VALUES);}strN=this.m_xml.substring(iNB,iNE+1);strV=this.m_xml.substring(iVB+1,iVE);if(strN.indexOf("<")!=-1){return this._setErr(XMLP.ERR_ATT_LT_NAME);}if(strV.indexOf("<")!=-1){return this._setErr(XMLP.ERR_ATT_LT_VALUE);}strV=SAXStrings.replace(strV,null,null,"\n"," ");strV=SAXStrings.replace(strV,null,null,"\t"," ");iRet=this._replaceEntities(strV);if(iRet==XMLP._ERROR){return iRet;}strV=this.m_cAlt;if(this._findAttributeIndex(strN)==-1){this._addAttribute(strN,strV);}else{return this._setErr(XMLP.ERR_ATT_DUP);}this.m_iP=iVE+2;return XMLP._ATT;};XMLP.prototype._parseCDATA=function(iB){var iE=this.m_xml.indexOf("]]>",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_CDATA);}this._setContent(XMLP._CONT_XML,iB,iE);this.m_iP=iE+3;return XMLP._CDATA;};XMLP.prototype._parseComment=function(iB){var iE=this.m_xml.indexOf("-"+"->",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_COMMENT);}this._setContent(XMLP._CONT_XML,iB,iE);this.m_iP=iE+3;return XMLP._COMMENT;};XMLP.prototype._parseDTD=function(iB){var iE,strClose,iInt,iLast;iE=this.m_xml.indexOf(">",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_DTD);}iInt=this.m_xml.indexOf("[",iB);strClose=((iInt!=-1)&&(iInt":">";while(true){if(iE==iLast){return this._setErr(XMLP.ERR_INFINITELOOP);}iLast=iE;iE=this.m_xml.indexOf(strClose,iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_DTD);}if(this.m_xml.substring(iE-1,iE+2)!="]]>"){break;}}this.m_iP=iE+strClose.length;return XMLP._DTD;};XMLP.prototype._parseElement=function(iB){var iE,iDE,iNE,iRet;var iType,strN,iLast;iDE=iE=this.m_xml.indexOf(">",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_ELM);}if(this.m_xml.charAt(iB)=="/"){iType=XMLP._ELM_E;iB++;}else{iType=XMLP._ELM_B;}if(this.m_xml.charAt(iE-1)=="/"){if(iType==XMLP._ELM_E){return this._setErr(XMLP.ERR_ELM_EMPTY);}iType=XMLP._ELM_EMP;iDE--;}iDE=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,iB,iDE);if(iE-iB!=1){if(SAXStrings.indexOfNonWhitespace(this.m_xml,iB,iDE)!=iB){return this._setErr(XMLP.ERR_ELM_NAME);}}this._clearAttributes();iNE=SAXStrings.indexOfWhitespace(this.m_xml,iB,iDE);if(iNE==-1){iNE=iDE+1;}else{this.m_iP=iNE;while(this.m_iP",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_PI);}iTB=SAXStrings.indexOfNonWhitespace(this.m_xml,iB,iE);if(iTB==-1){return this._setErr(XMLP.ERR_PI_TARGET);}iTE=SAXStrings.indexOfWhitespace(this.m_xml,iTB,iE);if(iTE==-1){iTE=iE;}iCB=SAXStrings.indexOfNonWhitespace(this.m_xml,iTE,iE);if(iCB==-1){iCB=iE;}iCE=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,iCB,iE);if(iCE==-1){iCE=iE-1;}this.m_name=this.m_xml.substring(iTB,iTE);this._setContent(XMLP._CONT_XML,iCB,iCE+1);this.m_iP=iE+2;return XMLP._PI;};XMLP.prototype._parseText=function(iB){var iE,iEE;iE=this.m_xml.indexOf("<",iB);if(iE==-1){iE=this.m_xml.length;}iEE=this.m_xml.indexOf("&",iB);if((iEE!=-1)&&(iEE<=iE)){iE=iEE;}this._setContent(XMLP._CONT_XML,iB,iE);this.m_iP=iE;return XMLP._TEXT;};XMLP.prototype._replaceEntities=function(strD,iB,iE){if(SAXStrings.isEmpty(strD)){return "";}iB=iB||0;iE=iE||strD.length;var iEB,iEE,strRet="";iEB=strD.indexOf("&",iB);iEE=iB;while((iEB>0)&&(iEBiE)){return this._setErr(XMLP.ERR_CLOSE_ENTITY);}iRet=this._replaceEntity(strD,iEB+1,iEE-1);if(iRet==XMLP._ERROR){return iRet;}strRet+=this.m_cAlt;iEB=strD.indexOf("&",iEE);}if(iEE!=iE){strRet+=strD.substring(iEE,iE);}this._setContent(XMLP._CONT_ALT,strRet);return XMLP._ENTITY;};XMLP.prototype._replaceEntity=function(strD,iB,iE){if(SAXStrings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;switch(strD.substring(iB,iE)){case "amp":strEnt="&";break;case "lt":strEnt="<";break;case "gt":strEnt=">";break;case "apos":strEnt="'";break;case "quot":strEnt="\"";break;default:if(strD.charAt(iB)=="#"){strEnt=String.fromCharCode(parseInt(strD.substring(iB+1,iE)));}else{return this._setErr(XMLP.ERR_ENTITY_UNKNOWN);}break;}this._setContent(XMLP._CONT_ALT,strEnt);return XMLP._ENTITY;};XMLP.prototype._setContent=function(iSrc){var args=arguments;if(XMLP._CONT_XML==iSrc){this.m_cAlt=null;this.m_cB=args[1];this.m_cE=args[2];}else{this.m_cAlt=args[1];this.m_cB=0;this.m_cE=args[1].length;}this.m_cSrc=iSrc;};XMLP.prototype._setErr=function(iErr){var _5b71=XMLP._errs[iErr];this.m_cAlt=_5b71;this.m_cB=0;this.m_cE=_5b71.length;this.m_cSrc=XMLP._CONT_ALT;return XMLP._ERROR;};SAXDriver=function(){this.m_hndDoc=null;this.m_hndErr=null;this.m_hndLex=null;};SAXDriver.DOC_B=1;SAXDriver.DOC_E=2;SAXDriver.ELM_B=3;SAXDriver.ELM_E=4;SAXDriver.CHARS=5;SAXDriver.PI=6;SAXDriver.CD_B=7;SAXDriver.CD_E=8;SAXDriver.CMNT=9;SAXDriver.DTD_B=10;SAXDriver.DTD_E=11;SAXDriver.prototype.parse=function(strD){var _5b73=new XMLP(strD);if(this.m_hndDoc&&this.m_hndDoc.setDocumentLocator){this.m_hndDoc.setDocumentLocator(this);}this.m_parser=_5b73;this.m_bErr=false;if(!this.m_bErr){this._fireEvent(SAXDriver.DOC_B);}this._parseLoop();if(!this.m_bErr){this._fireEvent(SAXDriver.DOC_E);}this.m_xml=null;this.m_iP=0;};SAXDriver.prototype.setDocumentHandler=function(hnd){this.m_hndDoc=hnd;};SAXDriver.prototype.setErrorHandler=function(hnd){this.m_hndErr=hnd;};SAXDriver.prototype.setLexicalHandler=function(hnd){this.m_hndLex=hnd;};SAXDriver.prototype.getColumnNumber=function(){return this.m_parser.getColumnNumber();};SAXDriver.prototype.getLineNumber=function(){return this.m_parser.getLineNumber();};SAXDriver.prototype.getMessage=function(){return this.m_strErrMsg;};SAXDriver.prototype.getPublicId=function(){return null;};SAXDriver.prototype.getSystemId=function(){return null;};SAXDriver.prototype.getLength=function(){return this.m_parser.getAttributeCount();};SAXDriver.prototype.getName=function(index){return this.m_parser.getAttributeName(index);};SAXDriver.prototype.getValue=function(index){return this.m_parser.getAttributeValue(index);};SAXDriver.prototype.getValueByName=function(name){return this.m_parser.getAttributeValueByName(name);};SAXDriver.prototype._fireError=function(_5b7a){this.m_strErrMsg=_5b7a;this.m_bErr=true;if(this.m_hndErr&&this.m_hndErr.fatalError){this.m_hndErr.fatalError(this);}};SAXDriver.prototype._fireEvent=function(iEvt){var hnd,func,args=arguments,iLen=args.length-1;if(this.m_bErr){return;}if(SAXDriver.DOC_B==iEvt){func="startDocument";hnd=this.m_hndDoc;}else{if(SAXDriver.DOC_E==iEvt){func="endDocument";hnd=this.m_hndDoc;}else{if(SAXDriver.ELM_B==iEvt){func="startElement";hnd=this.m_hndDoc;}else{if(SAXDriver.ELM_E==iEvt){func="endElement";hnd=this.m_hndDoc;}else{if(SAXDriver.CHARS==iEvt){func="characters";hnd=this.m_hndDoc;}else{if(SAXDriver.PI==iEvt){func="processingInstruction";hnd=this.m_hndDoc;}else{if(SAXDriver.CD_B==iEvt){func="startCDATA";hnd=this.m_hndLex;}else{if(SAXDriver.CD_E==iEvt){func="endCDATA";hnd=this.m_hndLex;}else{if(SAXDriver.CMNT==iEvt){func="comment";hnd=this.m_hndLex;}}}}}}}}}if(hnd&&hnd[func]){if(0==iLen){hnd[func]();}else{if(1==iLen){hnd[func](args[1]);}else{if(2==iLen){hnd[func](args[1],args[2]);}else{if(3==iLen){hnd[func](args[1],args[2],args[3]);}}}}}};SAXDriver.prototype._parseLoop=function(_5b7d){var _5b7e,_5b7d;_5b7d=this.m_parser;while(!this.m_bErr){_5b7e=_5b7d.next();if(_5b7e==XMLP._ELM_B){this._fireEvent(SAXDriver.ELM_B,_5b7d.getName(),this);}else{if(_5b7e==XMLP._ELM_E){this._fireEvent(SAXDriver.ELM_E,_5b7d.getName());}else{if(_5b7e==XMLP._ELM_EMP){this._fireEvent(SAXDriver.ELM_B,_5b7d.getName(),this);this._fireEvent(SAXDriver.ELM_E,_5b7d.getName());}else{if(_5b7e==XMLP._TEXT){this._fireEvent(SAXDriver.CHARS,_5b7d.getContent(),_5b7d.getContentBegin(),_5b7d.getContentEnd()-_5b7d.getContentBegin());}else{if(_5b7e==XMLP._ENTITY){this._fireEvent(SAXDriver.CHARS,_5b7d.getContent(),_5b7d.getContentBegin(),_5b7d.getContentEnd()-_5b7d.getContentBegin());}else{if(_5b7e==XMLP._PI){this._fireEvent(SAXDriver.PI,_5b7d.getName(),_5b7d.getContent().substring(_5b7d.getContentBegin(),_5b7d.getContentEnd()));}else{if(_5b7e==XMLP._CDATA){this._fireEvent(SAXDriver.CD_B);this._fireEvent(SAXDriver.CHARS,_5b7d.getContent(),_5b7d.getContentBegin(),_5b7d.getContentEnd()-_5b7d.getContentBegin());this._fireEvent(SAXDriver.CD_E);}else{if(_5b7e==XMLP._COMMENT){this._fireEvent(SAXDriver.CMNT,_5b7d.getContent(),_5b7d.getContentBegin(),_5b7d.getContentEnd()-_5b7d.getContentBegin());}else{if(_5b7e==XMLP._DTD){}else{if(_5b7e==XMLP._ERROR){this._fireError(_5b7d.getContent());}else{if(_5b7e==XMLP._NONE){return;}}}}}}}}}}}}};SAXStrings=function(){};SAXStrings.WHITESPACE=" \t\n\r";SAXStrings.QUOTES="\"'";SAXStrings.getColumnNumber=function(strD,iP){if(SAXStrings.isEmpty(strD)){return -1;}iP=iP||strD.length;var arrD=strD.substring(0,iP).split("\n");var _5b82=arrD[arrD.length-1];arrD.length--;var _5b83=arrD.join("\n").length;return iP-_5b83;};SAXStrings.getLineNumber=function(strD,iP){if(SAXStrings.isEmpty(strD)){return -1;}iP=iP||strD.length;return strD.substring(0,iP).split("\n").length;};SAXStrings.indexOfNonWhitespace=function(strD,iB,iE){if(SAXStrings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;for(var i=iB;i=iB;i--){if(SAXStrings.WHITESPACE.indexOf(strD.charAt(i))==-1){return i;}}return -1;};SAXStrings.replace=function(strD,iB,iE,strF,strR){if(SAXStrings.isEmpty(strD)){return "";}iB=iB||0;iE=iE||strD.length;return strD.substring(iB,iE).split(strF).join(strR);};Stack=function(){this.m_arr=new Array();};Stack.prototype.clear=function(){this.m_arr=new Array();};Stack.prototype.count=function(){return this.m_arr.length;};Stack.prototype.destroy=function(){this.m_arr=null;};Stack.prototype.peek=function(){if(this.m_arr.length==0){return null;}return this.m_arr[this.m_arr.length-1];};Stack.prototype.pop=function(){if(this.m_arr.length==0){return null;}var o=this.m_arr[this.m_arr.length-1];this.m_arr.length--;return o;};Stack.prototype.push=function(o){this.m_arr[this.m_arr.length]=o;};function isEmpty(str){return (str==null)||(str.length==0);}function trim(_5b9b,_5b9c,_5b9d){if(isEmpty(_5b9b)){return "";}if(_5b9c==null){_5b9c=true;}if(_5b9d==null){_5b9d=true;}var left=0;var right=0;var i=0;var k=0;if(_5b9c==true){while((i<_5b9b.length)&&(whitespace.indexOf(_5b9b.charAt(i++))!=-1)){left++;}}if(_5b9d==true){k=_5b9b.length-1;while((k>=left)&&(whitespace.indexOf(_5b9b.charAt(k--))!=-1)){right++;}}return _5b9b.substring(left,_5b9b.length-right);}function __escapeString(str){var _5ba3=/&/g;var _5ba4=//g;var _5ba6=/"/g;var _5ba7=/'/g;str=str.replace(_5ba3,"&");str=str.replace(_5ba4,"<");str=str.replace(_5ba5,">");str=str.replace(_5ba6,""");str=str.replace(_5ba7,"'");return str;}function __unescapeString(str){var _5ba9=/&/g;var _5baa=/</g;var _5bab=/>/g;var _5bac=/"/g;var _5bad=/'/g;str=str.replace(_5ba9,"&");str=str.replace(_5baa,"<");str=str.replace(_5bab,">");str=str.replace(_5bac,"\"");str=str.replace(_5bad,"'");return str;}function addClass(_4c01,_4c02){if(_4c01){if(_4c01.indexOf("|"+_4c02+"|")<0){_4c01+=_4c02+"|";}}else{_4c01="|"+_4c02+"|";}return _4c01;}DOMException=function(code){this._class=addClass(this._class,"DOMException");this.code=code;};DOMException.INDEX_SIZE_ERR=1;DOMException.DOMSTRING_SIZE_ERR=2;DOMException.HIERARCHY_REQUEST_ERR=3;DOMException.WRONG_DOCUMENT_ERR=4;DOMException.INVALID_CHARACTER_ERR=5;DOMException.NO_DATA_ALLOWED_ERR=6;DOMException.NO_MODIFICATION_ALLOWED_ERR=7;DOMException.NOT_FOUND_ERR=8;DOMException.NOT_SUPPORTED_ERR=9;DOMException.INUSE_ATTRIBUTE_ERR=10;DOMException.INVALID_STATE_ERR=11;DOMException.SYNTAX_ERR=12;DOMException.INVALID_MODIFICATION_ERR=13;DOMException.NAMESPACE_ERR=14;DOMException.INVALID_ACCESS_ERR=15;DOMImplementation=function(){this._class=addClass(this._class,"DOMImplementation");this._p=null;this.preserveWhiteSpace=false;this.namespaceAware=true;this.errorChecking=true;};DOMImplementation.prototype.escapeString=function DOMNode__escapeString(str){return __escapeString(str);};DOMImplementation.prototype.unescapeString=function DOMNode__unescapeString(str){return __unescapeString(str);};DOMImplementation.prototype.hasFeature=function DOMImplementation_hasFeature(_4c06,_4c07){var ret=false;if(_4c06.toLowerCase()=="xml"){ret=(!_4c07||(_4c07=="1.0")||(_4c07=="2.0"));}else{if(_4c06.toLowerCase()=="core"){ret=(!_4c07||(_4c07=="2.0"));}}return ret;};DOMImplementation.prototype.loadXML=function DOMImplementation_loadXML(_4c09){var _4c0a;try{_4c0a=new XMLP(_4c09);}catch(e){alert("Error Creating the SAX Parser. Did you include xmlsax.js or tinyxmlsax.js in your web page?\nThe SAX parser is needed to populate XML for