浏览代码

reset the simulation, when the slider is dragged

Kevin Trometer 7 年之前
父节点
当前提交
ca1389b3df
共有 1 个文件被更改,包括 7 次插入0 次删除
  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);