modified zoom
This commit is contained in:
@@ -66,8 +66,8 @@ bpmnAnnotation.prototype.paint = function () {
|
|||||||
this.graphics.drawLine(this.getWidth()/4,0,0,0);
|
this.graphics.drawLine(this.getWidth()/4,0,0,0);
|
||||||
this.graphics.drawLine(0,0,0,this.getHeight());
|
this.graphics.drawLine(0,0,0,this.getHeight());
|
||||||
this.graphics.drawLine(0,this.getHeight(),this.getWidth()/4,this.getHeight());
|
this.graphics.drawLine(0,this.getHeight(),this.getWidth()/4,this.getHeight());
|
||||||
this.graphics.setStroke(Stroke.DOTTED);
|
//this.graphics.setStroke(Stroke.DOTTED);
|
||||||
this.graphics.drawLine(0,this.getHeight()/2,-this.getWidth()/2,-this.getHeight()/4);
|
//this.graphics.drawLine(0,this.getHeight()/2,-this.getWidth()/2,-this.getHeight()/4);
|
||||||
this.graphics.paint();
|
this.graphics.paint();
|
||||||
|
|
||||||
/* New object is created to implement changing of Text functionality
|
/* New object is created to implement changing of Text functionality
|
||||||
|
|||||||
@@ -374,8 +374,7 @@ MyWorkflow.prototype.toggleShapes=function(item)
|
|||||||
{
|
{
|
||||||
for(var j = 0; j < conn[i].data.length ; j++)
|
for(var j = 0; j < conn[i].data.length ; j++)
|
||||||
{
|
{
|
||||||
if(typeof conn[i].data[j] != 'undefined')
|
if(typeof conn[i].data[j] != 'undefined') {
|
||||||
{
|
|
||||||
sourceNode[countConn] = conn[i].data[j].sourcePort.parentNode;
|
sourceNode[countConn] = conn[i].data[j].sourcePort.parentNode;
|
||||||
targetNode[countConn] = conn[i].data[j].targetPort.parentNode;
|
targetNode[countConn] = conn[i].data[j].targetPort.parentNode;
|
||||||
sourcePortName[countConn] = conn[i].data[j].sourcePort.properties.name;
|
sourcePortName[countConn] = conn[i].data[j].sourcePort.properties.name;
|
||||||
@@ -477,15 +476,13 @@ MyWorkflow.prototype.swapTaskSubprocess=function(itemObj)
|
|||||||
newShape = eval("new "+itemObj.type+"(this.workflow)");
|
newShape = eval("new "+itemObj.type+"(this.workflow)");
|
||||||
|
|
||||||
//Swapping from Task to subprocess and vice -versa
|
//Swapping from Task to subprocess and vice -versa
|
||||||
if((newShape.type == 'bpmnSubProcess' || newShape.type == 'bpmnTask') && !itemObj.type.match(/Boundary/))
|
if((newShape.type == 'bpmnSubProcess' || newShape.type == 'bpmnTask') && !itemObj.type.match(/Boundary/)) {
|
||||||
{
|
|
||||||
newShape.actiontype = 'addSubProcess';
|
newShape.actiontype = 'addSubProcess';
|
||||||
if(newShape.type == 'bpmnTask')
|
if(newShape.type == 'bpmnTask')
|
||||||
newShape.actiontype = 'addTask';
|
newShape.actiontype = 'addTask';
|
||||||
newShape.workflow.saveShape(newShape);
|
newShape.workflow.saveShape(newShape);
|
||||||
}
|
}
|
||||||
if((this.type == 'bpmnTask' || this.type == 'bpmnSubProcess') && !itemObj.type.match(/Boundary/) )
|
if((this.type == 'bpmnTask' || this.type == 'bpmnSubProcess') && !itemObj.type.match(/Boundary/)) {
|
||||||
{
|
|
||||||
this.actiontype = 'deleteTask';
|
this.actiontype = 'deleteTask';
|
||||||
this.noAlert = true;
|
this.noAlert = true;
|
||||||
if(this.type == 'bpmnSubProcess')
|
if(this.type == 'bpmnSubProcess')
|
||||||
@@ -525,8 +522,7 @@ MyWorkflow.prototype.checkConnectionsExist=function(port,portType,portTypeName)
|
|||||||
if(typeof conn[i] != 'undefined')
|
if(typeof conn[i] != 'undefined')
|
||||||
for(var j = 0; j < conn[i].data.length ; j++)
|
for(var j = 0; j < conn[i].data.length ; j++)
|
||||||
{
|
{
|
||||||
if(typeof conn[i].data[j] != 'undefined')
|
if(typeof conn[i].data[j] != 'undefined') {
|
||||||
{
|
|
||||||
portParentId[countConn] = eval('conn[i].data[j].'+portType+'.parentNode.id');
|
portParentId[countConn] = eval('conn[i].data[j].'+portType+'.parentNode.id');
|
||||||
portName[countConn] = eval('conn[i].data[j].'+portType+'.properties.name');
|
portName[countConn] = eval('conn[i].data[j].'+portType+'.properties.name');
|
||||||
countConn++;
|
countConn++;
|
||||||
@@ -800,7 +796,8 @@ MyWorkflow.prototype.enablePorts=function(oShape,aPort)
|
|||||||
/*Setting Background ,border and Z-order of the flow menu back to original when clicked
|
/*Setting Background ,border and Z-order of the flow menu back to original when clicked
|
||||||
*on the shape
|
*on the shape
|
||||||
**/
|
**/
|
||||||
for(var i=0; i< aPort.length ; i++){
|
for(var i=0; i< aPort.length ; i++)
|
||||||
|
{
|
||||||
if(aPort[i].match(/input/))
|
if(aPort[i].match(/input/))
|
||||||
eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(245, 115, 115))');
|
eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(245, 115, 115))');
|
||||||
else
|
else
|
||||||
@@ -822,7 +819,8 @@ MyWorkflow.prototype.disableFlowMenu =function(oShape,aPort)
|
|||||||
/*Setting Background ,border and Z-order of the flow menu back to original when clicked
|
/*Setting Background ,border and Z-order of the flow menu back to original when clicked
|
||||||
*on the shape
|
*on the shape
|
||||||
*/
|
*/
|
||||||
for(var i=0; i< aPort.length ; i++){
|
for(var i=0; i< aPort.length ; i++)
|
||||||
|
{
|
||||||
if(aPort[i].match(/input/))
|
if(aPort[i].match(/input/))
|
||||||
eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(245, 115, 115))');
|
eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(245, 115, 115))');
|
||||||
else
|
else
|
||||||
@@ -921,10 +919,8 @@ MyWorkflow.prototype.getCommonConnections = function(oShape)
|
|||||||
var tester = oShape.workflow.commonPorts.data;
|
var tester = oShape.workflow.commonPorts.data;
|
||||||
var temp1 = eval("oShape.workflow.commonPorts.data["+j+"].getConnections()");
|
var temp1 = eval("oShape.workflow.commonPorts.data["+j+"].getConnections()");
|
||||||
if(temp1.data[0]) {
|
if(temp1.data[0]) {
|
||||||
if(routes[j])
|
if(routes[j]) {
|
||||||
{
|
if(routes[j][1] != temp1.data[0].sourcePort.parentNode.id) {
|
||||||
if(routes[j][1] != temp1.data[0].sourcePort.parentNode.id)
|
|
||||||
{
|
|
||||||
routes[j] = new Array(3);
|
routes[j] = new Array(3);
|
||||||
routes[j][0] = temp1.data[0].id;
|
routes[j][0] = temp1.data[0].id;
|
||||||
routes[j][1] = temp1.data[0].sourcePort.parentNode.id;
|
routes[j][1] = temp1.data[0].sourcePort.parentNode.id;
|
||||||
@@ -933,8 +929,7 @@ MyWorkflow.prototype.getCommonConnections = function(oShape)
|
|||||||
routes[j][4] = temp1.data[0].sourcePort.properties.name;
|
routes[j][4] = temp1.data[0].sourcePort.properties.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
routes[j] = new Array(3);
|
routes[j] = new Array(3);
|
||||||
routes[j][0] = temp1.data[0].id;
|
routes[j][0] = temp1.data[0].id;
|
||||||
routes[j][1] = temp1.data[0].sourcePort.parentNode.id;
|
routes[j][1] = temp1.data[0].sourcePort.parentNode.id;
|
||||||
@@ -943,12 +938,6 @@ MyWorkflow.prototype.getCommonConnections = function(oShape)
|
|||||||
routes[j][4] = temp1.data[0].sourcePort.properties.name;
|
routes[j][4] = temp1.data[0].sourcePort.properties.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//j++;
|
|
||||||
// while(routes[j])
|
|
||||||
// {
|
|
||||||
// j++
|
|
||||||
// };
|
|
||||||
// j--;
|
|
||||||
}
|
}
|
||||||
var j = 0;
|
var j = 0;
|
||||||
var serial = new Array();
|
var serial = new Array();
|
||||||
@@ -1171,24 +1160,20 @@ MyWorkflow.prototype.saveShape= function(oNewShape)
|
|||||||
|
|
||||||
MyWorkflow.prototype.saveTask= function(actiontype,xpos,ypos)
|
MyWorkflow.prototype.saveTask= function(actiontype,xpos,ypos)
|
||||||
{
|
{
|
||||||
if(actiontype != '')
|
if(actiontype != '') {
|
||||||
{
|
|
||||||
var pro_uid = this.getUrlVars();
|
var pro_uid = this.getUrlVars();
|
||||||
var actiontype = actiontype;
|
var actiontype = actiontype;
|
||||||
var pos = '{"x":'+xpos+',"y":'+ypos+'}';
|
var pos = '{"x":'+xpos+',"y":'+ypos+'}';
|
||||||
switch(actiontype)
|
switch(actiontype) {
|
||||||
{
|
|
||||||
case 'addTask':
|
case 'addTask':
|
||||||
urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}';
|
urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: "processes_Ajax.php"+ urlparams,
|
url: "processes_Ajax.php"+ urlparams,
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
//Ext.Msg.alert (response.responseText);
|
//Ext.Msg.alert (response.responseText);
|
||||||
if(response.responseText != 1 && response.responseText != "")
|
if(response.responseText != 1 && response.responseText != "") {
|
||||||
{
|
|
||||||
workflow.newTaskInfo = Ext.util.JSON.decode(response.responseText);
|
workflow.newTaskInfo = Ext.util.JSON.decode(response.responseText);
|
||||||
workflow.taskName = this.workflow.newTaskInfo.label;
|
workflow.taskName = this.workflow.newTaskInfo.label;
|
||||||
workflow.task = eval("new bpmnTask(workflow) ");
|
workflow.task = eval("new bpmnTask(workflow) ");
|
||||||
@@ -1868,6 +1853,12 @@ MyWorkflow.prototype.zoom = function(sType)
|
|||||||
var xPos = fig.orgXPos * sType;
|
var xPos = fig.orgXPos * sType;
|
||||||
var yPos = fig.orgYPos * sType;
|
var yPos = fig.orgYPos * sType;
|
||||||
if(fig.type == 'bpmnTask'){
|
if(fig.type == 'bpmnTask'){
|
||||||
|
if (fig.getWidth() > 200 || this.getHeight() > 100) {
|
||||||
|
fig.limitFlag = false;
|
||||||
|
}
|
||||||
|
if (this.getWidth() < 165 || this.getHeight() < 40) {
|
||||||
|
fig.limitFlag = false;
|
||||||
|
}
|
||||||
fig.fontSize = parseInt(fig.orgFontSize) * sType;
|
fig.fontSize = parseInt(fig.orgFontSize) * sType;
|
||||||
//fig.bpmnText.drawStringRect(fig.taskName, fig.padleft, fig.padtop, fig.rectWidth, fig.rectheight, 'center');
|
//fig.bpmnText.drawStringRect(fig.taskName, fig.padleft, fig.padtop, fig.rectWidth, fig.rectheight, 'center');
|
||||||
fig.bpmnText.paint();
|
fig.bpmnText.paint();
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ bpmnTask = function (oWorkflow) {
|
|||||||
}
|
}
|
||||||
//Getting width and height from DB
|
//Getting width and height from DB
|
||||||
if(typeof oWorkflow.task_width != 'undefined' && typeof oWorkflow.task_height != 'undefined' && oWorkflow.task_width != ''){
|
if(typeof oWorkflow.task_width != 'undefined' && typeof oWorkflow.task_height != 'undefined' && oWorkflow.task_width != ''){
|
||||||
this.width = oWorkflow.task_width;
|
this.originalWidth = oWorkflow.task_width;
|
||||||
this.height = oWorkflow.task_height
|
this.originalHeight = oWorkflow.task_height
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.width = 165;
|
this.originalWidth = 165;
|
||||||
this.height = 40;
|
this.originalHeight = 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.taskName = ''; //It will set the Default Task Name with appropriate count While dragging a task on the canvas
|
this.taskName = ''; //It will set the Default Task Name with appropriate count While dragging a task on the canvas
|
||||||
@@ -44,22 +44,39 @@ bpmnTask.prototype.coord_converter = function (bound_width, bound_height, text_l
|
|||||||
bpmnTask.prototype.paint = function () {
|
bpmnTask.prototype.paint = function () {
|
||||||
VectorFigure.prototype.paint.call(this);
|
VectorFigure.prototype.paint.call(this);
|
||||||
|
|
||||||
if(typeof workflow.zoomfactor == 'undefined')
|
if(typeof workflow.zoomfactor == 'undefined') {
|
||||||
|
this.originalWidth = 165;
|
||||||
|
this.originalHeight = 40;
|
||||||
workflow.zoomfactor = 1;
|
workflow.zoomfactor = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(workflow.zoomfactor == 1) {
|
||||||
|
if ((this.getWidth() > 200 || this.getHeight() > 100) && this.limitFlag != true) {
|
||||||
|
this.width = this.originalWidth = 200;
|
||||||
|
this.height = this.originalHeight = 100;
|
||||||
|
}
|
||||||
|
if ((this.getWidth() < 165 || this.getHeight() < 40) && this.limitFlag != true) {
|
||||||
|
this.width = this.originalWidth = 165;
|
||||||
|
this.height = this.originalHeight = 40;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.width = this.originalWidth * workflow.zoomfactor;
|
||||||
|
this.height = this.originalHeight * workflow.zoomfactor;
|
||||||
|
}
|
||||||
//For Zooming
|
//For Zooming
|
||||||
|
|
||||||
//Set the Task Limitation
|
//Set the Task Limitation
|
||||||
if ((this.getWidth() >= 200 || this.getHeight() >= 100 ) && this.limitFlag != true) {
|
/*if ((this.getWidth() >= 200 || this.getHeight() >= 100 ) && this.limitFlag != true) {
|
||||||
this.originalWidth = 200;
|
this.originalWidth = 200;
|
||||||
this.originalHeight = 100;
|
this.originalHeight = 100;
|
||||||
}
|
}
|
||||||
else if ((this.getWidth() <= 165 || this.getHeight() <= 40) && this.limitFlag != true) {
|
else if ((this.getWidth() <= 165 || this.getHeight() <= 40) && this.limitFlag != true) {
|
||||||
this.originalWidth = 165;
|
this.originalWidth = 165;
|
||||||
this.originalHeight = 40;
|
this.originalHeight = 40;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
this.width = this.originalWidth * workflow.zoomfactor;
|
|
||||||
this.height = this.originalHeight * workflow.zoomfactor;
|
|
||||||
|
|
||||||
var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6);
|
var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6);
|
||||||
var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3);
|
var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3);
|
||||||
@@ -682,6 +699,7 @@ FlowMenu.prototype.onOtherFigureMoved = function (_39fd) {
|
|||||||
else if (bpmnShape.match(/End/)) {
|
else if (bpmnShape.match(/End/)) {
|
||||||
this.removechild(this.actionInterEvent);
|
this.removechild(this.actionInterEvent);
|
||||||
this.removechild(this.actionEndEvent);
|
this.removechild(this.actionEndEvent);
|
||||||
|
this.removechild(this.actionAnnotation);
|
||||||
this.removechild(this.actionTask);
|
this.removechild(this.actionTask);
|
||||||
this.removechild(this.actionGateway);
|
this.removechild(this.actionGateway);
|
||||||
this.removechild(this.actionAdd);
|
this.removechild(this.actionAdd);
|
||||||
@@ -703,6 +721,7 @@ FlowMenu.prototype.onOtherFigureMoved = function (_39fd) {
|
|||||||
}
|
}
|
||||||
else if (bpmnShape.match(/Annotation/) || bpmnShape.match(/Dataobject/)) {
|
else if (bpmnShape.match(/Annotation/) || bpmnShape.match(/Dataobject/)) {
|
||||||
this.removechild(this.actionAdd);
|
this.removechild(this.actionAdd);
|
||||||
|
this.removechild(this.actionAnnotation);
|
||||||
this.removechild(this.actionInterEvent);
|
this.removechild(this.actionInterEvent);
|
||||||
this.removechild(this.actionGateway);
|
this.removechild(this.actionGateway);
|
||||||
this.removechild(this.actionEndEvent);
|
this.removechild(this.actionEndEvent);
|
||||||
@@ -792,6 +811,7 @@ bpmnTask.prototype.addShapes = function (oStore) {
|
|||||||
else if (newShape.type.match(/Annotation/)) {
|
else if (newShape.type.match(/Annotation/)) {
|
||||||
conn.setTarget(newShape.getPort("input1"));
|
conn.setTarget(newShape.getPort("input1"));
|
||||||
conn.setSource(workflow.currentSelection.getPort("output2"));
|
conn.setSource(workflow.currentSelection.getPort("output2"));
|
||||||
|
//conn.targetDecorator.setStroke(Stroke.DOTTED);
|
||||||
workflow.addFigure(conn);
|
workflow.addFigure(conn);
|
||||||
newShape.actiontype = 'addText';
|
newShape.actiontype = 'addText';
|
||||||
newShape.conn = conn;
|
newShape.conn = conn;
|
||||||
|
|||||||
@@ -859,6 +859,7 @@ Ext.onReady ( function() {
|
|||||||
NewShape = eval("new "+data.name+"(workflow)");
|
NewShape = eval("new "+data.name+"(workflow)");
|
||||||
NewShape.x = e.xy[0];
|
NewShape.x = e.xy[0];
|
||||||
NewShape.y = e.xy[1];
|
NewShape.y = e.xy[1];
|
||||||
|
NewShape.limitFlag == false;
|
||||||
NewShape.actiontype = 'addTask';
|
NewShape.actiontype = 'addTask';
|
||||||
if(data.name == 'bpmnAnnotation'){
|
if(data.name == 'bpmnAnnotation'){
|
||||||
NewShape.actiontype = 'addText';
|
NewShape.actiontype = 'addText';
|
||||||
|
|||||||
Reference in New Issue
Block a user