- Refactor node properties to topics.

This commit is contained in:
Paulo Gustavo Veiga
2012-09-21 09:22:41 -03:00
parent 7bbcd82488
commit d2f9749d61
5 changed files with 145 additions and 120 deletions

View File

@@ -55,11 +55,6 @@ mindplot.MainTopic = new Class({
return group;
},
_defaultShapeType:function () {
return mindplot.model.TopicShape.LINE;
},
updateTopicShape:function (targetTopic, workspace) {
// Change figure based on the connected topic ...
var model = this.getModel();
@@ -163,74 +158,6 @@ mindplot.MainTopic = new Class({
result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight, true);
}
return result;
},
_getInnerPadding:function () {
var result;
var parent = this.getModel().getParent();
if (parent && !parent.isCentralTopic()) {
result = 3;
}
else {
result = 4;
}
return result;
},
_defaultText:function () {
var targetTopic = this.getOutgoingConnectedTopic();
var result = "";
if ($defined(targetTopic)) {
if (targetTopic.isCentralTopic()) {
result = $msg('MAIN_TOPIC');
} else {
result = $msg('SUB_TOPIC');
}
} else {
result = $msg('ISOLATED_TOPIC');
}
return result;
},
_defaultFontStyle:function () {
var targetTopic = this.getOutgoingConnectedTopic();
var result;
if ($defined(targetTopic)) {
if (targetTopic.isCentralTopic()) {
result = {
font:"Arial",
size:8,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
};
} else {
result = {
font:"Arial",
size:6,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
};
}
} else {
result = {
font:"Verdana",
size:8,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
};
}
return result;
},
_defaultBackgroundColor:function () {
return "rgb(224,229,239)";
},
_defaultBorderColor:function () {
return 'rgb(2,59,185)';
}
});