Skip to content

Commit

Permalink
abstract classes visual differences
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Apr 28, 2015
1 parent 37f7521 commit 8406965
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/js/ClassView.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ ClassView.prototype.openClassDoc = function (className, nameSpace) {
*/
ClassView.prototype.createClassInstance = function (name, classMetaData) {

var attrArr, methArr,
var attrArr, methArr, nameArr,
classParams = classMetaData["parameters"],
classProps = classMetaData["properties"],
classMethods = classMetaData["methods"],
Expand All @@ -92,7 +92,7 @@ ClassView.prototype.createClassInstance = function (name, classMetaData) {
};

return new joint.shapes.uml.Class({
name: name + "\x1b" + JSON.stringify({ url: function () {alert(name)} }),
name: nameArr = (classMetaData["ABSTRACT"] ? ["<<Abstract>>", name] : [name]),
attributes: attrArr = (function (params, ps) {
var arr = [], n;
for (n in params) {
Expand Down Expand Up @@ -129,7 +129,8 @@ ClassView.prototype.createClassInstance = function (name, classMetaData) {
},
size: {
width: 300,
height: Math.max(attrArr.length*12.1, 15) + Math.max(methArr.length*12.1, 15) + 40
height: Math.max(nameArr.length*12.1, 0) + Math.max(attrArr.length*12.1, 0)
+ Math.max(methArr.length*12.1, 0) + 30
}
});

Expand Down

0 comments on commit 8406965

Please sign in to comment.