fixed drawing shapes outside the region when process loaded from old processmap

This commit is contained in:
girish
2010-12-17 04:54:55 +00:00
parent fc657e9b47
commit 442f644dc3
2 changed files with 26 additions and 57 deletions

View File

@@ -36,7 +36,7 @@ MyWorkflow.prototype.setBoundary = function (oShape) {
} }
//Top Border //Top Border
if (oShape.y < 55) { if (oShape.y < 55) {
oShape.y = 71; oShape.y = 60;
} }
//Bottom Border //Bottom Border
if (oShape.y > 1000 - oShape.height) { if (oShape.y > 1000 - oShape.height) {

View File

@@ -1,7 +1,7 @@
Ext.onReady ( function() { Ext.onReady ( function() {
workflow = new MyWorkflow("paintarea"); workflow = new MyWorkflow("paintarea");
workflow.setEnableSmoothFigureHandling(true); workflow.setEnableSmoothFigureHandling(false);
workflow.scrollArea.width = 2000; workflow.scrollArea.width = 2000;
//For Undo and Redo Options //For Undo and Redo Options
// workflow.getCommandStack().addCommandStackEventListener(new commandListener()); // workflow.getCommandStack().addCommandStackEventListener(new commandListener());
@@ -20,30 +20,6 @@ Ext.onReady ( function() {
Ext.Msg.alert ('Failure'); Ext.Msg.alert ('Failure');
} }
}); });
//load all the Information related to the process
// var urlparams = '?action=load&data={"uid":"'+ pro_uid +'"}';
// Ext.Ajax.request({
// url: "processes_Ajax.php"+ urlparams,
// success: function(response) {
// this.workflow.processInfo = Ext.util.JSON.decode(response.responseText);
// },
// failure: function(){
// Ext.Msg.alert ('Failure');
// }
// });
//Get All the processes
// var urlparams = '?action=getProcesses';
// Ext.Ajax.request({
// url: "processes_Ajax.php"+ urlparams,
// success: function(response) {
// this.workflow.processName = Ext.util.JSON.decode(response.responseText);
// },
// failure: function(){
// Ext.Msg.alert ('Failure');
// }
// });
} }
@@ -534,10 +510,6 @@ Ext.onReady ( function() {
{ {
case 'tasks': case 'tasks':
for(var k=0;k<shapes.tasks.length;k++){ for(var k=0;k<shapes.tasks.length;k++){
var srctaskxpos = shapes.tasks[k][2];
var srctaskypos = shapes.tasks[k][3];
var task_width = shapes.tasks[k][4];
var task_height = shapes.tasks[k][5];
var task_boundary = shapes.tasks[k][6]; var task_boundary = shapes.tasks[k][6];
if(task_boundary != null && task_boundary == 'TIMER' && task_boundary == '') if(task_boundary != null && task_boundary == 'TIMER' && task_boundary == '')
_4562.workflow.boundaryEvent = true; _4562.workflow.boundaryEvent = true;
@@ -548,13 +520,14 @@ Ext.onReady ( function() {
_4562.workflow.taskNo++; _4562.workflow.taskNo++;
_4562.workflow.taskName = shapes.tasks[k][1]; _4562.workflow.taskName = shapes.tasks[k][1];
workflow.task_width = task_width; workflow.task_width = shapes.tasks[k][4];
workflow.task_height = task_height; workflow.task_height = shapes.tasks[k][5];
NewShape = eval("new bpmnTask(_4562.workflow)"); NewShape = eval("new bpmnTask(_4562.workflow)");
NewShape.x = shapes.tasks[k][2];
NewShape.y = shapes.tasks[k][3];
NewShape.taskName = shapes.tasks[k][1]; NewShape.taskName = shapes.tasks[k][1];
_4562.workflow.addFigure(NewShape, srctaskxpos, srctaskypos); workflow.setBoundary(NewShape);
//workflow.setBoundary(NewShape); _4562.workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.tasks[k][0]; NewShape.html.id = shapes.tasks[k][0];
NewShape.id = shapes.tasks[k][0]; NewShape.id = shapes.tasks[k][0];
} }
@@ -562,11 +535,12 @@ Ext.onReady ( function() {
case 'gateways': case 'gateways':
for(var k=0;k<shapes.gateways.length;k++){ for(var k=0;k<shapes.gateways.length;k++){
var srctype = shapes.gateways[k][1]; var srctype = shapes.gateways[k][1];
var srcxpos = shapes.gateways[k][2];
var srcypos = shapes.gateways[k][3];
NewShape = eval("new "+srctype+"(_4562.workflow)"); NewShape = eval("new "+srctype+"(_4562.workflow)");
_4562.workflow.addFigure(NewShape, srcxpos, srcypos); NewShape.x = shapes.gateways[k][2];
// workflow.setBoundary(NewShape); NewShape.y = shapes.gateways[k][3];
workflow.setBoundary(NewShape);
_4562.workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id //Setting newshape id to the old shape id
NewShape.html.id = shapes.gateways[k][0]; NewShape.html.id = shapes.gateways[k][0];
NewShape.id = shapes.gateways[k][0]; NewShape.id = shapes.gateways[k][0];
@@ -577,11 +551,11 @@ Ext.onReady ( function() {
var srceventtype = shapes.events[k][1]; var srceventtype = shapes.events[k][1];
if(! srceventtype.match(/End/)) if(! srceventtype.match(/End/))
{ {
var srceventxpos = shapes.events[k][2];
var srceventypos = shapes.events[k][3];
NewShape = eval("new "+srceventtype+"(_4562.workflow)"); NewShape = eval("new "+srceventtype+"(_4562.workflow)");
_4562.workflow.addFigure(NewShape, srceventxpos, srceventypos); NewShape.x = shapes.events[k][2];
// workflow.setBoundary(NewShape); NewShape.y = shapes.events[k][3];
workflow.setBoundary(NewShape);
_4562.workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id //Setting newshape id to the old shape id
NewShape.html.id = shapes.events[k][0]; NewShape.html.id = shapes.events[k][0];
NewShape.id = shapes.events[k][0]; NewShape.id = shapes.events[k][0];
@@ -590,17 +564,14 @@ Ext.onReady ( function() {
break; break;
case 'annotations': case 'annotations':
for(var k=0;k<shapes.annotations.length;k++){ for(var k=0;k<shapes.annotations.length;k++){
//var srcannotationname = shapes[j][k][1];
var srcannotationxpos = shapes.annotations[k][2];
var srcannotationypos = shapes.annotations[k][3];
var width = shapes.annotations[k][4];
var height = shapes.annotations[k][5];
_4562.workflow.annotationName = shapes.annotations[k][1]; _4562.workflow.annotationName = shapes.annotations[k][1];
workflow.anno_width = width; workflow.anno_width = shapes.annotations[k][4];
workflow.anno_height = height; workflow.anno_height = shapes.annotations[k][5];
NewShape = eval("new bpmnAnnotation(_4562.workflow)"); NewShape = eval("new bpmnAnnotation(_4562.workflow)");
_4562.workflow.addFigure(NewShape, srcannotationxpos, srcannotationypos); NewShape.x = shapes.annotations[k][2];
//workflow.setBoundary(NewShape); NewShape.y = shapes.annotations[k][3];
workflow.setBoundary(NewShape);
_4562.workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id //Setting newshape id to the old shape id
NewShape.html.id = shapes.annotations[k][0]; NewShape.html.id = shapes.annotations[k][0];
NewShape.id = shapes.annotations[k][0]; NewShape.id = shapes.annotations[k][0];
@@ -608,14 +579,12 @@ Ext.onReady ( function() {
break; break;
case 'subprocess': case 'subprocess':
for(var k=0;k<shapes.subprocess.length;k++){ for(var k=0;k<shapes.subprocess.length;k++){
var srctaskxpos = shapes.subprocess[k][2];
var srctaskypos = shapes.subprocess[k][3];
//_4562.workflow.taskNo++;
_4562.workflow.subProcessName = shapes.subprocess[k][1]; _4562.workflow.subProcessName = shapes.subprocess[k][1];
NewShape = eval("new bpmnSubProcess(_4562.workflow)"); NewShape = eval("new bpmnSubProcess(_4562.workflow)");
NewShape.x = shapes.subprocess[k][2];
NewShape.y = shapes.subprocess[k][3];
workflow.setBoundary(NewShape);
_4562.workflow.addFigure(NewShape, srctaskxpos, srctaskypos); _4562.workflow.addFigure(NewShape, srctaskxpos, srctaskypos);
//workflow.setBoundary(NewShape);
//Setting newshape id to the old shape id //Setting newshape id to the old shape id
NewShape.html.id = shapes.subprocess[k][0]; NewShape.html.id = shapes.subprocess[k][0];
NewShape.id = shapes.subprocess[k][0]; NewShape.id = shapes.subprocess[k][0];