| 1 | /** |
| 2 | * Copyright Copyright 2010-17 Simon Andrews |
| 3 | * |
| 4 | * This file is part of FastQC. |
| 5 | * |
| 6 | * FastQC is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * FastQC is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with FastQC; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | package uk.ac.babraham.FastQC.Dialogs; |
| 21 | |
| 22 | import javax.swing.*; |
| 23 | |
| 24 | import uk.ac.babraham.FastQC.FastQCApplication; |
| 25 | |
| 26 | import java.awt.*; |
| 27 | import java.awt.event.*; |
| 28 | |
| 29 | /** |
| 30 | * Shows the generic about dialog giving details of the current version |
| 31 | * and copyright assignments. This is just a thin shell around the |
| 32 | * SeqMonkTitlePanel which actually holds the relevant information and |
| 33 | * which is also used on the welcome screen. |
| 34 | */ |
| 35 | public class AboutDialog extends JDialog { |
| 36 | private static final long serialVersionUID = 1L; |
| 37 | |
| 38 | /** |
| 39 | * Instantiates a new about dialog. |
| 40 | * |
| 41 | * @param a The SeqMonk application. |
| 42 | */ |
| 43 | public AboutDialog(FastQCApplication a) { |
| 44 | super(a); |
| 45 | setTitle("About FastQC..."); |
| 46 | Container cont = getContentPane(); |
| 47 | cont.setLayout(new BorderLayout()); |
| 48 | |
| 49 | add(new FastQCTitlePanel(),BorderLayout.CENTER); |
| 50 | |
| 51 | JPanel buttonPanel = new JPanel(); |
| 52 | |
| 53 | JButton closeButton = new JButton("Close"); |
| 54 | getRootPane().setDefaultButton(closeButton); |
| 55 | closeButton.addActionListener(new ActionListener() { |
| 56 | public void actionPerformed(ActionEvent arg0) { |
| 57 | setVisible(false); |
| 58 | dispose(); |
| 59 | } |
| 60 | }); |
| 61 | buttonPanel.add(closeButton); |
| 62 | |
| 63 | cont.add(buttonPanel,BorderLayout.SOUTH); |
| 64 | |
| 65 | setSize(650,230); |
| 66 | setLocationRelativeTo(a); |
| 67 | setResizable(false); |
| 68 | setVisible(true); |
| 69 | } |
| 70 | |
| 71 | } |