incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject svn commit: r956021 - in /incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat: ./ elements/
Date Fri, 18 Jun 2010 15:13:31 GMT
Author: zoe
Date: Fri Jun 18 15:13:31 2010
New Revision: 956021

URL: http://svn.apache.org/viewvc?rev=956021&view=rev
Log:
ARIES-319 Steps towards fixing the provider switch - still more to do

Modified:
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Component.js
    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/Relationship.js
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/RelationshipManager.js
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ServerSideInterface.js
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TwistieAggregation.js

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Component.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Component.js?rev=956021&r1=956020&r2=956021&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Component.js (original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Component.js Fri
Jun 18 15:13:31 2010
@@ -163,8 +163,21 @@ updateProperties : function(props) {
 	// console.log("Properties processed.");
 },
 removeSelf : function() {
-	this.surface.remove(this.group);
+	//Remove this component and all the relationship elements attached to it.
+	//This one is subscribed to by RelationshipElement
+	dojo.publish("goat.component.delete." + this.id, [ this ]);
+
+	//This one is subscribed to by ComponentStatusGrid
 	dojo.publish("goat.component.delete", [ this ]);
+
+	this.surface.remove(this.group);
+	//Now we remove all other the elements
+	for (var type in this.elements) {
+		this.elements[type].remove();
+		delete this.elements[type];
+	}
+	this.relationshipManager.removeSelf();
+	delete this.RelationshipManager;
 },
 initGfx : function() {
 	this.group = this.surface.createGroup();

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=956021&r1=956020&r2=956021&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
Fri Jun 18 15:13:31 2010
@@ -31,7 +31,7 @@ constructor : function(owningComponent) 
 	this.owningComponent = owningComponent;
 },
 doLayout: function(){	
-    console.log(">doLayout");
+    //console.log(">doLayout");
     //console.log(this.owningComponent.elements);
     
 	if(this.layoutElements!=null){
@@ -115,7 +115,7 @@ doLayout: function(){	
 		.setStroke({width:1, color: '#808080'});
 	},this);
 	
-	console.log("<doLayout");
+	//console.log("<doLayout");
 	
 }
 

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Relationship.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Relationship.js?rev=956021&r1=956020&r2=956021&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Relationship.js
(original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/Relationship.js
Fri Jun 18 15:13:31 2010
@@ -76,7 +76,7 @@ activate : function(){
 		
 		var r = new goat.elements.RelationshipElement(surface, this.sscRelationship.name, this.sscRelationship.type,
components[this.sscRelationship.providedBy.id],components[component.id] );
 
-		console.log("type is " + this.sscRelationship.type);
+		//console.log("type is " + this.sscRelationship.type);
 		//Add a service decorator if it is a service relationship
 		if (this.sscRelationship.type == "serviceExport") {
 			r.addDecorator(new goat.elements.TriangleDecorator(this.theme,surface));

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/RelationshipManager.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/RelationshipManager.js?rev=956021&r1=956020&r2=956021&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/RelationshipManager.js
(original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/RelationshipManager.js
Fri Jun 18 15:13:31 2010
@@ -34,8 +34,8 @@ constructor : function(/*goat.Component*
 	this.owningComponent = owningComponent;
 	this.relationships = new Array();
 	
-	dojo.subscribe("goat.relationship.create."+owningComponent.id, this, this.registerRelationship);
-	dojo.subscribe("goat.relationship.remove."+owningComponent.id, this, this.removeRelationship);
+	this.createSub = dojo.subscribe("goat.relationship.create."+owningComponent.id, this, this.registerRelationship);
+	this.removeSub = dojo.subscribe("goat.relationship.remove."+owningComponent.id, this, this.removeRelationship);
 },
 registerRelationship: function(/*goat.elements.RelationshipElement*/relationship){	
 	//console.log(">registerRelationship");
@@ -56,7 +56,7 @@ registerRelationship: function(/*goat.el
 	//console.log("<registerRelationship");
 },
 removeRelationship: function(/*goat.elements.RelationshipElement*/relationship){
-	//console.log("Relationship Manager for "+this.owningComponent.id+" handling removal for
relationship..");
+	//console.log("Z: RelationshipManager "+this.owningComponent.id+" handling removal for relationship..");
 	//console.log(relationship);
 	
 	var aggregator = this.relationships[relationship.type];
@@ -82,7 +82,7 @@ removeRelationship: function(/*goat.elem
 			delete this.owningComponent.elements["relationship.aggregation."+relationship.type];
 		}
 
-	    //console.log("Forgetting about the aggregator");
+	    //console.log("Z: Realtionship manager: Forgetting about the aggregator");
 		delete this.relationships[relationship.type];
 	}
 },

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ServerSideInterface.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ServerSideInterface.js?rev=956021&r1=956020&r2=956021&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ServerSideInterface.js
(original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ServerSideInterface.js
Fri Jun 18 15:13:31 2010
@@ -21,20 +21,9 @@
 function forgetAboutEverything(){
 	console.log("forgetting about everything.. ");
 
-	for (var relationshipNumber in relationships) {
-        var relationship = relationships[relationshipNumber];
-	
-		if(relationship!=null){
-			console.log("removing relationship "+relationship.getKey());
-			delete relationship;
-		}
-	}
-	relationships = new Array();
 
 	for (var componentNumber in components) {
     var component = components[componentNumber];
-		console.log("Component here?");
-		console.log(component);
 		if(component!=null){
 			console.log("invoking removeself on "+component.id);
 			component.removeSelf();
@@ -44,6 +33,15 @@ function forgetAboutEverything(){
 	components = new Array();
 	
 
+	for (var relationshipNumber in relationships) {
+        var relationship = relationships[relationshipNumber];
+	
+		if(relationship!=null){
+			console.log("removing relationship "+relationship.getKey());
+			delete relationship;
+		}
+	}
+	relationships = new Array();
 	console.log("making sure absolutely..");
 	initialLayout.reset();
 }

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=956021&r1=956020&r2=956021&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
Fri Jun 18 15:13:31 2010
@@ -86,6 +86,9 @@ constructor: function(surface, name, typ
     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));
     
+    // When a component is deleted remove myself 
+    this.subs.push(dojo.subscribe("goat.component.delete."+fromComponent.id, this, this.removeSelf));
+    this.subs.push(dojo.subscribe("goat.component.delete."+toComponent.id, this, this.removeSelf));
 	
 	this.decorators = new Array();
 	
@@ -155,18 +158,18 @@ updateLine: function(){
 	
 },
 removeSelf: function(){
-	//console.log("Line from "+this.fromComponent.id+" to "+this.toComponent.id+" being removed");
+	console.log("Z: Line from "+this.fromComponent.id+" to "+this.toComponent.id+" being removed");
     //console.log(this);
 	if(!this.removed){
 		this.removed = true;
 		
-		//console.log("Line from "+this.fromComponent.id+" to "+this.toComponent.id+" being removed
from surface");
+		//console.log("Z: Line from "+this.fromComponent.id+" to "+this.toComponent.id+" being
removed from surface");
         //console.log(this);
         if(this.line!=null) {
             this.surface.remove(this.line);
         }
 
-        //console.log("Removing decorators..");
+        //console.log("Z: Removing decorators..");
 		dojo.forEach(this.decorators, function(decorator){
             //console.log("Asking...");
             //console.log(decorator);
@@ -184,8 +187,18 @@ removeSelf: function(){
 		});
 		
 		this.subs = new Array();
-		
-		dojo.publish("goat.relationship.remove."+this.fromComponent.id,[this]);
+
+		if(this.fromComponent.id != this.toComponent.id) {		
+			//console.log("Z:RelationshipElement -  publishing to this that I'm gone", this.fromComponent.id);
+			dojo.publish("goat.relationship.remove."+this.fromComponent.id,[this]);
+
+			//console.log("Z:RelationshipElement -  publishing to this that I'm gone", this.toComponent.id);
+			dojo.publish("goat.relationship.remove."+this.toComponent.id,[this]);
+		} else {
+			console.log("Z:RelationshipElement -  publishing to this that I'm gone", this.toComponent.id);
+        	dojo.publish("goat.relationship.remove."+this.toComponent.id,[this]);
+        }
+
 	}else{
 		console.log("Line from "+this.fromComponent.id+" to "+this.toComponent.id+" already marked
as deleted");
 	}

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TwistieAggregation.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TwistieAggregation.js?rev=956021&r1=956020&r2=956021&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TwistieAggregation.js
(original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/TwistieAggregation.js
Fri Jun 18 15:13:31 2010
@@ -89,15 +89,17 @@ dojo.declare("goat.elements.TwistieAggre
 			this.component.group.remove(this.group);
 			dojo.unsubscribe(this.addsub);
 			dojo.unsubscribe(this.removesub);
+
 		},		
 		onAdd: function(/*RelationshipElement[]*/args){
-			console.log("Aggregation Element notified of Relationship being added");
+		//console.log("I think I'm adding to this object ", this.component);
+			//console.log("Aggregation Element notified of Relationship being added");
 			//console.log(args[0]);
 			this.buildTwistie();
 			//notify parent we have altered our size.. 
 		}, 
 		onRemove: function(/*RelationshipElement[]*/args){
-			console.log("Aggregation Element notified of Relationship being removed");
+			//console.log("Aggregation Element notified of Relationship being removed");
 			//console.log(args[0]);
 			this.buildTwistie();
 			//notify parent we have altered our size.. 
@@ -105,7 +107,7 @@ dojo.declare("goat.elements.TwistieAggre
 		buildTwistie: function(){
 			//flush the old twistie.. if we had one!
 			if(this.group!=null){
-				console.log("Flushing old twistie");
+				//console.log("Flushing old twistie");
 				this.component.group.remove(this.group);
 				this.group=this.component.group.createGroup();
 			}
@@ -130,7 +132,7 @@ dojo.declare("goat.elements.TwistieAggre
 			var twistieName = this.type.substring("relationship.aggregation.".length, this.type.length);
 			this.twistie = new goat.TwistieSection(twistieName, this.group, this.component, this.x,
this.y, getItemsCallBack);
 			
-			console.log("requesting component refresh as rebuilt twistie may not have same dimensions");
+			//console.log("requesting component refresh as rebuilt twistie may not have same dimensions");
 			this.component.refresh();
 		}		
 });



Mime
View raw message