- Remove CENTRAL_NODE flag.

This commit is contained in:
Paulo Gustavo Veiga 2012-09-20 19:00:31 -03:00
parent a0ee153ca0
commit 7bbcd82488
2 changed files with 9 additions and 9 deletions

View File

@ -64,7 +64,7 @@ mindplot.MainTopic = new Class({
// Change figure based on the connected topic ... // Change figure based on the connected topic ...
var model = this.getModel(); var model = this.getModel();
var shapeType = model.getShapeType(); var shapeType = model.getShapeType();
if (targetTopic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (!targetTopic.isCentralTopic()) {
if (!$defined(shapeType)) { if (!$defined(shapeType)) {
// Get the real shape type ... // Get the real shape type ...
shapeType = this.getShapeType(); shapeType = this.getShapeType();
@ -168,7 +168,7 @@ mindplot.MainTopic = new Class({
_getInnerPadding:function () { _getInnerPadding:function () {
var result; var result;
var parent = this.getModel().getParent(); var parent = this.getModel().getParent();
if (parent && mindplot.model.INodeModel.MAIN_TOPIC_TYPE == parent.getType()) { if (parent && !parent.isCentralTopic()) {
result = 3; result = 3;
} }
else { else {
@ -181,7 +181,7 @@ mindplot.MainTopic = new Class({
var targetTopic = this.getOutgoingConnectedTopic(); var targetTopic = this.getOutgoingConnectedTopic();
var result = ""; var result = "";
if ($defined(targetTopic)) { if ($defined(targetTopic)) {
if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (targetTopic.isCentralTopic()) {
result = $msg('MAIN_TOPIC'); result = $msg('MAIN_TOPIC');
} else { } else {
result = $msg('SUB_TOPIC'); result = $msg('SUB_TOPIC');
@ -196,7 +196,7 @@ mindplot.MainTopic = new Class({
var targetTopic = this.getOutgoingConnectedTopic(); var targetTopic = this.getOutgoingConnectedTopic();
var result; var result;
if ($defined(targetTopic)) { if ($defined(targetTopic)) {
if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (targetTopic.isCentralTopic()) {
result = { result = {
font:"Arial", font:"Arial",
size:8, size:8,

View File

@ -29,7 +29,7 @@ mindplot.Topic = new Class({
// Position a topic .... // Position a topic ....
var pos = model.getPosition(); var pos = model.getPosition();
if (pos != null && model.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (pos != null && this.isCentralTopic()) {
this.setPosition(pos); this.setPosition(pos);
} }
@ -134,7 +134,7 @@ mindplot.Topic = new Class({
this._setBorderColor(brColor, false); this._setBorderColor(brColor, false);
// Define the pointer ... // Define the pointer ...
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && !this.isReadOnly()) { if (!this.isCentralTopic() && !this.isReadOnly()) {
this._innerShape.setCursor('move'); this._innerShape.setCursor('move');
} else { } else {
this._innerShape.setCursor('default'); this._innerShape.setCursor('default');
@ -340,7 +340,7 @@ mindplot.Topic = new Class({
if (!readOnly) { if (!readOnly) {
// Propagate mouse events ... // Propagate mouse events ...
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (!this.isCentralTopic()) {
result.setCursor('move'); result.setCursor('move');
} else { } else {
result.setCursor('default'); result.setCursor('default');
@ -829,7 +829,7 @@ mindplot.Topic = new Class({
setBranchVisibility:function (value) { setBranchVisibility:function (value) {
var current = this; var current = this;
var parent = this; var parent = this;
while (parent != null && parent.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { while (parent != null && !parent.isCentralTopic()) {
current = parent; current = parent;
parent = current.getParent(); parent = current.getParent();
} }
@ -1111,7 +1111,7 @@ mindplot.Topic = new Class({
var elem = this.get2DElement(); var elem = this.get2DElement();
workspace.appendChild(elem); workspace.appendChild(elem);
if (!this.isInWorkspace()) { if (!this.isInWorkspace()) {
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { if (!this.isCentralTopic()) {
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeAdded, this.getModel()); mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeAdded, this.getModel());
} }