src/main/java/de/uapcore/sudoku/Sudoku.java

Wed, 26 Aug 2020 19:09:07 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 26 Aug 2020 19:09:07 +0200
changeset 25
569220009c54
parent 18
530f60fa3dc9
permissions
-rw-r--r--

fixes wrong call of assertEquals()

     1 /*
     2  * Copyright 2013 Mike Becker. All rights reserved.
     3  * 
     4  * Redistribution and use in source and binary forms, with or without
     5  * modification, are permitted provided that the following conditions are met:
     6  * 
     7  * 1. Redistributions of source code must retain the above copyright
     8  *    notice, this list of conditions and the following disclaimer.
     9  * 
    10  * 2. Redistributions in binary form must reproduce the above copyright
    11  *    notice, this list of conditions and the following disclaimer in the
    12  *    documentation and/or other materials provided with the distribution.
    13  * 
    14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    17  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    18  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    24  * POSSIBILITY OF SUCH DAMAGE.
    25  */
    27 package de.uapcore.sudoku;
    29 import javax.swing.*;
    30 import java.awt.*;
    32 /**
    33  * Main class of the application.
    34  */
    35 public final class Sudoku extends JFrame {
    37     /**
    38      * Constructs the Sudoku main window.
    39      */
    40     public Sudoku() {
    41         super("Sudoku");
    43         Field f = new Field();
    44         ActionHandler h = new ActionHandler(f);
    45         setJMenuBar(new MainMenu(h));
    47         Container content = getContentPane();
    49         content.setLayout(new GridBagLayout());
    50         GridBagConstraints c = new GridBagConstraints();
    51         c.insets = new Insets(20, 20, 20, 20);
    52         c.fill = GridBagConstraints.HORIZONTAL;
    54         c.gridx = 0; c.gridy = 0;
    55         content.add(f, c);
    56         c.gridy++;
    57         content.add(new ButtonPanel(h), c);
    59         pack();
    60         content.setBackground(Color.WHITE);
    61         setLocationByPlatform(true);
    62         setDefaultCloseOperation(EXIT_ON_CLOSE);
    63         setMinimumSize(getSize());
    64     }
    66     /**
    67      * Main method starting the Sudoku solver.
    68      *
    69      * @param args the command line arguments
    70      */
    71     public static void main(String[] args) {
    72         new Sudoku().setVisible(true);
    73     }
    74 }

mercurial