| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
package uk.ac.babraham.FastQC.Dialogs; |
| 21 |
|
| 22 |
import java.awt.BorderLayout; |
| 23 |
import java.awt.Color; |
| 24 |
import java.awt.Font; |
| 25 |
import java.awt.Graphics; |
| 26 |
import java.awt.Graphics2D; |
| 27 |
import java.awt.GridBagConstraints; |
| 28 |
import java.awt.GridBagLayout; |
| 29 |
import java.awt.Insets; |
| 30 |
import java.awt.RenderingHints; |
| 31 |
|
| 32 |
import javax.swing.BorderFactory; |
| 33 |
import javax.swing.ImageIcon; |
| 34 |
import javax.swing.JLabel; |
| 35 |
import javax.swing.JPanel; |
| 36 |
import javax.swing.JTextField; |
| 37 |
|
| 38 |
import uk.ac.babraham.FastQC.FastQCApplication; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
public class FastQCTitlePanel extends JPanel { |
| 45 |
private static final long serialVersionUID = 1L; |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
public FastQCTitlePanel () { |
| 52 |
setLayout(new BorderLayout(5,1)); |
| 53 |
|
| 54 |
ImageIcon logo = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/fastqc_icon_100.png")); |
| 55 |
JPanel logoPanel = new JPanel(); |
| 56 |
logoPanel.add(new JLabel("",logo,JLabel.CENTER)); |
| 57 |
logoPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); |
| 58 |
add(logoPanel,BorderLayout.WEST); |
| 59 |
JPanel c = new JPanel(); |
| 60 |
c.setLayout(new GridBagLayout()); |
| 61 |
|
| 62 |
GridBagConstraints constraints = new GridBagConstraints(); |
| 63 |
constraints.gridx=1; |
| 64 |
constraints.gridy=1; |
| 65 |
constraints.weightx = 1; |
| 66 |
constraints.weighty=1; |
| 67 |
constraints.insets = new Insets(3, 3, 0, 0); |
| 68 |
constraints.fill = GridBagConstraints.NONE; |
| 69 |
|
| 70 |
JLabel program = new SmoothJLabel("FastQC High Throughput Sequence QC Report",JLabel.CENTER); |
| 71 |
program.setFont(new Font("Dialog",Font.BOLD,18)); |
| 72 |
program.setForeground(new Color(200,0,0)); |
| 73 |
c.add(program,constraints); |
| 74 |
|
| 75 |
constraints.gridy++; |
| 76 |
JLabel version = new SmoothJLabel("Version: "+FastQCApplication.VERSION, JLabel.CENTER); |
| 77 |
version.setFont(new Font("Dialog",Font.BOLD,15)); |
| 78 |
version.setForeground(new Color(0,0,200)); |
| 79 |
c.add(version,constraints); |
| 80 |
|
| 81 |
constraints.gridy++; |
| 82 |
|
| 83 |
JTextField website = new JTextField(" www.bioinformatics.babraham.ac.uk/projects/ "); |
| 84 |
website.setFont(new Font("Dialog",Font.PLAIN,14)); |
| 85 |
website.setEditable(false); |
| 86 |
website.setBorder(null); |
| 87 |
website.setOpaque(false); |
| 88 |
website.setHorizontalAlignment(JTextField.CENTER); |
| 89 |
c.add(website,constraints); |
| 90 |
constraints.gridy++; |
| 91 |
|
| 92 |
JLabel copyright = new JLabel("\u00a9 Simon Andrews, Pierre Lindenbaum, Brian Howard, Phil Ewels 2011-22,", JLabel.CENTER); |
| 93 |
copyright.setFont(new Font("Dialog",Font.PLAIN,14)); |
| 94 |
c.add(copyright,constraints); |
| 95 |
constraints.gridy++; |
| 96 |
|
| 97 |
JLabel copyright2 = new JLabel("HTSJDK BAM/SAM reader v2.24.1 from Samtools 2022", JLabel.CENTER); |
| 98 |
copyright2.setFont(new Font("Dialog",Font.PLAIN,10)); |
| 99 |
c.add(copyright2,constraints); |
| 100 |
constraints.gridy++; |
| 101 |
|
| 102 |
JLabel copyright3 = new JLabel("BZip decompression \u00a9Matthew J. Francis, 2011", JLabel.CENTER); |
| 103 |
copyright3.setFont(new Font("Dialog",Font.PLAIN,10)); |
| 104 |
c.add(copyright3,constraints); |
| 105 |
constraints.gridy++; |
| 106 |
|
| 107 |
JLabel copyright4 = new JLabel("Base64 encoding \u00a9Robert Harder, 2012", JLabel.CENTER); |
| 108 |
copyright4.setFont(new Font("Dialog",Font.PLAIN,10)); |
| 109 |
c.add(copyright4,constraints); |
| 110 |
constraints.gridy++; |
| 111 |
|
| 112 |
JLabel copyright5 = new JLabel("Java HDF5 reader \u00a9ETH, CISD and SIS, 2007-14", JLabel.CENTER); |
| 113 |
copyright5.setFont(new Font("Dialog",Font.PLAIN,10)); |
| 114 |
c.add(copyright5,constraints); |
| 115 |
|
| 116 |
add(c,BorderLayout.CENTER); |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
private class SmoothJLabel extends JLabel { |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
public SmoothJLabel (String text, int position) { |
| 132 |
super(text,position); |
| 133 |
} |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
public void paintComponent (Graphics g) { |
| 139 |
if (g instanceof Graphics2D) { |
| 140 |
((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| 141 |
} |
| 142 |
super.paintComponent(g); |
| 143 |
} |
| 144 |
|
| 145 |
} |
| 146 |
|
| 147 |
} |