/*
 * GGHApp.java
 */

package ggh;

import com.nexes.wizard.Wizard;
import com.nexes.wizard.WizardPanelDescriptor;
import ggh.dialog.Dialog1_Start_Descriptor;
import ggh.dialog.Dialog2_Encrypt_Descriptor;
import ggh.dialog.Dialog3_Decrypt_Descriptor;
import ggh.dialog.Dialog4_Summary_Descriptor;
import java.awt.Dimension;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;

/**
 * The main class of the application.
 */
public class GGHApp extends SingleFrameApplication {

    /**
     * At startup create and show the main frame of the application.
     */
    @Override protected void startup() {
        Wizard wizard = new Wizard();

        wizard.getDialog().setTitle("GGH šifrovací metoda pro asymetricky šifrovanou komunikaci | Dalibor Hampl | 2010");
        wizard.getDialog().setSize(700, 500);
        wizard.getDialog().setResizable(false);
        wizard.getDialog().setModal(true);


        WizardPanelDescriptor descriptor1 = new Dialog1_Start_Descriptor();
        wizard.registerWizardPanel(Dialog1_Start_Descriptor.IDENTIFIER, descriptor1);

        WizardPanelDescriptor descriptor2 = new Dialog2_Encrypt_Descriptor();
        wizard.registerWizardPanel(Dialog2_Encrypt_Descriptor.IDENTIFIER, descriptor2);

        WizardPanelDescriptor descriptor3 = new Dialog3_Decrypt_Descriptor();
        wizard.registerWizardPanel(Dialog3_Decrypt_Descriptor.IDENTIFIER, descriptor3);

        WizardPanelDescriptor descriptor4 = new Dialog4_Summary_Descriptor();
        wizard.registerWizardPanel(Dialog4_Summary_Descriptor.IDENTIFIER, descriptor4);

        wizard.setCurrentPanel(Dialog1_Start_Descriptor.IDENTIFIER);

        wizard.showModalDialog();
        wizard.getDialog().pack();
    }

    /**
     * This method is to initialize the specified window by injecting resources.
     * Windows shown in our application come fully initialized from the GUI
     * builder, so this additional configuration is not needed.
     */
    @Override protected void configureWindow(java.awt.Window root) {
    }

    /**
     * A convenient static getter for the application instance.
     * @return the instance of GGHApp
     */
    public static GGHApp getApplication() {
        return Application.getInstance(GGHApp.class);
    }

    /**
     * Main method launching the application.
     */
    public static void main(String[] args) {
        launch(GGHApp.class, args);
    }
}
