Sfoglia il codice sorgente

reset the simulation, when the slider is dragged

Kevin Trometer 7 anni fa
parent
commit
ca1389b3df
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      src/ui/view/TimePanel.java

+ 7 - 0
src/ui/view/TimePanel.java

@@ -104,6 +104,13 @@ public class TimePanel extends JPanel {
 				controller.resetSimulation();
 			}
 		});
+		
+		timeSlider.addMouseMotionListener(new MouseAdapter() {
+			@Override
+			public void mouseDragged(MouseEvent e) {
+				controller.resetSimulation();
+			}
+		});
 
 		// Panel
 		timeBtnPanel.setBorder(null);