// 
// The Waveset SPML General License 
// 
// Version 0.1, April 2003
// Copyright (C) 2003 Waveset Technologies, Inc..
// 6034 West Courtyard Drive, Suite 210, Austin, Texas 78730
// All rights reserved.
// 
// TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
// 
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// 
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions, and the disclaimers in Sections 6
//    and 7 below.
// 
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the disclaimers in Sections 6
//    and 7 below in the documentation and/or other materials provided
//    with the distribution.
// 
// 3. The end-user documentation included with the redistribution, if
//    any, must include the following acknowledgment:
// 
//    "This product includes software developed by 
//     Waveset Technologies, Inc. (www.waveset.com)."
// 
//    Alternately, this acknowledgment may appear in the software itself, if
//    and wherever such third-party acknowledgments normally appear.
//  
// 4. The names "Waveset" and "Waveset Technologies, Inc." must not be
//    used to endorse or promote products derived from this software
//    without the prior written permission of Waveset. For written
//    permission, please contact www.waveset.com.
//  
// 5. Products derived from this software may not be called "Waveset",
//    nor may "Waveset" appear in their name, without the prior written
//    permission of Waveset.
//  
// 6. NO WARRANTY 
// 
//    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED
//    OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
//    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
//    DISCLAIMED.
// 
// 7.  LIMITATION OF LIABILITY
// 
//    IN NO EVENT SHALL THE WAVESET OR ITS LICENSORS BE LIABLE FOR ANY
//    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
//    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
//    GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
//    IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
//    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
//    ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// 
// End of Terms and Conditions
// ====================================================================
//
// Component Name: org.openspml.browser.BrowserFrame
//
// Author(s): Jeff Larson
//
// Description:
//
// The main frame for the OpenSPML browser application.
//

package org.openspml.browser;

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

public class BrowserAboutBox extends JDialog implements ActionListener {

    JPanel panel1 = new JPanel();
    JPanel panel2 = new JPanel();
    JPanel insetsPanel1 = new JPanel();
    JPanel insetsPanel2 = new JPanel();
    JPanel insetsPanel3 = new JPanel();
    JButton button1 = new JButton();
    JLabel imageLabel = new JLabel();
    JLabel label1 = new JLabel();
    JLabel label2 = new JLabel();
    JLabel label3 = new JLabel();
    JLabel label4 = new JLabel();
    BorderLayout borderLayout1 = new BorderLayout();
    BorderLayout borderLayout2 = new BorderLayout();
    FlowLayout flowLayout1 = new FlowLayout();
    GridLayout gridLayout1 = new GridLayout();

    String product = "OpenSPML Browser";
    String version = "1.0";
    String copyright = "Copyright (C) 2003 Waveset Technologies Inc.";
    String comments = "";

    public BrowserAboutBox(Frame parent) {
	super(parent);
	enableEvents(AWTEvent.WINDOW_EVENT_MASK);
	try {
	    jbInit();
	}
	catch(Exception e) {
	    e.printStackTrace();
	}
	pack();
    }
    /**Component initialization*/
    private void jbInit() throws Exception  {
	imageLabel.setIcon(new ImageIcon(BrowserAboutBox.class.getResource("openSpml.gif")));
	this.setTitle("About");
	setResizable(false);
	panel1.setLayout(borderLayout1);
	panel2.setLayout(borderLayout2);
	insetsPanel1.setLayout(flowLayout1);
	insetsPanel2.setLayout(flowLayout1);
	insetsPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
	gridLayout1.setRows(4);
	gridLayout1.setColumns(1);
	label1.setText(product);
	label2.setText(version);
	label3.setText(copyright);
	label4.setText(comments);
	insetsPanel3.setLayout(gridLayout1);
	insetsPanel3.setBorder(BorderFactory.createEmptyBorder(10, 60, 10, 10));
	button1.setText("Ok");
	button1.addActionListener(this);
	insetsPanel2.add(imageLabel, null);
	panel2.add(insetsPanel2, BorderLayout.WEST);
	this.getContentPane().add(panel1, null);
	insetsPanel3.add(label1, null);
	insetsPanel3.add(label2, null);
	insetsPanel3.add(label3, null);
	insetsPanel3.add(label4, null);
	panel2.add(insetsPanel3, BorderLayout.CENTER);
	insetsPanel1.add(button1, null);
	panel1.add(insetsPanel1, BorderLayout.SOUTH);
	panel1.add(panel2, BorderLayout.NORTH);
    }
    /**Overridden so we can exit when window is closed*/
    protected void processWindowEvent(WindowEvent e) {
	if (e.getID() == WindowEvent.WINDOW_CLOSING) {
	    cancel();
	}
	super.processWindowEvent(e);
    }
    /**Close the dialog*/
    void cancel() {
	dispose();
    }
    /**Close the dialog on a button event*/
    public void actionPerformed(ActionEvent e) {
	if (e.getSource() == button1) {
	    cancel();
	}
    }
}
