/*
 * AboutDialog_n.java
 *
 * Created on February 13, 2004, 3:50 PM
 */
package usda.weru.util.gui;

/**
 * Gives the information on the MCREW application's latest build date, its current 
 * version number, what the application is about and the company name that produced 
 * this application.
 * @author  manmohan
 */
public class AboutDialog_n extends javax.swing.JDialog {

    private static final long serialVersionUID = 1L;

    /**
     * Single argument constructor for the about dialog GUI object.
     * @param parent The address of a parent frame in which the About dialog sits.
     */
    public AboutDialog_n(java.awt.Frame parent) {
        super(parent);
        initComponents();
    }

    /** 
     * 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.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        g_closeButton = new javax.swing.JButton();
        g_aboutScrollPane = new javax.swing.JScrollPane();
        g_aboutTextArea = new javax.swing.JTextArea();
        g_image = new javax.swing.JLabel();
        g_messageLabel = new javax.swing.JLabel();

        setTitle("JFC Application - About");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        g_closeButton.setMnemonic('O');
        g_closeButton.setText("Close");
        g_closeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                g_closeButton_ActionPerformed(evt);
            }
        });

        g_aboutTextArea.setEditable(false);
        g_aboutTextArea.setColumns(20);
        g_aboutTextArea.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
        g_aboutTextArea.setRows(8);
        g_aboutScrollPane.setViewportView(g_aboutTextArea);

        g_image.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        g_image.setIcon(new javax.swing.ImageIcon(getClass().getResource("/usda/weru/resources/weru.gif"))); // NOI18N

        g_messageLabel.setFont(g_messageLabel.getFont().deriveFont(g_messageLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
        g_messageLabel.setText("USDA ARS Wind Erosion Research Unit");

        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)
                    .addComponent(g_aboutScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 922, Short.MAX_VALUE)
                    .addComponent(g_image, javax.swing.GroupLayout.DEFAULT_SIZE, 922, Short.MAX_VALUE)
                    .addComponent(g_messageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 922, Short.MAX_VALUE)
                    .addComponent(g_closeButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(g_image)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(g_messageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(g_aboutScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 547, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(g_closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        setSize(new java.awt.Dimension(958, 746));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void g_closeButton_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_g_closeButton_ActionPerformed
        close();
}//GEN-LAST:event_g_closeButton_ActionPerformed

    private void close() {
        setVisible(false);
        dispose();
    }

    /** 
     * This method is called when the about dialog is to be closed by hitting the 
     * "Red X" button of the window.
     * @param evt The event generated when the " Red X " button on the window is hit. 
     */
    private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
        close();
    }//GEN-LAST:event_closeDialog

    /**
     * This method is used if this dialog is rum as an independent application.
     * @param args These are the command line arguments passed to the main method.
     */
    public static void main(String args[]) {
        new AboutDialog_n(new javax.swing.JFrame()).setVisible(true);
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane g_aboutScrollPane;
    public javax.swing.JTextArea g_aboutTextArea;
    public javax.swing.JButton g_closeButton;
    private javax.swing.JLabel g_image;
    protected javax.swing.JLabel g_messageLabel;
    // End of variables declaration//GEN-END:variables

}
