From 7bbcd824886f77def6ce18efb47b179d872c8686 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 20 Sep 2012 19:00:31 -0300 Subject: [PATCH] - Remove CENTRAL_NODE flag. --- mindplot/src/main/javascript/MainTopic.js | 8 ++++---- mindplot/src/main/javascript/Topic.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mindplot/src/main/javascript/MainTopic.js b/mindplot/src/main/javascript/MainTopic.js index 86e6833a..87401ebd 100644 --- a/mindplot/src/main/javascript/MainTopic.js +++ b/mindplot/src/main/javascript/MainTopic.js @@ -64,7 +64,7 @@ mindplot.MainTopic = new Class({ // Change figure based on the connected topic ... var model = this.getModel(); var shapeType = model.getShapeType(); - if (targetTopic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + if (!targetTopic.isCentralTopic()) { if (!$defined(shapeType)) { // Get the real shape type ... shapeType = this.getShapeType(); @@ -168,7 +168,7 @@ mindplot.MainTopic = new Class({ _getInnerPadding:function () { var result; var parent = this.getModel().getParent(); - if (parent && mindplot.model.INodeModel.MAIN_TOPIC_TYPE == parent.getType()) { + if (parent && !parent.isCentralTopic()) { result = 3; } else { @@ -181,7 +181,7 @@ mindplot.MainTopic = new Class({ var targetTopic = this.getOutgoingConnectedTopic(); var result = ""; if ($defined(targetTopic)) { - if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + if (targetTopic.isCentralTopic()) { result = $msg('MAIN_TOPIC'); } else { result = $msg('SUB_TOPIC'); @@ -196,7 +196,7 @@ mindplot.MainTopic = new Class({ var targetTopic = this.getOutgoingConnectedTopic(); var result; if ($defined(targetTopic)) { - if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + if (targetTopic.isCentralTopic()) { result = { font:"Arial", size:8, diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index fc9317e6..e47ab269 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -29,7 +29,7 @@ mindplot.Topic = new Class({ // Position a topic .... var pos = model.getPosition(); - if (pos != null && model.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + if (pos != null && this.isCentralTopic()) { this.setPosition(pos); } @@ -134,7 +134,7 @@ mindplot.Topic = new Class({ this._setBorderColor(brColor, false); // Define the pointer ... - if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && !this.isReadOnly()) { + if (!this.isCentralTopic() && !this.isReadOnly()) { this._innerShape.setCursor('move'); } else { this._innerShape.setCursor('default'); @@ -340,7 +340,7 @@ mindplot.Topic = new Class({ if (!readOnly) { // Propagate mouse events ... - if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + if (!this.isCentralTopic()) { result.setCursor('move'); } else { result.setCursor('default'); @@ -829,7 +829,7 @@ mindplot.Topic = new Class({ setBranchVisibility:function (value) { var current = this; var parent = this; - while (parent != null && parent.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + while (parent != null && !parent.isCentralTopic()) { current = parent; parent = current.getParent(); } @@ -1111,7 +1111,7 @@ mindplot.Topic = new Class({ var elem = this.get2DElement(); workspace.appendChild(elem); 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()); }