Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java,v diff -u -r1.41.2.16 -r1.41.2.17 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 5 Apr 2007 05:29:54 -0000 1.41.2.16 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 18 Apr 2007 07:53:34 -0000 1.41.2.17 @@ -532,7 +532,7 @@ gate.setYcoord(new Integer((y1.intValue() + 50 + y2.intValue()) / 2)); } else { - fromTransition = newTransition; + //fromTransition = newTransition; newTransition.setTransitionUIID(++maxId); newTransition.setFromActivity(activity); @@ -544,10 +544,10 @@ activity.setTransitionFrom(fromTransition); gate.setTransitionTo(fromTransition); - Integer x1 = (activity.getTransitionTo() != null) ? activity.getTransitionTo().getFromActivity().getXcoord() : null; /* set x/y position for Gate */ + Integer x1 = (activity.getTransitionTo() != null) ? activity.getTransitionTo().getFromActivity().getXcoord() : 0; /* set x/y position for Gate */ Integer x2 = (activity.getXcoord() != null) ? activity.getXcoord() : 0; - if(x2 != null) gate.setXcoord(x2>=x1 ? new Integer(x2.intValue()+123+13+20) : new Integer(x2.intValue()-13-20)); + if(x1 != null && x2 != null) gate.setXcoord(x2>=x1 ? new Integer(x2.intValue()+123+13+20) : new Integer(x2.intValue()-13-20)); else gate.setXcoord(new Integer(x2.intValue()+123+13+20)); gate.setYcoord(activity.getYcoord() + 25); @@ -574,7 +574,7 @@ Integer x1 = (toActivity.getXcoord() != null) ? toActivity.getXcoord() : 0; /* set x/y position for Gate */ Integer x2 = (toActivity.getTransitionFrom() != null) ? toActivity.getTransitionFrom().getToActivity().getXcoord() : null; - if(x2 != null) gate.setXcoord(x2>=x1 ? new Integer(x1.intValue()-13-20) : new Integer(x1.intValue()+123+13+20)); + if(x1 != null && x2 != null) gate.setXcoord(x2>=x1 ? new Integer(x1.intValue()-13-20) : new Integer(x1.intValue()+123+13+20)); else gate.setXcoord(new Integer(x1.intValue()-13-20)); gate.setYcoord(toActivity.getYcoord() + 25);