All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vadeen.neat.gui.panels.settings.NetworkSettingsDialog Maven / Gradle / Ivy

The newest version!
package com.vadeen.neat.gui.panels.settings;

import com.vadeen.neat.Neat;

import javax.swing.*;
import java.awt.*;

public class NetworkSettingsDialog extends JDialog {
    private JPanel contentPane;
    private JButton buttonOK;
    private JPanel mutatorPanel;
    private JPanel speciesPanel;
    private JPanel genomePanel;
    private JPanel generationPanel;

    private final Neat neat;

    public static void open(JFrame owner, Neat neat) {
        NetworkSettingsDialog dialog = new NetworkSettingsDialog(owner, neat);
        dialog.pack();
        dialog.setVisible(true);
    }

    public NetworkSettingsDialog(JFrame owner, Neat neat) {
        super(owner, "Network settings", true);
        this.neat = neat;

        $$$setupUI$$$();
        setContentPane(contentPane);
        setModal(true);
        getRootPane().setDefaultButton(buttonOK);

        buttonOK.addActionListener(e -> close());
    }

    private void close() {
        dispose();
    }

    private void createUIComponents() {
        mutatorPanel = MutatorSettingsPanel.create(neat);
        speciesPanel = SpeciesSettingsPanel.create(neat);
        genomePanel = GenomeSettingsPanel.create(neat);
        generationPanel = GenerationSettingsPanel.create(neat);
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        createUIComponents();
        contentPane = new JPanel();
        contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));
        final JTabbedPane tabbedPane1 = new JTabbedPane();
        contentPane.add(tabbedPane1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(600, 500), null, 0, false));
        final JScrollPane scrollPane1 = new JScrollPane();
        tabbedPane1.addTab("Mutator", scrollPane1);
        scrollPane1.setViewportView(mutatorPanel);
        final JScrollPane scrollPane2 = new JScrollPane();
        tabbedPane1.addTab("Species", scrollPane2);
        scrollPane2.setViewportView(speciesPanel);
        final JScrollPane scrollPane3 = new JScrollPane();
        tabbedPane1.addTab("Genome", scrollPane3);
        scrollPane3.setViewportView(genomePanel);
        final JScrollPane scrollPane4 = new JScrollPane();
        tabbedPane1.addTab("Generation", scrollPane4);
        scrollPane4.setViewportView(generationPanel);
        final JPanel panel1 = new JPanel();
        panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
        contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
        final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();
        panel1.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
        final JPanel panel2 = new JPanel();
        panel2.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
        panel1.add(panel2, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
        buttonOK = new JButton();
        buttonOK.setText("OK");
        panel2.add(buttonOK, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return contentPane;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy