You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2010/06/12 21:59:05 UTC

svn commit: r954132 - in /incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat: ElementLayoutManager.js elements/RelationshipElement.js

Author: zoe
Date: Sat Jun 12 19:59:05 2010
New Revision: 954132

URL: http://svn.apache.org/viewvc?rev=954132&view=rev
Log:
ARIES-319 Fixing the problem of additional lines appearing when components re-size

Modified:
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ElementLayoutManager.js
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ElementLayoutManager.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ElementLayoutManager.js?rev=954132&r1=954131&r2=954132&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ElementLayoutManager.js (original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ElementLayoutManager.js Sat Jun 12 19:59:05 2010
@@ -101,6 +101,10 @@ doLayout: function(){	
 	//console.log("Adjusting overall component dimensions");	
 	this.owningComponent.width=maxWidth;
 	this.owningComponent.height = currentYPos+yMargin;
+
+	//Publish the fact that component has resized so that relationship elements can re-draw
+    dojo.publish("goat.component.resize."+this.owningComponent.id, [this.owningComponent]);
+
 	
 	//now we know the width.. we can add our markup..
 	dojo.forEach(sepYPos, function(ypos){

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js?rev=954132&r1=954131&r2=954132&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js (original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js Sat Jun 12 19:59:05 2010
@@ -81,6 +81,11 @@ constructor: function(surface, name, typ
 	this.subs.push(dojo.subscribe("goat.component.hidden."+toComponent.id, this, this.onComponentHidden));
 	this.subs.push(dojo.subscribe("goat.component.onclick."+toComponent.id, this, this.onComponentClick));
 	this.subs.push(dojo.subscribe("goat.component.onclick."+fromComponent.id, this, this.onComponentClick));
+
+    // When a component is resized teh relationship line needs to eb re-drawn.
+    this.subs.push(dojo.subscribe("goat.component.resize."+fromComponent.id, this, this.onComponentResize));
+    this.subs.push(dojo.subscribe("goat.component.resize."+toComponent.id, this, this.onComponentResize));
+    
 	
 	this.decorators = new Array();
 	
@@ -207,6 +212,9 @@ getKey: function(){
 onComponentMove: function(component){
 	this.updateLine();
 },
+onComponentResize: function(component){
+	this.updateLine();
+},
 onComponentHidden: function(component){
 	this.updateVisibility();
 },