New editor

From Sokoban Wiki

Jump to: navigation, search

This task is: program a new editor for JSoko.
Currently the editor of JSoko is a quick and dirty (and very simple) editor for editing a level.
The editor should be a new JPanel or JDialog having its own GUI and event handling. You can use extend the class BoardDisplay (package sokoban.gui) for display the level. The editor should support: undo/redo, transforming a level (rotation, flipping) [you may use the class Transformation (package sokoban.gui) for doing this)], drawing a rectangle with the mouse and all of the elements in this rectangle can be moved with drag&drop, ...


It must be possible:

  • to cancel the editor changes
  • to start editing a completely new level
  • edit an existing level (can be passed to the editor as instance of the class Level (package sokoban.leveldata).

If an existing level is passed to the editor for editing it the editor should work on a copy of that level and after the changes have been confirmed by the user the old level is exchanged by the new level. If possible solutions of the old solutions should be kept for the new level.

You can have a look at the current editor of JSoko. Take a look what happens if you select a element (for instance a wall) and drag this element on the displayed level -> the mouse is repositioned so this is a fluent drag. The new editor should also have this feature.
Furthermore the current editor checks whether the player can leave the level and other things.

Personal tools