Add editing functionalities
This commit is contained in:
1 parent
81df80e7ea
commit
286023c5d8
9 files changed
+298
-16
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package ui;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
public class ClearMazeMenuItem extends JMenuItem
|
||||
implements ActionListener {
|
||||
|
||||
private final MazeApp mazeApp;
|
||||
|
||||
public ClearMazeMenuItem(MazeApp mazeApp) {
|
||||
|
||||
super("Clear maze");
|
||||
this.mazeApp = mazeApp;
|
||||
this.setAccelerator(KeyStroke.getKeyStroke("control D"));
|
||||
addActionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
int numberOfLines = mazeApp.getMazeAppModel()
|
||||
.getMaze().getDimensionY();
|
||||
int numberOfRows = mazeApp.getMazeAppModel()
|
||||
.getMaze().getDimensionX();
|
||||
this.mazeApp.getMazeAppModel()
|
||||
.newClearMaze(numberOfLines, numberOfRows);
|
||||
System.out.println("test");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user