/*
 * XAboutFrame.java
 *
 * Created on 1. duben 2009, 18:14
 */

package base;

import base.*;

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

/**
 *
 * @author  illi
 */
public class XAboutFrame extends javax.swing.JDialog {

    /** Creates new form XAboutFrame */
    public XAboutFrame() {
        initComponents();
        AboutFrameText.setText(aboutText);
        AboutFrameButtonClose.registerKeyboardAction(
        new DefaultAction((AbstractButton) AboutFrameButtonClose),
            KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false),
            JComponent.WHEN_IN_FOCUSED_WINDOW);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        AboutFrameScrollPane = new javax.swing.JScrollPane();
        AboutFrameText = new javax.swing.JTextArea();
        AboutFrameButtonClose = new javax.swing.JButton();
        AboutFrameLabel = new javax.swing.JLabel();

        setTitle("XMLspark About");
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        AboutFrameScrollPane.setBorder(null);
        AboutFrameScrollPane.setHorizontalScrollBar(null);
        AboutFrameScrollPane.setName("AboutFrameScrollPane"); // NOI18N

        AboutFrameText.setBackground(new java.awt.Color(240, 240, 240));
        AboutFrameText.setColumns(20);
        AboutFrameText.setEditable(false);
        AboutFrameText.setRows(5);
        AboutFrameText.setBorder(null);
        AboutFrameText.setName("AboutFrameText"); // NOI18N
        AboutFrameScrollPane.setViewportView(AboutFrameText);

        AboutFrameButtonClose.setText("Close");
        AboutFrameButtonClose.setName("AboutFrameButtonClose"); // NOI18N
        AboutFrameButtonClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AboutFrameButtonCloseActionPerformed(evt);
            }
        });

        AboutFrameLabel.setFont(new java.awt.Font("Lucida Console", 1, 15));
        AboutFrameLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        AboutFrameLabel.setText("ABOUT");
        AboutFrameLabel.setName("AboutFrameLabel"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(AboutFrameScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                            .addComponent(AboutFrameLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(AboutFrameButtonClose, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(158, 158, 158))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(AboutFrameLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(AboutFrameScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 365, Short.MAX_VALUE)
                .addGap(11, 11, 11)
                .addComponent(AboutFrameButtonClose)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void AboutFrameButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AboutFrameButtonCloseActionPerformed
    this.setVisible(false);
    MainWindow.EnableMainWindow();
}//GEN-LAST:event_AboutFrameButtonCloseActionPerformed

private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
    this.setVisible(false);
    MainWindow.EnableMainWindow();
}//GEN-LAST:event_formWindowClosing

private static final String aboutText = 
            "\n" + 
            "  PRODUCT VERSION: XMLspark v0.5b\n" +
            "  Java: 1.6.0_10\n" +
            "\n" +
            "  Bachelor's thesis\n" +
            "\n" +
            "  AUTHOR:\n" +
            "  Martin Seko - xsekom00@stud.fit.vutbr.cz\n" +
            "\n" +
            "  Last Build: 17.05.2009\n" +
            "\n\n";

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private static javax.swing.JButton AboutFrameButtonClose;
    private static javax.swing.JLabel AboutFrameLabel;
    private static javax.swing.JScrollPane AboutFrameScrollPane;
    private static javax.swing.JTextArea AboutFrameText;
    // End of variables declaration//GEN-END:variables

}
