package dev.kske.chess.ui;
import java.awt.Font;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiConsumer;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
/**
* Project: Chess
* File: GameConfigurationDialog.java
* Created: 24.07.2019
* Author: Kai S. K. Engelbart
*/
public class GameConfigurationDialog {
private GameConfigurationDialog() {}
public static void show(BiConsumer action) {
new JDialog() {
private static final long serialVersionUID = -5768339760489440385L;
{
setTitle("Game Configuration");
setBounds(100, 100, 281, 142);
setModal(true);
setLocationRelativeTo(null);
getContentPane().setLayout(null);
List options = new ArrayList<>(Arrays.asList("Natural Player", "AI Player"));
EngineUtil.getEngineInfos().forEach(info -> options.add(info.name));
JLabel lblWhite = new JLabel("White:");
lblWhite.setFont(new Font("Tahoma", Font.PLAIN, 14));
lblWhite.setBounds(10, 11, 49, 14);
getContentPane().add(lblWhite);
JComboBox