bpmnAnnotation = function (_30ab) { VectorFigure.call(this); if(typeof _30ab.anno_width != 'undefined' && typeof _30ab.anno_height != 'undefined') this.setDimension(_30ab.anno_width, _30ab.anno_height); else this.setDimension(110, 60); this.setAnnotationName(_30ab.annotationName); //It will set the Default Task Name with appropriate count While dragging a task on the canvas }; bpmnAnnotation.prototype = new VectorFigure; bpmnAnnotation.prototype.type = "bpmnAnnotation"; bpmnAnnotation.prototype.setAnnotationName = function (name) { if(typeof name != 'undefined') this.annotationName = name; else this.annotationName = 'Annotation'; }; bpmnAnnotation.prototype.coord_converter = function (bound_width, bound_height, text_length) { //bound_width = this.workflow.currentSelection.width; //bound_height = this.workflow.currentSelection.height; input_width = text_length * 6 input_height = 10 temp_width = bound_width - input_width; temp_width /= 2; temp_x = temp_width; temp_height = bound_height - 10; temp_height /= 2; temp_y = temp_height; var temp_coord = new Object(); temp_coord.temp_x = temp_x; temp_coord.temp_y = temp_y; return temp_coord; }; bpmnAnnotation.prototype.paint = function () { VectorFigure.prototype.paint.call(this); //Set the Task Limitation if(this.getWidth() > 200 || this.getHeight() > 100) { this.setDimension(200, 100); } if(this.getWidth() < 110 || this.getHeight() < 60) { this.setDimension(110, 60); } this.graphics.setColor("#ffffff"); this.graphics.fillRect(0,0, this.getWidth(), this.getHeight()); this.graphics.setColor("#000000"); this.graphics.drawLine(this.getWidth()/4,0,0,0); this.graphics.drawLine(0,0,0,this.getHeight()); this.graphics.drawLine(0,this.getHeight(),this.getWidth()/4,this.getHeight()); this.graphics.paint(); /*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); this.graphics.setStroke(this.stroke); this.graphics.setColor("#c0c0c0"); this.graphics.fillPolygon(x, y); for (var i = 0; i < x.length; i++) { x[i] = x[i] - 3; y[i] = y[i] - 3; } this.graphics.setColor("#ffffff"); this.graphics.fillPolygon(x, y); this.graphics.setColor("#ff0f0f"); this.graphics.drawPolygon(x, y); this.graphics.paint(); this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure */ /* New object is created to implement changing of Text functionality */ var bpmnText = new jsGraphics(this.id); var padleft = 0.10*this.getWidth(); var padtop = 0.18*this.getHeight(); var rectwidth = this.getWidth() - padleft; var rectheight = this.getHeight() - 2*padtop; bpmnText.drawStringRect(this.annotationName,0,padtop,rectwidth,rectheight,'center'); //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); //bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y); bpmnText.paint(); this.bpmnNewText = bpmnText; if(this.input1!=null){ this.input1.setPosition(0,this.height/2); } }; jsGraphics.prototype.drawTextString = function (txt, x, y, dx, dy) { this.htm += '