SolveResultMessageBox.java 957 B

12345678910111213141516171819202122232425
  1. package holeg.ui;
  2. import holeg.GridSolverResult;
  3. import javax.swing.*;
  4. public class SolveResultMessageBox {
  5. public static void show(GridSolverResult result) {
  6. switch(result) {
  7. case Error:
  8. default:
  9. JOptionPane.showMessageDialog(null,"Could not solve grid.","Error while solving.", JOptionPane.ERROR_MESSAGE);
  10. break;
  11. case PartialFailure:
  12. JOptionPane.showMessageDialog(null,"Could not solve some part of the grid.","Error while solving.", JOptionPane.ERROR_MESSAGE);
  13. break;
  14. case Solved:
  15. JOptionPane.showMessageDialog(null,"Successfully solved!","Success", JOptionPane.INFORMATION_MESSAGE);
  16. break;
  17. case Interrupted:
  18. JOptionPane.showMessageDialog(null,"Solver interrupted!","Interrupted while solving.", JOptionPane.WARNING_MESSAGE);
  19. break;
  20. }
  21. }
  22. }