Replace core.Utils.isDefined for $defined.

This commit is contained in:
Paulo Veiga
2011-07-27 13:44:09 -03:00
parent f60755fd8e
commit 0b67b42045
66 changed files with 406 additions and 401 deletions

View File

@@ -66,8 +66,8 @@ mindplot.BidirectionalArray = new Class({
},
get :function(index, sign) {
core.assert(core.Utils.isDefined(index), 'Illegal argument, index must be passed.');
if (core.Utils.isDefined(sign)) {
core.assert($defined(index), 'Illegal argument, index must be passed.');
if ($defined(sign)) {
core.assert(index >= 0, 'Illegal absIndex value');
index = index * sign;
}
@@ -82,14 +82,14 @@ mindplot.BidirectionalArray = new Class({
},
set : function(index, elem) {
core.assert(core.Utils.isDefined(index), 'Illegal index value');
core.assert($defined(index), 'Illegal index value');
var array = (index >= 0) ? this._rightElem : this._leftElem;
array[Math.abs(index)] = elem;
},
length : function(index) {
core.assert(core.Utils.isDefined(index), 'Illegal index value');
core.assert($defined(index), 'Illegal index value');
return (index >= 0) ? this._rightElem.length : this._leftElem.length;
},

View File

@@ -18,7 +18,7 @@
mindplot.BoardEntry = new Class({
initialize:function(lowerLimit, upperLimit, order) {
if (core.Utils.isDefined(lowerLimit) && core.Utils.isDefined(upperLimit)) {
if ($defined(lowerLimit) && $defined(upperLimit)) {
core.assert(lowerLimit < upperLimit, 'lowerLimit can not be greater that upperLimit');
}
this._upperLimit = upperLimit;
@@ -42,7 +42,7 @@ mindplot.BoardEntry = new Class({
},
setUpperLimit : function(value) {
core.assert(core.Utils.isDefined(value), "upper limit can not be null");
core.assert($defined(value), "upper limit can not be null");
core.assert(!isNaN(value), "illegal value");
this._upperLimit = value;
},
@@ -56,7 +56,7 @@ mindplot.BoardEntry = new Class({
},
setLowerLimit : function(value) {
core.assert(core.Utils.isDefined(value), "upper limit can not be null");
core.assert($defined(value), "upper limit can not be null");
core.assert(!isNaN(value), "illegal value");
this._lowerLimit = value;
},
@@ -89,18 +89,18 @@ mindplot.BoardEntry = new Class({
},
setTopic : function(topic, updatePosition) {
if (!core.Utils.isDefined(updatePosition) || (core.Utils.isDefined(updatePosition) && !updatePosition)) {
if (!$defined(updatePosition) || ($defined(updatePosition) && !updatePosition)) {
updatePosition = true;
}
this._topic = topic;
if (core.Utils.isDefined(topic)) {
if ($defined(topic)) {
// Fixed positioning. Only for main topic ...
var position = null;
var topicPosition = topic.getPosition();
// Must update position base on the border limits?
if (core.Utils.isDefined(this._xPos)) {
if ($defined(this._xPos)) {
position = new core.Point();
// Update x position ...
@@ -128,7 +128,7 @@ mindplot.BoardEntry = new Class({
},
isAvailable : function() {
return !core.Utils.isDefined(this._topic);
return !$defined(this._topic);
},
getOrder : function() {

View File

@@ -151,7 +151,7 @@ mindplot.BubbleTip = new Class({
mindplot.BubbleTip.getInstance = function(divContainer) {
var result = mindplot.BubbleTip.instance;
if (!core.Utils.isDefined(result)) {
if (!$defined(result)) {
mindplot.BubbleTip.instance = new mindplot.BubbleTip(divContainer);
result = mindplot.BubbleTip.instance;
}

View File

@@ -56,7 +56,7 @@ mindplot.CentralTopic.prototype.createChildModel = function(prepositionate)
var childModel = mindmap.createNode(mindplot.NodeModel.MAIN_TOPIC_TYPE);
if(prepositionate){
if (!core.Utils.isDefined(this.___siblingDirection))
if (!$defined(this.___siblingDirection))
{
this.___siblingDirection = 1;
}

View File

@@ -38,7 +38,7 @@ mindplot.Command = new Class(
mindplot.Command._nextUUID = function()
{
if (!core.Utils.isDefined(mindplot.Command._uuid))
if (!$defined(mindplot.Command._uuid))
{
mindplot.Command._uuid = 1;
}

View File

@@ -58,7 +58,7 @@ mindplot.ConnectionLine = new Class({
},
_createLine : function(lineType, defaultStyle) {
if (!core.Utils.isDefined(lineType)) {
if (!$defined(lineType)) {
lineType = defaultStyle;
}
lineType = parseInt(lineType);

View File

@@ -38,7 +38,7 @@ mindplot.ControlPoint = new Class({
},
setLine : function(line) {
if (core.Utils.isDefined(this._line)) {
if ($defined(this._line)) {
this._removeLine();
}
this._line = line;
@@ -52,7 +52,7 @@ mindplot.ControlPoint = new Class({
},
redraw : function() {
if (core.Utils.isDefined(this._line))
if ($defined(this._line))
this._createControlPoint();
},

View File

@@ -114,7 +114,7 @@ mindplot.CommandContext = new Class({
var result = [];
lineIds.forEach(function(lineId, index) {
var line = this._designer._relationships[lineId];
if (core.Utils.isDefined(line)) {
if ($defined(line)) {
result.push(line);
}
}.bind(this));

View File

@@ -96,7 +96,7 @@ mindplot.DragManager.prototype._buildMouseMoveListener = function(workspace, dra
// Call mouse move listeners ...
var dragListener = dragManager._listeners['dragging'];
if (core.Utils.isDefined(dragListener))
if ($defined(dragListener))
{
dragListener(event, dragNode);
}

View File

@@ -139,7 +139,7 @@ mindplot.DragPivot = new Class({
var connectRect = this._connectRect;
connectRect.setVisibility(value);
if (core.Utils.isDefined(this._line)) {
if ($defined(this._line)) {
this._line.setVisibility(value);
}
},
@@ -177,11 +177,11 @@ mindplot.DragPivot = new Class({
var connectToRect = this._connectRect;
workspace.removeChild(connectToRect);
if (core.Utils.isDefined(this._straightLine)) {
if ($defined(this._straightLine)) {
workspace.removeChild(this._straightLine);
}
if (core.Utils.isDefined(this._curvedLine)) {
if ($defined(this._curvedLine)) {
workspace.removeChild(this._curvedLine);
}
},

View File

@@ -18,8 +18,8 @@
mindplot.DragTopic = function(dragShape, draggedNode)
{
core.assert(core.Utils.isDefined(dragShape), 'Rect can not be null.');
core.assert(core.Utils.isDefined(draggedNode), 'draggedNode can not be null.');
core.assert($defined(dragShape), 'Rect can not be null.');
core.assert($defined(draggedNode), 'draggedNode can not be null.');
this._elem2d = dragShape;
this._order = null;
@@ -68,7 +68,7 @@ mindplot.DragTopic.prototype.disconnect = function(workspace)
mindplot.DragTopic.prototype.canBeConnectedTo = function(targetTopic)
{
core.assert(core.Utils.isDefined(targetTopic), 'parent can not be null');
core.assert($defined(targetTopic), 'parent can not be null');
var result = true;
if (!targetTopic.areChildrenShrinked() && !targetTopic.isCollapsed())
@@ -135,7 +135,7 @@ mindplot.DragTopic.prototype._getDragPivot = function()
mindplot.DragTopic.__getDragPivot = function()
{
var result = mindplot.DragTopic._dragPivot;
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
result = new mindplot.DragPivot();
mindplot.DragTopic._dragPivot = result;

View File

@@ -46,7 +46,7 @@ mindplot.DragTopicPositioner = new Class({
// Must be disconnected from their current connection ?.
var mainTopicToMainTopicConnection = this._lookUpForMainTopicToMainTopicConnection(dragTopic);
var currentConnection = dragTopic.getConnectedToTopic();
if (core.Utils.isDefined(currentConnection)) {
if ($defined(currentConnection)) {
// MainTopic->MainTopicConnection.
if (currentConnection.getType() == mindplot.NodeModel.MAIN_TOPIC_TYPE) {
if (mainTopicToMainTopicConnection != currentConnection) {
@@ -58,7 +58,7 @@ mindplot.DragTopicPositioner = new Class({
var dragXPosition = dragTopic.getPosition().x;
var currentXPosition = currentConnection.getPosition().x;
if (core.Utils.isDefined(mainTopicToMainTopicConnection)) {
if ($defined(mainTopicToMainTopicConnection)) {
// I have to change the current connection to a main topic.
dragTopic.disconnect(this._workspace);
} else
@@ -71,7 +71,7 @@ mindplot.DragTopicPositioner = new Class({
// Finally, connect nodes ...
if (!dragTopic.isConnected()) {
var centalTopic = topics[0];
if (core.Utils.isDefined(mainTopicToMainTopicConnection)) {
if ($defined(mainTopicToMainTopicConnection)) {
dragTopic.connectTo(mainTopicToMainTopicConnection);
} else if (Math.abs(dragTopic.getPosition().x - centalTopic.getPosition().x) <= mindplot.DragTopicPositioner.CENTRAL_TO_MAINTOPIC_MAX_HORIZONTAL_DISTANCE) {
dragTopic.connectTo(centalTopic);

View File

@@ -72,7 +72,7 @@ mindplot.FixedDistanceBoard = new Class({
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
if (core.Utils.isDefined(entry)) {
if ($defined(entry)) {
var upperLimit = entry.getUpperLimit() + yOffset;
var lowerLimit = entry.getLowerLimit() + yOffset;
entry.setUpperLimit(upperLimit);
@@ -172,7 +172,7 @@ mindplot.FixedDistanceBoard = new Class({
if (entries.length > 0) {
var l = 0;
for (l = 0; l < entries.length; l++) {
if (core.Utils.isDefined(entries[l]))
if ($defined(entries[l]))
break;
}
var topic = entries[l].getTopic();
@@ -245,7 +245,7 @@ mindplot.FixedDistanceBoard = new Class({
},
lookupEntryByPosition : function(pos) {
core.assert(core.Utils.isDefined(pos), 'position can not be null');
core.assert($defined(pos), 'position can not be null');
var entries = this._entries;
var result = null;

View File

@@ -156,7 +156,7 @@ mindplot.IconGroup = new Class({
registerListeners : function() {
this.options.nativeElem.addEventListener('click', function(event) {
// Avoid node creation ...
if (core.Utils.isDefined(event.stopPropagation)) {
if ($defined(event.stopPropagation)) {
event.stopPropagation(true);
} else {
event.cancelBubble = true;
@@ -165,7 +165,7 @@ mindplot.IconGroup = new Class({
});
this.options.nativeElem.addEventListener('dblclick', function(event) {
// Avoid node creation ...
if (core.Utils.isDefined(event.stopPropagation)) {
if ($defined(event.stopPropagation)) {
event.stopPropagation(true);
} else {
event.cancelBubble = true;

View File

@@ -57,7 +57,7 @@ mindplot.IconModel.prototype.isIconModel = function()
*/
mindplot.IconModel._nextUUID = function()
{
if (!core.Utils.isDefined(this._uuid))
if (!$defined(this._uuid))
{
this._uuid = 0;
}

View File

@@ -39,7 +39,7 @@ mindplot.ImageIcon = function(iconModel, topic, designer) {
removeImage.src = "../images/bin.png";
removeImage.inject(container);
if (!core.Utils.isDefined(designer._viewMode)|| (core.Utils.isDefined(designer._viewMode) && !designer._viewMode))
if (!$defined(designer._viewMode)|| ($defined(designer._viewMode) && !designer._viewMode))
{
removeImage.addEvent('click', function(event) {

View File

@@ -72,7 +72,7 @@ mindplot.LinkIcon = function(urlModel, topic, designer) {
attribution.inject(element);
element.inject(container);
if(!core.Utils.isDefined(designer._viewMode)|| (core.Utils.isDefined(designer._viewMode) && !designer._viewMode)){
if(!$defined(designer._viewMode)|| ($defined(designer._viewMode) && !designer._viewMode)){
var buttonContainer = new Element('div').setStyles({paddingTop:5, textAlign:'center'});
var editBtn = new Element('input', {type:'button', 'class':'btn-primary', value:'Edit','class':'btn-primary'}).addClass('button').inject(buttonContainer);
var removeBtn = new Element('input', {type:'button', value:'Remove','class':'btn-primary'}).addClass('button').inject(buttonContainer);

View File

@@ -120,7 +120,7 @@ mindplot.MainTopic.prototype.updateTopicShape = function(targetTopic, workspace)
var shapeType = model.getShapeType();
if (targetTopic.getType() != mindplot.NodeModel.CENTRAL_TOPIC_TYPE)
{
if (!core.Utils.isDefined(shapeType))
if (!$defined(shapeType))
{
// Get the real shape type ...
shapeType = this.getShapeType();
@@ -139,7 +139,7 @@ mindplot.MainTopic.prototype.disconnect = function(workspace)
var model = this.getModel();
var shapeType = model.getShapeType();
if (!core.Utils.isDefined(shapeType))
if (!$defined(shapeType))
{
// Change figure ...
shapeType = this.getShapeType();
@@ -163,7 +163,7 @@ mindplot.MainTopic.prototype._updatePositionOnChangeSize = function(oldSize, new
else{
var xOffset = Math.round((newSize.width - oldSize.width) / 2);
var pos = this.getPosition();
if (core.Utils.isDefined(pos))
if ($defined(pos))
{
if (pos.x > 0)
{
@@ -277,7 +277,7 @@ mindplot.MainTopic.prototype._defaultText = function()
{
var targetTopic = this.getOutgoingConnectedTopic();
var result = "";
if (core.Utils.isDefined(targetTopic))
if ($defined(targetTopic))
{
if (targetTopic.getType() == mindplot.NodeModel.CENTRAL_TOPIC_TYPE)
{
@@ -297,7 +297,7 @@ mindplot.MainTopic.prototype._defaultFontStyle = function()
{
var targetTopic = this.getOutgoingConnectedTopic();
var result;
if (core.Utils.isDefined(targetTopic))
if ($defined(targetTopic))
{
if (targetTopic.getType() == mindplot.NodeModel.CENTRAL_TOPIC_TYPE)
{

View File

@@ -27,7 +27,7 @@ mindplot.MainTopicBoard = new Class({
_getBoard: function() {
if (!core.Utils.isDefined(this._board)) {
if (!$defined(this._board)) {
var topic = this._topic;
this._board = new mindplot.FixedDistanceBoard(mindplot.MainTopicBoard.DEFAULT_MAIN_TOPIC_HEIGHT, topic, this._layoutManager);
}
@@ -89,7 +89,7 @@ mindplot.MainTopicBoard = new Class({
addBranch : function(topic) {
var order = topic.getOrder();
core.assert(core.Utils.isDefined(order), "Order must be defined");
core.assert($defined(order), "Order must be defined");
// If the entry is not available, I must swap the the entries...
var board = this._getBoard();

View File

@@ -18,7 +18,7 @@
mindplot.MindmapDesigner = function(profile, divElement)
{
core.assert(core.Utils.isDefined(profile.zoom), "zoom must be defined");
core.assert($defined(profile.zoom), "zoom must be defined");
// Undo manager ...
this._actionRunner = new mindplot.DesignerActionRunner(this);
@@ -87,7 +87,7 @@ mindplot.MindmapDesigner.prototype._registerEvents = function()
var workspace = this._workspace;
var screenManager = workspace.getScreenManager();
if (!core.Utils.isDefined(this._viewMode) || (core.Utils.isDefined(this._viewMode) && !this._viewMode))
if (!$defined(this._viewMode) || ($defined(this._viewMode) && !this._viewMode))
{
// Initialize workspace event listeners.
// Create nodes on double click...
@@ -175,7 +175,7 @@ mindplot.MindmapDesigner.prototype.onObjectFocusEvent = function(currentObject,
this.getEditor().lostFocus();
var selectableObjects = this.getSelectedObjects();
// Disable all nodes on focus but not the current if Ctrl key isn't being pressed
if (!core.Utils.isDefined(event) || event.ctrlKey == false)
if (!$defined(event) || event.ctrlKey == false)
{
for (var i = 0; i < selectableObjects.length; i++)
{
@@ -285,7 +285,7 @@ mindplot.MindmapDesigner.prototype.addRelationShip2SelectedNode = function(event
var pos = screen.getWorkspaceMousePosition(event);
var selectedTopics = this.getSelectedNodes();
if(selectedTopics.length >0 &&
(!core.Utils.isDefined(this._creatingRelationship) || (core.Utils.isDefined(this._creatingRelationship) && !this._creatingRelationship))){
(!$defined(this._creatingRelationship) || ($defined(this._creatingRelationship) && !this._creatingRelationship))){
this._workspace.enableWorkspaceEvents(false);
var fromNodePosition = selectedTopics[0].getPosition();
this._relationship = new web2d.CurvedLine();
@@ -313,10 +313,10 @@ mindplot.MindmapDesigner.prototype._relationshipMouseMove = function(event){
mindplot.MindmapDesigner.prototype._relationshipMouseClick = function (event, fromNode) {
var target = event.target;
while(target.tagName != "g" && core.Utils.isDefined(target.parentNode)){
while(target.tagName != "g" && $defined(target.parentNode)){
target=target.parentNode;
}
if(core.Utils.isDefined(target.virtualRef)){
if($defined(target.virtualRef)){
var targetNode = target.virtualRef;
this.addRelationship(fromNode, targetNode);
}
@@ -347,7 +347,7 @@ mindplot.MindmapDesigner.prototype.needsSave = function()
mindplot.MindmapDesigner.prototype.autoSaveEnabled = function(value)
{
if (core.Utils.isDefined(value) && value)
if ($defined(value) && value)
{
var autosave = function() {
@@ -467,7 +467,7 @@ mindplot.MindmapDesigner.prototype._nodeModelToNodeGraph = function(nodeModel, i
core.assert(nodeModel, "Node model can not be null");
var nodeGraph = this._buildNodeGraph(nodeModel);
if(core.Utils.isDefined(isVisible))
if($defined(isVisible))
nodeGraph.setVisibility(isVisible);
var children = nodeModel.getChildren().slice();
@@ -477,7 +477,7 @@ mindplot.MindmapDesigner.prototype._nodeModelToNodeGraph = function(nodeModel, i
for (var i = 0; i < children.length; i++)
{
var child = children[i];
if(core.Utils.isDefined(child))
if($defined(child))
this._nodeModelToNodeGraph(child);
}
@@ -545,11 +545,11 @@ mindplot.MindmapDesigner.prototype._buildRelationship = function (model) {
// Create node graph ...
var relationLine = new mindplot.RelationshipLine(fromTopic, toTopic, model.getLineType());
if(core.Utils.isDefined(model.getSrcCtrlPoint())){
if($defined(model.getSrcCtrlPoint())){
var srcPoint = model.getSrcCtrlPoint().clone();
relationLine.setSrcControlPoint(srcPoint);
}
if(core.Utils.isDefined(model.getDestCtrlPoint())){
if($defined(model.getDestCtrlPoint())){
var destPoint = model.getDestCtrlPoint().clone();
relationLine.setDestControlPoint(destPoint);
}
@@ -598,7 +598,7 @@ mindplot.MindmapDesigner.prototype._removeNode = function(node)
var model = node.getModel();
model.deleteNode();
if (core.Utils.isDefined(parent))
if ($defined(parent))
{
this._goToNode(parent);
}
@@ -719,7 +719,7 @@ mindplot.MindmapDesigner.prototype._getValidSelectedObjectsIds = function(valida
for (var i = 0; i < selectedNodes.length; i++)
{
var selectedNode = selectedNodes[i];
if (core.Utils.isDefined(validate))
if ($defined(validate))
{
isValid = validate(selectedNode);
}
@@ -736,7 +736,7 @@ mindplot.MindmapDesigner.prototype._getValidSelectedObjectsIds = function(valida
for( var j = 0; j< selectedRelationshipLines.length; j++){
var selectedLine = selectedRelationshipLines[j];
isValid = true;
if(core.Utils.isDefined(validate)){
if($defined(validate)){
isValid = validate(selectedLine);
}
@@ -1047,9 +1047,9 @@ mindplot.MindmapDesigner.prototype.keyEventHandler = function(event)
if (evt.keyCode == 8)
{
if (core.Utils.isDefined(event))
if ($defined(event))
{
if (core.Utils.isDefined(event.preventDefault)) {
if ($defined(event.preventDefault)) {
event.preventDefault();
} else {
event.returnValue = false;

View File

@@ -29,8 +29,8 @@ mindplot.NodeModel = new Class({
this._notes = [];
this._size = {width:50,height:20};
this._position = null;
if (core.Utils.isDefined(id)) {
if (!core.Utils.isDefined(mindplot.NodeModel._uuid) || id > mindplot.NodeModel._uuid) {
if ($defined(id)) {
if (!$defined(mindplot.NodeModel._uuid) || id > mindplot.NodeModel._uuid) {
mindplot.NodeModel._uuid = id;
}
this._id = id;
@@ -183,10 +183,10 @@ mindplot.NodeModel = new Class({
},
setPosition : function(x, y) {
core.assert(core.Utils.isDefined(x), "x coordinate must be defined");
core.assert(core.Utils.isDefined(y), "y coordinate must be defined");
core.assert($defined(x), "x coordinate must be defined");
core.assert($defined(y), "y coordinate must be defined");
if (!core.Utils.isDefined(this._position)) {
if (!$defined(this._position)) {
this._position = new core.Point();
}
this._position.x = parseInt(x);
@@ -198,10 +198,10 @@ mindplot.NodeModel = new Class({
},
setFinalPosition : function(x, y) {
core.assert(core.Utils.isDefined(x), "x coordinate must be defined");
core.assert(core.Utils.isDefined(y), "y coordinate must be defined");
core.assert($defined(x), "x coordinate must be defined");
core.assert($defined(y), "y coordinate must be defined");
if (!core.Utils.isDefined(this._finalPosition)) {
if (!$defined(this._finalPosition)) {
this._finalPosition = new core.Point();
}
this._finalPosition.x = parseInt(x);
@@ -253,7 +253,7 @@ mindplot.NodeModel = new Class({
canBeConnected : function(sourceModel, sourcePosition, targetTopicHeight) {
core.assert(sourceModel != this, 'The same node can not be parent and child if itself.');
core.assert(sourcePosition, 'childPosition can not be null.');
core.assert(core.Utils.isDefined(targetTopicHeight), 'childrenWidth can not be null.');
core.assert($defined(targetTopicHeight), 'childrenWidth can not be null.');
// Only can be connected if the node is in the left or rigth.
var targetModel = this;
@@ -412,7 +412,7 @@ mindplot.NodeModel = new Class({
}
var parent = this._parent;
if (core.Utils.isDefined(parent)) {
if ($defined(parent)) {
// if it is connected, I must remove it from the parent..
mindmap.disconnect(this);
}
@@ -443,7 +443,7 @@ mindplot.NodeModel.MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE = 220;
* @todo: This method must be implemented.
*/
mindplot.NodeModel._nextUUID = function() {
if (!core.Utils.isDefined(this._uuid)) {
if (!$defined(this._uuid)) {
this._uuid = 0;
}

View File

@@ -41,7 +41,7 @@ mindplot.Note = new Class({
imgContainer.inject(container);
if (!core.Utils.isDefined(designer._viewMode) || (core.Utils.isDefined(designer._viewMode) && !designer._viewMode)) {
if (!$defined(designer._viewMode) || ($defined(designer._viewMode) && !designer._viewMode)) {
var buttonContainer = new Element('div').setStyles({paddingTop:5, textAlign:'center'});
var editBtn = new Element('input', {type:'button', value:'Edit','class':'btn-primary'}).addClass('button').inject(buttonContainer);
var removeBtn = new Element('input', {type:'button', value:'Remove','class':'btn-primary'}).addClass('button').inject(buttonContainer);

View File

@@ -41,7 +41,7 @@ mindplot.PersistanceManager.save = function(mindmap, editorProperties, onSavedHa
} else
{
// Execute on success handler ...
if (core.Utils.isDefined(onSavedHandler))
if ($defined(onSavedHandler))
{
onSavedHandler();
}

View File

@@ -100,7 +100,7 @@ mindplot.RelationshipModel.prototype.clone = function(model){
*/
mindplot.RelationshipModel._nextUUID = function()
{
if (!core.Utils.isDefined(this._uuid))
if (!$defined(this._uuid))
{
this._uuid = 0;
}

View File

@@ -86,7 +86,7 @@ mindplot.RichTextEditor = mindplot.TextEditor.extend({
}
}.bind(this);
_animEffect = effect.periodical(10);
$(this.inputText).value = core.Utils.isDefined(this.initialText)&& this.initialText!=""? this.initialText: node.getText();
$(this.inputText).value = $defined(this.initialText)&& this.initialText!=""? this.initialText: node.getText();
this._editor = new nicEditor({iconsPath: '../images/nicEditorIcons.gif', buttonList : ['bold','italic','underline','removeformat','forecolor', 'fontSize', 'fontFamily', 'xhtml']}).panelInstance("inputText2");
},
init:function(node){

View File

@@ -24,7 +24,7 @@ mindplot.ScreenManager = function(width, height, divElement)
mindplot.ScreenManager.prototype.setScale = function(scale)
{
core.assert(core.Utils.isDefined(scale), 'Screen scale can not be null');
core.assert($defined(scale), 'Screen scale can not be null');
this._workspaceScale = scale;
};

View File

@@ -135,7 +135,7 @@ mindplot.TextEditor = new Class({
_updateNode : function ()
{
if (core.Utils.isDefined(this._currentNode) && this._currentNode.getText() != this.getText())
if ($defined(this._currentNode) && this._currentNode.getText() != this.getText())
{
var text = this.getText();
var topicId = this._currentNode.getId();
@@ -161,7 +161,7 @@ mindplot.TextEditor = new Class({
if (stopPropagation)
{
if (core.Utils.isDefined(event.stopPropagation))
if ($defined(event.stopPropagation))
{
event.stopPropagation(true);
} else
@@ -244,19 +244,19 @@ mindplot.TextEditor = new Class({
{
var inputField = $("inputText");
var spanField = $("spanText");
if (!core.Utils.isDefined(fontStyle.font))
if (!$defined(fontStyle.font))
{
fontStyle.font = "Arial";
}
if (!core.Utils.isDefined(fontStyle.style))
if (!$defined(fontStyle.style))
{
fontStyle.style = "normal";
}
if (!core.Utils.isDefined(fontStyle.weight))
if (!$defined(fontStyle.weight))
{
fontStyle.weight = "normal";
}
if (!core.Utils.isDefined(fontStyle.size))
if (!$defined(fontStyle.size))
{
fontStyle.size = 12;
}
@@ -367,7 +367,7 @@ mindplot.TextEditor = new Class({
},
clickEvent : function(event){
if(this.isVisible()){
if (core.Utils.isDefined(event.stopPropagation))
if ($defined(event.stopPropagation))
{
event.stopPropagation(true);
} else
@@ -380,7 +380,7 @@ mindplot.TextEditor = new Class({
},
mouseDownEvent : function(event){
if(this.isVisible()){
if (core.Utils.isDefined(event.stopPropagation))
if ($defined(event.stopPropagation))
{
event.stopPropagation(true);
} else

View File

@@ -135,7 +135,7 @@ mindplot.Tip.prototype.moveTopic=function(offset, panelHeight){
mindplot.Tip.getInstance = function(divContainer)
{
var result = mindplot.Tip.instance;
if(!core.Utils.isDefined(result))
if(!$defined(result))
{
mindplot.Tip.instance = new mindplot.Tip(divContainer);
result = mindplot.Tip.instance;

View File

@@ -60,7 +60,7 @@ mindplot.Topic.prototype._setShapeType = function(type, updateModel)
{
// Remove inner shape figure ...
var model = this.getModel();
if (core.Utils.isDefined(updateModel)&& updateModel)
if ($defined(updateModel)&& updateModel)
{
model.setShapeType(type);
}
@@ -79,7 +79,7 @@ mindplot.Topic.prototype._setShapeType = function(type, updateModel)
//this._registerDefaultListenersToElement(innerShape, this);
var dispatcher = dispatcherByEventType['mousedown'];
if(core.Utils.isDefined(dispatcher))
if($defined(dispatcher))
{
for(var i = 1; i<dispatcher._listeners.length; i++)
{
@@ -122,7 +122,7 @@ mindplot.Topic.prototype.getShapeType = function()
{
var model = this.getModel();
var result = model.getShapeType();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
result = this._defaultShapeType();
}
@@ -140,7 +140,7 @@ mindplot.Topic.prototype._removeInnerShape = function()
mindplot.Topic.prototype.INNER_RECT_ATTRIBUTES = {stroke:'0.5 solid'};
mindplot.Topic.prototype.getInnerShape = function()
{
if (!core.Utils.isDefined(this._innerShape))
if (!$defined(this._innerShape))
{
// Create inner box.
this._innerShape = this.buildShape(this.INNER_RECT_ATTRIBUTES);
@@ -170,7 +170,7 @@ mindplot.Topic.prototype.getInnerShape = function()
mindplot.Topic.prototype.buildShape = function(attributes, type)
{
var result;
if (!core.Utils.isDefined(type))
if (!$defined(type))
{
type = this.getShapeType();
}
@@ -247,7 +247,7 @@ mindplot.Topic.OUTER_SHAPE_ATTRIBUTES = {fillColor:'#dbe2e6',stroke:'1 solid #77
mindplot.Topic.prototype.getOuterShape = function()
{
if (!core.Utils.isDefined(this._outerShape))
if (!$defined(this._outerShape))
{
var rect = this.buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.NodeModel.SHAPE_TYPE_ROUNDED_RECT);
rect.setPosition(-2, -3);
@@ -260,7 +260,7 @@ mindplot.Topic.prototype.getOuterShape = function()
mindplot.Topic.prototype.getTextShape = function()
{
if (!core.Utils.isDefined(this._text))
if (!$defined(this._text))
{
var model = this.getModel();
this._text = this._buildTextShape();
@@ -274,7 +274,7 @@ mindplot.Topic.prototype.getTextShape = function()
mindplot.Topic.prototype.getOrBuildIconGroup = function()
{
if (!core.Utils.isDefined(this._icon))
if (!$defined(this._icon))
{
this._icon = this._buildIconGroup();
var group = this.get2DElement();
@@ -459,7 +459,7 @@ mindplot.Topic.prototype._buildTextShape = function(disableEventsListeners)
result.addEventListener('mousedown', function(event)
{
var eventDispatcher = topic.getInnerShape()._dispatcherByEventType['mousedown'];
if (core.Utils.isDefined(eventDispatcher))
if ($defined(eventDispatcher))
{
eventDispatcher.eventListener(event);
}
@@ -514,7 +514,7 @@ mindplot.Topic.prototype.setFontFamily = function(value, updateModel)
{
var textShape = this.getTextShape();
textShape.setFontFamily(value);
if (core.Utils.isDefined(updateModel) && updateModel)
if ($defined(updateModel) && updateModel)
{
var model = this.getModel();
model.setFontFamily(value);
@@ -536,7 +536,7 @@ mindplot.Topic.prototype.setFontSize = function(value, updateModel)
{
var textShape = this.getTextShape();
textShape.setSize(value);
if (core.Utils.isDefined(updateModel) && updateModel)
if ($defined(updateModel) && updateModel)
{
var model = this.getModel();
model.setFontSize(value);
@@ -559,7 +559,7 @@ mindplot.Topic.prototype.setFontStyle = function(value, updateModel)
{
var textShape = this.getTextShape();
textShape.setStyle(value);
if (core.Utils.isDefined(updateModel) && updateModel)
if ($defined(updateModel) && updateModel)
{
var model = this.getModel();
model.setFontStyle(value);
@@ -581,7 +581,7 @@ mindplot.Topic.prototype.setFontWeight = function(value, updateModel)
{
var textShape = this.getTextShape();
textShape.setWeight(value);
if (core.Utils.isDefined(updateModel) && updateModel)
if ($defined(updateModel) && updateModel)
{
var model = this.getModel();
model.setFontWeight(value);
@@ -592,7 +592,7 @@ mindplot.Topic.prototype.getFontWeight = function()
{
var model = this.getModel();
var result = model.getFontWeight();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
var font = this._defaultFontStyle();
result = font.weight;
@@ -604,7 +604,7 @@ mindplot.Topic.prototype.getFontFamily = function()
{
var model = this.getModel();
var result = model.getFontFamily();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
var font = this._defaultFontStyle();
result = font.font;
@@ -616,7 +616,7 @@ mindplot.Topic.prototype.getFontColor = function()
{
var model = this.getModel();
var result = model.getFontColor();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
var font = this._defaultFontStyle();
result = font.color;
@@ -628,7 +628,7 @@ mindplot.Topic.prototype.getFontStyle = function()
{
var model = this.getModel();
var result = model.getFontStyle();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
var font = this._defaultFontStyle();
result = font.style;
@@ -640,7 +640,7 @@ mindplot.Topic.prototype.getFontSize = function()
{
var model = this.getModel();
var result = model.getFontSize();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
var font = this._defaultFontStyle();
result = font.size;
@@ -652,7 +652,7 @@ mindplot.Topic.prototype.setFontColor = function(value, updateModel)
{
var textShape = this.getTextShape();
textShape.setColor(value);
if (core.Utils.isDefined(updateModel) && updateModel)
if ($defined(updateModel) && updateModel)
{
var model = this.getModel();
model.setFontColor(value);
@@ -675,7 +675,7 @@ mindplot.Topic.prototype._setText = function(text, updateModel)
setTimeout(executor(this), 0);*/
core.Executor.instance.delay(this.updateNode, 0,this, [updateModel]);
if (core.Utils.isDefined(updateModel) && updateModel)
if ($defined(updateModel) && updateModel)
{
var model = this.getModel();
model.setText(text);
@@ -691,7 +691,7 @@ mindplot.Topic.prototype.getText = function()
{
var model = this.getModel();
var result = model.getText();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
result = this._defaultText();
}
@@ -710,7 +710,7 @@ mindplot.Topic.prototype._setBackgroundColor = function(color, updateModel)
var connector = this.getShrinkConnector();
connector.setFill(color);
if (core.Utils.isDefined(updateModel) && updateModel)
if ($defined(updateModel) && updateModel)
{
var model = this.getModel();
model.setBackgroundColor(color);
@@ -721,7 +721,7 @@ mindplot.Topic.prototype.getBackgroundColor = function()
{
var model = this.getModel();
var result = model.getBackgroundColor();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
result = this._defaultBackgroundColor();
}
@@ -742,7 +742,7 @@ mindplot.Topic.prototype._setBorderColor = function(color, updateModel)
connector.setAttribute('strokeColor', color);
if (core.Utils.isDefined(updateModel) && updateModel)
if ($defined(updateModel) && updateModel)
{
var model = this.getModel();
model.setBorderColor(color);
@@ -753,7 +753,7 @@ mindplot.Topic.prototype.getBorderColor = function()
{
var model = this.getModel();
var result = model.getBorderColor();
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
result = this._defaultBorderColor();
}
@@ -934,7 +934,7 @@ mindplot.Topic.prototype.getIncomingLines = function()
{
var node = children[i];
var line = node.getOutgoingLine();
if (core.Utils.isDefined(line))
if ($defined(line))
{
result.push(line);
}
@@ -946,7 +946,7 @@ mindplot.Topic.prototype.getOutgoingConnectedTopic = function()
{
var result = null;
var line = this.getOutgoingLine();
if (core.Utils.isDefined(line))
if ($defined(line))
{
result = line.getTargetTopic();
}
@@ -958,7 +958,7 @@ mindplot.Topic.prototype._updateConnectionLines = function()
{
// Update this to parent line ...
var outgoingLine = this.getOutgoingLine();
if (core.Utils.isDefined(outgoingLine))
if ($defined(outgoingLine))
{
outgoingLine.redraw();
}
@@ -1008,7 +1008,7 @@ mindplot.Topic.prototype.moveToBack = function(){
this._relationships[j].moveToBack();
}
var connector = this.getShrinkConnector();
if(core.Utils.isDefined(connector)){
if($defined(connector)){
connector.moveToBack();
}
@@ -1021,7 +1021,7 @@ mindplot.Topic.prototype.moveToFront = function(){
this.get2DElement().moveToFront();
var connector = this.getShrinkConnector();
if(core.Utils.isDefined(connector)){
if($defined(connector)){
connector.moveToFront();
}
// Update relationship lines
@@ -1152,7 +1152,7 @@ mindplot.Topic.prototype.removeEventListener = function(type, listener)
mindplot.Topic.prototype._setSize = function(size)
{
core.assert(size, "size can not be null");
core.assert(core.Utils.isDefined(size.width), "size seem not to be a valid element");
core.assert($defined(size.width), "size seem not to be a valid element");
mindplot.Topic.superClass.setSize.call(this, size);
@@ -1186,7 +1186,7 @@ mindplot.Topic.prototype._updatePositionOnChangeSize = function(oldSize, newSize
mindplot.Topic.prototype.disconnect = function(workspace)
{
var outgoingLine = this.getOutgoingLine();
if (core.Utils.isDefined(outgoingLine))
if ($defined(outgoingLine))
{
core.assert(workspace, 'workspace can not be null');
@@ -1264,7 +1264,7 @@ mindplot.Topic.prototype.connectTo = function(targetTopic, workspace, isVisible)
// Create a connection line ...
var outgoingLine = new mindplot.ConnectionLine(this, targetTopic);
if(core.Utils.isDefined(isVisible))
if($defined(isVisible))
outgoingLine.setVisibility(isVisible);
this._outgoingLine = outgoingLine;
workspace.appendChild(outgoingLine);
@@ -1309,7 +1309,7 @@ mindplot.Topic.prototype._removeChild = function(child)
mindplot.Topic.prototype._getChildren = function()
{
var result = this._children;
if (!core.Utils.isDefined(result))
if (!$defined(result))
{
this._children = [];
result = this._children;
@@ -1322,7 +1322,7 @@ mindplot.Topic.prototype.removeFromWorkspace = function(workspace)
var elem2d = this.get2DElement();
workspace.removeChild(elem2d);
var line = this.getOutgoingLine();
if (core.Utils.isDefined(line))
if ($defined(line))
{
workspace.removeChild(line);
}
@@ -1346,7 +1346,7 @@ mindplot.Topic.prototype.createDragNode = function()
// Is the node already connected ?
var targetTopic = this.getOutgoingConnectedTopic();
if (core.Utils.isDefined(targetTopic))
if ($defined(targetTopic))
{
dragNode.connectTo(targetTopic);
}
@@ -1377,7 +1377,7 @@ mindplot.Topic.prototype.updateNode = function(updatePosition)
textShape.setPosition(iconOffset+this._offset+2, pos);
textShape.setTextSize(sizeWidth, sizeHeight);
var iconGroup = this.getIconGroup();
if(core.Utils.isDefined(iconGroup))
if($defined(iconGroup))
iconGroup.updateIconGroupPosition();
}
};

View File

@@ -30,7 +30,7 @@ mindplot.VariableDistanceBoard = new Class({
var index = this._orderToIndex(order);
var result = entries.get(index);
if (!core.Utils.isDefined(result)) {
if (!$defined(result)) {
// I've not found a entry. I have to create a new one.
var i = 1;
var zeroEntry = entries.get(0);
@@ -103,7 +103,7 @@ mindplot.VariableDistanceBoard = new Class({
},
lookupEntryByPosition:function(pos) {
core.assert(core.Utils.isDefined(pos), 'position can not be null');
core.assert($defined(pos), 'position can not be null');
var entries = this._entries;
var zeroEntry = entries.get(0);
if (zeroEntry.isCoordinateIn(pos.y)) {
@@ -123,7 +123,7 @@ mindplot.VariableDistanceBoard = new Class({
// Move to the next entry ...
var index = i * sign;
var entry = entries.get(index);
if (core.Utils.isDefined(entry)) {
if ($defined(entry)) {
currentEntry = entry;
} else {
// Calculate boundaries...
@@ -174,16 +174,16 @@ mindplot.VariableDistanceBoard = new Class({
var i = Math.abs(index) + 1;
while (currentTopic) {
var e = entries.get(i, indexSign);
if (core.Utils.isDefined(currentTopic) && !core.Utils.isDefined(e)) {
if ($defined(currentTopic) && !$defined(e)) {
var entryOrder = this._indexToOrder(i * indexSign);
e = this.lookupEntryByOrder(entryOrder);
}
// Move the topic to the next entry ...
var topic = null;
if (core.Utils.isDefined(e)) {
if ($defined(e)) {
topic = e.getTopic();
if (core.Utils.isDefined(currentTopic)) {
if ($defined(currentTopic)) {
e.setTopic(currentTopic);
}
this.update(e);

View File

@@ -73,7 +73,7 @@ mindplot.Workspace = new Class({
},
appendChild: function(shape) {
if (core.Utils.isDefined(shape.addToWorkspace)) {
if ($defined(shape.addToWorkspace)) {
shape.addToWorkspace(this);
} else {
this._workspace.appendChild(shape);
@@ -82,7 +82,7 @@ mindplot.Workspace = new Class({
removeChild: function(shape) {
// Element is a node, not a web2d element?
if (core.Utils.isDefined(shape.removeFromWorkspace)) {
if ($defined(shape.removeFromWorkspace)) {
shape.removeFromWorkspace(this);
} else {
this._workspace.removeChild(shape);
@@ -152,7 +152,7 @@ mindplot.Workspace = new Class({
var mWorkspace = this;
var mouseDownListener = function(event)
{
if (!core.Utils.isDefined(workspace.mouseMoveListener)) {
if (!$defined(workspace.mouseMoveListener)) {
if (mWorkspace.isWorkspaceEventsEnabled()) {
mWorkspace.enableWorkspaceEvents(false);

View File

@@ -28,7 +28,7 @@ mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument = function(domDoc
mindplot.XMLMindmapSerializerFactory.getSerializer = function(version){
if(!core.Utils.isDefined(version)){
if(!$defined(version)){
version = mindplot.ModelCodeName.BETA;
}
var codeNames = mindplot.XMLMindmapSerializerFactory._codeNames;

View File

@@ -28,7 +28,7 @@ mindplot.XMLMindmapSerializer_Beta.prototype.toXML = function(mindmap)
// Store map attributes ...
var mapElem = document.createElement("map");
var name = mindmap.getId();
if (core.Utils.isDefined(name))
if ($defined(name))
{
mapElem.setAttribute('name', name);
}
@@ -69,12 +69,12 @@ mindplot.XMLMindmapSerializer_Beta.prototype._topicToXML = function(document, to
}
var text = topic.getText();
if (core.Utils.isDefined(text)) {
if ($defined(text)) {
parentTopic.setAttribute('text', text);
}
var shape = topic.getShapeType();
if (core.Utils.isDefined(shape)) {
if ($defined(shape)) {
parentTopic.setAttribute('shape', shape);
}
@@ -101,19 +101,19 @@ mindplot.XMLMindmapSerializer_Beta.prototype._topicToXML = function(document, to
var fontStyle = topic.getFontStyle();
font += (fontStyle ? fontStyle : '') + ';';
if (core.Utils.isDefined(fontFamily) || core.Utils.isDefined(fontSize) || core.Utils.isDefined(fontColor)
|| core.Utils.isDefined(fontWeight )|| core.Utils.isDefined(fontStyle))
if ($defined(fontFamily) || $defined(fontSize) || $defined(fontColor)
|| $defined(fontWeight )|| $defined(fontStyle))
{
parentTopic.setAttribute('fontStyle', font);
}
var bgColor = topic.getBackgroundColor();
if (core.Utils.isDefined(bgColor)) {
if ($defined(bgColor)) {
parentTopic.setAttribute('bgColor', bgColor);
}
var brColor = topic.getBorderColor();
if (core.Utils.isDefined(brColor)) {
if ($defined(brColor)) {
parentTopic.setAttribute('brColor', brColor);
}
@@ -208,28 +208,28 @@ mindplot.XMLMindmapSerializer_Beta.prototype._deserializeNode = function(domElem
// Load attributes...
var text = domElem.getAttribute('text');
if (core.Utils.isDefined(text)) {
if ($defined(text)) {
topic.setText(text);
}
var order = domElem.getAttribute('order');
if (core.Utils.isDefined(order)) {
if ($defined(order)) {
topic.setOrder(order);
}
var shape = domElem.getAttribute('shape');
if (core.Utils.isDefined(shape)) {
if ($defined(shape)) {
topic.setShapeType(shape);
}
var isShrink = domElem.getAttribute('shrink');
if(core.Utils.isDefined(isShrink))
if($defined(isShrink))
{
topic.setChildrenShrinked(isShrink);
}
var fontStyle = domElem.getAttribute('fontStyle');
if (core.Utils.isDefined(fontStyle)) {
if ($defined(fontStyle)) {
var font = fontStyle.split(';');
if (font[0])
@@ -259,17 +259,17 @@ mindplot.XMLMindmapSerializer_Beta.prototype._deserializeNode = function(domElem
}
var bgColor = domElem.getAttribute('bgColor');
if (core.Utils.isDefined(bgColor)) {
if ($defined(bgColor)) {
topic.setBackgroundColor(bgColor);
}
var borderColor = domElem.getAttribute('brColor');
if (core.Utils.isDefined(borderColor)) {
if ($defined(borderColor)) {
topic.setBorderColor(borderColor);
}
var position = domElem.getAttribute('position');
if (core.Utils.isDefined(position)) {
if ($defined(position)) {
var pos = position.split(',');
topic.setPosition(pos[0], pos[1]);
}

View File

@@ -30,12 +30,12 @@ mindplot.XMLMindmapSerializer_Pela.prototype.toXML = function(mindmap)
// Store map attributes ...
var mapElem = document.createElement("map");
var name = mindmap.getId();
if (core.Utils.isDefined(name))
if ($defined(name))
{
mapElem.setAttribute('name', name);
}
var version = mindmap.getVersion();
if (core.Utils.isDefined(version))
if ($defined(version))
{
mapElem.setAttribute('version', version);
}
@@ -88,12 +88,12 @@ mindplot.XMLMindmapSerializer_Pela.prototype._topicToXML = function(document, to
}
var text = topic.getText();
if (core.Utils.isDefined(text)) {
if ($defined(text)) {
parentTopic.setAttribute('text', text);
}
var shape = topic.getShapeType();
if (core.Utils.isDefined(shape)) {
if ($defined(shape)) {
parentTopic.setAttribute('shape', shape);
}
@@ -123,19 +123,19 @@ mindplot.XMLMindmapSerializer_Pela.prototype._topicToXML = function(document, to
var fontStyle = topic.getFontStyle();
font += (fontStyle ? fontStyle : '') + ';';
if (core.Utils.isDefined(fontFamily) || core.Utils.isDefined(fontSize) || core.Utils.isDefined(fontColor)
|| core.Utils.isDefined(fontWeight) || core.Utils.isDefined(fontStyle))
if ($defined(fontFamily) || $defined(fontSize) || $defined(fontColor)
|| $defined(fontWeight) || $defined(fontStyle))
{
parentTopic.setAttribute('fontStyle', font);
}
var bgColor = topic.getBackgroundColor();
if (core.Utils.isDefined(bgColor)) {
if ($defined(bgColor)) {
parentTopic.setAttribute('bgColor', bgColor);
}
var brColor = topic.getBorderColor();
if (core.Utils.isDefined(brColor)) {
if ($defined(brColor)) {
parentTopic.setAttribute('brColor', brColor);
}
@@ -206,11 +206,11 @@ mindplot.XMLMindmapSerializer_Pela.prototype._relationshipToXML = function(docum
var lineType = relationship.getLineType();
relationDom.setAttribute("lineType",lineType);
if(lineType==mindplot.ConnectionLine.CURVED || lineType==mindplot.ConnectionLine.SIMPLE_CURVED){
if(core.Utils.isDefined(relationship.getSrcCtrlPoint())){
if($defined(relationship.getSrcCtrlPoint())){
var srcPoint = relationship.getSrcCtrlPoint();
relationDom.setAttribute("srcCtrlPoint",srcPoint.x+","+srcPoint.y);
}
if(core.Utils.isDefined(relationship.getDestCtrlPoint())){
if($defined(relationship.getDestCtrlPoint())){
var destPoint = relationship.getDestCtrlPoint();
relationDom.setAttribute("destCtrlPoint",destPoint.x+","+destPoint.y);
}
@@ -263,7 +263,7 @@ mindplot.XMLMindmapSerializer_Pela.prototype._deserializeNode = function(domElem
var type = (domElem.getAttribute('central') != null) ? mindplot.NodeModel.CENTRAL_TOPIC_TYPE : mindplot.NodeModel.MAIN_TOPIC_TYPE;
// Load attributes...
var id = domElem.getAttribute('id');
if(core.Utils.isDefined(id)) {
if($defined(id)) {
id=parseInt(id);
}
@@ -276,28 +276,28 @@ mindplot.XMLMindmapSerializer_Pela.prototype._deserializeNode = function(domElem
var topic = mindmap.createNode(type, id);
var text = domElem.getAttribute('text');
if (core.Utils.isDefined(text)) {
if ($defined(text)) {
topic.setText(text);
}
var order = domElem.getAttribute('order');
if (core.Utils.isDefined(order)) {
if ($defined(order)) {
topic.setOrder(parseInt(order));
}
var shape = domElem.getAttribute('shape');
if (core.Utils.isDefined(shape)) {
if ($defined(shape)) {
topic.setShapeType(shape);
}
var isShrink = domElem.getAttribute('shrink');
if(core.Utils.isDefined(isShrink))
if($defined(isShrink))
{
topic.setChildrenShrinked(isShrink);
}
var fontStyle = domElem.getAttribute('fontStyle');
if (core.Utils.isDefined(fontStyle)) {
if ($defined(fontStyle)) {
var font = fontStyle.split(';');
if (font[0])
@@ -327,17 +327,17 @@ mindplot.XMLMindmapSerializer_Pela.prototype._deserializeNode = function(domElem
}
var bgColor = domElem.getAttribute('bgColor');
if (core.Utils.isDefined(bgColor)) {
if ($defined(bgColor)) {
topic.setBackgroundColor(bgColor);
}
var borderColor = domElem.getAttribute('brColor');
if (core.Utils.isDefined(borderColor)) {
if ($defined(borderColor)) {
topic.setBorderColor(borderColor);
}
var position = domElem.getAttribute('position');
if (core.Utils.isDefined(position)) {
if ($defined(position)) {
var pos = position.split(',');
topic.setPosition(pos[0], pos[1]);
topic.setFinalPosition(pos[0], pos[1]);
@@ -400,10 +400,10 @@ mindplot.XMLMindmapSerializer_Pela.prototype._deserializeRelationship = function
}
var model = mindmap.createRelationship(srcId, destId);
model.setLineType(lineType);
if(core.Utils.isDefined(srcCtrlPoint) && srcCtrlPoint!=""){
if($defined(srcCtrlPoint) && srcCtrlPoint!=""){
model.setSrcCtrlPoint(core.Point.fromString(srcCtrlPoint));
}
if(core.Utils.isDefined(destCtrlPoint) && destCtrlPoint!=""){
if($defined(destCtrlPoint) && destCtrlPoint!=""){
model.setDestCtrlPoint(core.Point.fromString(destCtrlPoint));
}
model.setEndArrow(endArrow=="true");

View File

@@ -25,7 +25,7 @@ mindplot.commands.AddTopicCommand = new Class(
this._model = model;
this._parentId = parentTopicId;
this._id = mindplot.Command._nextUUID();
this._animated = core.Utils.isDefined(animated)?animated:false;
this._animated = $defined(animated)?animated:false;
},
execute: function(commandContext)
{
@@ -34,7 +34,7 @@ mindplot.commands.AddTopicCommand = new Class(
var topic = commandContext.createTopic(this._model, !this._animated);
// Connect to topic ...
if (core.Utils.isDefined(this._parentId))
if ($defined(this._parentId))
{
var parentTopic = commandContext.findTopics(this._parentId)[0];
commandContext.connect(topic, parentTopic, !this._animated);

View File

@@ -47,7 +47,7 @@ mindplot.commands.DragTopicCommand = new Class(
// }
// Disconnect topic ..
if (core.Utils.isDefined(origParentTopic))
if ($defined(origParentTopic))
{
commandContext.disconnect(topic);
}
@@ -70,7 +70,7 @@ mindplot.commands.DragTopicCommand = new Class(
this._position = origPosition;
// Finally, connect topic ...
if (core.Utils.isDefined(this._parentId))
if ($defined(this._parentId))
{
var parentTopic = commandContext.findTopics([this._parentId])[0];
commandContext.connect(topic, parentTopic);
@@ -78,7 +78,7 @@ mindplot.commands.DragTopicCommand = new Class(
// Backup old parent id ...
this._parentId = null;
if (core.Utils.isDefined(origParentTopic))
if ($defined(origParentTopic))
{
this._parentId = origParentTopic.getId();
}

View File

@@ -70,7 +70,7 @@ mindplot.commands.MoveControlPointCommand = new Class(
var model = line.getModel();
switch (this._point){
case 0:
if(core.Utils.isDefined(this._oldControlPoint)){
if($defined(this._oldControlPoint)){
line.setFrom(this._originalEndPoint.x, this._originalEndPoint.y);
model.setSrcCtrlPoint(this._oldControlPoint.clone());
line.setSrcControlPoint(this._oldControlPoint.clone());
@@ -78,7 +78,7 @@ mindplot.commands.MoveControlPointCommand = new Class(
}
break;
case 1:
if(core.Utils.isDefined(this._oldControlPoint)){
if($defined(this._oldControlPoint)){
line.setTo(this._originalEndPoint.x, this._originalEndPoint.y);
model.setDestCtrlPoint(this._oldControlPoint.clone());
line.setDestControlPoint(this._oldControlPoint.clone());

View File

@@ -16,7 +16,7 @@
* limitations under the License.
*/
if(core.Utils.isDefined(afterMindpotLibraryLoading))
if($defined(afterMindpotLibraryLoading))
{
afterMindpotLibraryLoading();
}

View File

@@ -39,7 +39,7 @@ mindplot.layoutManagers.BaseLayoutManager = new Class({
getTopicBoardForTopic:function(node){
var id = node.getId();
var result = this._boards[id];
if(!core.Utils.isDefined(result)){
if(!$defined(result)){
result = this._addNode(node);
}
return result;

View File

@@ -6,7 +6,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
this.parent(designer, options);
},
_nodeConnectEvent:function(targetNode, node){
if(core.Utils.isDefined(node.relationship)){
if($defined(node.relationship)){
this._movingNode(targetNode, node);
}
else if(!this._isCentralTopic(node)){
@@ -14,7 +14,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
}
},
_nodeDisconnectEvent:function(targetNode, node){
if(core.Utils.isDefined(node.relationship)){
if($defined(node.relationship)){
}
else{
this.parent(targetNode, node);
@@ -64,7 +64,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
}
// Register editor events ...
if (!core.Utils.isDefined(this.getDesigner()._viewMode)|| (core.Utils.isDefined(this.getDesigner()._viewMode) && !this.getDesigner()._viewMode))
if (!$defined(this.getDesigner()._viewMode)|| ($defined(this.getDesigner()._viewMode) && !this.getDesigner()._viewMode))
{
this.getDesigner()._editor.listenEventOnNode(topic, 'dblclick', true);
}
@@ -155,7 +155,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
parentBoard._removeEntry(node, entryObj.table, entryObj.index, this._modifiedTopics);
this._changeChildrenSide(node, pos, this._modifiedTopics);
node.setPosition(pos.clone(), false);
if(core.Utils.isDefined(this._modifiedTopics.set)){
if($defined(this._modifiedTopics.set)){
var key = node.getId();
if(this._modifiedTopics.has(key)){
nodePos = this._modifiedTopics.get(key).originalPos;
@@ -184,7 +184,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
childPos.y = newPos.y +(childPos.y - refPos.y);
this._changeChildrenSide(child, childPos, modifiedTopics);
child.setPosition(childPos, false);
if(core.Utils.isDefined(modifiedTopics.set)){
if($defined(modifiedTopics.set)){
var key = node.getId();
if(modifiedTopics.has(key)){
oldPos = this._modifiedTopics.get(key).originalPos;
@@ -335,7 +335,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
}
this._updateTopicsForReconnect(topic, mindplot.layoutManagers.FreeMindLayoutManager.RECONNECT_NODES_OPACITY);
var line = topic.getOutgoingLine();
if(core.Utils.isDefined(line)){
if($defined(line)){
line.setVisibility(false);
}
this._createIndicatorShapes();
@@ -382,7 +382,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
// parentBoard._updateTable(entryObj.index, entryObj.table, this._modifiedTopics, true);
}
if(core.Utils.isDefined(this._modifiedTopics.set)){
if($defined(this._modifiedTopics.set)){
var key = node.getId();
if(this._modifiedTopics.has(key)){
nodePos = this._modifiedTopics.get(key).originalPos;
@@ -449,7 +449,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
if(this._createShape == null){
//cancel everything.
var line = node.getOutgoingLine();
if(core.Utils.isDefined(line)){
if($defined(line)){
line.setVisibility(true);
}
core.Utils.animatePosition(this._modifiedTopics, null, this.getDesigner());
@@ -498,7 +498,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
}
},
_createIndicatorShapes:function(){
if(!core.Utils.isDefined(this._createChildShape) || !core.Utils.isDefined(this._createSiblingShape)){
if(!$defined(this._createChildShape) || !$defined(this._createSiblingShape)){
var rectAttributes = {fillColor:'#CC0033',opacity:0.4,width:30,height:30,strokeColor:'#FF9933'};
var rect = new web2d.Rect(0, rectAttributes);
rect.setVisibility(false);
@@ -677,7 +677,7 @@ mindplot.layoutManagers.FreeMindLayoutManager = mindplot.layoutManagers.BaseLayo
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeMouseOutEvent,[node ]);
},
_addToModifiedList:function(modifiedTopics, key, originalpos, newPos){
if(core.Utils.isDefined(modifiedTopics.set)){
if($defined(modifiedTopics.set)){
if(modifiedTopics.has(key)){
originalpos = modifiedTopics.get(key).originalPos;
}

View File

@@ -5,7 +5,7 @@ mindplot.layoutManagers.LayoutManagerFactory.managers = {
};
mindplot.layoutManagers.LayoutManagerFactory.getManagerByName = function(name){
var manager = mindplot.layoutManagers.LayoutManagerFactory.managers[name+"Manager"];
if(core.Utils.isDefined(manager)){
if($defined(manager)){
return manager;
}
else{

View File

@@ -40,7 +40,7 @@ mindplot.layoutManagers.OriginalLayoutManager = new Class({
for (var i = 0; i < children.length; i++) {
var child = children[i];
var order = child.getOrder();
if (!core.Utils.isDefined(order)) {
if (!$defined(order)) {
order = ++maxOrder;
child.setOrder(order);
}
@@ -131,7 +131,7 @@ mindplot.layoutManagers.OriginalLayoutManager = new Class({
}
// Register editor events ...
if (!core.Utils.isDefined(this.getDesigner()._viewMode) || (core.Utils.isDefined(this.getDesigner()._viewMode) && !this.getDesigner()._viewMode)) {
if (!$defined(this.getDesigner()._viewMode) || ($defined(this.getDesigner()._viewMode) && !this.getDesigner()._viewMode)) {
this.getDesigner()._editor.listenEventOnNode(topic, 'dblclick', true);
}

View File

@@ -16,7 +16,7 @@ mindplot.layoutManagers.boards.freeMindBoards.Board = mindplot.layoutManagers.bo
},
removeTopicFromBoard:function(node, modifiedTopics){
var pos;
if(core.Utils.isDefined(node._originalPosition))
if($defined(node._originalPosition))
pos = node._originalPosition;
var result = this.findNodeEntryIndex(node, pos);
core.assert(result.index<result.table.length,"node not found. Could not remove");
@@ -30,7 +30,7 @@ mindplot.layoutManagers.boards.freeMindBoards.Board = mindplot.layoutManagers.bo
// if creating a sibling or child
if(!this._layoutManager._isMovingNode && this._layoutManager.getDesigner().getSelectedNodes().length>0){
var selectedNode = this._layoutManager.getDesigner().getSelectedNodes()[0];
if(!core.Utils.isDefined(pos)){
if(!$defined(pos)){
if(selectedNode.getParent()!= null && node.getParent().getId() == selectedNode.getParent().getId()){
//creating a sibling - Lets put the new node below the selected node.
var parentBoard = this._layoutManager.getTopicBoardForTopic(selectedNode.getParent());
@@ -60,7 +60,7 @@ mindplot.layoutManagers.boards.freeMindBoards.Board = mindplot.layoutManagers.bo
}
}
this._addEntry(entry, result.table, result.index);
if(core.Utils.isDefined(pos)){
if($defined(pos)){
if(result.index>0){
var prevEntry =result.table[result.index-1];
entry.setMarginTop(pos.y-(prevEntry.getPosition() + prevEntry.getTotalMarginBottom()));
@@ -183,7 +183,7 @@ mindplot.layoutManagers.boards.freeMindBoards.Board = mindplot.layoutManagers.bo
var newPos = new core.Point(pos.x-(delta.x==null?0:delta.x), pos.y-delta.y);
entry.setPosition(newPos.x, newPos.y);
this._layoutManager._updateChildrenBoards(entry.getNode(), delta, modifiedTopics);
if(core.Utils.isDefined(modifiedTopics.set)){
if($defined(modifiedTopics.set)){
var key = entry.getId();
if(modifiedTopics.has(key)){
pos = modifiedTopics.get(key).originalPos;

View File

@@ -15,7 +15,7 @@ mindplot.layoutManagers.boards.freeMindBoards.CentralTopicBoard = mindplot.layou
{
position = altPosition;
}
if(!core.Utils.isDefined(position)){
if(!$defined(position)){
if(Math.sign(node.getParent().getPosition().x) == -1){
i=1;
}

View File

@@ -3,12 +3,12 @@ mindplot.layoutManagers.boards.freeMindBoards.Entry = new Class({
this._node = node;
this._DEFAULT_X_GAP = 30;
var pos = node.getModel().getFinalPosition();
if(useFinalPosition && core.Utils.isDefined(pos)){
if(useFinalPosition && $defined(pos)){
this.setPosition(pos.x, pos.y);
}
else{
pos = node.getPosition();
if(!core.Utils.isDefined(pos)){
if(!$defined(pos)){
var parent = node.getParent();
pos = parent.getPosition().clone();
var pwidth = parent.getSize().width;

View File

@@ -39,7 +39,7 @@ mindplot.util.Shape =
{
core.assert(rectCenterPoint, 'rectCenterPoint can not be null');
core.assert(rectSize, 'rectSize can not be null');
core.assert(core.Utils.isDefined(isAtRight), 'isRight can not be null');
core.assert($defined(isAtRight), 'isRight can not be null');
// Node is placed at the right ?
var result = new core.Point();
@@ -68,7 +68,7 @@ mindplot.util.Shape =
var y = sPos.y - tPos.y;
var gradient = 0;
if (core.Utils.isDefined(x))
if ($defined(x))
{
gradient = y / x;
}