Updated Zooming Feature and Included class.xpdl.php

This commit is contained in:
girish
2010-12-06 14:58:25 +00:00
parent 4d007e7a85
commit 5676ba0361
6 changed files with 3969 additions and 52 deletions

View File

@@ -866,7 +866,6 @@ Allows to specify the size of the text rectangle and to align the
text both horizontally (e.g. right) and vertically within that rectangle */ text both horizontally (e.g. right) and vertically within that rectangle */
this.drawStringRect = function(txt, x, y, width,height, halign) this.drawStringRect = function(txt, x, y, width,height, halign)
{ {
this.ftSz = '11px';
this.htm += '<div style="position:absolute;overflow:hidden;'+ this.htm += '<div style="position:absolute;overflow:hidden;'+
'left:' + x + 'px;'+ 'left:' + x + 'px;'+
'top:' + y + 'px;'+ 'top:' + y + 'px;'+

File diff suppressed because it is too large Load Diff

View File

@@ -2,8 +2,6 @@
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher =& headPublisher::getSingleton();
//$oHeadPublisher->setExtSkin( 'xtheme-gray'); //$oHeadPublisher->setExtSkin( 'xtheme-gray');
$oHeadPublisher->usingExtJs('ux/RowEditor');
$oHeadPublisher->addExtJsScript('bpmn/bpmnZoom',true);
$oHeadPublisher->addExtJsScript('bpmn/MyWorkflow',true ); //adding a javascript file .js $oHeadPublisher->addExtJsScript('bpmn/MyWorkflow',true ); //adding a javascript file .js
$oHeadPublisher->addExtJsScript('bpmn/pmosExt', true ); //adding a javascript file .js $oHeadPublisher->addExtJsScript('bpmn/pmosExt', true ); //adding a javascript file .js
$oHeadPublisher->addExtJsScript('bpmn/TaskContext', true ); //adding a javascript file .js $oHeadPublisher->addExtJsScript('bpmn/TaskContext', true ); //adding a javascript file .js

View File

@@ -77,17 +77,17 @@ bpmnAnnotation.prototype.paint = function () {
*/ */
/* New object is created to implement changing of Text functionality /* New object is created to implement changing of Text functionality
*/ */
var bpmnText = new jsGraphics(this.id); this.bpmnText = new jsGraphics(this.id);
var padleft = 0.10*this.getWidth(); var padleft = 0.10*this.getWidth();
var padtop = 0.18*this.getHeight(); var padtop = 0.18*this.getHeight();
var rectwidth = this.getWidth() - padleft; var rectwidth = this.getWidth() - padleft;
var rectheight = this.getHeight() - 2*padtop; var rectheight = this.getHeight() - 2*padtop;
bpmnText.drawStringRect(this.annotationName,0,padtop,rectwidth,rectheight,'center'); this.bpmnText.setFont('verdana', '11px', Font.PLAIN);
this.bpmnText.drawStringRect(this.annotationName,0,padtop,rectwidth,rectheight,'center');
//bpmnText.drawStringRect(this.taskName,this.getWidth()/2-20,this.getHeight()/2-11,200,'left'); //bpmnText.drawStringRect(this.taskName,this.getWidth()/2-20,this.getHeight()/2-11,200,'left');
//tempcoord = this.coord_converter(this.getWidth(), this.getHeight(), this.taskName.length); //tempcoord = this.coord_converter(this.getWidth(), this.getHeight(), this.taskName.length);
//bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y); //bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y);
bpmnText.paint(); this.bpmnText.paint();
this.bpmnNewText = bpmnText;
if(this.input1!=null){ if(this.input1!=null){
this.input1.setPosition(0,this.height/2); this.input1.setPosition(0,this.height/2);
@@ -161,7 +161,7 @@ bpmnAnnotation.prototype.onDoubleClick = function () {
* The string is first cleared and new string is painted.<br><br> * The string is first cleared and new string is painted.<br><br>
**/ **/
bpmnAnnotationDialog.prototype.onOk = function () { bpmnAnnotationDialog.prototype.onOk = function () {
this.figure.bpmnNewText.clear(); this.figure.bpmnText.clear();
len = Math.ceil(this.input.value.length/16); len = Math.ceil(this.input.value.length/16);
if(this.input.value.length < 19) if(this.input.value.length < 19)
@@ -175,9 +175,9 @@ bpmnAnnotation.prototype.onDoubleClick = function () {
else else
this.figure.rectWidth = 150; this.figure.rectWidth = 150;
//tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length) //tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length)
this.figure.bpmnNewText.drawStringRect(this.input.value,20,20,this.figure.rectWidth,'left'); this.figure.bpmnText.drawStringRect(this.input.value,20,20,this.figure.rectWidth,'left');
// this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y); // this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y);
this.figure.bpmnNewText.paint(); this.figure.bpmnText.paint();
this.figure.annotationName = this.input.value; //Set Updated Text value this.figure.annotationName = this.input.value; //Set Updated Text value
//Updating Annotation Text Async into the DB //Updating Annotation Text Async into the DB

View File

@@ -70,7 +70,7 @@ bpmnTask.prototype.paint = function () {
/* Created New Object of jsGraphics to draw String. /* Created New Object of jsGraphics to draw String.
* New object is created to implement changing of Text functionality * New object is created to implement changing of Text functionality
*/ */
bpmnText = new jsGraphics(this.id); this.bpmnText = new jsGraphics(this.id);
/*if(this.taskName.length <= 17) /*if(this.taskName.length <= 17)
{ {
@@ -101,8 +101,8 @@ bpmnTask.prototype.paint = function () {
} }
var rectheight = this.getHeight() - padtop -7; var rectheight = this.getHeight() - padtop -7;
this.bpmnText.setFont('verdana', '11px', Font.PLAIN);
bpmnText.drawStringRect(this.taskName, padleft, padtop, this.rectWidth, rectheight, 'center'); this.bpmnText.drawStringRect(this.taskName, padleft, padtop, this.rectWidth, rectheight, 'center');
// tempcoord = this.coord_converter(this.getWidth(), this.getHeight(), this.taskName.length); // tempcoord = this.coord_converter(this.getWidth(), this.getHeight(), this.taskName.length);
// bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y); // bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y);
@@ -153,13 +153,13 @@ bpmnTask.prototype.paint = function () {
boundaryTimer.drawLine(x[3]-x[3]/1.08+5,y[5]+4,x[3]-x[3]/1.08+8,y[5]+4); //45th min line boundaryTimer.drawLine(x[3]-x[3]/1.08+5,y[5]+4,x[3]-x[3]/1.08+8,y[5]+4); //45th min line
boundaryTimer.drawLine(x[3]-x[3]/1.08+8,y[5]-4,x[3]-x[3]/1.08+11,y[5]-1); //50th min line boundaryTimer.drawLine(x[3]-x[3]/1.08+8,y[5]-4,x[3]-x[3]/1.08+11,y[5]-1); //50th min line
boundaryTimer.drawLine(x[3]-x[3]/1.08+15,y[5]-7,x[3]-x[3]/1.08+15,y[5]-4); //60th min line boundaryTimer.drawLine(x[3]-x[3]/1.08+15,y[5]-7,x[3]-x[3]/1.08+15,y[5]-4); //60th min line
if(this.boundaryEvent == true) if(this.boundaryEvent == true)
boundaryTimer.paint(); boundaryTimer.paint();
/**************************** Drawing Timer Boundary event ends here *******************************/ /**************************** Drawing Timer Boundary event ends here *******************************/
bpmnText.paint(); this.bpmnText.paint();
this.bpmnNewText = bpmnText; //this.bpmnNewText = this.bpmnText;
/*Code Added to Dynamically shift Ports on resizing of shapes /*Code Added to Dynamically shift Ports on resizing of shapes
**/ **/
@@ -185,7 +185,7 @@ jsGraphics.prototype.drawTextString = function (txt, x, y, dx, dy) {
/*Workflow.prototype.onMouseUp=function(x,y){ /*Workflow.prototype.onMouseUp=function(x,y){
//Saving Task/Annotations position on Async Ajax call //Saving Task/Annotations position on Async Ajax call
this.dragging=false; this.dragging=false;
this.draggingLine=null; this.draggingLine=null;
};*/ };*/
@@ -278,7 +278,7 @@ InputPort.prototype.onDrop = function (port) {
newObj.sPortType =port.properties.name; newObj.sPortType =port.properties.name;
preObj.sPortType =this.properties.name; preObj.sPortType =this.properties.name;
this.workflow.saveRoute(preObj,newObj); this.workflow.saveRoute(preObj,newObj);
var _3f02 = new CommandConnect(this.parentNode.workflow, port, this); var _3f02 = new CommandConnect(this.parentNode.workflow, port, this);
if (_3f02.source.type == _3f02.target.type) { if (_3f02.source.type == _3f02.target.type) {
return; return;
@@ -302,7 +302,7 @@ OutputPort.prototype.onDrop = function (port) {
if (this.parentNode.id == port.parentNode.id || connect == false) { if (this.parentNode.id == port.parentNode.id || connect == false) {
} else { } else {
var _4070 = new CommandConnect(this.parentNode.workflow, this, port); var _4070 = new CommandConnect(this.parentNode.workflow, this, port);
if (_4070.source.type == _4070.target.type) { if (_4070.source.type == _4070.target.type) {
@@ -344,7 +344,7 @@ OutputPort.prototype.onDrop = function (port) {
} }
else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/)) else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/))
{ {
var preObj = this.workflow.currentSelection; var preObj = this.workflow.currentSelection;
var newObj = port.parentNode; var newObj = port.parentNode;
newObj.conn = _4070.connection; newObj.conn = _4070.connection;
@@ -572,8 +572,8 @@ FlowMenu.prototype.onOtherFigureMoved = function (_39fd) {
//@params - max X pos(canvas Width) = 918 //@params - max X pos(canvas Width) = 918
//@params - max Y pos(canvas Height) = 837 //@params - max Y pos(canvas Height) = 837
/////////////////////////////////////////// ///////////////////////////////////////////
//Preventing Task from drawing outside canvas Code Ends here //Preventing Task from drawing outside canvas Code Ends here
if (_39fd.type == 'DecoratedConnection' || _39fd.workflow.contextClicked == true) { if (_39fd.type == 'DecoratedConnection' || _39fd.workflow.contextClicked == true) {
this.removechild(this.actionAdd); this.removechild(this.actionAdd);
@@ -732,8 +732,8 @@ bpmnTask.prototype.addShapes = function (_3896) {
//Assigning values to newShape Object for Saving Task automatically (Async Ajax Call) //Assigning values to newShape Object for Saving Task automatically (Async Ajax Call)
newShape.x = xOffset; newShape.x = xOffset;
newShape.y = yOffset; newShape.y = yOffset;
var conn = new DecoratedConnection(); var conn = new DecoratedConnection();
@@ -917,7 +917,7 @@ bpmnTask.prototype.trim = function (str) {
* The string is first cleared and new string is painted.<br><br> * The string is first cleared and new string is painted.<br><br>
**/ **/
bpmnTaskDialog.prototype.onOk = function () { bpmnTaskDialog.prototype.onOk = function () {
this.figure.bpmnNewText.clear(); this.figure.bpmnText.clear();
//len = Math.ceil(this.input.value.length/16); //len = Math.ceil(this.input.value.length/16);
var len = this.workflow.currentSelection.width / 18; var len = this.workflow.currentSelection.width / 18;
if (len >= 6) { if (len >= 6) {
@@ -952,9 +952,10 @@ bpmnTaskDialog.prototype.onOk = function () {
//tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length) //tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length)
this.figure.bpmnNewText.drawStringRect(this.input.value, padleft, padtop, this.figure.rectWidth, rectheight, 'center'); this.figure.bpmnText.setFont('verdana', '11px', Font.PLAIN);
this.figure.bpmnText.drawStringRect(this.input.value, padleft, padtop, this.figure.rectWidth, rectheight, 'center');
// this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y); // this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y);
this.figure.bpmnNewText.paint(); this.figure.bpmnText.paint();
this.workflow.currentSelection.taskName = this.input.value; //Set Updated Text value this.workflow.currentSelection.taskName = this.input.value; //Set Updated Text value
//Saving task name (whenever updated) onAsynch AJAX call //Saving task name (whenever updated) onAsynch AJAX call
this.figure.actiontype = 'updateTaskName'; this.figure.actiontype = 'updateTaskName';

View File

@@ -155,7 +155,7 @@ Ext.onReady ( function() {
workflow.getCommandStack().redo(); workflow.getCommandStack().redo();
} }
}, },
{ {
xtype: 'tbsplit', xtype: 'tbsplit',
text: 'Process', text: 'Process',
@@ -167,8 +167,8 @@ Ext.onReady ( function() {
} }
}, },
{text: 'Input Document'},{text: 'Output Document'},{text: 'Trigger'},{text: 'Report Table'},{text: 'Database Connection'},{text: 'Cases Scheduler'}] {text: 'Input Document'},{text: 'Output Document'},{text: 'Trigger'},{text: 'Report Table'},{text: 'Database Connection'},{text: 'Cases Scheduler'}]
}) })
}, },
{ {
text:'Zoom In', text:'Zoom In',
@@ -178,19 +178,56 @@ Ext.onReady ( function() {
var fig = figures.get(f); var fig = figures.get(f);
var width = fig.getWidth(); var width = fig.getWidth();
var height = fig.getHeight(); var height = fig.getHeight();
fig.setDimension(width+10,height+10); fig.setDimension(width+20,height+20);
if(fig.type == 'bpmnTask')
{
fig.bpmnText.clear();
//len = Math.ceil(this.input.value.length/16);
var len = fig.width / 18;
if (len >= 6) {
// len = 1.5;
var padleft = 0.12 * fig.width;
var padtop = 0.32 * fig.height - 3;
fig.rectWidth = fig.width - 2 * padleft;
}
else {
padleft = 0.1 * fig.width;
padtop = 0.09 * fig.height - 3;
fig.rectWidth = fig.width - 2 * padleft;
}
var rectheight = fig.height - 2*padtop;
if(typeof fig.size == 'undefined')
fig.size = fig.bpmnText.ftSz.substr(0,fig.bpmnText.ftSz.length-2);
else
fig.size = parseInt(fig.size) + 4;
eval("fig.bpmnText.setFont('verdana','"+fig.size+"px', Font.PLAIN)");
fig.bpmnText.drawStringRect(fig.taskName, padleft, padtop, fig.rectWidth, rectheight, 'center');
fig.bpmnText.paint();
}
else if(fig.type == 'bpmnAnnotation')
{
fig.bpmnText.clear();
var text = fig.annotationName;
len = Math.ceil(text.length/16);
if(text.length < 19)
{
len = 1.5;
if(text.length > 9)
fig.rectWidth = text.length*8;
else
fig.rectWidth = 48;
}
else
fig.rectWidth = 150;
if(typeof fig.size == 'undefined')
fig.size = fig.bpmnText.ftSz.substr(0,fig.bpmnText.ftSz.length-2);
else
fig.size = parseInt(fig.size) + 4;
eval("fig.bpmnText.setFont('verdana','"+fig.size+"px', Font.PLAIN)");
fig.bpmnText.drawStringRect(text,20,20,fig.rectWidth,'left');
fig.bpmnText.paint();
}
} }
// var lines = workflow.getDocument().getLines();
// for(l = 0;l<lines.getSize();l++){
// var line = lines.get(l);
// line.startX += 10;
// line.startY += 10;
// line.endX += 10;
// line.endY += 10;
// }
oZoom = new bpmnZoom();
oZoom.increaseFontSize();
} }
}, },
{ {
@@ -203,8 +240,7 @@ Ext.onReady ( function() {
var height = fig.getHeight(); var height = fig.getHeight();
fig.setDimension(width-10,height-10); fig.setDimension(width-10,height-10);
} }
oZoom = new bpmnZoom();
oZoom.decreaseFontSize();
} }
}, },
], ],
@@ -400,7 +436,7 @@ Ext.onReady ( function() {
NewShape.x = e.xy[0]; NewShape.x = e.xy[0];
NewShape.y = e.xy[1]; NewShape.y = e.xy[1];
NewShape.actiontype = 'addTask'; NewShape.actiontype = 'addTask';
if(data.name == 'bpmnAnnotation') if(data.name == 'bpmnAnnotation')
{ {
NewShape.actiontype = 'addText'; NewShape.actiontype = 'addText';
@@ -412,8 +448,8 @@ Ext.onReady ( function() {
workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it
NewShape.taskName = workflow.taskName; NewShape.taskName = workflow.taskName;
} }
var scrollLeft = workflow.getScrollLeft(); var scrollLeft = workflow.getScrollLeft();
@@ -430,7 +466,7 @@ Ext.onReady ( function() {
//var totalgateways = shapes[1].length; //shapes[1] is an array for all the gateways //var totalgateways = shapes[1].length; //shapes[1] is an array for all the gateways
//var totalevents = shapes[2].length; //shapes[2] is an array for all the events //var totalevents = shapes[2].length; //shapes[2] is an array for all the events
var totalroutes = shapes.routes.length; //shapes[3] is an array for all the routes var totalroutes = shapes.routes.length; //shapes[3] is an array for all the routes
for(var i=0;i<=totalroutes-1;i++) for(var i=0;i<=totalroutes-1;i++)
{ {
var sourceid = shapes.routes[i][1]; //getting source id for connection from Routes array var sourceid = shapes.routes[i][1]; //getting source id for connection from Routes array
@@ -501,7 +537,7 @@ Ext.onReady ( function() {
var shapes = new Array(); var shapes = new Array();
//var param = new Array(); //var param = new Array();
var shapeType = new Array(); var shapeType = new Array();
for(var i=0; i<=responsearray.length-1;i++) for(var i=0; i<=responsearray.length-1;i++)
{ {
jsonstring[i] = responsearray[i].split(":"); jsonstring[i] = responsearray[i].split(":");
@@ -558,10 +594,10 @@ Ext.onReady ( function() {
_4562.workflow.boundaryEvent = true; _4562.workflow.boundaryEvent = true;
else else
_4562.workflow.boundaryEvent = false; _4562.workflow.boundaryEvent = false;
if(k != 0) if(k != 0)
_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 = task_width;
workflow.task_height = task_height; workflow.task_height = task_height;
@@ -736,7 +772,7 @@ Ext.onReady ( function() {
annotations[p][6] = this.workflow.figures.data[c].annotationName; annotations[p][6] = this.workflow.figures.data[c].annotationName;
p++; p++;
} }
if(this.workflow.figures.data[c].type.match(/SubProcess/)) if(this.workflow.figures.data[c].type.match(/SubProcess/))
{ {
subprocess[r] = new Array(); subprocess[r] = new Array();