Browse Source

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

Teh-Hai Julian Zheng 7 years ago
parent
commit
0560f5d6be
2 changed files with 2 additions and 2 deletions
  1. 1 0
      src/ui/view/GUI.java
  2. 1 2
      src/ui/view/MyCanvas.java

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

@@ -358,6 +358,7 @@ public class GUI implements CategoryListener {
 						tableModel.addRow(temp);
 					}
 				}
+				table.clearSelection();
 			}
 		});
 

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

@@ -160,6 +160,7 @@ class MyCanvas extends JPanel implements MouseListener, MouseMotionListener {
 	@Override
 	public void mousePressed(MouseEvent e) {
 		tempCps = null;
+		dataSelected = null;
 		// Object Selection
 		for (CpsObject cps : model.getObjectsOnCanvas()) {
 			cx = cps.getPosition().x;
@@ -175,8 +176,6 @@ class MyCanvas extends JPanel implements MouseListener, MouseMotionListener {
 				if (tempCps.getClass() == HolonObject.class) {
 					HolonObject tempObj = ((HolonObject) tempCps);
 					dataSelected = tempObj.getElements();
-				} else {
-					dataSelected = new ArrayList<>();
 				}
 			}
 		}