* @param sudoku
* The sudoku which will be solved.
*/
public GUI(Sudoku sudoku) {
// Get the main monitor
Monitor monitor = display.getPrimaryMonitor();
ImageLoader loader = new ImageLoader();
ImageData data = loader.load("images/Logo.png")[0];
Image image = new Image(display, data);
shell.setImage(image);
// Customize the shell
GridLayout layout = noMarginGridLayout(1, true, 16);
shell.setLayout(layout);
// Add the sudoku composite.
getMenu(shell);
getSudokuComposite(shell);
getControlComposite(shell);
// Set the sudoku
setSudoku(sudoku);
// Make the shell as small as possible.
shell.pack();
shell.setMinimumSize(shell.getSize());
// Monitor dimension
Rectangle mSize = monitor.getBounds();
Rectangle sSize = shell.getBounds();
// Set the location
shell.setLocation(mSize.x + (mSize.width - sSize.width) / 2, mSize.y
+ (mSize.height - sSize.height) / 2);