draft of activation boxes handling

This commit is contained in:
Szymon Stasik
2016-03-08 10:40:52 +01:00
parent 6c621f243d
commit 2452532557
6 changed files with 185 additions and 62 deletions

View File

@@ -43,8 +43,10 @@ exports.bounds = {
verticalPos:0,
list: [],
activations: [],
init : function(){
this.list = [];
this.activations = [],
this.data = {
startx:undefined,
stopx :undefined,
@@ -96,6 +98,16 @@ exports.bounds = {
this.updateLoops(_startx,_starty,_stopx,_stopy);
},
newActivation:function(message){
console.debug("new activation", message);
this.activations.push({startx:undefined,starty:this.verticalPos,stopx:undefined,stopy:undefined, actor: message.from.actor});
},
endActivation:function(){
var activation = this.activations.pop();
console.debug("render end activation", activation);
//loop.stopy = exports.bounds.getVerticalPos();
return activation;
},
newLoop:function(title){
this.list.push({startx:undefined,starty:this.verticalPos,stopx:undefined,stopy:undefined, title:title});
},
@@ -328,6 +340,19 @@ module.exports.draw = function (text, id) {
forceWidth);
}
break;
case sq.yy.LINETYPE.ACTIVE_START:
console.info('ACTIVE_START', msg);
// exports.bounds.bumpVerticalPos(conf.boxMargin);
exports.bounds.newActivation(msg);
// exports.bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
break;
case sq.yy.LINETYPE.ACTIVE_END:
console.info('ACTIVE_END', msg);
var activationData = exports.bounds.endActivation();
// svgDraw.drawActivation(diagram, activationData, conf);
// exports.bounds.bumpVerticalPos(conf.boxMargin);
break;
case sq.yy.LINETYPE.LOOP_START:
exports.bounds.bumpVerticalPos(conf.boxMargin);
exports.bounds.newLoop(msg.message);