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
26 lines
493 B
Java
26 lines
493 B
Java
package ui;
|
|
|
|
import javax.swing.*;
|
|
import maze.Maze;
|
|
import java.awt.*;
|
|
|
|
public class WindowPanel extends JPanel
|
|
{
|
|
private final MazeDrawing drawingPanelGrid;
|
|
|
|
public WindowPanel(MazeApp mazeApp) {
|
|
|
|
setLayout(new BorderLayout());
|
|
|
|
add(drawingPanelGrid = new MazeDrawing(mazeApp), BorderLayout.CENTER);
|
|
}
|
|
|
|
public void notifyForUpdates(Object param) {
|
|
drawingPanelGrid.notifyForUpdates(param);
|
|
}
|
|
|
|
public void paintShortestPath() {
|
|
drawingPanelGrid.paintShortestPath();
|
|
}
|
|
}
|