Browse Source

Added feature to update unitGraphLocalPeriod in GUI automatically.

Ludwig Tietze 7 years ago
parent
commit
56f8d4d4a0
1 changed files with 13 additions and 4 deletions
  1. 13 4
      src/ui/view/GUI.java

+ 13 - 4
src/ui/view/GUI.java

@@ -1193,7 +1193,7 @@ public class GUI implements CategoryListener {
 							} else {
 								holonEleNamesDisplayed = ele.getEleName() + " ";
 							}
-							unitGraph.repaintWithNewElement(selectedElements);
+							repaintGraphAux(selectedElements);
 						}
 						updCon.getActualHolonElement(null, yValueElements, 2,
 								tables);
@@ -1205,7 +1205,7 @@ public class GUI implements CategoryListener {
 						updCon.getActualHolonElement(null, yValueElements, 1,
 								tables);
 						holonEleNamesDisplayed = ele.getEleName() + " ";
-						unitGraph.repaintWithNewElement(selectedElements);
+						repaintGraphAux(selectedElements);
 					}
 				} else {
 					elementGraph.setText(Languages.getLanguage()[25]);
@@ -1881,7 +1881,7 @@ public class GUI implements CategoryListener {
 				}
 				if (temp instanceof HolonSwitch) {
 					showScrollGraph();
-					unitGraph.repaintWithNewSwitch((HolonSwitch) temp);
+					repaintGraphAux((HolonSwitch)temp);
 					unitGraph.fillArrayofBooleans();
 				}
 				// Write new data in the PropertyTable
@@ -2570,7 +2570,7 @@ public class GUI implements CategoryListener {
 						openNewUpperNodeTab();
 					}
 					if (temp instanceof HolonSwitch) {
-						unitGraph.repaintWithNewSwitch((HolonSwitch) temp);
+						repaintGraphAux((HolonSwitch)temp);
 						unitGraph.fillArrayofBooleans();
 					}
 				}
@@ -2785,4 +2785,13 @@ public class GUI implements CategoryListener {
 			contentPane.requestFocus();
 		}
 	}
+	private void repaintGraphAux(ArrayList<HolonElement> o){//TODO: 
+		unitGraph.repaintWithNewElement((ArrayList<HolonElement>)o);
+		unitGraphLocalPeriod.setText(""+unitGraph.getLocalPeriod());
+	}
+	
+	private void repaintGraphAux(HolonSwitch o){//TODO: 
+		unitGraph.repaintWithNewSwitch(o);
+		unitGraphLocalPeriod.setText(""+unitGraph.getLocalPeriod());
+	}
 }