001    /*
002     * The contents of this file are subject to the Mozilla Public
003     * License Version 1.1 (the "License"); you may not use this file
004     * except in compliance with the License. You may obtain a copy of
005     * the License at http://www.mozilla.org/MPL/
006     *
007     * Software distributed under the License is distributed on an "AS
008     * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
009     * implied. See the License for the specific language governing
010     * rights and limitations under the License.
011     *
012     * The Original Code is Knowtator.
013     *
014     * The Initial Developer of the Original Code is University of Colorado.  
015     * Copyright (C) 2005 - 2008.  All Rights Reserved.
016     *
017     * Knowtator was developed by the Center for Computational Pharmacology
018     * (http://compbio.uchcs.edu) at the University of Colorado Health 
019     *  Sciences Center School of Medicine with support from the National 
020     *  Library of Medicine.  
021     *
022     * Current information about Knowtator can be obtained at 
023     * http://knowtator.sourceforge.net/
024     *
025     * Contributor(s):
026     *   Philip V. Ogren <philip@ogren.info> (Original Author)
027     */
028    package edu.uchsc.ccp.knowtator.wizards;
029    
030    import java.awt.BorderLayout;
031    import java.awt.Dimension;
032    
033    import javax.swing.JButton;
034    import javax.swing.JDialog;
035    import javax.swing.JFrame;
036    import javax.swing.JPanel;
037    
038    public class WizardFrame extends JDialog {
039            private static final long serialVersionUID = 0;
040    
041            public static final String PREVIOUS = "PREVIOUS";
042    
043            public static final String NEXT = "NEXT";
044    
045            public static final String CANCEL = "CANCEL";
046    
047            JButton previousButton;
048    
049            JButton nextButton;
050    
051            JButton cancelButton;
052    
053            JPanel contentPane;
054    
055            public WizardFrame(JFrame parent, String title) {
056                    this(parent, title, new Dimension(400, 300));
057            }
058    
059            public WizardFrame(JFrame parent, String title, Dimension dimension) {
060                    super(parent, title, true);
061                    setSize(dimension);
062                    JPanel buttonsPanel = new JPanel();
063    
064                    previousButton = new JButton("Previous");
065                    previousButton.setActionCommand(PREVIOUS);
066                    nextButton = new JButton("Next");
067                    nextButton.setActionCommand(NEXT);
068                    cancelButton = new JButton("Cancel");
069                    cancelButton.setActionCommand(CANCEL);
070    
071                    buttonsPanel.add(previousButton);
072                    buttonsPanel.add(nextButton);
073                    buttonsPanel.add(cancelButton);
074    
075                    contentPane = new JPanel();
076    
077                    setLayout(new BorderLayout());
078                    add(buttonsPanel, BorderLayout.SOUTH);
079                    add(contentPane, BorderLayout.CENTER);
080            }
081    
082    }