diff --git a/gulliver/js/ext/draw2d.js b/gulliver/js/ext/draw2d.js index ea3c9a6fc..740a815ae 100755 --- a/gulliver/js/ext/draw2d.js +++ b/gulliver/js/ext/draw2d.js @@ -6,12 +6,7 @@ Copyright: 2006 Andreas Herz. All rights reserved. Created: 5.11.2006 by Andreas Herz (Web: http://www.freegroup.de ) LICENSE: LGPL **/ -var _errorStack_=[]; -function pushErrorStack(e,_43a3){ -_errorStack_.push(_43a3+"\n"); -throw e; -} -AbstractEvent=function(){ +Event=function(){ this.type=null; this.target=null; this.relatedTarget=null; @@ -19,102 +14,69 @@ this.cancelable=false; this.timeStamp=null; this.returnValue=true; }; -AbstractEvent.prototype.initEvent=function(sType,_43a5){ +Event.prototype.initEvent=function(sType,_3a0c){ this.type=sType; -this.cancelable=_43a5; +this.cancelable=_3a0c; this.timeStamp=(new Date()).getTime(); }; -AbstractEvent.prototype.preventDefault=function(){ +Event.prototype.preventDefault=function(){ if(this.cancelable){ this.returnValue=false; } }; -AbstractEvent.fireDOMEvent=function(_43a6,_43a7){ +Event.fireDOMEvent=function(_3a0d,_3a0e){ if(document.createEvent){ var evt=document.createEvent("Events"); -evt.initEvent(_43a6,true,true); -_43a7.dispatchEvent(evt); +evt.initEvent(_3a0d,true,true); +_3a0e.dispatchEvent(evt); }else{ if(document.createEventObject){ var evt=document.createEventObject(); -_43a7.fireEvent("on"+_43a6,evt); +_3a0e.fireEvent("on"+_3a0d,evt); } } }; EventTarget=function(){ -this.eventhandlers={}; +this.eventhandlers=new Object(); }; -EventTarget.prototype.addEventListener=function(sType,_43aa){ +EventTarget.prototype.addEventListener=function(sType,_3a11){ if(typeof this.eventhandlers[sType]=="undefined"){ -this.eventhandlers[sType]=[]; +this.eventhandlers[sType]=new Array; } -this.eventhandlers[sType][this.eventhandlers[sType].length]=_43aa; +this.eventhandlers[sType][this.eventhandlers[sType].length]=_3a11; }; -EventTarget.prototype.dispatchEvent=function(_43ab){ -_43ab.target=this; -if(typeof this.eventhandlers[_43ab.type]!="undefined"){ -for(var i=0;i=0&&_49f8>_49f5){ +_3de1=this.data[j]; +_3de2=_3de1[f]; +while(j>=0&&_3de2>_3ddf){ this.data[j+1]=this.data[j]; j--; if(j>=0){ -_49f7=this.data[j]; -_49f8=_49f7[f]; +_3de1=this.data[j]; +_3de2=_3de1[f]; } } -this.data[j+1]=_49f6; +this.data[j+1]=_3de0; } }; ArrayList.prototype.clone=function(){ -var _49f9=new ArrayList(this.size); +var _3de3=new ArrayList(this.size); for(var i=0;i"+_385a+""); +function trace(_3dbe){ +var _3dbf=openwindow("about:blank",700,400); +_3dbf.document.writeln("
"+_3dbe+"
"); } -function openwindow(url,width,_385e){ +function openwindow(url,width,_3dc2){ var left=(screen.width-width)/2; -var top=(screen.height-_385e)/2; -property="left="+left+", top="+top+", toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,alwaysRaised,width="+width+",height="+_385e; +var top=(screen.height-_3dc2)/2; +property="left="+left+", top="+top+", toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,alwaysRaised,width="+width+",height="+_3dc2; return window.open(url,"_blank",property); } function dumpObject(obj){ @@ -290,14 +245,12 @@ Drag=function(){ }; Drag.current=null; Drag.currentTarget=null; -Drag.currentHover=null; -Drag.currentCompartment=null; Drag.dragging=false; Drag.isDragging=function(){ return this.dragging; }; -Drag.setCurrent=function(_3d9d){ -this.current=_3d9d; +Drag.setCurrent=function(_326a){ +this.current=_326a; this.dragging=true; }; Drag.getCurrent=function(){ @@ -306,51 +259,44 @@ return this.current; Drag.clearCurrent=function(){ this.current=null; this.dragging=false; -this.currentTarget=null; }; -Draggable=function(_3d9e,_3d9f){ -this.id=UUID.create(); -this.node=null; +Draggable=function(_326b,_326c){ EventTarget.call(this); -this.construct(_3d9e,_3d9f); +this.construct(_326b,_326c); this.diffX=0; this.diffY=0; this.targets=new ArrayList(); }; -Draggable.prototype=new EventTarget(); -Draggable.prototype.construct=function(_3da0){ -if(_3da0===null||_3da0===undefined){ -return; -} -this.element=_3da0; +Draggable.prototype=new EventTarget; +Draggable.prototype.construct=function(_326d,_326e){ +this.element=_326d; +this.constraints=_326e; var oThis=this; -var _3da2=function(){ -var _3da3=new DragDropEvent(); -_3da3.initDragDropEvent("dblclick",true); -oThis.dispatchEvent(_3da3); -var _3da4=arguments[0]||window.event; -_3da4.cancelBubble=true; -_3da4.returnValue=false; +var _3270=function(){ +var _3271=new DragDropEvent(); +_3271.initDragDropEvent("dblclick",true); +oThis.dispatchEvent(_3271); +var _3272=arguments[0]||window.event; +_3272.cancelBubble=true; +_3272.returnValue=false; }; -var _3da5=function(){ -var _3da6=arguments[0]||window.event; -var _3da7=new DragDropEvent(); -if(oThis.node!==null){ -var _3da8=oThis.node.getWorkflow().getAbsoluteX(); -var _3da9=oThis.node.getWorkflow().getAbsoluteY(); -var _3daa=oThis.node.getWorkflow().getScrollLeft(); -var _3dab=oThis.node.getWorkflow().getScrollTop(); -_3da7.x=_3da6.clientX-oThis.element.offsetLeft+_3daa-_3da8; -_3da7.y=_3da6.clientY-oThis.element.offsetTop+_3dab-_3da9; -} -if(_3da6.button===2){ -_3da7.initDragDropEvent("contextmenu",true); -oThis.dispatchEvent(_3da7); +var _3273=function(){ +var _3274=arguments[0]||window.event; +var _3275=new DragDropEvent(); +var _3276=oThis.node.workflow.getAbsoluteX(); +var _3277=oThis.node.workflow.getAbsoluteY(); +var _3278=oThis.node.workflow.getScrollLeft(); +var _3279=oThis.node.workflow.getScrollTop(); +_3275.x=_3274.clientX-oThis.element.offsetLeft+_3278-_3276; +_3275.y=_3274.clientY-oThis.element.offsetTop+_3279-_3277; +if(_3274.button==2){ +_3275.initDragDropEvent("contextmenu",true); +oThis.dispatchEvent(_3275); }else{ -_3da7.initDragDropEvent("dragstart",true); -if(oThis.dispatchEvent(_3da7)){ -oThis.diffX=_3da6.clientX-oThis.element.offsetLeft; -oThis.diffY=_3da6.clientY-oThis.element.offsetTop; +_3275.initDragDropEvent("dragstart",true); +if(oThis.dispatchEvent(_3275)){ +oThis.diffX=_3274.clientX-oThis.element.offsetLeft; +oThis.diffY=_3274.clientY-oThis.element.offsetTop; Drag.setCurrent(oThis); if(oThis.isAttached==true){ oThis.detachEventHandlers(); @@ -358,118 +304,111 @@ oThis.detachEventHandlers(); oThis.attachEventHandlers(); } } -_3da6.cancelBubble=true; -_3da6.returnValue=false; +_3274.cancelBubble=true; +_3274.returnValue=false; }; -var _3dac=function(){ -if(Drag.getCurrent()===null){ -var _3dad=arguments[0]||window.event; -if(Drag.currentHover!==null&&oThis!==Drag.currentHover){ -var _3dae=new DragDropEvent(); -_3dae.initDragDropEvent("mouseleave",false,oThis); -Drag.currentHover.dispatchEvent(_3dae); +var _327a=function(){ +if(Drag.getCurrent()==null){ +var _327b=arguments[0]||window.event; +if(Drag.currentHover!=null&&oThis!=Drag.currentHover){ +var _327c=new DragDropEvent(); +_327c.initDragDropEvent("mouseleave",false,oThis); +Drag.currentHover.dispatchEvent(_327c); } -if(oThis!==null&&oThis!==Drag.currentHover){ -var _3dae=new DragDropEvent(); -_3dae.initDragDropEvent("mouseenter",false,oThis); -oThis.dispatchEvent(_3dae); +if(oThis!=null&&oThis!=Drag.currentHover){ +var _327c=new DragDropEvent(); +_327c.initDragDropEvent("mouseenter",false,oThis); +oThis.dispatchEvent(_327c); } Drag.currentHover=oThis; }else{ } }; if(this.element.addEventListener){ -this.element.addEventListener("mousemove",_3dac,false); -this.element.addEventListener("mousedown",_3da5,false); -this.element.addEventListener("dblclick",_3da2,false); +this.element.addEventListener("mousemove",_327a,false); +this.element.addEventListener("mousedown",_3273,false); +this.element.addEventListener("dblclick",_3270,false); }else{ if(this.element.attachEvent){ -this.element.attachEvent("onmousemove",_3dac); -this.element.attachEvent("onmousedown",_3da5); -this.element.attachEvent("ondblclick",_3da2); +this.element.attachEvent("onmousemove",_327a); +this.element.attachEvent("onmousedown",_3273); +this.element.attachEvent("ondblclick",_3270); }else{ -throw "Drag not supported in this browser."; +throw new Error("Drag not supported in this browser."); } } }; -Draggable.prototype.onDrop=function(_3daf,_3db0){ -}; Draggable.prototype.attachEventHandlers=function(){ var oThis=this; oThis.isAttached=true; this.tempMouseMove=function(){ -var _3db2=arguments[0]||window.event; -var _3db3=new Point(_3db2.clientX-oThis.diffX,_3db2.clientY-oThis.diffY); -if(oThis.node!==null&&oThis.node.getCanSnapToHelper()){ -_3db3=oThis.node.getWorkflow().snapToHelper(oThis.node,_3db3); +var _327e=arguments[0]||window.event; +var _327f=new Point(_327e.clientX-oThis.diffX,_327e.clientY-oThis.diffY); +if(oThis.node.getCanSnapToHelper()){ +_327f=oThis.node.getWorkflow().snapToHelper(oThis.node,_327f); } -oThis.element.style.left=_3db3.x+"px"; -oThis.element.style.top=_3db3.y+"px"; -if(oThis.node!==null){ -var _3db4=oThis.node.getWorkflow().getScrollLeft(); -var _3db5=oThis.node.getWorkflow().getScrollTop(); -var _3db6=oThis.node.getWorkflow().getAbsoluteX(); -var _3db7=oThis.node.getWorkflow().getAbsoluteY(); -var _3db8=oThis.getDropTarget(_3db2.clientX+_3db4-_3db6,_3db2.clientY+_3db5-_3db7); -var _3db9=oThis.getCompartment(_3db2.clientX+_3db4-_3db6,_3db2.clientY+_3db5-_3db7); -if(Drag.currentTarget!==null&&_3db8!=Drag.currentTarget){ -var _3dba=new DragDropEvent(); -_3dba.initDragDropEvent("dragleave",false,oThis); -Drag.currentTarget.dispatchEvent(_3dba); +oThis.element.style.left=_327f.x+"px"; +oThis.element.style.top=_327f.y+"px"; +var _3280=oThis.node.workflow.getScrollLeft(); +var _3281=oThis.node.workflow.getScrollTop(); +var _3282=oThis.node.workflow.getAbsoluteX(); +var _3283=oThis.node.workflow.getAbsoluteY(); +var _3284=oThis.getDropTarget(_327e.clientX+_3280-_3282,_327e.clientY+_3281-_3283); +var _3285=oThis.getCompartment(_327e.clientX+_3280-_3282,_327e.clientY+_3281-_3283); +if(Drag.currentTarget!=null&&_3284!=Drag.currentTarget){ +var _3286=new DragDropEvent(); +_3286.initDragDropEvent("dragleave",false,oThis); +Drag.currentTarget.dispatchEvent(_3286); } -if(_3db8!==null&&_3db8!==Drag.currentTarget){ -var _3dba=new DragDropEvent(); -_3dba.initDragDropEvent("dragenter",false,oThis); -_3db8.dispatchEvent(_3dba); +if(_3284!=null&&_3284!=Drag.currentTarget){ +var _3286=new DragDropEvent(); +_3286.initDragDropEvent("dragenter",false,oThis); +_3284.dispatchEvent(_3286); } -Drag.currentTarget=_3db8; -if(Drag.currentCompartment!==null&&_3db9!==Drag.currentCompartment){ -var _3dba=new DragDropEvent(); -_3dba.initDragDropEvent("figureleave",false,oThis); -Drag.currentCompartment.dispatchEvent(_3dba); +Drag.currentTarget=_3284; +if(Drag.currentCompartment!=null&&_3285!=Drag.currentCompartment){ +var _3286=new DragDropEvent(); +_3286.initDragDropEvent("figureleave",false,oThis); +Drag.currentCompartment.dispatchEvent(_3286); } -if(_3db9!==null&&_3db9.node!=oThis.node&&_3db9!==Drag.currentCompartment){ -var _3dba=new DragDropEvent(); -_3dba.initDragDropEvent("figureenter",false,oThis); -_3db9.dispatchEvent(_3dba); +if(_3285!=null&&_3285.node!=oThis.node&&_3285!=Drag.currentCompartment){ +var _3286=new DragDropEvent(); +_3286.initDragDropEvent("figureenter",false,oThis); +_3285.dispatchEvent(_3286); } -Drag.currentCompartment=_3db9; -} -var _3dbb=new DragDropEvent(); -_3dbb.initDragDropEvent("drag",false); -oThis.dispatchEvent(_3dbb); +Drag.currentCompartment=_3285; +var _3287=new DragDropEvent(); +_3287.initDragDropEvent("drag",false); +oThis.dispatchEvent(_3287); }; oThis.tempMouseUp=function(){ oThis.detachEventHandlers(); -var _3dbc=arguments[0]||window.event; -if(oThis.node!==null){ -var _3dbd=oThis.node.getWorkflow().getScrollLeft(); -var _3dbe=oThis.node.getWorkflow().getScrollTop(); -var _3dbf=oThis.node.getWorkflow().getAbsoluteX(); -var _3dc0=oThis.node.getWorkflow().getAbsoluteY(); -var _3dc1=oThis.getDropTarget(_3dbc.clientX+_3dbd-_3dbf,_3dbc.clientY+_3dbe-_3dc0); -var _3dc2=oThis.getCompartment(_3dbc.clientX+_3dbd-_3dbf,_3dbc.clientY+_3dbe-_3dc0); -if(_3dc1!==null){ -var _3dc3=new DragDropEvent(); -_3dc3.initDragDropEvent("drop",false,oThis); -_3dc1.dispatchEvent(_3dc3); +var _3288=arguments[0]||window.event; +var _3289=new DragDropEvent(); +_3289.initDragDropEvent("dragend",false); +oThis.dispatchEvent(_3289); +var _328a=oThis.node.workflow.getScrollLeft(); +var _328b=oThis.node.workflow.getScrollTop(); +var _328c=oThis.node.workflow.getAbsoluteX(); +var _328d=oThis.node.workflow.getAbsoluteY(); +var _328e=oThis.getDropTarget(_3288.clientX+_328a-_328c,_3288.clientY+_328b-_328d); +var _328f=oThis.getCompartment(_3288.clientX+_328a-_328c,_3288.clientY+_328b-_328d); +if(_328e!=null){ +var _3290=new DragDropEvent(); +_3290.initDragDropEvent("drop",false,oThis); +_328e.dispatchEvent(_3290); } -if(_3dc2!==null&&_3dc2.node!==oThis.node){ -var _3dc3=new DragDropEvent(); -_3dc3.initDragDropEvent("figuredrop",false,oThis); -_3dc2.dispatchEvent(_3dc3); +if(_328f!=null&&_328f.node!=oThis.node){ +var _3290=new DragDropEvent(); +_3290.initDragDropEvent("figuredrop",false,oThis); +_328f.dispatchEvent(_3290); } -if(Drag.currentTarget!==null){ -var _3dc3=new DragDropEvent(); -_3dc3.initDragDropEvent("dragleave",false,oThis); -Drag.currentTarget.dispatchEvent(_3dc3); +if(Drag.currentTarget!=null){ +var _3290=new DragDropEvent(); +_3290.initDragDropEvent("dragleave",false,oThis); +Drag.currentTarget.dispatchEvent(_3290); Drag.currentTarget=null; } -} -var _3dc4=new DragDropEvent(); -_3dc4.initDragDropEvent("dragend",false); -oThis.dispatchEvent(_3dc4); -oThis.onDrop(_3dbc.clientX,_3dbc.clientY); Drag.currentCompartment=null; Drag.clearCurrent(); }; @@ -501,28 +440,28 @@ throw new Error("Drag doesn't support this browser."); }; Draggable.prototype.getDropTarget=function(x,y){ for(var i=0;i0){ -window.clearInterval(oThis.timer); +if(_3dfe.timer>0){ +window.clearInterval(_3dfe.timer); } -oThis.timer=window.setInterval(_3c52,20); +_3dfe.timer=window.setInterval(_3dff,20); }else{ -this.setAlpha(this.alphaBeforeOnDrag); +this.setAlpha(1); } this.command.setPosition(this.x,this.y); this.workflow.commandStack.execute(this.command); @@ -1226,59 +1128,69 @@ this.workflow.hideSnapToHelperLines(); this.fireMoveEvent(); }; Figure.prototype.onDragstart=function(x,y){ -this.command=this.createCommand(new EditPolicy(EditPolicy.MOVE)); -return this.command!==null; +if(!this.canDrag){ +return false; +} +this.command=new CommandMove(this,this.x,this.y); +return true; }; Figure.prototype.setCanDrag=function(flag){ this.canDrag=flag; if(flag){ this.html.style.cursor="move"; }else{ -this.html.style.cursor=""; +this.html.style.cursor=null; } }; -Figure.prototype.getCanDrag=function(){ -return this.canDrag; -}; -Figure.prototype.setAlpha=function(_3c56){ -if(this.alpha===_3c56){ +Figure.prototype.setAlpha=function(_3e03){ +if(this.alpha==_3e03){ return; } -this.alpha=Math.max(0,Math.min(1,_3c56)); -if(this.alpha==1){ -this.html.style.filter=""; -this.html.style.opacity=""; -}else{ -this.html.style.filter="alpha(opacity="+Math.round(this.alpha*100)+")"; -this.html.style.opacity=this.alpha; +try{ +this.html.style.MozOpacity=_3e03; } -}; -Figure.prototype.getAlpha=function(){ -return this.alpha; +catch(exc){ +} +try{ +this.html.style.opacity=_3e03; +} +catch(exc){ +} +try{ +var _3e04=Math.round(_3e03*100); +if(_3e04>=99){ +this.html.style.filter=""; +}else{ +this.html.style.filter="alpha(opacity="+_3e04+")"; +} +} +catch(exc){ +} +this.alpha=_3e03; }; Figure.prototype.setDimension=function(w,h){ this.width=Math.max(this.getMinWidth(),w); this.height=Math.max(this.getMinHeight(),h); -if(this.html===null){ +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){ +if(this.workflow!=null&&this.workflow.getCurrentSelection()==this){ this.workflow.showResizeHandles(this); } }; Figure.prototype.setPosition=function(xPos,yPos){ this.x=xPos; this.y=yPos; -if(this.html===null){ +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){ +if(this.workflow!=null&&this.workflow.getCurrentSelection()==this){ this.workflow.showResizeHandles(this); } }; @@ -1336,12 +1248,12 @@ return this.y; Figure.prototype.getAbsoluteX=function(){ return this.x; }; -Figure.prototype.onKeyDown=function(_3c60,ctrl){ -if(_3c60==46){ -this.workflow.getCommandStack().execute(this.createCommand(new EditPolicy(EditPolicy.DELETE))); +Figure.prototype.onKeyDown=function(_3e0e,ctrl){ +if(_3e0e==46&&this.isDeleteable()==true){ +this.workflow.commandStack.execute(new CommandDelete(this)); } if(ctrl){ -this.workflow.onKeyDown(_3c60,ctrl); +this.workflow.onKeyDown(_3e0e,ctrl); } }; Figure.prototype.getPosition=function(){ @@ -1354,17 +1266,17 @@ var iX2=x+this.width; var iY2=y+this.height; return (iX>=x&&iX<=iX2&&iY>=y&&iY<=iY2); }; -Figure.prototype.attachMoveListener=function(_3c68){ -if(_3c68===null||this.moveListener===null){ +Figure.prototype.attachMoveListener=function(_3e16){ +if(_3e16==null||this.moveListener==null){ return; } -this.moveListener.add(_3c68); +this.moveListener.add(_3e16); }; -Figure.prototype.detachMoveListener=function(_3c69){ -if(_3c69===null||this.moveListener===null){ +Figure.prototype.detachMoveListener=function(_3e17){ +if(_3e17==null||this.moveListener==null){ return; } -this.moveListener.remove(_3c69); +this.moveListener.remove(_3e17); }; Figure.prototype.fireMoveEvent=function(){ this.setDocumentDirty(); @@ -1373,55 +1285,42 @@ for(var i=0;ih){ @@ -1867,16 +1692,16 @@ Oval.prototype.setDimension.call(this,h,h); Circle.prototype.isStrechable=function(){ return false; }; -Rectangle=function(width,_42b8){ +Rectangle=function(width,_3e35){ this.bgColor=null; this.lineColor=new Color(0,0,0); this.lineStroke=1; Figure.call(this); -if(width&&_42b8){ -this.setDimension(width,_42b8); +if(width&&_3e35){ +this.setDimension(width,_3e35); } }; -Rectangle.prototype=new Figure(); +Rectangle.prototype=new Figure; Rectangle.prototype.type="Rectangle"; Rectangle.prototype.dispose=function(){ Figure.prototype.dispose.call(this); @@ -1893,14 +1718,14 @@ item.style.border=this.lineStroke+"px solid "+this.lineColor.getHTMLStyle(); item.style.fontSize="1px"; item.style.lineHeight="1px"; item.innerHTML=" "; -if(this.bgColor!==null){ +if(this.bgColor!=null){ item.style.backgroundColor=this.bgColor.getHTMLStyle(); } return item; }; Rectangle.prototype.setBackgroundColor=function(color){ this.bgColor=color; -if(this.bgColor!==null){ +if(this.bgColor!=null){ this.html.style.backgroundColor=this.bgColor.getHTMLStyle(); }else{ this.html.style.backgroundColor="transparent"; @@ -1911,7 +1736,7 @@ return this.bgColor; }; Rectangle.prototype.setColor=function(color){ this.lineColor=color; -if(this.lineColor!==null){ +if(this.lineColor!=null){ this.html.style.border=this.lineStroke+"px solid "+this.lineColor.getHTMLStyle(); }else{ this.html.style.border=this.lineStroke+"0px"; @@ -1927,14 +1752,14 @@ Rectangle.prototype.getHeight=function(){ return Figure.prototype.getHeight.call(this)+2*this.lineStroke; }; Rectangle.prototype.setDimension=function(w,h){ -Figure.prototype.setDimension.call(this,w-2*this.lineStroke,h-2*this.lineStroke); +return Figure.prototype.setDimension.call(this,w-2*this.lineStroke,h-2*this.lineStroke); }; 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){ +if(this.lineColor!=null){ c=this.lineColor.getHTMLStyle(); } this.html.style.border=this.lineStroke+"px solid "+c; @@ -1943,9 +1768,6 @@ Rectangle.prototype.getLineWidth=function(){ return this.lineStroke; }; ImageFigure=function(url){ -if(url===undefined){ -url=null; -} this.url=url; Node.call(this); this.setDimension(40,40); @@ -1959,7 +1781,7 @@ item.style.height=this.height+"px"; item.style.margin="0px"; item.style.padding="0px"; item.style.border="0px"; -if(this.url!==null){ +if(this.url!=null){ item.style.backgroundImage="url("+this.url+")"; }else{ item.style.backgroundImage=""; @@ -1972,37 +1794,30 @@ ImageFigure.prototype.isResizeable=function(){ return false; }; ImageFigure.prototype.setImage=function(url){ -if(url===undefined){ -url=null; -} this.url=url; -if(this.url!==null){ +if(this.url!=null){ this.html.style.backgroundImage="url("+this.url+")"; }else{ this.html.style.backgroundImage=""; } }; -Port=function(_3e6f,_3e70){ +Port=function(_41c2,_41c3){ Corona=function(){ }; -Corona.prototype=new Circle(); -Corona.prototype.setAlpha=function(_3e71){ -Circle.prototype.setAlpha.call(this,Math.min(0.3,_3e71)); -this.setDeleteable(false); -this.setCanDrag(false); -this.setResizeable(false); -this.setSelectable(false); +Corona.prototype=new Circle; +Corona.prototype.setAlpha=function(_41c4){ +Circle.prototype.setAlpha.call(this,Math.min(0.3,_41c4)); }; -if(_3e6f===null||_3e6f===undefined){ +if(_41c2==null){ this.currentUIRepresentation=new Circle(); }else{ -this.currentUIRepresentation=_3e6f; +this.currentUIRepresentation=_41c2; } -if(_3e70===null||_3e70===undefined){ +if(_41c3==null){ this.connectedUIRepresentation=new Circle(); this.connectedUIRepresentation.setColor(null); }else{ -this.connectedUIRepresentation=_3e70; +this.connectedUIRepresentation=_41c3; } this.disconnectedUIRepresentation=this.currentUIRepresentation; this.hideIfConnected=false; @@ -2019,17 +1834,17 @@ this.setColor(new Color(90,150,90)); Rectangle.prototype.setColor.call(this,null); this.dropable=new DropTarget(this.html); this.dropable.node=this; -this.dropable.addEventListener("dragenter",function(_3e72){ -_3e72.target.node.onDragEnter(_3e72.relatedTarget.node); +this.dropable.addEventListener("dragenter",function(_41c5){ +_41c5.target.node.onDragEnter(_41c5.relatedTarget.node); }); -this.dropable.addEventListener("dragleave",function(_3e73){ -_3e73.target.node.onDragLeave(_3e73.relatedTarget.node); +this.dropable.addEventListener("dragleave",function(_41c6){ +_41c6.target.node.onDragLeave(_41c6.relatedTarget.node); }); -this.dropable.addEventListener("drop",function(_3e74){ -_3e74.relatedTarget.node.onDrop(_3e74.target.node); +this.dropable.addEventListener("drop",function(_41c7){ +_41c7.relatedTarget.node.onDrop(_41c7.target.node); }); }; -Port.prototype=new Rectangle(); +Port.prototype=new Rectangle; Port.prototype.type="Port"; Port.ZOrderBaseIndex=5000; Port.setZOrderBaseIndex=function(index){ @@ -2041,9 +1856,9 @@ this.hideIfConnected=flag; Port.prototype.dispose=function(){ var size=this.moveListener.getSize(); for(var i=0;i=x&&iX<=iX2&&iY>=y&&iY<=iY2); }; -Port.prototype.showCorona=function(flag,_3e9d){ -if(flag===true){ +Port.prototype.showCorona=function(flag,_41ed){ +if(flag==true){ this.corona=new Corona(); this.corona.setAlpha(0.3); this.corona.setBackgroundColor(new Color(0,125,125)); @@ -2239,38 +2038,28 @@ 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){ +if(flag==false&&this.corona!=null){ this.parentNode.getWorkflow().removeFigure(this.corona); this.corona=null; } } }; -Port.prototype.createCommand=function(_3e9e){ -if(_3e9e.getPolicy()===EditPolicy.MOVE){ -if(!this.canDrag){ -return null; -} -return new CommandMovePort(this); -} -if(_3e9e.getPolicy()===EditPolicy.CONNECT){ -if(_3e9e.source.parentNode.id===_3e9e.target.parentNode.id){ -return null; -}else{ -return new CommandConnect(_3e9e.canvas,_3e9e.source,_3e9e.target); -} -} -return null; +InputPort=function(_4067){ +Port.call(this,_4067); }; -InputPort=function(_3865){ -Port.call(this,_3865); -}; -InputPort.prototype=new Port(); +InputPort.prototype=new Port; InputPort.prototype.type="InputPort"; -InputPort.prototype.onDragstart=function(x,y){ -if(!this.canDrag){ -return false; +InputPort.prototype.onDrop=function(port){ +if(port.getMaxFanOut&&port.getMaxFanOut()<=port.getFanOut()){ +return; +} +if(this.parentNode.id==port.parentNode.id){ +}else{ +if(port instanceof OutputPort){ +var _4069=new CommandConnect(this.parentNode.workflow,port,this); +this.parentNode.workflow.getCommandStack().execute(_4069); +} } -return true; }; InputPort.prototype.onDragEnter=function(port){ if(port instanceof OutputPort){ @@ -2279,13 +2068,13 @@ Port.prototype.onDragEnter.call(this,port); if(port instanceof LineStartResizeHandle){ var line=this.workflow.currentSelection; if(line instanceof Connection&&line.getSource() instanceof InputPort){ -Port.prototype.onDragEnter.call(this,line.getTarget()); +Port.prototype.onDragEnter.call(this,line.getSource()); } }else{ if(port instanceof LineEndResizeHandle){ var line=this.workflow.currentSelection; if(line instanceof Connection&&line.getTarget() instanceof InputPort){ -Port.prototype.onDragEnter.call(this,line.getSource()); +Port.prototype.onDragEnter.call(this,line.getTarget()); } } } @@ -2298,36 +2087,36 @@ Port.prototype.onDragLeave.call(this,port); if(port instanceof LineStartResizeHandle){ var line=this.workflow.currentSelection; if(line instanceof Connection&&line.getSource() instanceof InputPort){ -Port.prototype.onDragLeave.call(this,line.getTarget()); +Port.prototype.onDragLeave.call(this,line.getSource()); } }else{ if(port instanceof LineEndResizeHandle){ var line=this.workflow.currentSelection; if(line instanceof Connection&&line.getTarget() instanceof InputPort){ -Port.prototype.onDragLeave.call(this,line.getSource()); +Port.prototype.onDragLeave.call(this,line.getTarget()); } } } } }; -InputPort.prototype.createCommand=function(_386c){ -if(_386c.getPolicy()==EditPolicy.CONNECT){ -if(_386c.source.parentNode.id==_386c.target.parentNode.id){ -return null; -} -if(_386c.source instanceof OutputPort){ -return new CommandConnect(_386c.canvas,_386c.source,_386c.target); -} -return null; -} -return Port.prototype.createCommand.call(this,_386c); -}; -OutputPort=function(_43dd){ -Port.call(this,_43dd); +OutputPort=function(_357f){ +Port.call(this,_357f); this.maxFanOut=100; }; -OutputPort.prototype=new Port(); +OutputPort.prototype=new Port; OutputPort.prototype.type="OutputPort"; +OutputPort.prototype.onDrop=function(port){ +if(this.getMaxFanOut()<=this.getFanOut()){ +return; +} +if(this.parentNode.id==port.parentNode.id){ +}else{ +if(port instanceof InputPort){ +var _3581=new CommandConnect(this.parentNode.workflow,this,port); +this.parentNode.workflow.getCommandStack().execute(_3581); +} +} +}; OutputPort.prototype.onDragEnter=function(port){ if(this.getMaxFanOut()<=this.getFanOut()){ return; @@ -2338,13 +2127,13 @@ Port.prototype.onDragEnter.call(this,port); if(port instanceof LineStartResizeHandle){ var line=this.workflow.currentSelection; if(line instanceof Connection&&line.getSource() instanceof OutputPort){ -Port.prototype.onDragEnter.call(this,line.getTarget()); +Port.prototype.onDragEnter.call(this,line.getSource()); } }else{ if(port instanceof LineEndResizeHandle){ var line=this.workflow.currentSelection; if(line instanceof Connection&&line.getTarget() instanceof OutputPort){ -Port.prototype.onDragEnter.call(this,line.getSource()); +Port.prototype.onDragEnter.call(this,line.getTarget()); } } } @@ -2357,23 +2146,20 @@ Port.prototype.onDragLeave.call(this,port); if(port instanceof LineStartResizeHandle){ var line=this.workflow.currentSelection; if(line instanceof Connection&&line.getSource() instanceof OutputPort){ -Port.prototype.onDragLeave.call(this,line.getTarget()); +Port.prototype.onDragLeave.call(this,line.getSource()); } }else{ if(port instanceof LineEndResizeHandle){ var line=this.workflow.currentSelection; if(line instanceof Connection&&line.getTarget() instanceof OutputPort){ -Port.prototype.onDragLeave.call(this,line.getSource()); +Port.prototype.onDragLeave.call(this,line.getTarget()); } } } } }; OutputPort.prototype.onDragstart=function(x,y){ -if(!this.canDrag){ -return false; -} -if(this.maxFanOut===-1){ +if(this.maxFanOut==-1){ return true; } if(this.getMaxFanOut()<=this.getFanOut()){ @@ -2388,7 +2174,7 @@ OutputPort.prototype.getMaxFanOut=function(){ return this.maxFanOut; }; OutputPort.prototype.getFanOut=function(){ -if(this.getParent().workflow===null){ +if(this.getParent().workflow==null){ return 0; } var count=0; @@ -2408,55 +2194,33 @@ count++; } return count; }; -OutputPort.prototype.createCommand=function(_43ea){ -if(_43ea.getPolicy()===EditPolicy.CONNECT){ -if(_43ea.source.parentNode.id===_43ea.target.parentNode.id){ -return null; -} -if(_43ea.source instanceof InputPort){ -return new CommandConnect(_43ea.canvas,_43ea.target,_43ea.source); -} -return null; -} -return Port.prototype.createCommand.call(this,_43ea); -}; Line=function(){ this.lineColor=new Color(0,0,0); this.stroke=1; this.canvas=null; -this.parent=null; this.workflow=null; this.html=null; this.graphics=null; -this.id=UUID.create(); +this.id=this.generateUId(); this.startX=30; this.startY=30; this.endX=100; this.endY=100; this.alpha=1; this.isMoving=false; -this.model=null; this.zOrder=Line.ZOrderBaseIndex; -this.corona=Line.CoronaWidth; -this.properties={}; this.moveListener=new ArrayList(); this.setSelectable(true); this.setDeleteable(true); }; -Line.prototype.type="Line"; Line.ZOrderBaseIndex=200; -Line.ZOrderBaseIndex=200; -Line.CoronaWidth=5; Line.setZOrderBaseIndex=function(index){ Line.ZOrderBaseIndex=index; }; -Line.setDefaultCoronaWidth=function(width){ -Line.CoronaWidth=width; -}; Line.prototype.dispose=function(){ this.canvas=null; this.workflow=null; -if(this.graphics!==null){ +if(this.graphics!=null){ this.graphics.clear(); } this.graphics=null; @@ -2465,14 +2229,11 @@ Line.prototype.getZOrder=function(){ return this.zOrder; }; Line.prototype.setZOrder=function(index){ -if(this.html!==null){ +if(this.html!=null){ this.html.style.zIndex=index; } this.zOrder=index; }; -Line.prototype.setCoronaWidth=function(width){ -this.corona=width; -}; Line.prototype.createHTMLElement=function(){ var item=document.createElement("div"); item.id=this.id; @@ -2484,27 +2245,8 @@ item.style.width="0px"; item.style.zIndex=this.zOrder; return item; }; -Line.prototype.setId=function(id){ -this.id=id; -if(this.html!==null){ -this.html.id=id; -} -}; -Line.prototype.getId=function(){ -return this.id; -}; -Line.prototype.getProperties=function(){ -return this.properties; -}; -Line.prototype.getProperty=function(key){ -return this.properties[key]; -}; -Line.prototype.setProperty=function(key,value){ -this.properties[key]=value; -this.setDocumentDirty(); -}; Line.prototype.getHTMLElement=function(){ -if(this.html===null){ +if(this.html==null){ this.html=this.createHTMLElement(); } return this.html; @@ -2515,27 +2257,23 @@ return this.workflow; Line.prototype.isResizeable=function(){ return true; }; -Line.prototype.setCanvas=function(_3df8){ -this.canvas=_3df8; -if(this.graphics!==null){ +Line.prototype.setCanvas=function(_3ecb){ +this.canvas=_3ecb; +if(this.graphics!=null){ this.graphics.clear(); } this.graphics=null; }; -Line.prototype.setWorkflow=function(_3df9){ -this.workflow=_3df9; -if(this.graphics!==null){ +Line.prototype.setWorkflow=function(_3ecc){ +this.workflow=_3ecc; +if(this.graphics!=null){ this.graphics.clear(); } this.graphics=null; }; Line.prototype.paint=function(){ -if(this.html===null){ -return; -} -try{ -if(this.graphics===null){ -this.graphics=new jsGraphics(this.html); +if(this.graphics==null){ +this.graphics=new jsGraphics(this.id); }else{ this.graphics.clear(); } @@ -2543,16 +2281,12 @@ this.graphics.setStroke(this.stroke); this.graphics.setColor(this.lineColor.getHTMLStyle()); this.graphics.drawLine(this.startX,this.startY,this.endX,this.endY); this.graphics.paint(); -} -catch(e){ -pushErrorStack(e,"Line.prototype.paint=function()"); -} }; -Line.prototype.attachMoveListener=function(_3dfa){ -this.moveListener.add(_3dfa); +Line.prototype.attachMoveListener=function(_3ecd){ +this.moveListener.add(_3ecd); }; -Line.prototype.detachMoveListener=function(_3dfb){ -this.moveListener.remove(_3dfb); +Line.prototype.detachMoveListener=function(_3ece){ +this.moveListener.remove(_3ece); }; Line.prototype.fireMoveEvent=function(){ var size=this.moveListener.getSize(); @@ -2560,18 +2294,18 @@ for(var i=0;i=99){ +var _3ed5=Math.round(_3ed4*100); +if(_3ed5>=99){ this.html.style.filter=""; }else{ -this.html.style.filter="alpha(opacity="+_3e02+")"; +this.html.style.filter="alpha(opacity="+_3ed5+")"; } } -catch(exc3){ +catch(exc){ } -this.alpha=_3e01; +this.alpha=_3ed4; }; Line.prototype.setStartPoint=function(x,y){ this.startX=x; this.startY=y; -if(this.graphics!==null){ +if(this.graphics!=null){ this.paint(); } this.setDocumentDirty(); @@ -2616,7 +2350,7 @@ this.setDocumentDirty(); Line.prototype.setEndPoint=function(x,y){ this.endX=x; this.endY=y; -if(this.graphics!==null){ +if(this.graphics!=null){ this.paint(); } this.setDocumentDirty(); @@ -2655,8 +2389,8 @@ Line.prototype.getLength=function(){ return Math.sqrt((this.startX-this.endX)*(this.startX-this.endX)+(this.startY-this.endY)*(this.startY-this.endY)); }; Line.prototype.getAngle=function(){ -var _3e09=this.getLength(); -var angle=-(180/Math.PI)*Math.asin((this.startY-this.endY)/_3e09); +var _3edc=this.getLength(); +var angle=-(180/Math.PI)*Math.asin((this.startY-this.endY)/_3edc); if(angle<0){ if(this.endX0)&&((yDiff*yDiff)0)&&((yDiff*yDiff)0)&&(toDir===DOWN))||((yDiff<0)&&(toDir==UP))){ -point=new Point(toPt.x,_399d.y); +if(((yDiff>0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){ +point=new Point(toPt.x,_3bad.y); }else{ -if(_399e==toDir){ -var pos=Math.min(_399d.x,toPt.x)-this.MINDIST; -point=new Point(pos,_399d.y); +if(_3bae==toDir){ +var pos=Math.min(_3bad.x,toPt.x)-this.MINDIST; +point=new Point(pos,_3bad.y); }else{ -point=new Point(_399d.x-(xDiff/2),_399d.y); +point=new Point(_3bad.x-(xDiff/2),_3bad.y); } } } @@ -2842,22 +2566,22 @@ dir=DOWN; } } }else{ -if(_399e==RIGHT){ -if((xDiff<0)&&((yDiff*yDiff)0){ -point=new Point(_399d.x+this.MINDIST,_399d.y); +point=new Point(_3bad.x+this.MINDIST,_3bad.y); }else{ -if(((yDiff>0)&&(toDir===DOWN))||((yDiff<0)&&(toDir===UP))){ -point=new Point(toPt.x,_399d.y); +if(((yDiff>0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){ +point=new Point(toPt.x,_3bad.y); }else{ -if(_399e==toDir){ -var pos=Math.max(_399d.x,toPt.x)+this.MINDIST; -point=new Point(pos,_399d.y); +if(_3bae==toDir){ +var pos=Math.max(_3bad.x,toPt.x)+this.MINDIST; +point=new Point(pos,_3bad.y); }else{ -point=new Point(_399d.x-(xDiff/2),_399d.y); +point=new Point(_3bad.x-(xDiff/2),_3bad.y); } } } @@ -2868,22 +2592,22 @@ dir=DOWN; } } }else{ -if(_399e==DOWN){ +if(_3bae==DOWN){ if(((xDiff*xDiff)0){ -point=new Point(_399d.x,_399d.y+this.MINDIST); +point=new Point(_3bad.x,_3bad.y+this.MINDIST); }else{ -if(((xDiff>0)&&(toDir===RIGHT))||((xDiff<0)&&(toDir===LEFT))){ -point=new Point(_399d.x,toPt.y); +if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){ +point=new Point(_3bad.x,toPt.y); }else{ -if(_399e===toDir){ -var pos=Math.max(_399d.y,toPt.y)+this.MINDIST; -point=new Point(_399d.x,pos); +if(_3bae==toDir){ +var pos=Math.max(_3bad.y,toPt.y)+this.MINDIST; +point=new Point(_3bad.x,pos); }else{ -point=new Point(_399d.x,_399d.y-(yDiff/2)); +point=new Point(_3bad.x,_3bad.y-(yDiff/2)); } } } @@ -2894,22 +2618,22 @@ dir=RIGHT; } } }else{ -if(_399e==UP){ -if(((xDiff*xDiff)0)&&(toDir===DOWN)){ +if(_3bae==UP){ +if(((xDiff*xDiff)0)&&(toDir==DOWN)){ point=toPt; dir=toDir; }else{ if(yDiff<0){ -point=new Point(_399d.x,_399d.y-this.MINDIST); +point=new Point(_3bad.x,_3bad.y-this.MINDIST); }else{ -if(((xDiff>0)&&(toDir===RIGHT))||((xDiff<0)&&(toDir===LEFT))){ -point=new Point(_399d.x,toPt.y); +if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){ +point=new Point(_3bad.x,toPt.y); }else{ -if(_399e===toDir){ -var pos=Math.min(_399d.y,toPt.y)-this.MINDIST; -point=new Point(_399d.x,pos); +if(_3bae==toDir){ +var pos=Math.min(_3bad.y,toPt.y)-this.MINDIST; +point=new Point(_3bad.x,pos); }else{ -point=new Point(_399d.x,_399d.y-(yDiff/2)); +point=new Point(_3bad.x,_3bad.y-(yDiff/2)); } } } @@ -2924,94 +2648,94 @@ dir=RIGHT; } } this._route(conn,point,dir,toPt,toDir); -conn.addPoint(_399d); +conn.addPoint(_3bad); }; -BezierConnectionRouter=function(_3a03){ -if(!_3a03){ +BezierConnectionRouter=function(_354a){ +if(!_354a){ this.cheapRouter=new ManhattanConnectionRouter(); }else{ this.cheapRouter=null; } this.iteration=5; }; -BezierConnectionRouter.prototype=new ConnectionRouter(); +BezierConnectionRouter.prototype=new ConnectionRouter; BezierConnectionRouter.prototype.type="BezierConnectionRouter"; -BezierConnectionRouter.prototype.drawBezier=function(_3a04,_3a05,t,iter){ -var n=_3a04.length-1; -var q=[]; -var _3a0a=n+1; -for(var i=0;i<_3a0a;i++){ -q[i]=[]; -q[i][0]=_3a04[i]; +BezierConnectionRouter.prototype.drawBezier=function(_354b,_354c,t,iter){ +var n=_354b.length-1; +var q=new Array(); +var _3551=n+1; +for(var i=0;i<_3551;i++){ +q[i]=new Array(); +q[i][0]=_354b[i]; } for(var j=1;j<=n;j++){ for(var i=0;i<=(n-j);i++){ q[i][j]=new 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=[]; -var c2=[]; +var c1=new Array(); +var c2=new Array(); for(var i=0;i=0){ -this.drawBezier(c1,_3a05,t,--iter); -this.drawBezier(c2,_3a05,t,--iter); +this.drawBezier(c1,_354c,t,--iter); +this.drawBezier(c2,_354c,t,--iter); }else{ for(var i=0;i0)&&((yDiff*yDiff)0)&&((yDiff*yDiff)0)&&(toDir===DOWN))||((yDiff<0)&&(toDir===UP))){ -point=new Point(toPt.x,_3a17.y); +if(((yDiff>0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){ +point=new Point(toPt.x,_355e.y); }else{ -if(_3a18===toDir){ -var pos=Math.min(_3a17.x,toPt.x)-_3a1d; -point=new Point(pos,_3a17.y); +if(_355f==toDir){ +var pos=Math.min(_355e.x,toPt.x)-_3564; +point=new Point(pos,_355e.y); }else{ -point=new Point(_3a17.x-(xDiff/2),_3a17.y); +point=new Point(_355e.x-(xDiff/2),_355e.y); } } } @@ -3022,22 +2746,22 @@ dir=DOWN; } } }else{ -if(_3a18===RIGHT){ +if(_355f==RIGHT){ if((xDiff<0)&&((yDiff*yDiff)0){ -point=new Point(_3a17.x+_3a1d,_3a17.y); +point=new Point(_355e.x+_3564,_355e.y); }else{ -if(((yDiff>0)&&(toDir===DOWN))||((yDiff<0)&&(toDir===UP))){ -point=new Point(toPt.x,_3a17.y); +if(((yDiff>0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){ +point=new Point(toPt.x,_355e.y); }else{ -if(_3a18===toDir){ -var pos=Math.max(_3a17.x,toPt.x)+_3a1d; -point=new Point(pos,_3a17.y); +if(_355f==toDir){ +var pos=Math.max(_355e.x,toPt.x)+_3564; +point=new Point(pos,_355e.y); }else{ -point=new Point(_3a17.x-(xDiff/2),_3a17.y); +point=new Point(_355e.x-(xDiff/2),_355e.y); } } } @@ -3048,22 +2772,22 @@ dir=DOWN; } } }else{ -if(_3a18===DOWN){ -if(((xDiff*xDiff)0){ -point=new Point(_3a17.x,_3a17.y+_3a1d); +point=new Point(_355e.x,_355e.y+_3564); }else{ -if(((xDiff>0)&&(toDir===RIGHT))||((xDiff<0)&&(toDir===LEFT))){ -point=new Point(_3a17.x,toPt.y); +if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){ +point=new Point(_355e.x,toPt.y); }else{ -if(_3a18===toDir){ -var pos=Math.max(_3a17.y,toPt.y)+_3a1d; -point=new Point(_3a17.x,pos); +if(_355f==toDir){ +var pos=Math.max(_355e.y,toPt.y)+_3564; +point=new Point(_355e.x,pos); }else{ -point=new Point(_3a17.x,_3a17.y-(yDiff/2)); +point=new Point(_355e.x,_355e.y-(yDiff/2)); } } } @@ -3074,22 +2798,22 @@ dir=RIGHT; } } }else{ -if(_3a18===UP){ -if(((xDiff*xDiff)0)&&(toDir===DOWN)){ +if(_355f==UP){ +if(((xDiff*xDiff)0)&&(toDir==DOWN)){ point=toPt; dir=toDir; }else{ if(yDiff<0){ -point=new Point(_3a17.x,_3a17.y-_3a1d); +point=new Point(_355e.x,_355e.y-_3564); }else{ -if(((xDiff>0)&&(toDir===RIGHT))||((xDiff<0)&&(toDir===LEFT))){ -point=new Point(_3a17.x,toPt.y); +if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){ +point=new Point(_355e.x,toPt.y); }else{ -if(_3a18===toDir){ -var pos=Math.min(_3a17.y,toPt.y)-_3a1d; -point=new Point(_3a17.x,pos); +if(_355f==toDir){ +var pos=Math.min(_355e.y,toPt.y)-_3564; +point=new Point(_355e.x,pos); }else{ -point=new Point(_3a17.x,_3a17.y-(yDiff/2)); +point=new Point(_355e.x,_355e.y-(yDiff/2)); } } } @@ -3103,29 +2827,29 @@ dir=RIGHT; } } } -this._route(_3a15,conn,point,dir,toPt,toDir); -_3a15.push(_3a17); +this._route(_355c,conn,point,dir,toPt,toDir); +_355c.push(_355e); }; FanConnectionRouter=function(){ }; -FanConnectionRouter.prototype=new NullConnectionRouter(); +FanConnectionRouter.prototype=new NullConnectionRouter; FanConnectionRouter.prototype.type="FanConnectionRouter"; FanConnectionRouter.prototype.route=function(conn){ -var _3846=conn.getStartPoint(); +var _40c7=conn.getStartPoint(); var toPt=conn.getEndPoint(); var lines=conn.getSource().getConnections(); -var _3849=new ArrayList(); +var _40ca=new ArrayList(); var index=0; for(var i=0;i1){ +if(_40ca.getSize()>1){ this.routeCollision(conn,index); }else{ NullConnectionRouter.prototype.route.call(this,conn); @@ -3139,32 +2863,32 @@ FanConnectionRouter.prototype.routeCollision=function(conn,index){ var start=conn.getStartPoint(); var end=conn.getEndPoint(); conn.addPoint(start); -var _3852=10; -var _3853=new Point((end.x+start.x)/2,(end.y+start.y)/2); -var _3854=end.getPosition(start); +var _40d3=10; +var _40d4=new Point((end.x+start.x)/2,(end.y+start.y)/2); +var _40d5=end.getPosition(start); var ray; -if(_3854==PositionConstants.SOUTH||_3854==PositionConstants.EAST){ +if(_40d5==PositionConstants.SOUTH||_40d5==PositionConstants.EAST){ ray=new Point(end.x-start.x,end.y-start.y); }else{ ray=new Point(start.x-end.x,start.y-end.y); } -var _3856=Math.sqrt(ray.x*ray.x+ray.y*ray.y); -var _3857=_3852*ray.x/_3856; -var _3858=_3852*ray.y/_3856; -var _3859; -if(index%2===0){ -_3859=new Point(_3853.x+(index/2)*(-1*_3858),_3853.y+(index/2)*_3857); +var _40d7=Math.sqrt(ray.x*ray.x+ray.y*ray.y); +var _40d8=_40d3*ray.x/_40d7; +var _40d9=_40d3*ray.y/_40d7; +var _40da; +if(index%2==0){ +_40da=new Point(_40d4.x+(index/2)*(-1*_40d9),_40d4.y+(index/2)*_40d8); }else{ -_3859=new Point(_3853.x+(index/2)*_3858,_3853.y+(index/2)*(-1*_3857)); +_40da=new Point(_40d4.x+(index/2)*_40d9,_40d4.y+(index/2)*(-1*_40d8)); } -conn.addPoint(_3859); +conn.addPoint(_40da); conn.addPoint(end); }; -Graphics=function(_3601,_3602,_3603){ -this.jsGraphics=_3601; -this.xt=_3603.x; -this.yt=_3603.y; -this.radian=_3602*Math.PI/180; +Graphics=function(_3a61,_3a62,_3a63){ +this.jsGraphics=_3a61; +this.xt=_3a63.x; +this.yt=_3a63.y; +this.radian=_3a62*Math.PI/180; this.sinRadian=Math.sin(this.radian); this.cosRadian=Math.cos(this.radian); }; @@ -3189,24 +2913,24 @@ 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]); }; -Graphics.prototype.fillPolygon=function(_3619,_361a){ -var rotX=[]; -var rotY=[]; -for(var i=0;i<_3619.length;i++){ -rotX[i]=this.xt+_3619[i]*this.cosRadian-_361a[i]*this.sinRadian; -rotY[i]=this.yt+_3619[i]*this.sinRadian+_361a[i]*this.cosRadian; +Graphics.prototype.fillPolygon=function(_3a79,_3a7a){ +var rotX=new Array(); +var rotY=new Array(); +for(var i=0;i<_3a79.length;i++){ +rotX[i]=this.xt+_3a79[i]*this.cosRadian-_3a7a[i]*this.sinRadian; +rotY[i]=this.yt+_3a79[i]*this.sinRadian+_3a7a[i]*this.cosRadian; } this.jsGraphics.fillPolygon(rotX,rotY); }; Graphics.prototype.setColor=function(color){ this.jsGraphics.setColor(color.getHTMLStyle()); }; -Graphics.prototype.drawPolygon=function(_361f,_3620){ -var rotX=[]; -var rotY=[]; -for(var i=0;i<_361f.length;i++){ -rotX[i]=this.xt+_361f[i]*this.cosRadian-_3620[i]*this.sinRadian; -rotY[i]=this.yt+_361f[i]*this.sinRadian+_3620[i]*this.cosRadian; +Graphics.prototype.drawPolygon=function(_3a7f,_3a80){ +var rotX=new Array(); +var rotY=new Array(); +for(var i=0;i<_3a7f.length;i++){ +rotX[i]=this.xt+_3a7f[i]*this.cosRadian-_3a80[i]*this.sinRadian; +rotY[i]=this.yt+_3a7f[i]*this.sinRadian+_3a80[i]*this.cosRadian; } this.jsGraphics.drawPolygon(rotX,rotY); }; @@ -3214,7 +2938,6 @@ Connection=function(){ Line.call(this); this.sourcePort=null; this.targetPort=null; -this.canDrag=true; this.sourceDecorator=null; this.targetDecorator=null; this.sourceAnchor=new ConnectionAnchor(); @@ -3225,120 +2948,83 @@ this.children=new ArrayList(); this.setColor(new Color(0,0,115)); this.setLineWidth(1); }; -Connection.prototype=new Line(); -Connection.prototype.type="Connection"; +Connection.prototype=new Line; Connection.defaultRouter=new ManhattanConnectionRouter(); -Connection.setDefaultRouter=function(_427a){ -Connection.defaultRouter=_427a; +Connection.setDefaultRouter=function(_2e24){ +Connection.defaultRouter=_2e24; }; Connection.prototype.disconnect=function(){ -if(this.sourcePort!==null){ +if(this.sourcePort!=null){ this.sourcePort.detachMoveListener(this); this.fireSourcePortRouteEvent(); } -if(this.targetPort!==null){ +if(this.targetPort!=null){ this.targetPort.detachMoveListener(this); this.fireTargetPortRouteEvent(); } }; Connection.prototype.reconnect=function(){ -if(this.sourcePort!==null){ +if(this.sourcePort!=null){ this.sourcePort.attachMoveListener(this); this.fireSourcePortRouteEvent(); } -if(this.targetPort!==null){ +if(this.targetPort!=null){ this.targetPort.attachMoveListener(this); this.fireTargetPortRouteEvent(); } }; Connection.prototype.isResizeable=function(){ -return this.getCanDrag(); +return true; }; -Connection.prototype.setCanDrag=function(flag){ -this.canDrag=flag; -}; -Connection.prototype.getCanDrag=function(){ -return this.canDrag; -}; -Connection.prototype.addFigure=function(_427c,_427d){ -var entry={}; -entry.figure=_427c; -entry.locator=_427d; +Connection.prototype.addFigure=function(_2e25,_2e26){ +var entry=new Object(); +entry.figure=_2e25; +entry.locator=_2e26; this.children.add(entry); -if(this.graphics!==null){ -this.paint(); -} -var oThis=this; -var _4280=function(){ -var _4281=arguments[0]||window.event; -_4281.returnValue=false; -oThis.getWorkflow().setCurrentSelection(oThis); -oThis.getWorkflow().showLineResizeHandles(oThis); -}; -if(_427c.getHTMLElement().addEventListener){ -_427c.getHTMLElement().addEventListener("mousedown",_4280,false); -}else{ -if(_427c.getHTMLElement().attachEvent){ -_427c.getHTMLElement().attachEvent("onmousedown",_4280); -} -} -}; -Connection.prototype.setSourceDecorator=function(_4282){ -this.sourceDecorator=_4282; -if(this.graphics!==null){ +if(this.graphics!=null){ this.paint(); } }; -Connection.prototype.getSourceDecorator=function(){ -return this.sourceDecorator; -}; -Connection.prototype.setTargetDecorator=function(_4283){ -this.targetDecorator=_4283; -if(this.graphics!==null){ +Connection.prototype.setSourceDecorator=function(_2e28){ +this.sourceDecorator=_2e28; +if(this.graphics!=null){ this.paint(); } }; -Connection.prototype.getTargetDecorator=function(){ -return this.targetDecorator; +Connection.prototype.setTargetDecorator=function(_2e29){ +this.targetDecorator=_2e29; +if(this.graphics!=null){ +this.paint(); +} }; -Connection.prototype.setSourceAnchor=function(_4284){ -this.sourceAnchor=_4284; +Connection.prototype.setSourceAnchor=function(_2e2a){ +this.sourceAnchor=_2e2a; this.sourceAnchor.setOwner(this.sourcePort); -if(this.graphics!==null){ +if(this.graphics!=null){ this.paint(); } }; -Connection.prototype.setTargetAnchor=function(_4285){ -this.targetAnchor=_4285; +Connection.prototype.setTargetAnchor=function(_2e2b){ +this.targetAnchor=_2e2b; this.targetAnchor.setOwner(this.targetPort); -if(this.graphics!==null){ +if(this.graphics!=null){ this.paint(); } }; -Connection.prototype.setRouter=function(_4286){ -if(_4286!==null){ -this.router=_4286; +Connection.prototype.setRouter=function(_2e2c){ +if(_2e2c!=null){ +this.router=_2e2c; }else{ this.router=new NullConnectionRouter(); } -if(this.graphics!==null){ +if(this.graphics!=null){ this.paint(); } }; Connection.prototype.getRouter=function(){ return this.router; }; -Connection.prototype.setWorkflow=function(_4287){ -Line.prototype.setWorkflow.call(this,_4287); -for(var i=0;i0){ -window.clearInterval(_4269.timer); +if(_3e60.timer>0){ +window.clearInterval(_3e60.timer); } -_4269.timer=window.setInterval(_426a,30); +_3e60.timer=window.setInterval(_3e61,30); } -_4265.setCanvas(this); +_3e5c.setCanvas(this); if(xPos&&yPos){ -_4265.setPosition(xPos,yPos); +_3e5c.setPosition(xPos,yPos); } -if(_4265 instanceof Line){ -this.canvasLines.add(_4265); -this.html.appendChild(_4265.getHTMLElement()); +if(_3e5c instanceof Line){ +this.canvasLines.add(_3e5c); +this.html.appendChild(_3e5c.getHTMLElement()); }else{ var obj=this.canvasLines.getFirstElement(); -if(obj===null){ -this.html.appendChild(_4265.getHTMLElement()); +if(obj==null){ +this.html.appendChild(_3e5c.getHTMLElement()); }else{ -this.html.insertBefore(_4265.getHTMLElement(),obj.getHTMLElement()); +this.html.insertBefore(_3e5c.getHTMLElement(),obj.getHTMLElement()); } } -if(!_4268){ -_4265.paint(); -} -} -catch(e){ -pushErrorStack(e,"Canvas.prototype.addFigure= function( /*:Figure*/figure,/*:int*/ xPos,/*:int*/ yPos, /*:boolean*/ avoidPaint)"); +if(!_3e5f){ +_3e5c.paint(); } }; -Canvas.prototype.removeFigure=function(_426c){ -if(this.enableSmoothFigureHandling===true){ +Canvas.prototype.removeFigure=function(_3e63){ +if(this.enableSmoothFigureHandling==true){ var oThis=this; -var _426e=_426c; -var _426f=function(){ -if(_426e.alpha>0){ -_426e.setAlpha(Math.max(0,_426e.alpha-0.05)); +var _3e65=_3e63; +var _3e66=function(){ +if(_3e65.alpha>0){ +_3e65.setAlpha(Math.max(0,_3e65.alpha-0.05)); }else{ -window.clearInterval(_426e.timer); -_426e.timer=-1; -oThis.html.removeChild(_426e.html); -_426e.setCanvas(null); +window.clearInterval(_3e65.timer); +_3e65.timer=-1; +oThis.html.removeChild(_3e65.html); +_3e65.setCanvas(null); } }; -if(_426e.timer>0){ -window.clearInterval(_426e.timer); +if(_3e65.timer>0){ +window.clearInterval(_3e65.timer); } -_426e.timer=window.setInterval(_426f,20); +_3e65.timer=window.setInterval(_3e66,20); }else{ -this.html.removeChild(_426c.html); -_426c.setCanvas(null); +this.html.removeChild(_3e63.html); +_3e63.setCanvas(null); } -if(_426c instanceof Line){ -this.canvasLines.remove(_426c); +if(_3e63 instanceof Line){ +this.canvasLines.remove(_3e63); } }; Canvas.prototype.getEnableSmoothFigureHandling=function(){ @@ -4184,29 +3839,15 @@ this.enableSmoothFigureHandling=flag; Canvas.prototype.getWidth=function(){ return parseInt(this.html.style.width); }; -Canvas.prototype.setWidth=function(width){ -if(this.scrollArea!==null){ -this.scrollArea.style.width=width+"px"; -}else{ -this.html.style.width=width+"px"; -} -}; Canvas.prototype.getHeight=function(){ return parseInt(this.html.style.height); }; -Canvas.prototype.setHeight=function(_4272){ -if(this.scrollArea!==null){ -this.scrollArea.style.height=_4272+"px"; +Canvas.prototype.setBackgroundImage=function(_3e68,_3e69){ +if(_3e68!=null){ +if(_3e69){ +this.html.style.background="transparent url("+_3e68+") "; }else{ -this.html.style.height=_4272+"px"; -} -}; -Canvas.prototype.setBackgroundImage=function(_4273,_4274){ -if(_4273!==null){ -if(_4274){ -this.html.style.background="transparent url("+_4273+") "; -}else{ -this.html.style.background="transparent url("+_4273+") no-repeat"; +this.html.style.background="transparent url("+_3e68+") no-repeat"; } }else{ this.html.style.background="transparent"; @@ -4221,7 +3862,7 @@ return this.x; Canvas.prototype.getAbsoluteY=function(){ var el=this.html; var ot=el.offsetTop; -while((el=el.offsetParent)!==null){ +while((el=el.offsetParent)!=null){ ot+=el.offsetTop; } return ot; @@ -4229,7 +3870,7 @@ return ot; Canvas.prototype.getAbsoluteX=function(){ var el=this.html; var ol=el.offsetLeft; -while((el=el.offsetParent)!==null){ +while((el=el.offsetParent)!=null){ ol+=el.offsetLeft; } return ol; @@ -4241,17 +3882,14 @@ Canvas.prototype.getScrollTop=function(){ return this.scrollArea.scrollTop; }; Workflow=function(id){ -try{ if(!id){ return; } -this.menu=null; this.gridWidthX=10; this.gridWidthY=10; this.snapToGridHelper=null; this.verticalSnapToHelperLine=null; this.horizontalSnapToHelperLine=null; -this.snapToGeometryHelper=null; this.figures=new ArrayList(); this.lines=new ArrayList(); this.commonPorts=new ArrayList(); @@ -4263,7 +3901,6 @@ this.toolPalette=null; this.dragging=false; this.tooltip=null; this.draggingLine=null; -this.draggingLineCommand=null; this.commandStack=new CommandStack(); this.oldScrollPosLeft=0; this.oldScrollPosTop=0; @@ -4283,180 +3920,146 @@ this.resizeHandle8=new ResizeHandle(this,8); this.resizeHandleHalfWidth=parseInt(this.resizeHandle2.getWidth()/2); Canvas.call(this,id); this.setPanning(false); -if(this.html!==null){ +if(this.html!=null){ this.html.style.backgroundImage="url(grid_10.png)"; -this.html.className="Workflow"; oThis=this; this.html.tabIndex="0"; -var _42f2=function(){ -var _42f3=arguments[0]||window.event; -_42f3.cancelBubble=true; -_42f3.returnValue=false; -_42f3.stopped=true; -var diffX=_42f3.clientX; -var diffY=_42f3.clientY; -var _42f6=oThis.getScrollLeft(); -var _42f7=oThis.getScrollTop(); -var _42f8=oThis.getAbsoluteX(); -var _42f9=oThis.getAbsoluteY(); -var line=oThis.getBestLine(diffX+_42f6-_42f8,diffY+_42f7-_42f9,null); -if(line!==null){ -line.onContextMenu(diffX+_42f6-_42f8,diffY+_42f7-_42f9); +var _4116=function(){ +var _4117=arguments[0]||window.event; +var diffX=_4117.clientX; +var diffY=_4117.clientY; +var _411a=oThis.getScrollLeft(); +var _411b=oThis.getScrollTop(); +var _411c=oThis.getAbsoluteX(); +var _411d=oThis.getAbsoluteY(); +if(oThis.getBestFigure(diffX+_411a-_411c,diffY+_411b-_411d)!=null){ +return; +} +var line=oThis.getBestLine(diffX+_411a-_411c,diffY+_411b-_411d,null); +if(line!=null){ +line.onContextMenu(diffX+_411a-_411c,diffY+_411b-_411d); }else{ -oThis.onContextMenu(diffX+_42f6-_42f8,diffY+_42f7-_42f9); +oThis.onContextMenu(diffX+_411a-_411c,diffY+_411b-_411d); } }; this.html.oncontextmenu=function(){ return false; }; var oThis=this; -var _42fc=function(event){ +var _4120=function(event){ var ctrl=event.ctrlKey; oThis.onKeyDown(event.keyCode,ctrl); }; -var _42ff=function(){ -var _4300=arguments[0]||window.event; -if(_4300.returnValue==false){ -return; -} -var diffX=_4300.clientX; -var diffY=_4300.clientY; -var _4303=oThis.getScrollLeft(); -var _4304=oThis.getScrollTop(); -var _4305=oThis.getAbsoluteX(); -var _4306=oThis.getAbsoluteY(); -oThis.onMouseDown(diffX+_4303-_4305,diffY+_4304-_4306); +var _4123=function(){ +var _4124=arguments[0]||window.event; +var diffX=_4124.clientX; +var diffY=_4124.clientY; +var _4127=oThis.getScrollLeft(); +var _4128=oThis.getScrollTop(); +var _4129=oThis.getAbsoluteX(); +var _412a=oThis.getAbsoluteY(); +oThis.onMouseDown(diffX+_4127-_4129,diffY+_4128-_412a); }; -var _4307=function(){ -var _4308=arguments[0]||window.event; -if(oThis.currentMenu!==null){ +var _412b=function(){ +var _412c=arguments[0]||window.event; +if(oThis.currentMenu!=null){ oThis.removeFigure(oThis.currentMenu); oThis.currentMenu=null; } -if(_4308.button==2){ +if(_412c.button==2){ return; } -var diffX=_4308.clientX; -var diffY=_4308.clientY; -var _430b=oThis.getScrollLeft(); -var _430c=oThis.getScrollTop(); -var _430d=oThis.getAbsoluteX(); -var _430e=oThis.getAbsoluteY(); -oThis.onMouseUp(diffX+_430b-_430d,diffY+_430c-_430e); +var diffX=_412c.clientX; +var diffY=_412c.clientY; +var _412f=oThis.getScrollLeft(); +var _4130=oThis.getScrollTop(); +var _4131=oThis.getAbsoluteX(); +var _4132=oThis.getAbsoluteY(); +oThis.onMouseUp(diffX+_412f-_4131,diffY+_4130-_4132); }; -var _430f=function(){ -var _4310=arguments[0]||window.event; -var diffX=_4310.clientX; -var diffY=_4310.clientY; -var _4313=oThis.getScrollLeft(); -var _4314=oThis.getScrollTop(); -var _4315=oThis.getAbsoluteX(); -var _4316=oThis.getAbsoluteY(); -oThis.currentMouseX=diffX+_4313-_4315; -oThis.currentMouseY=diffY+_4314-_4316; +var _4133=function(){ +var _4134=arguments[0]||window.event; +var diffX=_4134.clientX; +var diffY=_4134.clientY; +var _4137=oThis.getScrollLeft(); +var _4138=oThis.getScrollTop(); +var _4139=oThis.getAbsoluteX(); +var _413a=oThis.getAbsoluteY(); +oThis.currentMouseX=diffX+_4137-_4139; +oThis.currentMouseY=diffY+_4138-_413a; var obj=oThis.getBestFigure(oThis.currentMouseX,oThis.currentMouseY); -if(Drag.currentHover!==null&&obj===null){ -var _4318=new DragDropEvent(); -_4318.initDragDropEvent("mouseleave",false,oThis); -Drag.currentHover.dispatchEvent(_4318); +if(Drag.currentHover!=null&&obj==null){ +var _413c=new DragDropEvent(); +_413c.initDragDropEvent("mouseleave",false,oThis); +Drag.currentHover.dispatchEvent(_413c); }else{ -var diffX=_4310.clientX; -var diffY=_4310.clientY; -var _4313=oThis.getScrollLeft(); -var _4314=oThis.getScrollTop(); -var _4315=oThis.getAbsoluteX(); -var _4316=oThis.getAbsoluteY(); -oThis.onMouseMove(diffX+_4313-_4315,diffY+_4314-_4316); +var diffX=_4134.clientX; +var diffY=_4134.clientY; +var _4137=oThis.getScrollLeft(); +var _4138=oThis.getScrollTop(); +var _4139=oThis.getAbsoluteX(); +var _413a=oThis.getAbsoluteY(); +oThis.onMouseMove(diffX+_4137-_4139,diffY+_4138-_413a); } -if(obj===null){ +if(obj==null){ Drag.currentHover=null; } -if(oThis.tooltip!==null){ +if(oThis.tooltip!=null){ if(Math.abs(oThis.currentTooltipX-oThis.currentMouseX)>10||Math.abs(oThis.currentTooltipY-oThis.currentMouseY)>10){ oThis.showTooltip(null); } } }; -var _4319=function(_431a){ -var _431a=arguments[0]||window.event; -var diffX=_431a.clientX; -var diffY=_431a.clientY; -var _431d=oThis.getScrollLeft(); -var _431e=oThis.getScrollTop(); -var _431f=oThis.getAbsoluteX(); -var _4320=oThis.getAbsoluteY(); -var line=oThis.getBestLine(diffX+_431d-_431f,diffY+_431e-_4320,null); -if(line!==null){ +var _413d=function(_413e){ +var _413e=arguments[0]||window.event; +var diffX=_413e.clientX; +var diffY=_413e.clientY; +var _4141=oThis.getScrollLeft(); +var _4142=oThis.getScrollTop(); +var _4143=oThis.getAbsoluteX(); +var _4144=oThis.getAbsoluteY(); +var line=oThis.getBestLine(diffX+_4141-_4143,diffY+_4142-_4144,null); +if(line!=null){ line.onDoubleClick(); } }; if(this.html.addEventListener){ -this.html.addEventListener("contextmenu",_42f2,false); -this.html.addEventListener("mousemove",_430f,false); -this.html.addEventListener("mouseup",_4307,false); -this.html.addEventListener("mousedown",_42ff,false); -this.html.addEventListener("keydown",_42fc,false); -this.html.addEventListener("dblclick",_4319,false); +this.html.addEventListener("contextmenu",_4116,false); +this.html.addEventListener("mousemove",_4133,false); +this.html.addEventListener("mouseup",_412b,false); +this.html.addEventListener("mousedown",_4123,false); +this.html.addEventListener("keydown",_4120,false); +this.html.addEventListener("dblclick",_413d,false); }else{ if(this.html.attachEvent){ -this.html.attachEvent("oncontextmenu",_42f2); -this.html.attachEvent("onmousemove",_430f); -this.html.attachEvent("onmousedown",_42ff); -this.html.attachEvent("onmouseup",_4307); -this.html.attachEvent("onkeydown",_42fc); -this.html.attachEvent("ondblclick",_4319); +this.html.attachEvent("oncontextmenu",_4116); +this.html.attachEvent("onmousemove",_4133); +this.html.attachEvent("onmousedown",_4123); +this.html.attachEvent("onmouseup",_412b); +this.html.attachEvent("onkeydown",_4120); +this.html.attachEvent("ondblclick",_413d); }else{ -throw "Open-jACOB Draw2D not supported in this browser."; +throw new Error("Open-jACOB Draw2D not supported in this browser."); } } } -} -catch(e){ -pushErrorStack(e,"Workflow=function(/*:String*/id)"); -} }; -Workflow.prototype=new Canvas(); +Workflow.prototype=new Canvas; Workflow.prototype.type="Workflow"; Workflow.COLOR_GREEN=new Color(0,255,0); -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 _4322=this.getDocument(); -var _4323=_4322.getLines().clone(); -for(var i=0;i<_4323.getSize();i++){ -(new CommandDelete(_4323.get(i))).execute(); -} -var _4325=_4322.getFigures().clone(); -for(var i=0;i<_4325.getSize();i++){ -(new CommandDelete(_4325.get(i))).execute(); -} -this.commonPorts.removeAllElements(); -this.dropTargets.removeAllElements(); -this.compartments.removeAllElements(); -this.selectionListeners.removeAllElements(); -this.dialogs.removeAllElements(); -this.commandStack=new CommandStack(); -this.currentSelection=null; -this.currentMenu=null; -Drag.clearCurrent(); -}; Workflow.prototype.onScroll=function(){ -var _4326=this.getScrollLeft(); -var _4327=this.getScrollTop(); -var _4328=_4326-this.oldScrollPosLeft; -var _4329=_4327-this.oldScrollPosTop; +var _4146=this.getScrollLeft(); +var _4147=this.getScrollTop(); +var _4148=_4146-this.oldScrollPosLeft; +var _4149=_4147-this.oldScrollPosTop; for(var i=0;i=0){ @@ -4491,36 +4094,36 @@ window.clearTimeout(this.tooltipTimer); this.tooltipTimer=-1; } } -this.tooltip=_4336; -if(this.tooltip!==null){ +this.tooltip=_4156; +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 _4339=function(){ +var _4159=function(){ oThis.tooltipTimer=-1; oThis.showTooltip(null); }; -if(_4337==true){ -this.tooltipTimer=window.setTimeout(_4339,5000); +if(_4157==true){ +this.tooltipTimer=window.setTimeout(_4159,5000); } } }; -Workflow.prototype.showDialog=function(_433a,xPos,yPos){ +Workflow.prototype.showDialog=function(_415a,xPos,yPos){ if(xPos){ -this.addFigure(_433a,xPos,yPos); +this.addFigure(_415a,xPos,yPos); }else{ -this.addFigure(_433a,200,100); +this.addFigure(_415a,200,100); } -this.dialogs.add(_433a); +this.dialogs.add(_415a); }; Workflow.prototype.showMenu=function(menu,xPos,yPos){ -if(this.menu!==null){ +if(this.menu!=null){ this.html.removeChild(this.menu.getHTMLElement()); this.menu.setWorkflow(); } this.menu=menu; -if(this.menu!==null){ +if(this.menu!=null){ this.menu.setWorkflow(this); this.menu.setPosition(xPos,yPos); this.html.appendChild(this.menu.getHTMLElement()); @@ -4529,21 +4132,21 @@ this.menu.paint(); }; Workflow.prototype.onContextMenu=function(x,y){ var menu=this.getContextMenu(); -if(menu!==null){ +if(menu!=null){ this.showMenu(menu,x,y); } }; Workflow.prototype.getContextMenu=function(){ return null; }; -Workflow.prototype.setToolWindow=function(_4343,x,y){ -this.toolPalette=_4343; +Workflow.prototype.setToolWindow=function(_4163,x,y){ +this.toolPalette=_4163; if(y){ -this.addFigure(_4343,x,y); +this.addFigure(_4163,x,y); }else{ -this.addFigure(_4343,20,20); +this.addFigure(_4163,20,20); } -this.dialogs.add(_4343); +this.dialogs.add(_4163); }; Workflow.prototype.setSnapToGrid=function(flag){ if(flag){ @@ -4563,116 +4166,122 @@ Workflow.prototype.setGridWidth=function(dx,dy){ this.gridWidthX=dx; this.gridWidthY=dy; }; -Workflow.prototype.addFigure=function(_434a,xPos,yPos){ -try{ -Canvas.prototype.addFigure.call(this,_434a,xPos,yPos,true); -_434a.setWorkflow(this); -var _434d=this; -if(_434a instanceof CompartmentFigure){ -this.compartments.add(_434a); +Workflow.prototype.addFigure=function(_416a,xPos,yPos){ +Canvas.prototype.addFigure.call(this,_416a,xPos,yPos,true); +_416a.setWorkflow(this); +var _416d=this; +if(_416a instanceof CompartmentFigure){ +this.compartments.add(_416a); } -if(_434a instanceof Line){ -this.lines.add(_434a); +if(_416a instanceof Line){ +this.lines.add(_416a); }else{ -this.figures.add(_434a); -_434a.draggable.addEventListener("drag",function(_434e){ -var _434f=_434d.getFigure(_434e.target.element.id); -if(_434f===null){ +this.figures.add(_416a); +_416a.draggable.addEventListener("dragend",function(_416e){ +}); +_416a.draggable.addEventListener("dragstart",function(_416f){ +var _4170=_416d.getFigure(_416f.target.element.id); +if(_4170==null){ return; } -if(_434f.isSelectable()==false){ +if(_4170.isSelectable()==false){ return; } -_434d.moveResizeHandles(_434f); +_416d.showResizeHandles(_4170); +_416d.setCurrentSelection(_4170); +}); +_416a.draggable.addEventListener("drag",function(_4171){ +var _4172=_416d.getFigure(_4171.target.element.id); +if(_4172==null){ +return; +} +if(_4172.isSelectable()==false){ +return; +} +_416d.moveResizeHandles(_4172); }); } -_434a.paint(); +_416a.paint(); this.setDocumentDirty(); -} -catch(e){ -pushErrorStack(e,"Workflow.prototype.addFigure=function(/*:Figure*/ figure ,/*:int*/ xPos, /*:int*/ yPos)"); -} }; -Workflow.prototype.removeFigure=function(_4350){ -Canvas.prototype.removeFigure.call(this,_4350); -this.figures.remove(_4350); -this.lines.remove(_4350); -this.dialogs.remove(_4350); -_4350.setWorkflow(null); -if(_4350 instanceof CompartmentFigure){ -this.compartments.remove(_4350); +Workflow.prototype.removeFigure=function(_4173){ +Canvas.prototype.removeFigure.call(this,_4173); +this.figures.remove(_4173); +this.lines.remove(_4173); +this.dialogs.remove(_4173); +_4173.setWorkflow(null); +if(_4173 instanceof CompartmentFigure){ +this.compartments.remove(_4173); } -if(_4350 instanceof Connection){ -_4350.disconnect(); +if(_4173 instanceof Connection){ +_4173.disconnect(); } -if(this.currentSelection==_4350){ +if(this.currentSelection==_4173){ this.setCurrentSelection(null); } this.setDocumentDirty(); -_4350.onRemove(this); }; -Workflow.prototype.moveFront=function(_4351){ -this.html.removeChild(_4351.getHTMLElement()); -this.html.appendChild(_4351.getHTMLElement()); +Workflow.prototype.moveFront=function(_4174){ +this.html.removeChild(_4174.getHTMLElement()); +this.html.appendChild(_4174.getHTMLElement()); }; -Workflow.prototype.moveBack=function(_4352){ -this.html.removeChild(_4352.getHTMLElement()); -this.html.insertBefore(_4352.getHTMLElement(),this.html.firstChild); +Workflow.prototype.moveBack=function(_4175){ +this.html.removeChild(_4175.getHTMLElement()); +this.html.insertBefore(_4175.getHTMLElement(),this.html.firstChild); }; -Workflow.prototype.getBestCompartmentFigure=function(x,y,_4355){ -var _4356=null; +Workflow.prototype.getBestCompartmentFigure=function(x,y,_4178){ +var _4179=null; for(var i=0;ithis.maxundo){ this.undostack=this.undostack.slice(this.undostack.length-this.maxundo); } -this.notifyListeners(_39ad,CommandStack.POST_EXECUTE); +this.notifyListeners(_3f6c,CommandStack.POST_EXECUTE); }; CommandStack.prototype.undo=function(){ -var _39ae=this.undostack.pop(); -if(_39ae){ -this.notifyListeners(_39ae,CommandStack.PRE_UNDO); -this.redostack.push(_39ae); -_39ae.undo(); -this.notifyListeners(_39ae,CommandStack.POST_UNDO); +var _3f6d=this.undostack.pop(); +if(_3f6d){ +this.notifyListeners(_3f6d,CommandStack.PRE_UNDO); +this.redostack.push(_3f6d); +_3f6d.undo(); +this.notifyListeners(_3f6d,CommandStack.POST_UNDO); } }; CommandStack.prototype.redo=function(){ -var _39af=this.redostack.pop(); -if(_39af){ -this.notifyListeners(_39af,CommandStack.PRE_REDO); -this.undostack.push(_39af); -_39af.redo(); -this.notifyListeners(_39af,CommandStack.POST_REDO); +var _3f6e=this.redostack.pop(); +if(_3f6e){ +this.notifyListeners(_3f6e,CommandStack.PRE_REDO); +this.undostack.push(_3f6e); +_3f6e.redo(); +this.notifyListeners(_3f6e,CommandStack.POST_REDO); } }; CommandStack.prototype.canRedo=function(){ @@ -6322,22 +5881,22 @@ return this.redostack.length>0; CommandStack.prototype.canUndo=function(){ return this.undostack.length>0; }; -CommandStack.prototype.addCommandStackEventListener=function(_39b0){ -this.eventListeners.add(_39b0); +CommandStack.prototype.addCommandStackEventListener=function(_3f6f){ +this.eventListeners.add(_3f6f); }; -CommandStack.prototype.removeCommandStackEventListener=function(_39b1){ -this.eventListeners.remove(_39b1); +CommandStack.prototype.removeCommandStackEventListener=function(_3f70){ +this.eventListeners.remove(_3f70); }; -CommandStack.prototype.notifyListeners=function(_39b2,state){ -var event=new CommandStackEvent(_39b2,state); +CommandStack.prototype.notifyListeners=function(_3f71,state){ +var event=new CommandStackEvent(_3f71,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); -} -_3b23=this.m_xml.charAt(iVB); -if(SAXStrings.QUOTES.indexOf(_3b23)==-1){ -return this._setErr(XMLP.ERR_ATT_VALUES); -} -iVE=this.m_xml.indexOf(_3b23,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 _3b3d=XMLP._errs[iErr]; -this.m_cAlt=_3b3d; -this.m_cB=0; -this.m_cE=_3b3d.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 _3b3f=new XMLP(strD); -if(this.m_hndDoc&&this.m_hndDoc.setDocumentLocator){ -this.m_hndDoc.setDocumentLocator(this); -} -this.m_parser=_3b3f; -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(_3b46){ -this.m_strErrMsg=_3b46; -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(_3b49){ -var _3b4a,_3b49; -_3b49=this.m_parser; -while(!this.m_bErr){ -_3b4a=_3b49.next(); -if(_3b4a==XMLP._ELM_B){ -this._fireEvent(SAXDriver.ELM_B,_3b49.getName(),this); -}else{ -if(_3b4a==XMLP._ELM_E){ -this._fireEvent(SAXDriver.ELM_E,_3b49.getName()); -}else{ -if(_3b4a==XMLP._ELM_EMP){ -this._fireEvent(SAXDriver.ELM_B,_3b49.getName(),this); -this._fireEvent(SAXDriver.ELM_E,_3b49.getName()); -}else{ -if(_3b4a==XMLP._TEXT){ -this._fireEvent(SAXDriver.CHARS,_3b49.getContent(),_3b49.getContentBegin(),_3b49.getContentEnd()-_3b49.getContentBegin()); -}else{ -if(_3b4a==XMLP._ENTITY){ -this._fireEvent(SAXDriver.CHARS,_3b49.getContent(),_3b49.getContentBegin(),_3b49.getContentEnd()-_3b49.getContentBegin()); -}else{ -if(_3b4a==XMLP._PI){ -this._fireEvent(SAXDriver.PI,_3b49.getName(),_3b49.getContent().substring(_3b49.getContentBegin(),_3b49.getContentEnd())); -}else{ -if(_3b4a==XMLP._CDATA){ -this._fireEvent(SAXDriver.CD_B); -this._fireEvent(SAXDriver.CHARS,_3b49.getContent(),_3b49.getContentBegin(),_3b49.getContentEnd()-_3b49.getContentBegin()); -this._fireEvent(SAXDriver.CD_E); -}else{ -if(_3b4a==XMLP._COMMENT){ -this._fireEvent(SAXDriver.CMNT,_3b49.getContent(),_3b49.getContentBegin(),_3b49.getContentEnd()-_3b49.getContentBegin()); -}else{ -if(_3b4a==XMLP._DTD){ -}else{ -if(_3b4a==XMLP._ERROR){ -this._fireError(_3b49.getContent()); -}else{ -if(_3b4a==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 _3b4e=arrD[arrD.length-1]; -arrD.length--; -var _3b4f=arrD.join("\n").length; -return iP-_3b4f; -}; -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=[]; -}; -Stack.prototype.clear=function(){ -this.m_arr=[]; -}; -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(_3b67,_3b68,_3b69){ -if(isEmpty(_3b67)){ -return ""; -} -if(_3b68===null){ -_3b68=true; -} -if(_3b69===null){ -_3b69=true; -} -var left=0; -var right=0; -var i=0; -var k=0; -if(_3b68==true){ -while((i<_3b67.length)&&(whitespace.indexOf(_3b67.charAt(i++))!=-1)){ -left++; -} -} -if(_3b69==true){ -k=_3b67.length-1; -while((k>=left)&&(whitespace.indexOf(_3b67.charAt(k--))!=-1)){ -right++; -} -} -return _3b67.substring(left,_3b67.length-right); -} -function __escapeString(str){ -var _3b6f=/&/g; -var _3b70=//g; -var _3b72=/"/g; -var _3b73=/'/g; -str=str.replace(_3b6f,"&"); -str=str.replace(_3b70,"<"); -str=str.replace(_3b71,">"); -str=str.replace(_3b72,"""); -str=str.replace(_3b73,"'"); -return str; -} -function __unescapeString(str){ -var _3b75=/&/g; -var _3b76=/</g; -var _3b77=/>/g; -var _3b78=/"/g; -var _3b79=/'/g; -str=str.replace(_3b75,"&"); -str=str.replace(_3b76,"<"); -str=str.replace(_3b77,">"); -str=str.replace(_3b78,"\""); -str=str.replace(_3b79,"'"); -return str; -} -function addClass(_4688,_4689){ -if(_4688){ -if(_4688.indexOf("|"+_4689+"|")<0){ -_4688+=_4689+"|"; -} -}else{ -_4688="|"+_4689+"|"; -} -return _4688; -} -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(_468d,_468e){ -var ret=false; -if(_468d.toLowerCase()=="xml"){ -ret=(!_468e||(_468e=="1.0")||(_468e=="2.0")); -}else{ -if(_468d.toLowerCase()=="core"){ -ret=(!_468e||(_468e=="2.0")); -} -} -return ret; -}; -DOMImplementation.prototype.loadXML=function DOMImplementation_loadXML(_4690){ -var _4691; -try{ -_4691=new XMLP(_4690); -} -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