package gui;

import java.awt.Cursor;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JScrollPane;

@SuppressWarnings("serial")
public class HelpEnzymeActivity extends JLabel {
	/*
	 * create a question mark label.
	 * When you click on this question mark, a window displaying enzyme activities appear
	 */
	public HelpEnzymeActivity(){
		
	final ImageIcon enzymeActivityPict = new ImageIcon(getClass().getResource("/pictures/enzymeActivity2.png"));
	Icon flag = new ImageIcon(getClass().getResource("/pictures/questionMark.png"));
	setIcon(flag);
	
	addMouseListener(new MouseAdapter() {
	
		public void mouseEntered(MouseEvent e) {
			setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		}
		
		public void mouseClicked(MouseEvent e){
			JDialog dialog = new JDialog();
			dialog.setTitle("Enzyme activity");
			JScrollPane all = new JScrollPane();
			dialog.add(all);
			JLabel jl = new JLabel(enzymeActivityPict);
			all.setViewportView(jl);
			dialog.pack();
			dialog.setVisible(true);	
			}
		});
	
}


}
