Replace core.Utils.isDefined for $defined.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user