Преглед изворни кода

Merge branch 'Ohne_Drag_and_Drop' of https://git.tk.informatik.tu-darmstadt.de/carlos.garcia/praktikum-holons.git into Ohne_Drag_and_Drop

Kevin Trometer пре 8 година
родитељ
комит
81175f3743
2 измењених фајлова са 8 додато и 3 уклоњено
  1. 7 3
      src/ui/view/GUI.java
  2. 1 0
      src/ui/view/MyCanvas.java

+ 7 - 3
src/ui/view/GUI.java

@@ -434,7 +434,8 @@ public class GUI implements CategoryListener {
 			@Override
 			public void mousePressed(MouseEvent e) {
 
-				// Update of the Information about the HolonElements
+				// Update of the Information about the HolonElements - only for
+				// HolonObjects
 				if (tableModelHolonElement.getRowCount() > 0) {
 					for (int i = tableModelHolonElement.getRowCount() - 1; i > -1; i--) {
 						tableModelHolonElement.removeRow(i);
@@ -447,13 +448,16 @@ public class GUI implements CategoryListener {
 					}
 				}
 
-				// Update of the Information about the Properties
+				// Update of the Information about the Properties - only for
+				// CpsObjects
+				// Erase old data
 				if (tableModelProperties.getRowCount() > 0) {
 					for (int i = tableModelProperties.getRowCount() - 1; i > -1; i--) {
 						tableModelProperties.removeRow(i);
 					}
 				}
-				if (canvas.dataSelected != null) {
+				// Write new data
+				if (canvas.tempCps != null) {
 					Object[] tempName = { "Name", canvas.tempCps.getName() };
 					tableModelProperties.addRow(tempName);
 					Object[] tempId = { "ID", canvas.tempCps.getID() };

+ 1 - 0
src/ui/view/MyCanvas.java

@@ -29,6 +29,7 @@ import classes.CpsObject;
 import classes.HolonElement;
 import classes.HolonObject;
 import classes.HolonSwitch;
+import classes.HolonTransformer;
 import javafx.util.Pair;
 import ui.controller.Control;
 import ui.model.*;