public void actionPerformed(ActionEvent e) {

		if (e.getSource() == buttonPlay) {
			wait = !wait;
		}
		else if (e.getSource() == buttonPrev) {
			wait = true;
			view.controller().prev();
			view.flush();
			repaint();
		}
		else if (e.getSource() == buttonNext) {
			wait = true;
			view.controller().next();
			view.flush();
			repaint();
		}
		else if (e.getSource() == buttonReset) {
			wait = true;
			while(view.controller().hasPrev()) {
				view.controller().prev();
			}
			view.flush();
			repaint();
		}
		else if (e.getSource() == buttonKey) {
			panel.toggleKey();
		}
	}