|
@@ -130,7 +130,7 @@ public class VisualisationInteractor implements MouseInputListener,
|
|
// Delete the clicked object
|
|
// Delete the clicked object
|
|
controller.deleteSmartDevice(clicked);
|
|
controller.deleteSmartDevice(clicked);
|
|
clicked = null;
|
|
clicked = null;
|
|
- panel.repaint();
|
|
|
|
|
|
+ controller.notifyObservers();
|
|
});
|
|
});
|
|
|
|
|
|
rightClickMenu.add(itemDelete);
|
|
rightClickMenu.add(itemDelete);
|
|
@@ -181,8 +181,9 @@ public class VisualisationInteractor implements MouseInputListener,
|
|
for (Packet p : c.getTerminationPackages(1000))
|
|
for (Packet p : c.getTerminationPackages(1000))
|
|
System.out.println(p.toString());
|
|
System.out.println(p.toString());
|
|
});
|
|
});
|
|
- model.getConnections().removeAll(terminated);
|
|
|
|
- panel.repaint();
|
|
|
|
|
|
+ if(model.getConnections().removeAll(terminated))
|
|
|
|
+ controller.notifyObservers();
|
|
|
|
+
|
|
});
|
|
});
|
|
rightClickMenu.add(itemDebug);
|
|
rightClickMenu.add(itemDebug);
|
|
|
|
|
|
@@ -327,8 +328,8 @@ public class VisualisationInteractor implements MouseInputListener,
|
|
&& (dragged.getX() != dragged_x || dragged.getY() != dragged_y)) {
|
|
&& (dragged.getX() != dragged_x || dragged.getY() != dragged_y)) {
|
|
control.moveSmartDevice(dragged, dragged_x, dragged_y,
|
|
control.moveSmartDevice(dragged, dragged_x, dragged_y,
|
|
dragged.getZ());
|
|
dragged.getZ());
|
|
- panel.repaint();
|
|
|
|
dragged = null;
|
|
dragged = null;
|
|
|
|
+ model.notifyObservers();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -366,7 +367,7 @@ public class VisualisationInteractor implements MouseInputListener,
|
|
} else {
|
|
} else {
|
|
connectionFrom = null;
|
|
connectionFrom = null;
|
|
}
|
|
}
|
|
- panel.repaint();
|
|
|
|
|
|
+ control.notifyObservers();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|