summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-10-17 01:24:50 (EDT)
committerManik Kishore2012-10-17 01:24:50 (EDT)
commit0b3f37bdd03efc79772146e5be82b3733b1b663b (patch)
tree1324b07d7f623ae01d6277b4b49bfee98cc6f126
parentb3762d851ed4e53b418cffb6691cc7fc6871accf (diff)
downloadorg.eclipse.stardust.ui.web-0b3f37bdd03efc79772146e5be82b3733b1b663b.zip
org.eclipse.stardust.ui.web-0b3f37bdd03efc79772146e5be82b3733b1b663b.tar.gz
org.eclipse.stardust.ui.web-0b3f37bdd03efc79772146e5be82b3733b1b663b.tar.bz2
CRNT-26662
Added null check in m_symbol.js refreshCommentPrimitives() git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@60085 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js247
1 files changed, 124 insertions, 123 deletions
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
index 781285e..71a8854 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
@@ -3,7 +3,7 @@
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors: SunGard CSA LLC - initial API and implementation and/or initial
* documentation
******************************************************************************/
@@ -26,7 +26,7 @@ define(
};
/**
- *
+ *
*/
function Symbol() {
var drawable = m_drawable.createDrawable();
@@ -51,14 +51,14 @@ define(
// Method initialization
/**
- *
+ *
*/
Symbol.prototype.toString = function() {
return "Lightdust.Symbol";
};
/**
- *
+ *
*/
Symbol.prototype.getProperties = function() {
this.properties.dimensions = {
@@ -72,7 +72,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.initialize = function(x, y) {
this.prepare(x, y);
@@ -101,21 +101,21 @@ define(
}
/**
- *
+ *
*/
Symbol.prototype.getXCenter = function() {
return this.x + 0.5 * this.width;
};
/**
- *
+ *
*/
Symbol.prototype.getYCenter = function() {
return this.y + 0.5 * this.height;
};
/**
- *
+ *
*/
Symbol.prototype.prepare = function(x, y) {
this.x = x;
@@ -125,7 +125,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.prepareNoPosition = function() {
this.createPrimitives();
@@ -158,7 +158,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.isContainerSymbol = function() {
return false;
@@ -179,14 +179,14 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.requiresParentSymbol = function() {
return true;
};
/**
- *
+ *
*/
Symbol.prototype.completeNoTransfer = function() {
m_messageDisplay.clear();
@@ -224,7 +224,7 @@ define(
this.initializeDefaultEventHandling();
this.initializeEventHandling();
- this.initializeCommentPrimitivesEventHandling();
+ this.initializeCommentPrimitivesEventHandling();
this.primitivesToFront();
this.createChildSymbols();
@@ -291,7 +291,7 @@ define(
return commandType;
}
/**
- *
+ *
* Registers symbol in specific lists in the diagram.
*/
Symbol.prototype.register = function() {
@@ -299,21 +299,21 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.createPrimitives = function() {
// Nothing to be done
};
/**
- *
+ *
*/
Symbol.prototype.createChildSymbols = function() {
// Nothing to be done
};
/**
- *
+ *
*/
Symbol.prototype.createCommentPrimitives = function() {
this.commentCountText = m_canvasManager.drawTextNode(
@@ -335,7 +335,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.createAnchorPoints = function() {
this.anchorPoints[0] = new AnchorPoint(this, 0);
@@ -345,7 +345,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.showAnchorPoints = function() {
for ( var n in this.anchorPoints) {
@@ -354,7 +354,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.hideAnchorPoints = function() {
for ( var n in this.anchorPoints) {
@@ -363,7 +363,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.getClosestAnchorPoint = function(x, y,
skipScrollAdjustment) {
@@ -392,7 +392,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.showPrimitives = function() {
for ( var n in this.primitives) {
@@ -402,7 +402,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.hidePrimitives = function() {
for ( var n in this.primitives) {
@@ -411,7 +411,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.hide = function() {
this.visible = false;
@@ -424,7 +424,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.show = function() {
this.visible = true;
@@ -435,7 +435,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.hideConnections = function() {
var n = 0;
@@ -501,7 +501,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.cacheAnchorPointAndAdjust = function(
currentAnchorPt, targetAnchorPt) {
@@ -533,7 +533,7 @@ define(
}
/**
- *
+ *
*/
Symbol.prototype.showConnections = function() {
var n = 0;
@@ -562,7 +562,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.primitivesToFront = function() {
for ( var n in this.primitives) {
@@ -571,7 +571,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.adjustAnchorPoints = function() {
this.anchorPoints[0].adjust();
@@ -581,7 +581,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.adjustCommentPrimitives = function() {
this.commentCountText.animate({
@@ -608,7 +608,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.adjustAuxiliaryElements = function() {
if (this.visible) {
@@ -622,13 +622,13 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.adjustChildSymbols = function() {
};
/**
- *
+ *
*/
Symbol.prototype.adjustSelectFrame = function() {
this.leftSelectFrame.attr("path", this
@@ -642,7 +642,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.isInBoundingBox = function(xClick, yClick) {
return this.x <= xClick && this.x + this.width >= xClick
@@ -651,7 +651,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.isInRectangle = function(x, y, width, height) {
return x <= this.x && x + width >= this.x + this.width
@@ -660,7 +660,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.createProximitySensorPrimitive = function() {
return m_canvasManager.drawRectangle(this.x
@@ -678,7 +678,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.createSelectFrame = function() {
this.leftSelectFrame = m_canvasManager.drawPath(this
@@ -755,7 +755,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.getLeftSelectFramePath = function() {
return "M"
@@ -769,7 +769,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.getTopSelectFramePath = function() {
return "M"
@@ -782,7 +782,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.getRightSelectFramePath = function() {
return "M"
@@ -796,7 +796,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.getBottomSelectFramePath = function() {
return "M"
@@ -810,7 +810,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.createFlyOutMenuBackground = function(x, y,
height, width) {
@@ -840,7 +840,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.showSelectFrame = function() {
this.leftSelectFrame.show();
@@ -850,7 +850,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.hideSelectFrame = function() {
this.leftSelectFrame.hide();
@@ -860,7 +860,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.move = function(x, y) {
this.moveBy(x - (this.x + (this.width / 2)), y
@@ -868,7 +868,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.moveTo = function(x, y) {
this.x = x;
@@ -877,7 +877,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.moveBy = function(dX, dY) {
this.x = this.x + dX;
@@ -940,7 +940,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.refresh = function() {
this.refreshFromModelElement();
@@ -955,10 +955,11 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.refreshCommentPrimitives = function() {
- if (this.modelElement.comments.length > 0) {
+ if (this.modelElement != null
+ && this.modelElement.comments.length > 0) {
this.commentCountText.attr("text",
this.modelElement.comments.length);
this.commentCountText.show();
@@ -979,13 +980,13 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.adjustPrimitives = function() {
};
/**
- *
+ *
*/
Symbol.prototype.dragStart = function() {
// TODO hide for all selected
@@ -1009,7 +1010,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.dragStop = function() {
if (this.diagram.mode == this.diagram.SYMBOL_MOVE_MODE) {
@@ -1107,7 +1108,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.proximityHoverIn = function(event) {
if (this.diagram.mode == this.diagram.NORMAL_MODE) {
@@ -1132,7 +1133,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.proximityHoverOut = function(event) {
if (this.diagram.mode == this.diagram.NORMAL_MODE) {
@@ -1196,7 +1197,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.addToPrimitives = function(element) {
this.primitives.push(element);
@@ -1222,7 +1223,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.initializeCommentPrimitivesEventHandling = function() {
this.commentCountIcon
@@ -1232,7 +1233,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.initializeDefaultEventHandling = function(
element) {
@@ -1260,7 +1261,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.mouseMove = function(x, y) {
if (this.diagram.isInConnectionMode()) {
@@ -1286,7 +1287,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.hoverIn = function(x, y) {
if (this.diagram.isInConnectionMode()) {
@@ -1312,7 +1313,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.hoverOut = function() {
if (this.diagram.isInConnectionMode()) {
@@ -1330,7 +1331,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.click = function(x, y) {
// When symbol is Draged, the edit symbol operation should
@@ -1379,7 +1380,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.select = function() {
if (!this.isCompleted()) {
@@ -1396,7 +1397,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.showPropertiesPanel = function(page) {
if (this.propertiesPanel != null) {
@@ -1407,7 +1408,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.deselect = function() {
if (!this.isCompleted()) {
@@ -1424,19 +1425,19 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.highlight = function() {
};
/**
- *
+ *
*/
Symbol.prototype.dehighlight = function() {
};
/**
- *
+ *
*/
Symbol.prototype.deselectAnchorPoints = function() {
for ( var n in this.anchorPoints) {
@@ -1445,7 +1446,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.remove = function() {
this.removePrimitives();
@@ -1460,7 +1461,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.createAndSubmitDeleteCommand = function() {
var command = m_command.createRemoveNodeCommand(this
@@ -1490,7 +1491,7 @@ define(
}
/**
- *
+ *
*/
Symbol.prototype.removePrimitives = function() {
var n = 0;
@@ -1502,7 +1503,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.removeConnections = function() {
var n = 0;
@@ -1514,7 +1515,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.removeAnchorPoints = function() {
for ( var n in this.anchorPoints) {
@@ -1523,7 +1524,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.stretchStart = function() {
this.preDragSymbolState = {
@@ -1535,7 +1536,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.stretchStop = function() {
// Check if stretch is overlapping with other symbol boundry
@@ -1563,7 +1564,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.isSymbolWithinStretchLimit = function() {
// If stretch is outside left/right margin of swimlane
@@ -1590,7 +1591,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.stretchLeft = function(dX, dY, x, y) {
this.width += this.x - (x - this.diagram.X_OFFSET);
@@ -1601,7 +1602,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.stretchTop = function(dX, dY, x, y) {
this.height += this.y - (y - this.diagram.Y_OFFSET);
@@ -1612,7 +1613,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.stretchRight = function(dX, dY, x, y) {
this.width = x - this.diagram.X_OFFSET - this.x;
@@ -1622,7 +1623,7 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.stretchBottom = function(dX, dY, x, y) {
this.height += ((y - this.diagram.Y_OFFSET) - (this.y + this.height));
@@ -1632,21 +1633,21 @@ define(
};
/**
- *
+ *
*/
Symbol.prototype.validateCreateConnection = function() {
return true;
};
/*
- *
+ *
*/
Symbol.prototype.onParentSymbolChange = function() {
// Do nothing
};
/*
- *
+ *
*/
Symbol.prototype.flipFlowOrientation = function(flowOrientation) {
var x = this.x;
@@ -1656,21 +1657,21 @@ define(
};
/*
- *
+ *
*/
Symbol.prototype.getDashboardX = function() {
return this.x + 30;
};
/*
- *
+ *
*/
Symbol.prototype.getDashboardY = function() {
return this.y + 30;
};
/*
- *
+ *
*/
Symbol.prototype.hideGlow = function() {
if (this.glow != null) {
@@ -1681,7 +1682,7 @@ define(
};
/*
- *
+ *
*/
Symbol.prototype.removeGlow = function() {
if (this.glow != null) {
@@ -1690,13 +1691,13 @@ define(
}
}
};
-
+
/**
- *
+ *
*/
Symbol.prototype.clickCommentPrimitive = function() {
m_utils.debug("Comment Primitives clicked");
-
+
this.showPropertiesPanel("commentsPropertiesPage");
};
}
@@ -1704,21 +1705,21 @@ define(
// Callback methods for closure trick
/**
- *
+ *
*/
function Symbol_hoverInClosure(event, x, y) {
this.auxiliaryProperties.callbackScope.hoverIn(x, y);
}
/**
- *
+ *
*/
function Symbol_hoverOutClosure() {
this.auxiliaryProperties.callbackScope.hoverOut();
}
/**
- *
+ *
*/
function Symbol_clickClosure(event, x, y) {
this.auxiliaryProperties.callbackScope.click(x, y);
@@ -1730,14 +1731,14 @@ define(
}
/**
- *
+ *
*/
function Symbol_hoverInFlyOutMenuClosure() {
this.auxiliaryProperties.callbackScope.showFlyOutMenu();
}
/**
- *
+ *
*/
function Symbol_hoverOutFlyOutMenuClosure(event) {
// Hover out(hide flyout menu) if mouse cursor is outside
@@ -1749,14 +1750,14 @@ define(
}
/**
- *
+ *
*/
function Symbol_mouseMoveClosure(event, x, y) {
this.auxiliaryProperties.callbackScope.mouseMove(x, y);
}
/**
- *
+ *
*/
function Symbol_dragClosure(dX, dY, x, y, event) {
this.auxiliaryProperties.callbackScope.diagram
@@ -1776,21 +1777,21 @@ define(
}
/**
- *
+ *
*/
function Symbol_dragStartClosure() {
this.auxiliaryProperties.callbackScope.dragStart();
}
/**
- *
+ *
*/
function Symbol_dragStopClosure() {
this.auxiliaryProperties.callbackScope.dragStop();
}
/**
- *
+ *
*/
function Symbol_stretchLeftClosure(dX, dY, x, y) {
this.auxiliaryProperties.callbackScope
@@ -1806,7 +1807,7 @@ define(
}
/**
- *
+ *
*/
function Symbol_stretchTopClosure(dX, dY, x, y) {
this.auxiliaryProperties.callbackScope
@@ -1822,7 +1823,7 @@ define(
}
/**
- *
+ *
*/
function Symbol_stretchRightClosure(dX, dY, x, y) {
this.auxiliaryProperties.callbackScope
@@ -1838,7 +1839,7 @@ define(
}
/**
- *
+ *
*/
function Symbol_stretchBottomClosure(dX, dY, x, y) {
this.auxiliaryProperties.callbackScope
@@ -1854,7 +1855,7 @@ define(
}
/**
- *
+ *
*/
function Symbol_stretchStartClosure() {
if (this.auxiliaryProperties.callbackScope.stretchStart) {
@@ -1863,7 +1864,7 @@ define(
}
/**
- *
+ *
*/
function Symbol_stretchStopClosure() {
this.auxiliaryProperties.callbackScope.stretchStop();
@@ -1872,14 +1873,14 @@ define(
}
/**
- *
+ *
*/
function Symbol_clickCommentPrimitiveClosure(){
- this.auxiliaryProperties.callbackScope.clickCommentPrimitive();
+ this.auxiliaryProperties.callbackScope.clickCommentPrimitive();
}
-
+
/**
- *
+ *
*/
// TODO Is this needed
function Symbol_createClosure(callbackScope, data) {
@@ -1929,14 +1930,14 @@ define(
AnchorPoint_dragStopClosure);
/**
- *
+ *
*/
AnchorPoint.prototype.toString = function() {
return "Lightdust.AnchorPoint";
};
/**
- *
+ *
*/
AnchorPoint.prototype.moveTo = function(x, y) {
this.x = x;
@@ -1948,7 +1949,7 @@ define(
}
/**
- *
+ *
*/
AnchorPoint.prototype.adjust = function() {
if (this.orientation == m_constants.NORTH) {
@@ -1967,7 +1968,7 @@ define(
};
/**
- *
+ *
*/
AnchorPoint.prototype.show = function() {
this.graphics.show();
@@ -1975,14 +1976,14 @@ define(
};
/**
- *
+ *
*/
AnchorPoint.prototype.hide = function() {
this.graphics.hide();
};
/**
- *
+ *
*/
AnchorPoint.prototype.select = function() {
this.graphics
@@ -2002,7 +2003,7 @@ define(
};
/**
- *
+ *
*/
AnchorPoint.prototype.deselect = function() {
this.graphics.animate({
@@ -2018,21 +2019,21 @@ define(
};
/**
- *
+ *
*/
AnchorPoint.prototype.hoverIn = function() {
this.select();
};
/**
- *
+ *
*/
AnchorPoint.prototype.hoverOut = function() {
this.deselect();
};
/**
- *
+ *
*/
AnchorPoint.prototype.drag = function(dX, dY, x, y) {
if (this.dragConnection == null) {
@@ -2105,7 +2106,7 @@ define(
}
/**
- *
+ *
*/
AnchorPoint.prototype.dragStart = function() {
this.symbol.diagram.mode = this.symbol.diagram.SYMBOL_MOVE_MODE;
@@ -2150,7 +2151,7 @@ define(
}
/**
- *
+ *
*/
AnchorPoint.prototype.dragStop = function() {
this.symbol.diagram.mode = this.symbol.diagram.NORMAL_MODE;
@@ -2270,7 +2271,7 @@ define(
}
/**
- *
+ *
*/
AnchorPoint.prototype.remove = function() {
this.graphics.remove();