// Path: src/main/java/ch/picard/ppimapbuilder/ui/util/label/HelpIcon.java
// public class HelpIcon extends JLabel{
// 	private static final long serialVersionUID = 1L;
// 
// 	public HelpIcon(String message) {
// 		super();
// 		try {
// 			setIcon(new ImageIcon(HelpIcon.class.getResource("help.png")));
// 		} catch (Exception e) {
// 			setText("[?]");
// 		}
// 		setToolTipText(message);
// 	}
// }


import ch.picard.ppimapbuilder.data.organism.Organism;
import ch.picard.ppimapbuilder.ui.util.label.HelpIcon;
import net.miginfocom.swing.MigLayout;
import javax.swing.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
/*
 * This file is part of PPiMapBuilder.
 *
 * PPiMapBuilder is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * PPiMapBuilder is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PPiMapBuilder.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright 2015 Echeverria P.C., Dupuis P., Cornut G., Gravouil K., Kieffer A., Picard D.
 *
 */

package ch.picard.ppimapbuilder.ui.querywindow.component.panel.field;



public class ReferenceOrganismSelectionPanel extends JPanel {

	private static final long serialVersionUID = 1L;
	private final JComboBox<Organism> refOrgCb;
	private final OtherOrganismSelectionPanel otherOrganismSelectionPanel;
	private ItemListener itemListener = null;

	public ReferenceOrganismSelectionPanel() {
		this(null);
	}

	public ReferenceOrganismSelectionPanel(OtherOrganismSelectionPanel otherOrganismSelectionPanel) {
		this.otherOrganismSelectionPanel = otherOrganismSelectionPanel;
		setLayout(new MigLayout("ins 0", "[grow][]", "[][grow]"));
		setOpaque(false);

		// Reference organism label
		JLabel lblReferenceOrganism = new JLabel("Reference organism:");
		add(lblReferenceOrganism);

		// Reference organism Help Icon
// Path: src/main/java/ch/picard/ppimapbuilder/ui/util/label/HelpIcon.java
// public class HelpIcon extends JLabel{
// 	private static final long serialVersionUID = 1L;
// 
// 	public HelpIcon(String message) {
// 		super();
// 		try {
// 			setIcon(new ImageIcon(HelpIcon.class.getResource("help.png")));
// 		} catch (Exception e) {
// 			setText("[?]");
// 		}
// 		setToolTipText(message);
// 	}
// }


// Path: src/main/java/ch/picard/ppimapbuilder/ui/querywindow/component/panel/field/ReferenceOrganismSelectionPanel.java
import ch.picard.ppimapbuilder.data.organism.Organism;
import ch.picard.ppimapbuilder.ui.util.label.HelpIcon;
import net.miginfocom.swing.MigLayout;
import javax.swing.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;

/*
 * This file is part of PPiMapBuilder.
 *
 * PPiMapBuilder is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * PPiMapBuilder is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PPiMapBuilder.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright 2015 Echeverria P.C., Dupuis P., Cornut G., Gravouil K., Kieffer A., Picard D.
 *
 */

package ch.picard.ppimapbuilder.ui.querywindow.component.panel.field;



public class ReferenceOrganismSelectionPanel extends JPanel {

	private static final long serialVersionUID = 1L;
	private final JComboBox<Organism> refOrgCb;
	private final OtherOrganismSelectionPanel otherOrganismSelectionPanel;
	private ItemListener itemListener = null;

	public ReferenceOrganismSelectionPanel() {
		this(null);
	}

	public ReferenceOrganismSelectionPanel(OtherOrganismSelectionPanel otherOrganismSelectionPanel) {
		this.otherOrganismSelectionPanel = otherOrganismSelectionPanel;
		setLayout(new MigLayout("ins 0", "[grow][]", "[][grow]"));
		setOpaque(false);

		// Reference organism label
		JLabel lblReferenceOrganism = new JLabel("Reference organism:");
		add(lblReferenceOrganism);

		// Reference organism Help Icon
		JLabel lblHelpRefOrganism = new HelpIcon("Select here the organism from which the protein you entered come from");