Procházet zdrojové kódy

Feedback on Mapping Edge creation, auto updating Metrics

Jan Enders před 7 roky
rodič
revize
886d8c8ece

+ 6 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/MappingGraphManager.java

@@ -10,6 +10,7 @@ import org.graphstream.graph.Node;
 
 import de.tu_darmstadt.informatik.tk.scopviz.debug.Debug;
 import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
+import de.tu_darmstadt.informatik.tk.scopviz.ui.MetricboxManager;
 
 /**
  * Class extending GraphManager. Offers the possibility to merge an underlay and
@@ -371,8 +372,11 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 			return false;
 
 		// check and update capacity
-		if (!addMapping(underlayNode, operatorNode))
+		if (!addMapping(underlayNode, operatorNode)){
+			Debug.out("Could not place Mapping Edge due to insufficient capacity!", 2);
 			return false;
+		}
+			
 
 		e = getGraph().addEdge(newID, operatorNode, underlayNode, true);
 		Debug.out("Created an directed edge with Id " + newID + " from " + operatorNode + " to " + underlayNode);
@@ -381,6 +385,7 @@ public class MappingGraphManager extends GraphManager implements EdgeCreatedList
 		e.addAttribute(ATTRIBUTE_KEY_MAPPING, true);
 
 		selectEdge(newID);
+		MetricboxManager.updateMetrics();
 		return true;
 	}