package opartgui;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.awt.geom.*;

public class SplashWindow extends javax.swing.JDialog{

    public SplashWindow(java.awt.Frame parent) {
        super(parent);
        initComponents();
    }
    /**Creates the GUI elements */
    private void initComponents() {

        Pause pause = new Pause();

        welcomeTextPane = new javax.swing.JTextPane();
        imageComboBox = new javax.swing.JComboBox();
        okButton = new javax.swing.JButton();
        ImagePanel backgroundPanel = new ImagePanel();

        getContentPane().setLayout(null);

        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation(screenSize.width/2 - (200),
                    screenSize.height/2 - (150));

        setSize(400,300);
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Welcome to OPAGA - About");

        setResizable(false);

        backgroundPanel.doDisplay(pause.imageDraw());
        backgroundPanel.repaint();
        backgroundPanel.invert();
        getContentPane().add(backgroundPanel);
        backgroundPanel.setBounds(0, 0, 400, 300);
        backgroundPanel.setLayout(null);


        welcomeTextPane.setEditable(false);
        welcomeTextPane.setBorder(new javax.swing.border.MatteBorder(new java.awt.Insets(3, 3, 3, 3), new java.awt.Color(51, 51, 255)));
        welcomeTextPane.setText(" Welcome to OPAGA the Java OP-Art Generator and  Animator.\n\n Version 1.1b (Refinements in progress: Final Release date 21/6/04) designed using JAVA\n\n Author: Jorden Lacey \n\n Date: 13/06/04");
        backgroundPanel.add(welcomeTextPane);
        welcomeTextPane.setBounds(50, 50, 300, 150);

        okButton.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        okButton.setText("OK");
        okButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                okButtonMouseReleased(evt);
            }
        });
        backgroundPanel.add(okButton);
        okButton.setBounds(150, 220, 100, 20);
    }

    private void okButtonMouseReleased(java.awt.event.MouseEvent evt) {
        setVisible(false);
        dispose();
    }

    public static void main(String args[]) {
        new SplashWindow(new javax.swing.JFrame());
    }

    // Variables declaration - do not modify
    private javax.swing.JPanel backgroundPanel;
    private javax.swing.JComboBox imageComboBox;
    private javax.swing.JButton okButton;
    private javax.swing.JTextPane welcomeTextPane;
    // End of variables declaration

}


