2
* Copyright Copyright 2010-12 Simon Andrews
4
* This file is part of FastQC.
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.
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.
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
*/package uk.ac.babraham.FastQC.Dialogs;
21
import java.awt.BorderLayout;
22
import java.awt.Color;
24
import java.awt.Graphics;
25
import java.awt.Graphics2D;
26
import java.awt.GridBagConstraints;
27
import java.awt.GridBagLayout;
28
import java.awt.Insets;
29
import java.awt.RenderingHints;
31
import javax.swing.BorderFactory;
32
import javax.swing.ImageIcon;
33
import javax.swing.JLabel;
34
import javax.swing.JPanel;
35
import javax.swing.JTextField;
37
import uk.ac.babraham.FastQC.FastQCApplication;
40
* The Class SeqMonkTitlePanel.
42
public class FastQCTitlePanel extends JPanel {
45
* Provides a small panel which gives details of the FastQC version
46
* and copyright. Used in both the welcome panel and the about dialog.
48
public FastQCTitlePanel () {
49
setLayout(new BorderLayout(5,1));
51
ImageIcon logo = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/fastqc_icon_100.png"));
52
JPanel logoPanel = new JPanel();
53
logoPanel.add(new JLabel("",logo,JLabel.CENTER));
54
logoPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
55
add(logoPanel,BorderLayout.WEST);
56
JPanel c = new JPanel();
57
c.setLayout(new GridBagLayout());
59
GridBagConstraints constraints = new GridBagConstraints();
62
constraints.weightx = 1;
63
constraints.weighty=1;
64
constraints.insets = new Insets(3, 3, 0, 0);
65
constraints.fill = GridBagConstraints.NONE;
67
JLabel program = new SmoothJLabel("FastQC High Throughput Sequence QC Report",JLabel.CENTER);
68
program.setFont(new Font("Dialog",Font.BOLD,18));
69
program.setForeground(new Color(200,0,0));
70
c.add(program,constraints);
73
JLabel version = new SmoothJLabel("Version: "+FastQCApplication.VERSION, JLabel.CENTER);
74
version.setFont(new Font("Dialog",Font.BOLD,15));
75
version.setForeground(new Color(0,0,200));
76
c.add(version,constraints);
79
// Use a text field so they can copy this
80
JTextField website = new JTextField(" www.bioinformatics.babraham.ac.uk/projects/ ");
81
website.setFont(new Font("Dialog",Font.PLAIN,14));
82
website.setEditable(false);
83
website.setBorder(null);
84
website.setOpaque(false);
85
website.setHorizontalAlignment(JTextField.CENTER);
86
c.add(website,constraints);
89
JLabel copyright = new JLabel("\u00a9 Simon Andrews, Babraham Bioinformatics, 2011", JLabel.CENTER);
90
copyright.setFont(new Font("Dialog",Font.PLAIN,14));
91
c.add(copyright,constraints);
94
JLabel copyright2 = new JLabel("Picard BAM/SAM reader \u00a9The Broad Institute, 2009", JLabel.CENTER);
95
copyright2.setFont(new Font("Dialog",Font.PLAIN,10));
96
c.add(copyright2,constraints);
99
JLabel copyright3 = new JLabel("BZip decompression \u00a9Matthew J. Francis, 2011", JLabel.CENTER);
100
copyright3.setFont(new Font("Dialog",Font.PLAIN,10));
101
c.add(copyright3,constraints);
103
add(c,BorderLayout.CENTER);
107
* A JLabel with anti-aliasing enabled. Takes the same constructor
108
* arguments as JLabel
110
private class SmoothJLabel extends JLabel {
113
* Creates a new label
115
* @param text The text
116
* @param position The JLabel constant position for alignment
118
public SmoothJLabel (String text, int position) {
119
super(text,position);
123
* @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
125
public void paintComponent (Graphics g) {
126
if (g instanceof Graphics2D) {
127
((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
129
super.paintComponent(g);