try to handle resolution of alternate path

=> to check SOLVED, might be set SOVLED while not fully tested.
This commit is contained in:
philippe lhardy
2017-12-02 21:54:51 +01:00
parent 52d244c758
commit b5d27ed694
2 changed files with 107 additions and 20 deletions

View File

@@ -115,6 +115,7 @@ public class Display extends JFrame
maze.resetWallsProvider(model);
model.setMazeListener(maze);
model.reset();
// we are in GUI event thread, need to release it and do it outside.
new Thread() {
@@ -151,6 +152,7 @@ public class Display extends JFrame
void resolve()
{
model.reset();
model.resolve(model.getWidth() - 1, model.getHeight() - 1, maze);
}
@@ -446,6 +448,16 @@ public class Display extends JFrame
}
};
savePngButton.addActionListener(savePngAction);
final JButton saveButton = new JButton(labels.getString("save") +" raw");
Action saveAction = new AbstractAction() {
public void actionPerformed(ActionEvent evt)
{
//
System.out.println("save");
save((MazeParamsFixed) params,model);
}
};
saveButton.addActionListener(saveAction);
final JButton quitButton = new JButton(labels.getString("quit"));
Action quitAction = new AbstractAction() {
@@ -462,6 +474,7 @@ public class Display extends JFrame
resizecontrol.add(slider);
resizecontrol.add(autoSlide);
resizecontrol.add(savePngButton);
resizecontrol.add(saveButton);
resizecontrol.add(quitButton);
add(controlDisplayPanel, BorderLayout.SOUTH);
@@ -1076,6 +1089,7 @@ public class Display extends JFrame
}
}
public static void main(String pArgs[])
{
LabyModel model = null;