Interface PuzzleView

All Known Implementing Classes:
PuzzleApplet, PuzzleGui

public interface PuzzleView

The basic interface for a generic view of a PuzzleModel. Adding other methods here will force views to implement the methods


Method Summary
 void setEnabledUndo(boolean value)
          Enable/disable the undo move command.
 void showGrid(int[] list)
          Show a grid/board, where list is the values between 0 and size*size-1 representing locations of square-elements.
 void showText(java.lang.String text)
          Shows text in some view-specific way, e.g., in a textfield for information.
 

Method Detail

showText

public void showText(java.lang.String text)
Shows text in some view-specific way, e.g., in a textfield for information.

Parameters:
text - is the text to display

setEnabledUndo

public void setEnabledUndo(boolean value)
Enable/disable the undo move command. The controller should enable undo when undos are possible and disable undo when no moves have been made that are undoable

Parameters:
value - determines whether undo is enabled(true) or disabled (false)

showGrid

public void showGrid(int[] list)
Show a grid/board, where list is the values between 0 and size*size-1 representing locations of square-elements. If list[3] = 7 then square 7 is in location 3 (zero/first row, column 3 if there are more than 3 elements per side.

Parameters:
list - is the elements to be shown