jascha Bohne 7 years ago
parent
commit
1cdd4d1f50

+ 7 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphManager.java

@@ -202,6 +202,13 @@ public class GraphManager {
 		deletedNode = null;
 	}
 
+	/**
+	 * @return the activeSubGraph
+	 */
+	public MyGraph getActiveSubGraph() {
+		return activeSubGraph;
+	}
+
 	/**
 	 * returns a View of the Graph. The View lives in the Swing Thread and the
 	 * Graph in the Main thread.

+ 4 - 0
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/PropertiesManager.java

@@ -118,6 +118,7 @@ public final class PropertiesManager {
 		itemVisibilityRules.put("ui.clicked", -1);
 		itemVisibilityRules.put("ui.map.selected", -1);
 		itemVisibilityRules.put("xyz", -1);
+		itemVisibilityRules.put("ui.pie-values", -1);
 
 		// properties, which shall be filtered out of the properties window ,
 		// only if debug is disabled
@@ -296,6 +297,9 @@ public final class PropertiesManager {
 		temp = selected.getAttributeKeySet().toArray(temp);
 		for (int i = 0; i < temp.length; i++) {
 			String key = temp[i];
+			if(key.startsWith("org.graphstream")){
+				continue;
+			}
 			switch (key) {
 			// filter out or change attributes added by graphstream that are of
 			// no use to the user

+ 12 - 5
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/ToolboxManager.java

@@ -295,7 +295,7 @@ public final class ToolboxManager {
 	 *
 	 */
 	public static class PairKeyFactory
-			implements Callback<TableColumn.CellDataFeatures<Pair<Object, String>, String>, ObservableValue<String>> {
+	implements Callback<TableColumn.CellDataFeatures<Pair<Object, String>, String>, ObservableValue<String>> {
 		@Override
 		public ObservableValue<String> call(TableColumn.CellDataFeatures<Pair<Object, String>, String> data) {
 			return new ReadOnlyObjectWrapper<>(data.getValue().getValue());
@@ -307,7 +307,7 @@ public final class ToolboxManager {
 	 *
 	 */
 	public static class PairValueFactory
-			implements Callback<TableColumn.CellDataFeatures<Pair<Object, String>, Object>, ObservableValue<Object>> {
+	implements Callback<TableColumn.CellDataFeatures<Pair<Object, String>, Object>, ObservableValue<Object>> {
 		@SuppressWarnings("unchecked")
 		@Override
 		public ObservableValue<Object> call(TableColumn.CellDataFeatures<Pair<Object, String>, Object> data) {
@@ -390,11 +390,18 @@ public final class ToolboxManager {
 			TextInputDialog weightDialog = new TextInputDialog(Double.toString(OptionsManager.getDefaultWeight()));
 			weightDialog.setTitle("needed Processing power");
 			weightDialog.setHeaderText("Please enter the amount of processing power the node needs");
-			weightDialog.setContentText("neede Power");
+			weightDialog.setContentText("needed Power");
 			Optional<String> result = weightDialog.showAndWait();
 			org.graphstream.graph.Node actualNode = Main.getInstance().getGraphManager().getGraph().getNode(n.getId());
-			if (result.isPresent()) {
-				actualNode.addAttribute("process-need", Double.parseDouble(result.get()));
+			if(actualNode == null){
+				actualNode = Main.getInstance().getGraphManager().getGraph().getNode(Main.getInstance().getGraphManager().getActiveSubGraph().getId() + n.getId());
+			}
+			if (result.isPresent() && actualNode!= null) {
+				try  {
+					actualNode.addAttribute("process-need", Double.parseDouble(result.get()));
+				} catch (Exception e){
+					actualNode.addAttribute("process-need", 0.0);
+				}
 				GraphHelper.propagateAttribute(Main.getInstance().getGraphManager().getGraph(), actualNode,
 						"process-need", Double.parseDouble(result.get()));
 			}