Files
TpMazeJava/src/ui/DrawShortestPathMenuItem.java
T
regar42 c0afbe104c Add menu button to draw the shortest path
ui:
* Add methods to draw the shortest path from MazeApp, WindowPanel and
  MazeDrawing
* Add a Maze menu with a button to draw the shortest path from departure
  to arrival
2017-12-24 20:20:40 +01:00

26 lines
492 B
Java

package ui;
import javax.swing.JMenuItem;
import model.MazeAppModel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class DrawShortestPathMenuItem extends JMenuItem
implements ActionListener {
private final MazeApp mazeApp;
public DrawShortestPathMenuItem(MazeApp mazeApp) {
super("Draw shortest path");
this.mazeApp = mazeApp;
addActionListener(this);
}
public void actionPerformed(ActionEvent evt) {
mazeApp.drawShortestPath();
}
}