summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-12-07 09:32:33 (EST)
committerStephan Born2013-01-25 12:34:56 (EST)
commitfe6612fc08ba2faaf7f98aa4ed1b44309b24d4df (patch)
tree38fcf6291a359354c3ffcfa88bf8c31d324ef4d3
parent068910e7d4a23d499a4b729f846b0fd4604a6135 (diff)
downloadorg.eclipse.stardust.ui.web-fe6612fc08ba2faaf7f98aa4ed1b44309b24d4df.zip
org.eclipse.stardust.ui.web-fe6612fc08ba2faaf7f98aa4ed1b44309b24d4df.tar.gz
org.eclipse.stardust.ui.web-fe6612fc08ba2faaf7f98aa4ed1b44309b24d4df.tar.bz2
CRNT-25116
Added hidden frame for selectFrames. Made changes to stretch to use scroll position git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61465 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_constants.js1
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js154
2 files changed, 125 insertions, 30 deletions
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_constants.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_constants.js
index 45dc78e..a3f66ca 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_constants.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_constants.js
@@ -42,6 +42,7 @@ define(function() {
SELECT_FRAME_STROKE_WIDTH : 1.0,
SELECT_FRAME_DASHARRAY : "- ",
SELECT_FRAME_R : 3,
+ HIDDEN_FRAME_STROKE_WIDTH : 5.0,
DEFAULT_ANCHOR_WIDTH : 6,
DEFAULT_ANCHOR_HEIGHT : 6,
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 e3ac214..d486f6c 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
@@ -49,6 +49,13 @@ define(
this.topSelectFrame = null;
this.rightSelectFrame = null;
this.bottomSelectFrame = null;
+ // Hidden select frames with thick margin for selection for
+ // Stretch/Shrink
+ this.leftSelectHiddenFrame = null;
+ this.topSelectHiddenFrame = null;
+ this.rightSelectHiddenFrame = null;
+ this.bottomSelectHiddenFrame = null;
+
this.dragStartX = 0;
this.dragStartY = 0;
this.visible = true;
@@ -96,6 +103,10 @@ define(
transferObject.rightSelectFrame = null;
transferObject.bottomSelectFrame = null;
transferObject.leftSelectFrame = null;
+ transferObject.topSelectHiddenFrame = null;
+ transferObject.rightSelectHiddenFrame = null;
+ transferObject.bottomSelectHiddenFrame = null;
+ transferObject.leftSelectHiddenFrame = null;
transferObject.flyOutMenuBackground = null;
transferObject.bottomFlyOutMenuItems = null;
transferObject.rightFlyOutMenuItems = null;
@@ -776,6 +787,16 @@ define(
.getRightSelectFramePath());
this.bottomSelectFrame.attr("path", this
.getBottomSelectFramePath());
+
+ this.leftSelectHiddenFrame.attr("path", this
+ .getLeftSelectFramePath());
+ this.topSelectHiddenFrame.attr("path", this
+ .getTopSelectFramePath());
+ this.rightSelectHiddenFrame.attr("path", this
+ .getRightSelectFramePath());
+ this.bottomSelectHiddenFrame.attr("path", this
+ .getBottomSelectFramePath());
+
};
/**
@@ -818,6 +839,87 @@ define(
*
*/
Symbol.prototype.createSelectFrame = function() {
+ // Create hidden select frames, with thick width for ease to
+ // selection
+ this.leftSelectHiddenFrame = m_canvasManager.drawPath(this
+ .getLeftSelectFramePath(), {
+ "stroke" : "white",
+ "stroke-width" : m_constants.HIDDEN_FRAME_STROKE_WIDTH,
+ "stroke-dasharray" : ""
+ });
+
+ this.leftSelectHiddenFrame.auxiliaryProperties = {
+ callbackScope : this
+ };
+ this.leftSelectHiddenFrame.mouseover(function() {
+ this.attr("cursor", "w-resize");
+ });
+ this.leftSelectHiddenFrame.drag(Symbol_stretchLeftClosure,
+ Symbol_stretchStartClosure,
+ Symbol_stretchStopClosure);
+
+ this.leftSelectHiddenFrame.hide();
+
+ this.topSelectHiddenFrame = m_canvasManager.drawPath(this
+ .getTopSelectFramePath(), {
+ "stroke" : "white",
+ "stroke-width" : m_constants.HIDDEN_FRAME_STROKE_WIDTH,
+ "stroke-dasharray" : ""
+ });
+
+ this.topSelectHiddenFrame.auxiliaryProperties = {
+ callbackScope : this
+ };
+ this.topSelectHiddenFrame.mouseover(function() {
+ this.attr("cursor", "n-resize");
+ });
+ this.topSelectHiddenFrame.drag(Symbol_stretchTopClosure,
+ Symbol_stretchStartClosure,
+ Symbol_stretchStopClosure);
+
+ this.topSelectHiddenFrame.hide();
+
+ this.rightSelectHiddenFrame = m_canvasManager.drawPath(this
+ .getRightSelectFramePath(), {
+ "stroke" : "white",
+ "stroke-width" : m_constants.HIDDEN_FRAME_STROKE_WIDTH,
+ "stroke-dasharray" : ""
+ });
+
+ this.rightSelectHiddenFrame.auxiliaryProperties = {
+ callbackScope : this
+ };
+ this.rightSelectHiddenFrame.mouseover(function() {
+ this.attr("cursor", "e-resize");
+ });
+ this.rightSelectHiddenFrame.drag(
+ Symbol_stretchRightClosure,
+ Symbol_stretchStartClosure,
+ Symbol_stretchStopClosure);
+ this.rightSelectHiddenFrame.hide();
+
+ this.bottomSelectHiddenFrame = m_canvasManager
+ .drawPath(
+ this.getBottomSelectFramePath(),
+ {
+ "stroke" : "white",
+ "stroke-width" : m_constants.HIDDEN_FRAME_STROKE_WIDTH,
+ "stroke-dasharray" : ""
+ });
+
+ this.bottomSelectHiddenFrame.auxiliaryProperties = {
+ callbackScope : this
+ };
+
+ this.bottomSelectHiddenFrame.mouseover(function() {
+ this.attr("cursor", "s-resize");
+ });
+ this.bottomSelectHiddenFrame.drag(
+ Symbol_stretchBottomClosure,
+ Symbol_stretchStartClosure,
+ Symbol_stretchStopClosure);
+ this.bottomSelectHiddenFrame.hide();
+
this.leftSelectFrame = m_canvasManager.drawPath(this
.getLeftSelectFramePath(), {
"stroke" : m_constants.DATA_FLOW_COLOR,
@@ -828,12 +930,6 @@ define(
callbackScope : this
};
- this.leftSelectFrame.mouseover(function() {
- this.attr("cursor", "w-resize");
- });
- this.leftSelectFrame.drag(Symbol_stretchLeftClosure,
- Symbol_stretchStartClosure,
- Symbol_stretchStopClosure);
this.leftSelectFrame.hide();
this.topSelectFrame = m_canvasManager.drawPath(this
@@ -846,12 +942,6 @@ define(
callbackScope : this
};
- this.topSelectFrame.mouseover(function() {
- this.attr("cursor", "n-resize");
- });
- this.topSelectFrame.drag(Symbol_stretchTopClosure,
- Symbol_stretchStartClosure,
- Symbol_stretchStopClosure);
this.topSelectFrame.hide();
this.rightSelectFrame = m_canvasManager.drawPath(this
@@ -864,12 +954,6 @@ define(
callbackScope : this
};
- this.rightSelectFrame.mouseover(function() {
- this.attr("cursor", "e-resize");
- });
- this.rightSelectFrame.drag(Symbol_stretchRightClosure,
- Symbol_stretchStartClosure,
- Symbol_stretchStopClosure);
this.rightSelectFrame.hide();
this.bottomSelectFrame = m_canvasManager.drawPath(this
@@ -882,12 +966,6 @@ define(
callbackScope : this
};
- this.bottomSelectFrame.mouseover(function() {
- this.attr("cursor", "s-resize");
- });
- this.bottomSelectFrame.drag(Symbol_stretchBottomClosure,
- Symbol_stretchStartClosure,
- Symbol_stretchStopClosure);
this.bottomSelectFrame.hide();
};
@@ -984,6 +1062,10 @@ define(
this.topSelectFrame.show();
this.rightSelectFrame.show();
this.bottomSelectFrame.show();
+ this.leftSelectHiddenFrame.show();
+ this.topSelectHiddenFrame.show();
+ this.rightSelectHiddenFrame.show();
+ this.bottomSelectHiddenFrame.show();
};
/**
@@ -994,6 +1076,10 @@ define(
this.topSelectFrame.hide();
this.rightSelectFrame.hide();
this.bottomSelectFrame.hide();
+ this.leftSelectHiddenFrame.hide();
+ this.topSelectHiddenFrame.hide();
+ this.rightSelectHiddenFrame.hide();
+ this.bottomSelectHiddenFrame.hide();
};
/**
@@ -1748,6 +1834,7 @@ define(
*
*/
Symbol.prototype.stretchStart = function() {
+ var scrollPos = m_modelerUtils.getModelerScrollPosition();
this.preDragSymbolState = {
x : this.x,
y : this.y,
@@ -1815,8 +1902,10 @@ define(
*
*/
Symbol.prototype.stretchLeft = function(dX, dY, x, y) {
- this.width += this.x - (x - this.diagram.X_OFFSET);
- this.x = x - this.diagram.X_OFFSET;
+ var scrollPos = m_modelerUtils.getModelerScrollPosition();
+ this.width += this.x - scrollPos.left
+ - (x - this.diagram.X_OFFSET);
+ this.x = x - this.diagram.X_OFFSET + scrollPos.left;
if (this.width < m_constants.SYMBOL_MIN_SIZE)
this.width = m_constants.SYMBOL_MIN_SIZE;
this.adjustGeometry();
@@ -1826,8 +1915,10 @@ define(
*
*/
Symbol.prototype.stretchTop = function(dX, dY, x, y) {
- this.height += this.y - (y - this.diagram.Y_OFFSET);
- this.y = y - this.diagram.Y_OFFSET;
+ var scrollPos = m_modelerUtils.getModelerScrollPosition();
+ this.height += this.y - (y - this.diagram.Y_OFFSET)
+ - scrollPos.top;
+ this.y = y + scrollPos.top - this.diagram.Y_OFFSET;
if (this.height < m_constants.SYMBOL_MIN_SIZE)
this.height = m_constants.SYMBOL_MIN_SIZE;
this.adjustGeometry();
@@ -1837,7 +1928,9 @@ define(
*
*/
Symbol.prototype.stretchRight = function(dX, dY, x, y) {
- this.width = x - this.diagram.X_OFFSET - this.x;
+ var scrollPos = m_modelerUtils.getModelerScrollPosition();
+ this.width = x - this.diagram.X_OFFSET - this.x
+ + scrollPos.left;
if (this.width < m_constants.SYMBOL_MIN_SIZE)
this.width = m_constants.SYMBOL_MIN_SIZE;
this.adjustGeometry();
@@ -1847,7 +1940,8 @@ define(
*
*/
Symbol.prototype.stretchBottom = function(dX, dY, x, y) {
- this.height += ((y - this.diagram.Y_OFFSET) - (this.y + this.height));
+ var scrollPos = m_modelerUtils.getModelerScrollPosition();
+ this.height += ((y + scrollPos.top - this.diagram.Y_OFFSET) - (this.y + this.height));
if (this.height < m_constants.SYMBOL_MIN_SIZE)
this.height = m_constants.SYMBOL_MIN_SIZE;
this.adjustGeometry();