Permalink
Browse files

Patch to allow modification JoinJs diagram generalization (same as as…

…scociation)
  • Loading branch information...
runqingz committed Nov 10, 2017
1 parent adb4238 commit 27b62a831eb39262ceedb222aad4698673157432
Showing with 19 additions and 2 deletions.
  1. +19 −2 umpleonline/scripts/jjs/jjs_parse.js
@@ -127,6 +127,14 @@ var JJSdiagram = {
JJSdiagram.makeUmpleCodeFromAssociation('removeAssociation',JJSdiagram.paper.model.getCell(linkView.model.toJSON().source.id).toJSON(), JJSdiagram.paper.model.getCell(elmentViewDisconnected.model.toJSON().id).toJSON(), '');
}
}
else if (linkView.model.get('type') === 'uml.Generalization') {
if (arrowhead === 'source') {
JJSdiagram.makeUmpleCodeFromGeneralization('removeGeneralization',JJSdiagram.paper.model.getCell(linkView.model.toJSON().target.id).toJSON(), JJSdiagram.paper.model.getCell(elmentViewDisconnected.model.toJSON().id).toJSON());
}
else if (arrowhead === 'target'){
JJSdiagram.makeUmpleCodeFromGeneralization('removeGeneralization',JJSdiagram.paper.model.getCell(elmentViewDisconnected.model.toJSON().id).toJSON(), JJSdiagram.paper.model.getCell(linkView.model.toJSON().source.id).toJSON());
}
}
}
}
);
@@ -141,6 +149,14 @@ var JJSdiagram = {
JJSdiagram.makeUmpleCodeFromAssociation('addJjsAssociation', JJSdiagram.paper.model.getCell(linkView.model.toJSON().source.id).toJSON(), JJSdiagram.paper.model.getCell(elementViewConnected.model.toJSON().id).toJSON());
}
}
else if (linkView.model.get('type') === 'uml.Generalization') {
if (arrowhead === 'source') {
JJSdiagram.makeUmpleCodeFromGeneralization('addJjsGeneralization',JJSdiagram.paper.model.getCell(linkView.model.toJSON().target.id).toJSON(), JJSdiagram.paper.model.getCell(elementViewConnected.model.toJSON().id).toJSON());
}
else if (arrowhead === 'target'){
JJSdiagram.makeUmpleCodeFromGeneralization('addJjsGeneralization',JJSdiagram.paper.model.getCell(elementViewConnected.model.toJSON().id).toJSON(), JJSdiagram.paper.model.getCell(linkView.model.toJSON().source.id).toJSON());
}
}
}
}
);
@@ -156,8 +172,9 @@ var JJSdiagram = {
}
break;
case 'uml.Generalization':
JJSdiagram.makeUmpleCodeFromGeneralization('removeGeneralization', this.paper.model.getCell(cell.toJSON().target.id).toJSON(), this.paper.model.getCell(cell.toJSON().source.id).toJSON());
if (cell.toJSON().source.id !== undefined && cell.toJSON().target.id !== undefined) {
JJSdiagram.makeUmpleCodeFromGeneralization('removeGeneralization', this.paper.model.getCell(cell.toJSON().target.id).toJSON(), this.paper.model.getCell(cell.toJSON().source.id).toJSON());
}
break;
default:
console.log('JJSdiagram -->initJJSDiagram -->graph remove listener--> unknown type');

0 comments on commit 27b62a8

Please sign in to comment.