Commit Graph
25 Commits
Author SHA1 Message Date
regar42 11200ebed2 Fix repainting when the path is drawn
ui:
* Fix repainting when the path is supposed to be drawn. At any
  repainting (window resizing, menu unfolding), the maze was repainted
  without the shortest path. We now use the attribute stored in the
  model to know whether the path should be drawn or not when we repaint
  the panel (see #24)
2017-12-26 22:16:40 +01:00
regar42 7242872b83 Add a button to clear path
model:
* Add an attribute to MazeAppModel to keep track of if the path is drawn
  or not. For future use to enable/disable the Clear button depending on
  if the path is drawn or not

ui:
* Add a "Clear shortest path" button to the Maze menu
* Add a method to clear the path in MazeApp (just trigger a repainting
  of the MazeApp, which erase the path, since its not drawn by default)
  and update MazeAppModel accordingly
2017-12-24 21:27:20 +01:00
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
regar42 1e934b05e6 Fix paintShortestPath and move it into MazeDrawing
model:
* Add getShortest() to MazeAppModel, which returns the list of vertexes
  on the shortest path from departure to arrival
ui:
* Move paintShortestPath from MazeApp to MazeDrawing
* Fix a bug in paintShortestPath where a switch between width and height
  caused ellipses to be mislocated (probably still the same confusion
  between the x and y axes)
2017-12-24 19:09:14 +01:00
regar42 b5eb6b0b8c Move paintShortestPath from model to ui 2017-12-23 22:31:56 +01:00
antograb 9f56d3082a Add paintShortestPath to MazeAppModel 2017-12-21 09:38:31 +01:00
antograb 16df6a26c6 Fix exception when exiting showDialog 2017-12-21 09:03:55 +01:00
antograb 3cdf425435 Add load maze 2017-12-20 21:05:56 +01:00
regar42 987fb858e4 Use proper dialog type for the "Save Maze" button
Instead of using showOpenDialog(), use showSaveDialog()
2017-12-20 01:18:37 +01:00
regar42 53ee6f1565 Add a button to save the maze from the ui 2017-12-19 23:30:12 +01:00
antograb 213071d3c2 Fix indexes confusion 2017-12-18 16:32:47 +01:00
antograb d9b52c35e2 [WIP] Load maze 2017-12-18 11:47:55 +01:00
antograb 9aa134eb77 Accidentally forgot to save file 2017-12-17 20:30:35 +01:00
antograb 7d5b2938fc Add loading options in JMenuBar
Need to fix bug when loading new maze
with different dimensions
2017-12-17 20:27:55 +01:00
regar42 79ed877d9d Merge branch 'boxTypeEdition' into mvc and cleanup
* Merge branch 'boxTypeEdition' into mvc
* Remove some useless spaces and blank lines
2017-12-16 20:40:27 +01:00
regar42 083962eec5 Merge branch 'menuBar' into mvc 2017-12-16 18:03:56 +01:00
regar42 bac9b54d58 Fixing lines and spaces and restoring labyOutput 2017-12-16 17:41:02 +01:00
antograb a5d0df4b96 Modified LoadMenuItem 2017-12-16 16:21:57 +01:00
antograb a6783e4a0d Add LoadMazeMenuItem (not finished) 2017-12-16 15:47:16 +01:00
antograb d8acf6ebe8 Add ActionListener for QuitMenuItem 2017-12-16 15:15:39 +01:00
antograb f8623fdd7a Add Observer and Observable implementation
Add update method, notifyForUpdates methods
Currently not working
2017-12-16 14:51:39 +01:00
regar42 40c05909e6 Add orange borders to the printed boxes 2017-12-16 13:15:25 +01:00
antograb 892d7e6ff3 Add maze in Model, then modify UI methods using maze. 2017-12-14 09:54:46 +01:00
antograb 94f4ab4e5a Add grid layout for the maze
Still have to add the maze to MazeAppModel and delete reference in ui
classes
2017-12-13 10:11:20 +01:00
antograb 0e398a7b57 Add UI package and JMenuBar 2017-12-11 11:42:01 +01:00