Package easiest

Source Code of easiest.ESTsSubmitter

/* $Id: ESTsSubmitter.java 67 2008-12-21 22:00:12Z weizhongli $
* $Author: weizhongli $
* ======================================================================
* Batch ESTs submitter to dbEST
* ====================================================================== */


package easiest;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.BorderLayout;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import java.awt.Point;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JFrame;
import javax.swing.JDialog;
import javax.swing.JTabbedPane;
import java.awt.Rectangle;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.table.DefaultTableModel;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.awt.Dimension;
import javax.swing.JScrollPane;
import javax.swing.JTable;

public class ESTsSubmitter {

  private JFrame jFrame = null//  @jve:decl-index=0:visual-constraint="10,10"
  private JMenuBar jJMenuBar = null;
  private JMenu fileMenu = null;
  private JMenu helpMenu = null;
  private JMenuItem exitMenuItem = null;
  private JMenuItem aboutMenuItem = null;
  private JDialog aboutDialog = null;
  private JDialog errorDialog = null//  @jve:decl-index=0:visual-constraint="188,531"
  private JPanel aboutContentPane = null;
  private JPanel errorContentPane = null;
  private JLabel aboutVersionLabel = null;
  private JLabel errorVersionLabel = null;
  private JTabbedPane jTabbedPane = null;
  private JPanel jPanel = null;
  private JPanel jPanel1 = null;
  private JPanel jPanel2 = null;
  private JPanel jPanel3 = null;
  private JLabel jLabel = null;
  private JLabel jLabel1 = null;
  private JLabel jLabel2 = null;
  private JLabel jLabel3 = null;
  private JLabel jLabel4 = null;
  private JLabel jLabel5 = null;
  private JLabel jLabel6 = null;
  private JLabel jLabel7 = null;
  private JComboBox jComboBoxCont = null;
  private JTextField jTextFieldName = null;
  private JTextField jTextFieldFax = null;
  private JTextField jTextFieldTel = null;
  private JTextField jTextFieldEmail = null;
  private JTextField jTextFieldLab = null;
  private JTextField jTextFieldInst = null;
  private JTextField jTextFieldAddr = null;
  private static JButton jButtonCont = null;
  private JLabel jLabel8 = null;
  private JLabel jLabel9 = null;
  private JLabel jLabel10 = null;
  private JLabel jLabel11 = null;
  private JLabel jLabel12 = null;
  private JLabel jLabel13 = null;
  private JLabel jLabel14 = null;
  private JLabel jLabel15 = null;
  private JLabel jLabel16 = null;
  private JLabel jLabel17 = null;
  private JLabel jLabel18 = null;
  private JLabel jLabel19 = null;
  private JComboBox jComboBoxPub = null;
  private JTextField jTextFieldMed = null;
  private JTextField jTextFieldTitle = null;
  private JTextField jTextFieldAuthors = null;
  private JTextField jTextFieldJournal = null;
  private JTextField jTextFieldVolume = null;
  private JTextField jTextFieldSuppl = null;
  private JTextField jTextFieldIssue = null;
  private JTextField jTextFieldI_Suppl = null;
  private JTextField jTextFieldPages = null;
  private JTextField jTextFieldYear = null;
  private JComboBox jComboBoxStatus = null;
  private JLabel jLabel20 = null;
  private JLabel jLabel21 = null;
  private JLabel jLabel22 = null;
  private JLabel jLabel23 = null;
  private JLabel jLabel24 = null;
  private JLabel jLabel25 = null;
  private JLabel jLabel26 = null;
  private JLabel jLabel27 = null;
  private JLabel jLabel28 = null;
  private JLabel jLabel29 = null;
  private JLabel jLabel30 = null;
  private JLabel jLabel31 = null;
  private JLabel jLabel32 = null;
  private JLabel jLabel33 = null;
  private JLabel jLabel34 = null;
  private JLabel jLabel35 = null;
  private JLabel jLabel36 = null;
  private JLabel jLabel37 = null;
  private JComboBox jComboBoxLib = null;
  private JTextField jTextFieldLibName = null;
  private JTextField jTextFieldOrganism = null;
  private JTextField jTextFieldStrain = null;
  private JTextField jTextFieldCultivar = null;
  private JTextField jTextFieldIsolate = null;
  private JComboBox jComboBoxSex = null;
  private JTextField jTextFieldOrgan = null;
  private JTextField jTextFieldTissue = null;
  private JTextField jTextFieldCell_Type = null;
  private JTextField jTextFieldCell_Line = null;
  private JTextField jTextFieldStage = null;
  private JTextField jTextFieldHost = null;
  private JTextField jTextFieldVector = null;
  private JComboBox jComboBoxV_Type = null;
  private JTextField jTextFieldRE_1 = null;
  private JTextField jTextFieldRE_2 = null;
  private JTextField jTextFieldDescr = null;
  private JLabel jLabel38 = null;
  private JLabel jLabel39 = null;
  private JLabel jLabel40 = null;
  private JLabel jLabel41 = null;
  private JLabel jLabel42 = null;
  private JLabel jLabel43 = null;
  private JLabel jLabel44 = null;
  private JLabel jLabel45 = null;
  private JLabel jLabel46 = null;
  private JLabel jLabel47 = null;
  private JLabel jLabel48 = null;
  private JLabel jLabel49 = null;
  private JLabel jLabel50 = null;
  private JLabel jLabel51 = null;
  private JLabel jLabel52 = null;
  private JLabel jLabel53 = null;
  private JLabel jLabel54 = null;
  private JLabel jLabel55 = null;
  private JLabel jLabel56 = null;
  private JLabel jLabel57 = null;
  private JLabel jLabel58 = null;
  private JLabel jLabel59 = null;
  private JLabel jLabel60 = null;
  private JLabel jLabel61 = null;
  private JLabel jLabel62 = null;
  private JLabel jLabel63 = null;
  private JLabel jLabel64 = null;
  private JLabel jLabel65 = null;
  private JLabel jLabel66 = null;
  private JLabel jLabel67 = null;
  private JLabel jLabel68 = null;
  private JLabel jLabel69 = null;
  private JLabel jLabel70 = null;
  private JLabel jLabel71 = null;
  private JLabel jLabel72 = null;
  private JLabel jLabel73 = null;
  private JComboBox jComboBoxEST = null;
  private JComboBox jComboBoxStatusEST = null;
  private JTextField jTextFieldContEST = null;
  private JTextField jTextFieldCitationEST = null;
  private JTextField jTextFieldLibEST = null;
  private JTextField jTextFieldPublic = null;
  private JPanel jPanelStart = null;
  private JLabel jLabel75 = null;
  private JLabel jLabel76 = null;
  private JTextField jTextFieldDir = null;
  private JButton jButtonDir = null;
  private JLabel jLabel77 = null;
  private JPanel jPanelFinish = null;
  private static JButton jButtonPub = null;
 
  private String filePath = null;
  private String contactFilePath =null;
  private String publicationFilePath =null;
  private String libraryFilePath =null;
  private String estFilePath =null;
  private PrintWriter outputContact = null;
  private PrintWriter outputPublication = null;
  private PrintWriter outputLibrary = null;
  private PrintWriter outputEst = null;
  private BufferedReader inputFasta =null;
  private JLabel jLabel78 = null;
  private static JButton jButtonLib = null;
  private JLabel jLabel79 = null;
  private JLabel jLabel80 = null;
  private JTextField jTextFieldDna_Type = null;
  private JTextField jTextFieldComment = null;
  private JTextField jTextFieldSeq_Primer = null;
  private JTextField jTextFieldP_End = null;
  private JFrame jFrameAdvanced = null
  private JPanel jContentPaneAdvance = null;
  private static JButton jButtonAdvanced = null;
  private JScrollPane jScrollPane = null;
  private JTable jTable = null;
  private JTextField jTextFieldInputFasta = null;
  private JLabel jLabel74 = null;
  private JButton jButtonFasta = null;
  private JButton jButtonLoad = null;
  private static JButton jButtonEst = null;
  private JLabel jLabel82 = null;
  private JLabel jLabel83 = null;
  private JLabel jLabel84 = null;
  private JLabel jLabel85 = null;
  private JLabel jLabel81 = null;
  private JLabel jLabel86 = null;
  private JLabel jLabel87 = null;
  private JLabel jLabel88 = null;
  private JLabel jLabel89 = null;
  private JLabel jLabel90 = null;
 
 
  /**
   * This method initializes jFrame
   *
   * @return javax.swing.JFrame
   */
  private JFrame getJFrame() {
    if (jFrame == null) {
      jFrame = new JFrame();
      jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      jFrame.setJMenuBar(getJJMenuBar());
      jFrame.setSize(824, 511);
      jFrame.setContentPane(getJTabbedPane());
      jFrame.setTitle("ESTsSubmitter");
    }
    return jFrame;
  }

  /**
   * This method initializes jJMenuBar 
   *  
   * @return javax.swing.JMenuBar 
   */
  private JMenuBar getJJMenuBar() {
    if (jJMenuBar == null) {
      jJMenuBar = new JMenuBar();
      jJMenuBar.add(getFileMenu());
      jJMenuBar.add(getHelpMenu());
    }
    return jJMenuBar;
  }

  /**
   * This method initializes jMenu 
   *  
   * @return javax.swing.JMenu 
   */
  private JMenu getFileMenu() {
    if (fileMenu == null) {
      fileMenu = new JMenu();
      fileMenu.setText("File");
      fileMenu.add(getExitMenuItem());
    }
    return fileMenu;
  }


  /**
   * This method initializes jMenu 
   *  
   * @return javax.swing.JMenu 
   */
  private JMenu getHelpMenu() {
    if (helpMenu == null) {
      helpMenu = new JMenu();
      helpMenu.setText("Help");
      helpMenu.add(getAboutMenuItem());
    }
    return helpMenu;
  }

  /**
   * This method initializes jMenuItem 
   *  
   * @return javax.swing.JMenuItem 
   */
  private JMenuItem getExitMenuItem() {
    if (exitMenuItem == null) {
      exitMenuItem = new JMenuItem();
      exitMenuItem.setText("Exit");
      exitMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          System.exit(0);
        }
      });
    }
    return exitMenuItem;
  }

  /**
   * This method initializes jMenuItem 
   *  
   * @return javax.swing.JMenuItem 
   */
  private JMenuItem getAboutMenuItem() {
    if (aboutMenuItem == null) {
      aboutMenuItem = new JMenuItem();
      aboutMenuItem.setText("About");
      aboutMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          JDialog aboutDialog = getAboutDialog();
          aboutDialog.pack();
          Point loc = getJFrame().getLocation();
          loc.translate(20, 20);
          aboutDialog.setLocation(loc);
          aboutDialog.setVisible(true);
        }
      });
    }
    return aboutMenuItem;
  }

  /**
   * This method initializes aboutDialog 
   *  
   * @return javax.swing.JDialog
   */
  private JDialog getAboutDialog() {
    if (aboutDialog == null) {
      aboutDialog = new JDialog(getJFrame(), true);
      aboutDialog.setTitle("About");
      aboutDialog.setContentPane(getAboutContentPane());
    }
    return aboutDialog;
  }

  /**
   * This method initializes errorDialog 
   *  
   * @return javax.swing.JDialog
   */
  private JDialog getErrorDialog() {
    if (errorDialog == null) {
      errorDialog = new JDialog(getJFrame(), true);
      errorDialog.setTitle("Error");
      errorDialog.setSize(new Dimension(325, 183));
      errorDialog.setContentPane(getErrorContentPane());
    }
    return errorDialog;
  }
 
  /**
   * This method initializes aboutContentPane
   *
   * @return javax.swing.JPanel
   */
  private JPanel getAboutContentPane() {
    if (aboutContentPane == null) {
      aboutContentPane = new JPanel();
      aboutContentPane.setLayout(new BorderLayout());
      aboutContentPane.add(getAboutVersionLabel(), BorderLayout.CENTER);
    }
    return aboutContentPane;
  }

  /**
   * This method initializes aboutContentPane
   *
   * @return javax.swing.JPanel
   */
  private JPanel getErrorContentPane() {
    if (errorContentPane == null) {
      errorContentPane = new JPanel();
      errorContentPane.setLayout(new BorderLayout());
      errorContentPane.add(getErrorVersionLabel(), BorderLayout.CENTER);
    }
    return errorContentPane;
  }
 
  /**
   * This method initializes aboutVersionLabel 
   *  
   * @return javax.swing.JLabel 
   */
  private JLabel getAboutVersionLabel() {
    if (aboutVersionLabel == null) {
      aboutVersionLabel = new JLabel();
      aboutVersionLabel.setText("ESTsSubmitter Version 0.1 in easiEST");
      aboutVersionLabel.setHorizontalAlignment(SwingConstants.CENTER);
    }
    return aboutVersionLabel;
  }
 
  /**
   * This method initializes aboutVersionLabel 
   *  
   * @return javax.swing.JLabel 
   */
  private JLabel getErrorVersionLabel() {
    if (errorVersionLabel == null) {
      errorVersionLabel = new JLabel();
      errorVersionLabel.setText("             You missed the required fileds with *.       ");
      errorVersionLabel.setBounds(new Rectangle(17, 70, 270, 16));
      errorVersionLabel.setHorizontalAlignment(SwingConstants.CENTER);
    }
    return errorVersionLabel;
  }

  /**
   * This method initializes jTabbedPane 
   *  
   * @return javax.swing.JTabbedPane 
   */
  private JTabbedPane getJTabbedPane() {
    if (jTabbedPane == null) {
      jTabbedPane = new JTabbedPane();
      jTabbedPane.setTabPlacement(JTabbedPane.LEFT);
      jTabbedPane.addTab("Start Project       ", new ImageIcon("icons/n1.png"), getJPanelStart(), null);
      jTabbedPane.addTab("CONTACT File      ", new ImageIcon("icons/n2.png"), getJPanel(), null);
      jTabbedPane.addTab("PUBLICATION File", new ImageIcon("icons/n3.png"), getJPanel1(), null);
      jTabbedPane.addTab("LIBRARY File         ", new ImageIcon("icons/n4.png"), getJPanel2(), null);
      jTabbedPane.addTab("EST File                   ", new ImageIcon("icons/n5.png"), getJPanel3(), null);
      jTabbedPane.addTab("Finish                       ", new ImageIcon("icons/n6.png"), getJPanelFinish(), null);
     
    }
    return jTabbedPane;
  }

  /**
   * This method initializes jPanel 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel() {
    if (jPanel == null) {
      jLabel79 = new JLabel();
      jLabel79.setBounds(new Rectangle(122, 296, 176, 18));
      jLabel79.setText("*: Field required");
      jLabel7 = new JLabel();
      jLabel7.setBounds(new Rectangle(46, 241, 73, 16));
      jLabel7.setToolTipText("Address string, comma delineation");
      jLabel7.setText("Address");
      jLabel6 = new JLabel();
      jLabel6.setBounds(new Rectangle(46, 212, 77, 16));
      jLabel6.setToolTipText("Institution name");
      jLabel6.setText("Institute");
      jLabel5 = new JLabel();
      jLabel5.setBounds(new Rectangle(45, 179, 76, 16));
      jLabel5.setToolTipText("Laboratory providing EST");
      jLabel5.setText("Laboratory");
      jLabel4 = new JLabel();
      jLabel4.setBounds(new Rectangle(46, 152, 38, 16));
      jLabel4.setToolTipText("Email address");
      jLabel4.setText("Email");
      jLabel3 = new JLabel();
      jLabel3.setBounds(new Rectangle(44, 118, 68, 16));
      jLabel3.setToolTipText("Telephone number as string of digits");
      jLabel3.setText("Telephone");
      jLabel2 = new JLabel();
      jLabel2.setBounds(new Rectangle(46, 90, 38, 16));
      jLabel2.setToolTipText("Fax number as string of digits");
      jLabel2.setText("Fax");
      jLabel1 = new JLabel();
      jLabel1.setBounds(new Rectangle(45, 60, 56, 16));
      jLabel1.setToolTipText("Name of person submitting the EST");
      jLabel1.setText("Name*");
      jLabel = new JLabel();
      jLabel.setBounds(new Rectangle(43, 31, 62, 16));
      jLabel.setToolTipText("Entry type (obligatory field)");
      jLabel.setText("Type*");
      jPanel = new JPanel();
      jPanel.setLayout(null);
      jPanel.add(jLabel, null);
      jPanel.add(jLabel1, null);
      jPanel.add(jLabel2, null);
      jPanel.add(jLabel3, null);
      jPanel.add(jLabel4, null);
      jPanel.add(jLabel5, null);
      jPanel.add(jLabel6, null);
      jPanel.add(jLabel7, null);
      jPanel.add(getJComboBoxCont(), null);
      jPanel.add(getJTextFieldName(), null);
      jPanel.add(getJTextFieldFax(), null);
      jPanel.add(getJTextFieldTel(), null);
      jPanel.add(getJTextFieldEmail(), null);
      jPanel.add(getJTextFieldLab(), null);
      jPanel.add(getJTextFieldInst(), null);
      jPanel.add(getJTextFieldAddr(), null);
      jPanel.add(getJButtonCont(), null);
      jPanel.add(jLabel79, null);
    }
    return jPanel;
  }

  /**
   * This method initializes jPanel1 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel1() {
    if (jPanel1 == null) {
      jLabel80 = new JLabel();
      jLabel80.setBounds(new Rectangle(135, 413, 152, 16));
      jLabel80.setText("*: Field required");
      jLabel78 = new JLabel();
      jLabel78.setBounds(new Rectangle(195, 362, 342, 16));
      jLabel78.setText("1: Unpublished; 2: Submitted; 3: In press; 4: Published");
      jLabel19 = new JLabel();
      jLabel19.setBounds(new Rectangle(43, 358, 53, 21));
      jLabel19.setToolTipText("Publication status (Obligatory field)");
      jLabel19.setText("Status*");
      jLabel18 = new JLabel();
      jLabel18.setBounds(new Rectangle(44, 329, 44, 16));
      jLabel18.setToolTipText("Year of publication (Obligatory field)");
      jLabel18.setText("Year*");
      jLabel17 = new JLabel();
      jLabel17.setBounds(new Rectangle(45, 299, 38, 16));
      jLabel17.setToolTipText("Page, format:   123-9");
      jLabel17.setText("Pages");
      jLabel16 = new JLabel();
      jLabel16.setBounds(new Rectangle(45, 270, 68, 20));
      jLabel16.setToolTipText("Issue supplement number");
      jLabel16.setText("I_Suppl");
      jLabel15 = new JLabel();
      jLabel15.setBounds(new Rectangle(43, 239, 65, 21));
      jLabel15.setToolTipText("Issue number");
      jLabel15.setText("Issue");
      jLabel14 = new JLabel();
      jLabel14.setBounds(new Rectangle(45, 209, 61, 18));
      jLabel14.setToolTipText("Supplement number");
      jLabel14.setText("Suppl");
      jLabel13 = new JLabel();
      jLabel13.setBounds(new Rectangle(46, 180, 60, 20));
      jLabel13.setToolTipText("Volume number");
      jLabel13.setText("Volume");
      jLabel12 = new JLabel();
      jLabel12.setBounds(new Rectangle(45, 151, 62, 21));
      jLabel12.setToolTipText("Journal name");
      jLabel12.setText("Journal");
      jLabel11 = new JLabel();
      jLabel11.setBounds(new Rectangle(46, 120, 64, 19));
      jLabel11.setToolTipText("Author name, format:  Name,I.I.; Name2,I.I.; Name3,I.I. (Obligatory field)");
      jLabel11.setText("Authors*");
      jLabel10 = new JLabel();
      jLabel10.setBounds(new Rectangle(45, 89, 49, 18));
      jLabel10.setToolTipText("Title of article (Obligatory field)");
      jLabel10.setText("Title*");
      jLabel9 = new JLabel();
      jLabel9.setBounds(new Rectangle(46, 60, 49, 17));
      jLabel9.setToolTipText("Medline unique identifier");
      jLabel9.setText("MEDUID");
      jLabel8 = new JLabel();
      jLabel8.setBounds(new Rectangle(44, 30, 38, 16));
      jLabel8.setToolTipText("Entry type (obligatory field)");
      jLabel8.setText("Type*");
      jPanel1 = new JPanel();
      jPanel1.setLayout(null);
      jPanel1.add(jLabel8, null);
      jPanel1.add(jLabel9, null);
      jPanel1.add(jLabel10, null);
      jPanel1.add(jLabel11, null);
      jPanel1.add(jLabel12, null);
      jPanel1.add(jLabel13, null);
      jPanel1.add(jLabel14, null);
      jPanel1.add(jLabel15, null);
      jPanel1.add(jLabel16, null);
      jPanel1.add(jLabel17, null);
      jPanel1.add(jLabel18, null);
      jPanel1.add(jLabel19, null);
      jPanel1.add(getJComboBoxPub(), null);
      jPanel1.add(getJTextFieldMed(), null);
      jPanel1.add(getJTextFieldTitle(), null);
      jPanel1.add(getJTextFieldAuthors(), null);
      jPanel1.add(getJTextFieldJournal(), null);
      jPanel1.add(getJTextFieldVolume(), null);
      jPanel1.add(getJTextFieldSuppl(), null);
      jPanel1.add(getJTextFieldIssue(), null);
      jPanel1.add(getJTextFieldI_Suppl(), null);
      jPanel1.add(getJTextFieldPages(), null);
      jPanel1.add(getJTextFieldYear(), null);
      jPanel1.add(getJComboBoxStatus(), null);
      jPanel1.add(getJButtonPub(), null);
      jPanel1.add(jLabel78, null);
      jPanel1.add(jLabel80, null);
    }
    return jPanel1;
  }

  /**
   * This method initializes jPanel2 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel2() {
    if (jPanel2 == null) {
      jLabel84 = new JLabel();
      jLabel84.setBounds(new Rectangle(121, 389, 89, 16));
      jLabel84.setText("*: Field required");
      jLabel37 = new JLabel();
      jLabel37.setBounds(new Rectangle(344, 206, 38, 16));
      jLabel37.setToolTipText("Description of library preparation methods, vector, etc");
      jLabel37.setText("Descr");
      jLabel36 = new JLabel();
      jLabel36.setBounds(new Rectangle(345, 176, 38, 16));
      jLabel36.setToolTipText("Restriction enzyme at site2 of vector");
      jLabel36.setText("RE_2");
      jLabel35 = new JLabel();
      jLabel35.setBounds(new Rectangle(345, 146, 38, 16));
      jLabel35.setToolTipText("Restriction enzyme at site1 of vector");
      jLabel35.setText("RE_1");
      jLabel34 = new JLabel();
      jLabel34.setBounds(new Rectangle(345, 115, 82, 16));
      jLabel34.setToolTipText("Type of vector");
      jLabel34.setText("Vector_Type");
      jLabel33 = new JLabel();
      jLabel33.setBounds(new Rectangle(345, 86, 47, 16));
      jLabel33.setToolTipText("Name of vector");
      jLabel33.setText("Vector");
      jLabel32 = new JLabel();
      jLabel32.setBounds(new Rectangle(345, 57, 38, 16));
      jLabel32.setToolTipText("Laboratory host");
      jLabel32.setText("Host");
      jLabel31 = new JLabel();
      jLabel31.setBounds(new Rectangle(344, 239, 38, 16));
      jLabel31.setToolTipText("Developmental stage");
      jLabel31.setText("Stage");
      jLabel30 = new JLabel();
      jLabel30.setBounds(new Rectangle(45, 330, 60, 16));
      jLabel30.setToolTipText("Name of cell line");
      jLabel30.setText("Cell_Line");
      jLabel29 = new JLabel();
      jLabel29.setBounds(new Rectangle(46, 300, 60, 16));
      jLabel29.setToolTipText("Cell type");
      jLabel29.setText("Cell_Type");
      jLabel28 = new JLabel();
      jLabel28.setBounds(new Rectangle(45, 270, 46, 16));
      jLabel28.setToolTipText("Tissue type");
      jLabel28.setText("Tissue");
      jLabel27 = new JLabel();
      jLabel27.setBounds(new Rectangle(45, 240, 38, 16));
      jLabel27.setToolTipText("Organ name");
      jLabel27.setText("Organ");
      jLabel26 = new JLabel();
      jLabel26.setBounds(new Rectangle(46, 210, 38, 16));
      jLabel26.setToolTipText("Sex of organism");
      jLabel26.setText("Sex");
      jLabel25 = new JLabel();
      jLabel25.setBounds(new Rectangle(45, 179, 60, 16));
      jLabel25.setToolTipText("Individual isolate from which the sequence was obtained");
      jLabel25.setText("Isolate");
      jLabel24 = new JLabel();
      jLabel24.setBounds(new Rectangle(46, 150, 61, 16));
      jLabel24.setToolTipText("Plant cultivar");
      jLabel24.setText("Cultivar");
      jLabel23 = new JLabel();
      jLabel23.setBounds(new Rectangle(46, 119, 38, 16));
      jLabel23.setToolTipText("Organism strain");
      jLabel23.setText("Strain");
      jLabel22 = new JLabel();
      jLabel22.setBounds(new Rectangle(46, 90, 70, 16));
      jLabel22.setToolTipText("Scientific name of Organism from which library prepared (Obligatory field)");
      jLabel22.setText("Organism*");
      jLabel21 = new JLabel();
      jLabel21.setBounds(new Rectangle(45, 61, 48, 16));
      jLabel21.setToolTipText("Name of library (Obligatory field)");
      jLabel21.setText("Name*");
      jLabel20 = new JLabel();
      jLabel20.setBounds(new Rectangle(45, 31, 38, 16));
      jLabel20.setToolTipText("Entry type (obligatory field)");
      jLabel20.setText("Type*");
      jPanel2 = new JPanel();
      jPanel2.setLayout(null);
      jPanel2.add(jLabel20, null);
      jPanel2.add(jLabel21, null);
      jPanel2.add(jLabel22, null);
      jPanel2.add(jLabel23, null);
      jPanel2.add(jLabel24, null);
      jPanel2.add(jLabel25, null);
      jPanel2.add(jLabel26, null);
      jPanel2.add(jLabel27, null);
      jPanel2.add(jLabel28, null);
      jPanel2.add(jLabel29, null);
      jPanel2.add(jLabel30, null);
      jPanel2.add(jLabel31, null);
      jPanel2.add(jLabel32, null);
      jPanel2.add(jLabel33, null);
      jPanel2.add(jLabel34, null);
      jPanel2.add(jLabel35, null);
      jPanel2.add(jLabel36, null);
      jPanel2.add(jLabel37, null);
      jPanel2.add(getJComboBoxLib(), null);
      jPanel2.add(getJTextFieldLibName(), null);
      jPanel2.add(getJTextFieldOrganism(), null);
      jPanel2.add(getJTextFieldStrain(), null);
      jPanel2.add(getJTextFieldCultivar(), null);
      jPanel2.add(getJTextFieldIsolate(), null);
      jPanel2.add(getJComboBoxSex(), null);
      jPanel2.add(getJTextFieldOrgan(), null);
      jPanel2.add(getJTextFieldTissue(), null);
      jPanel2.add(getJTextFieldCell_Type(), null);
      jPanel2.add(getJTextFieldCell_Line(), null);
      jPanel2.add(getJTextFieldStage(), null);
      jPanel2.add(getJTextFieldHost(), null);
      jPanel2.add(getJTextFieldVector(), null);
      jPanel2.add(getJComboBoxV_Type(), null);
      jPanel2.add(getJTextFieldRE_1(), null);
      jPanel2.add(getJTextFieldRE_2(), null);
      jPanel2.add(getJTextFieldDescr(), null);
      jPanel2.add(getJButtonLib(), null);
      jPanel2.add(jLabel84, null);
    }
    return jPanel2;
  }

  /**
   * This method initializes jPanel3 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanel3() {
    if (jPanel3 == null) {
      jLabel85 = new JLabel();
      jLabel85.setBounds(new Rectangle(298, 413, 88, 16));
      jLabel85.setText("*: Field required");
      jLabel82 = new JLabel();
      jLabel82.setBounds(new Rectangle(133, 225, 376, 21));
      jLabel82.setText("The first word in the sequence header will be used as EST#.");
      jLabel74 = new JLabel();
      jLabel74.setBounds(new Rectangle(44, 194, 89, 23));
      jLabel74.setText("Input Fasta file*");
      jLabel73 = new JLabel();
      jLabel73.setBounds(new Rectangle(344, 121, 61, 15));
      jLabel73.setToolTipText("Comments about EST.");
      jLabel73.setText("Comment");
      jLabel72 = new JLabel();
      jLabel72.setToolTipText("Y or N to indicate if a polyA tail was or was not found in the EST sequence.");
      jLabel72.setBounds(new Rectangle(480, 85, 38, 16));
      jLabel72.setText("PolyA");
      jLabel71 = new JLabel();
      jLabel71.setToolTipText("The actual sequence of the library tag found in the EST read. If the tag was searched for and not found, put 'Not found' in this field.");
      jLabel71.setBounds(new Rectangle(480, 54, 56, 19));
      jLabel71.setText("Tag_Seq");
      jLabel70 = new JLabel();
      jLabel70.setToolTipText("Tissue that was source for the tagged library, if a library tag was found.");
      jLabel70.setBounds(new Rectangle(389, 86, 76, 16));
      jLabel70.setText("Tag_Tissue");
      jLabel69 = new JLabel();
      jLabel69.setToolTipText("Name of library whose tag is found in this sequence");
      jLabel69.setBounds(new Rectangle(389, 55, 62, 16));
      jLabel69.setText("Tag_Lib");
      jLabel68 = new JLabel();
      jLabel68.setToolTipText("Putative identification of sequence by submitter");
      jLabel68.setBounds(new Rectangle(339, 86, 38, 16));
      jLabel68.setText("Put_ID");
      jLabel67 = new JLabel();
      jLabel67.setBounds(new Rectangle(343, 91, 46, 16));
      jLabel67.setToolTipText("Date of public release. Leave blank for immediate release.Format:  9/11/1994 (MM/DD/YYYY). Obligatory field.");
      jLabel67.setText("Public*");
      jLabel66 = new JLabel();
      jLabel66.setBounds(new Rectangle(45, 121, 62, 16));
      jLabel66.setToolTipText("cDNA (default), Genomic, Viral, Synthetic, Other");
      jLabel66.setText("DNA_Type");
      jLabel65 = new JLabel();
      jLabel65.setToolTipText("Base position of last base of highest quality sequence");
      jLabel65.setBounds(new Rectangle(458, 26, 122, 16));
      jLabel65.setText("HiQual_Stop");
      jLabel64 = new JLabel();
      jLabel64.setToolTipText("Base position of start of highest quality sequence (default=1)");
      jLabel64.setBounds(new Rectangle(309, 22, 119, 20));
      jLabel64.setText("HiQual_Start");
      jLabel63 = new JLabel();
      jLabel63.setBounds(new Rectangle(345, 150, 38, 16));
      jLabel63.setToolTipText("Which end sequenced e.g. 5'");
      jLabel63.setText("P_End");
      jLabel62 = new JLabel();
      jLabel62.setBounds(new Rectangle(43, 150, 74, 16));
      jLabel62.setToolTipText("Sequencing primer description or sequence");
      jLabel62.setText("Seq_Primer");
      jLabel61 = new JLabel();
      jLabel61.setToolTipText("Column number or letter");
      jLabel61.setBounds(new Rectangle(65, 35, 51, 16));
      jLabel61.setText("Column");
      jLabel60 = new JLabel();
      jLabel60.setToolTipText("Row number or letter");
      jLabel60.setBounds(new Rectangle(23, 34, 38, 16));
      jLabel60.setText("Row");
      jLabel59 = new JLabel();
      jLabel59.setToolTipText("Plate number or code");
      jLabel59.setBounds(new Rectangle(85, 18, 38, 16));
      jLabel59.setText("Plate");
      jLabel58 = new JLabel();
      jLabel58.setToolTipText("Estimated error in insert length (bases)");
      jLabel58.setBounds(new Rectangle(287, 89, 38, 16));
      jLabel58.setText("Error");
      jLabel57 = new JLabel();
      jLabel57.setToolTipText("Insert length (in bases)");
      jLabel57.setBounds(new Rectangle(287, 61, 78, 17));
      jLabel57.setText("Insert Length");
      jLabel56 = new JLabel();
      jLabel56.setToolTipText("Backward PCR primer sequence");
      jLabel56.setBounds(new Rectangle(212, 125, 47, 16));
      jLabel56.setText("PCR_B");
      jLabel55 = new JLabel();
      jLabel55.setToolTipText("Forward PCR primer sequence");
      jLabel55.setBounds(new Rectangle(212, 94, 48, 16));
      jLabel55.setText("PCR_F");
      jLabel54 = new JLabel();
      jLabel54.setToolTipText("Database cross-reference accession");
      jLabel54.setBounds(new Rectangle(211, 65, 61, 16));
      jLabel54.setText("DBXRef");
      jLabel53 = new JLabel();
      jLabel53.setToolTipText("Database name for cross-reference to another database");
      jLabel53.setBounds(new Rectangle(221, 141, 62, 16));
      jLabel53.setText("DBName");
      jLabel52 = new JLabel();
      jLabel52.setToolTipText("Other ESTs on this clone");
      jLabel52.setBounds(new Rectangle(141, 143, 62, 16));
      jLabel52.setText("Other_EST");
      jLabel51 = new JLabel();
      jLabel51.setToolTipText("Source id number for the clone stored in the host");
      jLabel51.setBounds(new Rectangle(128, 110, 90, 16));
      jLabel51.setText("Source_InHost");
      jLabel50 = new JLabel();
      jLabel50.setToolTipText("Source id number for the clone as pure DNA");
      jLabel50.setBounds(new Rectangle(128, 80, 76, 16));
      jLabel50.setText("Source_DNA");
      jLabel49 = new JLabel();
      jLabel49.setToolTipText("Source providing clone e.g. ATCC");
      jLabel49.setBounds(new Rectangle(58, 113, 48, 16));
      jLabel49.setText("Source");
      jLabel48 = new JLabel();
      jLabel48.setToolTipText("Clone id");
      jLabel48.setBounds(new Rectangle(15, 19, 59, 16));
      jLabel48.setText("Clone ID");
      jLabel47 = new JLabel();
      jLabel47.setToolTipText("Genome database Dsegment number");
      jLabel47.setBounds(new Rectangle(57, 83, 76, 16));
      jLabel47.setText("GDB_DSEG");
      jLabel46 = new JLabel();
      jLabel46.setToolTipText("Genome database accession number");
      jLabel46.setBounds(new Rectangle(9, 116, 38, 16));
      jLabel46.setText("GDB#");
      jLabel45 = new JLabel();
      jLabel45.setToolTipText("Secondary GenBank accessions");
      jLabel45.setBounds(new Rectangle(9, 86, 48, 16));
      jLabel45.setText("GB_SEC");
      jLabel44 = new JLabel();
      jLabel44.setToolTipText("GenBank accession number");
      jLabel44.setBounds(new Rectangle(9, 57, 38, 16));
      jLabel44.setText("GB#");
      jLabel43 = new JLabel();
      jLabel43.setBounds(new Rectangle(44, 225, 38, 16));
      jLabel43.setToolTipText("EST id assigned by contact lab (Obligatory field)");
      jLabel43.setText("EST# *");
      jLabel42 = new JLabel();
      jLabel42.setBounds(new Rectangle(343, 61, 47, 16));
      jLabel42.setToolTipText("Library name (must be identical string to library name entry, obligatory field)");
      jLabel42.setText("Library*");
      jLabel41 = new JLabel();
      jLabel41.setBounds(new Rectangle(46, 90, 61, 16));
      jLabel41.setToolTipText("Journal citation (must be identical string to the publication title, obligatory field)");
      jLabel41.setText("Citation*");
      jLabel40 = new JLabel();
      jLabel40.setBounds(new Rectangle(45, 60, 76, 16));
      jLabel40.setToolTipText("Name of contact (must be identical string to the contact entry, obligatory field)");
      jLabel40.setText("Cont_Name*");
      jLabel39 = new JLabel();
      jLabel39.setBounds(new Rectangle(344, 33, 49, 16));
      jLabel39.setToolTipText("Status of EST entry - \"New\" or \"Update\" (obligatory field)");
      jLabel39.setText("Status*");
      jLabel38 = new JLabel();
      jLabel38.setBounds(new Rectangle(45, 31, 38, 16));
      jLabel38.setToolTipText("Entry type (obligatory field)");
      jLabel38.setText("Type*");
      jPanel3 = new JPanel();
      jPanel3.setLayout(null);
      jPanel3.add(jLabel38, null);
      jPanel3.add(jLabel39, null);
      jPanel3.add(jLabel40, null);
      jPanel3.add(jLabel41, null);
      jPanel3.add(jLabel42, null);
      jPanel3.add(jLabel43, null);
      jPanel3.add(jLabel62, null);
      jPanel3.add(jLabel63, null);
      jPanel3.add(jLabel66, null);
      jPanel3.add(jLabel67, null);
      jPanel3.add(jLabel73, null);
      jPanel3.add(getJComboBoxEST(), null);
      jPanel3.add(getJComboBoxStatusEST(), null);
      jPanel3.add(getJTextFieldContEST(), null);
      jPanel3.add(getJTextFieldCitationEST(), null);
      jPanel3.add(getJTextFieldLibEST(), null);
      jPanel3.add(getJTextFieldPublic(), null);
      jPanel3.add(getJTextFieldDna_Type(), null);
      jPanel3.add(getJTextFieldComment(), null);
      jPanel3.add(getJTextFieldSeq_Primer(), null);
      jPanel3.add(getJTextFieldP_End(), null);
      // Do not show the advanced option in this version
      //jPanel3.add(getJButtonAdvanced(), null);
      jPanel3.add(getJScrollPane(), null);
      jPanel3.add(getJTextFieldInputFasta(), null);
      jPanel3.add(jLabel74, null);
      jPanel3.add(getJButtonFasta(), null);
      jPanel3.add(getJButtonLoad(), null);
      jPanel3.add(getJButtonEst(), null);
      jPanel3.add(jLabel82, null);
      jPanel3.add(jLabel85, null);
    }
    return jPanel3;
  }

  /**
   * This method initializes jComboBoxCont 
   *  
   * @return javax.swing.JComboBox 
   */
  private JComboBox getJComboBoxCont() {
    if (jComboBoxCont == null) {
      jComboBoxCont = new JComboBox(new String[]{"Cont"});
      jComboBoxCont.setBounds(new Rectangle(121, 29, 69, 25));
    }
    return jComboBoxCont;
  }

  /**
   * This method initializes jTextFieldName 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldName() {
    if (jTextFieldName == null) {
      jTextFieldName = new JTextField();
      jTextFieldName.setBounds(new Rectangle(121, 60, 211, 20));
      jTextFieldName.getDocument().addDocumentListener(new DocumentListener () {
        public void changedUpdate(DocumentEvent arg0) {
        }
        public void insertUpdate(DocumentEvent arg0) {
          jTextFieldContEST.setText(jTextFieldName.getText());
        }
        public void removeUpdate(DocumentEvent arg0) {
          jTextFieldContEST.setText(jTextFieldName.getText());
        }
      });
    }
    return jTextFieldName;
  }

  /**
   * This method initializes jTextFieldFax 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldFax() {
    if (jTextFieldFax == null) {
      jTextFieldFax = new JTextField();
      jTextFieldFax.setBounds(new Rectangle(121, 91, 211, 20));
    }
    return jTextFieldFax;
  }

  /**
   * This method initializes jTextFieldTel 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldTel() {
    if (jTextFieldTel == null) {
      jTextFieldTel = new JTextField();
      jTextFieldTel.setBounds(new Rectangle(121, 119, 209, 19));
    }
    return jTextFieldTel;
  }

  /**
   * This method initializes jTextFieldEmail 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldEmail() {
    if (jTextFieldEmail == null) {
      jTextFieldEmail = new JTextField();
      jTextFieldEmail.setBounds(new Rectangle(120, 150, 211, 19));
    }
    return jTextFieldEmail;
  }

  /**
   * This method initializes jTextFieldLab 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldLab() {
    if (jTextFieldLab == null) {
      jTextFieldLab = new JTextField();
      jTextFieldLab.setBounds(new Rectangle(121, 177, 210, 19));
    }
    return jTextFieldLab;
  }

  /**
   * This method initializes jTextFieldInst 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldInst() {
    if (jTextFieldInst == null) {
      jTextFieldInst = new JTextField();
      jTextFieldInst.setBounds(new Rectangle(120, 209, 212, 19));
    }
    return jTextFieldInst;
  }

  /**
   * This method initializes jTextFieldAddr 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldAddr() {
    if (jTextFieldAddr == null) {
      jTextFieldAddr = new JTextField();
      jTextFieldAddr.setBounds(new Rectangle(120, 239, 360, 21));
    }
    return jTextFieldAddr;
  }

  /**
   * This method initializes jButtonCont 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButtonCont() {
    if (jButtonCont == null) {
      jButtonCont = new JButton();
      jButtonCont.setBounds(new Rectangle(121, 268, 179, 20));
      jButtonCont.setText("Generate CONTACT File");
      jButtonCont.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          if (jTextFieldName.getText().equalsIgnoreCase("") ) {
            errorDialog = getErrorDialog();
            errorDialog.pack();
            Point loc = getJFrame().getLocation();
            loc.translate(60, 60);
            errorDialog.setLocation(loc);
            errorDialog.setVisible(true);
          }
          else {
            contactFilePath = filePath+ "/CONTACT";
            try {
              outputContact = new PrintWriter(new FileWriter(contactFilePath));
            } catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }   
            String contactInfo = getContactInfo();
            outputContact.println(contactInfo);
            outputContact.close();
          }
        }
      });
    }
    return jButtonCont;
  }

/**
* This method  getContactInfo 
*  
* @return String
*/
private String getContactInfo() {
  String contactInfo;
  contactInfo  = "TYPE: Cont\n";
  if (!jTextFieldName.getText().equalsIgnoreCase("")) {
    contactInfo = contactInfo + "NAME: " + jTextFieldName.getText() + "\n";
  }
  if (!jTextFieldFax.getText().equalsIgnoreCase("")) {
    contactInfo = contactInfo + "FAX:  " + jTextFieldFax.getText() + "\n";
  }
  if (!jTextFieldTel.getText().equalsIgnoreCase("") ) {
    contactInfo = contactInfo + "TEL:  " + jTextFieldTel.getText() + "\n";
  }
  if (!jTextFieldEmail.getText().equalsIgnoreCase("") ) {
    contactInfo = contactInfo + "EMAIL:" + jTextFieldEmail.getText() + "\n";
  }
  if (!jTextFieldLab.getText().equalsIgnoreCase("") ) {
    contactInfo = contactInfo + "LAB:  " + jTextFieldLab.getText() + "\n";
  }
  if (!jTextFieldInst.getText().equalsIgnoreCase("") ) {
    contactInfo = contactInfo + "INST: " + jTextFieldInst.getText() + "\n";
  }
  if (!jTextFieldAddr.getText().equalsIgnoreCase("") ) {
    contactInfo = contactInfo + "ADDR: " + jTextFieldAddr.getText() + "\n";
  }
  contactInfo = contactInfo + "||" + "\n";
  return contactInfo;
  }

  /**
   * This method initializes jComboBoxPub 
   *  
   * @return javax.swing.JComboBox 
   */
  private JComboBox getJComboBoxPub() {
    if (jComboBoxPub == null) {
      jComboBoxPub = new JComboBox(new String [] {"Pub"});
      jComboBoxPub.setBounds(new Rectangle(135, 31, 66, 21));
    }
    return jComboBoxPub;
  }

  /**
   * This method initializes jTextFieldMed 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldMed() {
    if (jTextFieldMed == null) {
      jTextFieldMed = new JTextField();
      jTextFieldMed.setBounds(new Rectangle(134, 60, 68, 21));
    }
    return jTextFieldMed;
  }

  /**
   * This method initializes jTextFieldTitle 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldTitle() {
    if (jTextFieldTitle == null) {
      jTextFieldTitle = new JTextField();
      jTextFieldTitle.setBounds(new Rectangle(135, 91, 361, 18));
      jTextFieldTitle.getDocument().addDocumentListener(new DocumentListener () {
        public void changedUpdate(DocumentEvent arg0) {
        }
        public void insertUpdate(DocumentEvent arg0) {
          jTextFieldCitationEST.setText(jTextFieldTitle.getText());
        }
        public void removeUpdate(DocumentEvent arg0) {
          jTextFieldCitationEST.setText(jTextFieldTitle.getText());
        }
      });
    }
    return jTextFieldTitle;
  }

  /**
   * This method initializes jTextFieldAuthors 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldAuthors() {
    if (jTextFieldAuthors == null) {
      jTextFieldAuthors = new JTextField();
      jTextFieldAuthors.setBounds(new Rectangle(134, 121, 361, 19));
    }
    return jTextFieldAuthors;
  }

  /**
   * This method initializes jTextFieldJournal 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldJournal() {
    if (jTextFieldJournal == null) {
      jTextFieldJournal = new JTextField();
      jTextFieldJournal.setBounds(new Rectangle(136, 151, 357, 20));
    }
    return jTextFieldJournal;
  }

  /**
   * This method initializes jTextFieldVolume 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldVolume() {
    if (jTextFieldVolume == null) {
      jTextFieldVolume = new JTextField();
      jTextFieldVolume.setBounds(new Rectangle(135, 179, 54, 20));
    }
    return jTextFieldVolume;
  }

  /**
   * This method initializes jTextFieldSuppl 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldSuppl() {
    if (jTextFieldSuppl == null) {
      jTextFieldSuppl = new JTextField();
      jTextFieldSuppl.setBounds(new Rectangle(135, 209, 55, 20));
    }
    return jTextFieldSuppl;
  }

  /**
   * This method initializes jTextFieldIssue 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldIssue() {
    if (jTextFieldIssue == null) {
      jTextFieldIssue = new JTextField();
      jTextFieldIssue.setBounds(new Rectangle(136, 240, 54, 23));
    }
    return jTextFieldIssue;
  }

  /**
   * This method initializes jTextFieldI_Suppl 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldI_Suppl() {
    if (jTextFieldI_Suppl == null) {
      jTextFieldI_Suppl = new JTextField();
      jTextFieldI_Suppl.setBounds(new Rectangle(135, 271, 56, 21));
    }
    return jTextFieldI_Suppl;
  }

  /**
   * This method initializes jTextFieldPages 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldPages() {
    if (jTextFieldPages == null) {
      jTextFieldPages = new JTextField();
      jTextFieldPages.setBounds(new Rectangle(135, 299, 56, 19));
    }
    return jTextFieldPages;
  }

  /**
   * This method initializes jTextFieldYear 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldYear() {
    if (jTextFieldYear == null) {
      jTextFieldYear = new JTextField();
      jTextFieldYear.setBounds(new Rectangle(135, 330, 56, 21));
    }
    return jTextFieldYear;
  }

  /**
   * This method initializes jComboBoxStatus 
   *  
   * @return javax.swing.JComboBox 
   */
  private JComboBox getJComboBoxStatus() {
    if (jComboBoxStatus == null) {
      jComboBoxStatus = new JComboBox(new String [] {"1", "2", "3", "4"} );
      jComboBoxStatus.setBounds(new Rectangle(136, 361, 55, 21));
    }
    return jComboBoxStatus;
  }

  /**
   * This method initializes jComboBoxLib 
   *  
   * @return javax.swing.JComboBox 
   */
  private JComboBox getJComboBoxLib() {
    if (jComboBoxLib == null) {
      jComboBoxLib = new JComboBox(new String [] {"Lib"} );
      jComboBoxLib.setBounds(new Rectangle(121, 32, 77, 17));
    }
    return jComboBoxLib;
  }

  /**
   * This method initializes jTextFieldLibName 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldLibName() {
    if (jTextFieldLibName == null) {
      jTextFieldLibName = new JTextField();
      jTextFieldLibName.setBounds(new Rectangle(120, 60, 180, 19));
      jTextFieldLibName.getDocument().addDocumentListener(new DocumentListener () {
        public void changedUpdate(DocumentEvent arg0) {
        }
        public void insertUpdate(DocumentEvent arg0) {
          jTextFieldLibEST.setText(jTextFieldLibName.getText());
        }
        public void removeUpdate(DocumentEvent arg0) {
          jTextFieldLibEST.setText(jTextFieldLibName.getText());
        }
      });
    }
    return jTextFieldLibName;
  }

  /**
   * This method initializes jTextFieldOrganism 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldOrganism() {
    if (jTextFieldOrganism == null) {
      jTextFieldOrganism = new JTextField();
      jTextFieldOrganism.setBounds(new Rectangle(120, 90, 181, 21));
    }
    return jTextFieldOrganism;
  }

  /**
   * This method initializes jTextFieldStrain 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldStrain() {
    if (jTextFieldStrain == null) {
      jTextFieldStrain = new JTextField();
      jTextFieldStrain.setBounds(new Rectangle(120, 120, 180, 20));
    }
    return jTextFieldStrain;
  }

  /**
   * This method initializes jTextFieldCultivar 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldCultivar() {
    if (jTextFieldCultivar == null) {
      jTextFieldCultivar = new JTextField();
      jTextFieldCultivar.setBounds(new Rectangle(120, 149, 181, 20));
    }
    return jTextFieldCultivar;
  }

  /**
   * This method initializes jTextFieldIsolate 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldIsolate() {
    if (jTextFieldIsolate == null) {
      jTextFieldIsolate = new JTextField();
      jTextFieldIsolate.setBounds(new Rectangle(120, 180, 181, 19));
    }
    return jTextFieldIsolate;
  }

  /**
   * This method initializes jComboBoxSex 
   *  
   * @return javax.swing.JComboBox 
   */
  private JComboBox getJComboBoxSex() {
    if (jComboBoxSex == null) {
      jComboBoxSex = new JComboBox(new String [] {
          "", "female", "male", "hermaphrodite"} );
      jComboBoxSex.setBounds(new Rectangle(121, 209, 137, 16));
    }
    return jComboBoxSex;
  }

  /**
   * This method initializes jTextFieldOrgan 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldOrgan() {
    if (jTextFieldOrgan == null) {
      jTextFieldOrgan = new JTextField();
      jTextFieldOrgan.setBounds(new Rectangle(120, 240, 180, 20));
    }
    return jTextFieldOrgan;
  }

  /**
   * This method initializes jTextFieldTissue 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldTissue() {
    if (jTextFieldTissue == null) {
      jTextFieldTissue = new JTextField();
      jTextFieldTissue.setBounds(new Rectangle(120, 270, 180, 20));
    }
    return jTextFieldTissue;
  }

  /**
   * This method initializes jTextFieldCell_Type 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldCell_Type() {
    if (jTextFieldCell_Type == null) {
      jTextFieldCell_Type = new JTextField();
      jTextFieldCell_Type.setBounds(new Rectangle(120, 301, 180, 20));
    }
    return jTextFieldCell_Type;
  }

  /**
   * This method initializes jTextFieldCell_Line 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldCell_Line() {
    if (jTextFieldCell_Line == null) {
      jTextFieldCell_Line = new JTextField();
      jTextFieldCell_Line.setBounds(new Rectangle(121, 330, 180, 20));
    }
    return jTextFieldCell_Line;
  }

  /**
   * This method initializes jTextFieldStage 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldStage() {
    if (jTextFieldStage == null) {
      jTextFieldStage = new JTextField();
      jTextFieldStage.setBounds(new Rectangle(434, 239, 165, 20));
    }
    return jTextFieldStage;
  }

  /**
   * This method initializes jTextFieldHost 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldHost() {
    if (jTextFieldHost == null) {
      jTextFieldHost = new JTextField();
      jTextFieldHost.setBounds(new Rectangle(435, 56, 168, 20));
    }
    return jTextFieldHost;
  }

  /**
   * This method initializes jTextFieldVector 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldVector() {
    if (jTextFieldVector == null) {
      jTextFieldVector = new JTextField();
      jTextFieldVector.setBounds(new Rectangle(434, 86, 168, 20));
    }
    return jTextFieldVector;
  }


  /**
   * This method initializes jComboBoxV_Type 
   *  
   * @return javax.swing.JComboBox 
   */
  private JComboBox getJComboBoxV_Type() {
    if (jComboBoxV_Type == null) {
      jComboBoxV_Type = new JComboBox(new String [] {
          "", "Cosmid", "Phage", "Plasmid", "YAC", "other"});
      jComboBoxV_Type.setBounds(new Rectangle(434, 116, 135, 17));
    }
    return jComboBoxV_Type;
  }

  /**
   * This method initializes jTextFieldRE_1 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldRE_1() {
    if (jTextFieldRE_1 == null) {
      jTextFieldRE_1 = new JTextField();
      jTextFieldRE_1.setBounds(new Rectangle(436, 145, 165, 19));
    }
    return jTextFieldRE_1;
  }

  /**
   * This method initializes jTextFieldRE_2 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldRE_2() {
    if (jTextFieldRE_2 == null) {
      jTextFieldRE_2 = new JTextField();
      jTextFieldRE_2.setBounds(new Rectangle(435, 176, 169, 20));
    }
    return jTextFieldRE_2;
  }

  /**
   * This method initializes jTextFieldDescr 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldDescr() {
    if (jTextFieldDescr == null) {
      jTextFieldDescr = new JTextField();
      jTextFieldDescr.setBounds(new Rectangle(435, 207, 167, 20));
    }
    return jTextFieldDescr;
  }

  /**
   * This method initializes jComboBoxEST 
   *  
   * @return javax.swing.JComboBox 
   */
  private JComboBox getJComboBoxEST() {
    if (jComboBoxEST == null) {
      jComboBoxEST = new JComboBox(new String [] {"EST"} );
      jComboBoxEST.setBounds(new Rectangle(134, 32, 79, 18));
      jComboBoxEST.setEnabled(true);
    }
    return jComboBoxEST;
  }

  /**
   * This method initializes jComboBoxStatusEST 
   *  
   * @return javax.swing.JComboBox 
   */
  private JComboBox getJComboBoxStatusEST() {
    if (jComboBoxStatusEST == null) {
      jComboBoxStatusEST = new JComboBox(new String [] {"New", "Update"} );
      jComboBoxStatusEST.setBounds(new Rectangle(405, 31, 81, 18));
    }
    return jComboBoxStatusEST;
  }

  /**
   * This method initializes jTextFieldContEST 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldContEST() {
    if (jTextFieldContEST == null) {
      jTextFieldContEST = new JTextField();
      jTextFieldContEST.setBounds(new Rectangle(133, 58, 183, 20));
      jTextFieldContEST.setEditable(false);
    }
    return jTextFieldContEST;
  }

  /**
   * This method initializes jTextFieldCitationEST 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldCitationEST() {
    if (jTextFieldCitationEST == null) {
      jTextFieldCitationEST = new JTextField();
      jTextFieldCitationEST.setBounds(new Rectangle(133, 90, 184, 20));
      jTextFieldCitationEST.setEditable(false);
    }
    return jTextFieldCitationEST;
  }

  /**
   * This method initializes jTextFieldLibEST 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldLibEST() {
    if (jTextFieldLibEST == null) {
      jTextFieldLibEST = new JTextField();
      jTextFieldLibEST.setBounds(new Rectangle(404, 61, 198, 20));
      jTextFieldLibEST.setEditable(false);
    }
    return jTextFieldLibEST;
  }

  /**
   * This method initializes jTextFieldPublic 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldPublic() {
    if (jTextFieldPublic == null) {
      jTextFieldPublic = new JTextField();
      jTextFieldPublic.setBounds(new Rectangle(403, 91, 198, 17));
    }
    return jTextFieldPublic;
  }

  /**
   * This method initializes jPanelStart 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanelStart() {
    if (jPanelStart == null) {
      jLabel89 = new JLabel();
      jLabel89.setBounds(new Rectangle(46, 240, 511, 16));
      jLabel89.setToolTipText("Tips: Move the mouse on the labels of fields for tips when inputting data. \");");
      jLabel89.setText("Tips: Move the mouse on the labels of fields for tips when inputting data. ");
      jLabel83 = new JLabel();
      jLabel83.setBounds(new Rectangle(45, 135, 511, 19));
      jLabel83.setText("*: Field required. You have to set a directory firstly, otherwise you can not do anything. ");
      jLabel77 = new JLabel();
      jLabel77.setBounds(new Rectangle(44, 195, 512, 16));
      jLabel77.setText("Then please create files of CONTACT, PUBLICATION, LIBRARY and EST step by step. ");
      jLabel76 = new JLabel();
      jLabel76.setBounds(new Rectangle(46, 75, 511, 15));
      jLabel76.setText("To start a project, please firstly indicate a directory for the output files * :");
      jLabel75 = new JLabel();
      jLabel75.setBounds(new Rectangle(45, 30, 211, 18));
      jLabel75.setText("Welcome to ESTsSubmitter!");
      jPanelStart = new JPanel();
      jPanelStart.setLayout(null);
      jPanelStart.add(jLabel75, null);
      jPanelStart.add(jLabel76, null);
      jPanelStart.add(getJTextFieldDir(), null);
      jPanelStart.add(getJButtonDir(), null);
      jPanelStart.add(jLabel77, null);
      jPanelStart.add(jLabel83, null);
      jPanelStart.add(jLabel89, null);
    }
    return jPanelStart;
  }

  /**
   * This method initializes jTextFieldDir 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldDir() {
    if (jTextFieldDir == null) {
      jTextFieldDir = new JTextField();
      jTextFieldDir.setBounds(new Rectangle(45, 105, 407, 23));
    }
    return jTextFieldDir;
  }

  /**
   * This method initializes jButtonDir 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButtonDir() {
    if (jButtonDir == null) {
      jButtonDir = new JButton();
      jButtonDir.setBounds(new Rectangle(466, 105, 90, 20));
      jButtonDir.setText("Browse");
      jButtonDir.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          if (filePath == null) {
            filePath = new String(".");
          }
          JFileChooser fc = new JFileChooser(filePath);
          fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
          fc.showOpenDialog(jButtonDir);
          File projectDir = fc.getSelectedFile();
          String projectDirPath = projectDir.getAbsolutePath();
          jTextFieldDir.setText(projectDirPath);
          filePath = projectDirPath;
          if (projectDirPath != null) {
            jButtonCont.setEnabled(true);
            jButtonPub.setEnabled(true);
            jButtonLib.setEnabled(true);
            jButtonEst.setEnabled(true);
          }
        }
      });
    }
    return jButtonDir;
  }

  /**
   * This method initializes jPanelFinish 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJPanelFinish() {
    if (jPanelFinish == null) {
      jLabel90 = new JLabel();
      jLabel90.setBounds(new Rectangle(45, 64, 520, 16));
      jLabel90.setText("For submission, mail the 4 files to dbEST (batch-sub@ncbi.nlm.nih.gov).");
      jLabel88 = new JLabel();
      jLabel88.setBounds(new Rectangle(45, 253, 189, 12));
      jLabel88.setText("Dec 2008");
      jLabel87 = new JLabel();
      jLabel87.setBounds(new Rectangle(44, 224, 233, 17));
      jLabel87.setText("Weizhong Li");
      jLabel86 = new JLabel();
      jLabel86.setBounds(new Rectangle(46, 120, 314, 22));
      jLabel86.setText("Thanks for using ESTsSubmitter!");
      jLabel81 = new JLabel();
      jLabel81.setBounds(new Rectangle(44, 30, 521, 21));
      jLabel81.setText("To see the result in your project, just go to the fold you specified in the Step 1. ");
      jPanelFinish = new JPanel();
      jPanelFinish.setLayout(null);
      jPanelFinish.add(jLabel81, null);
      jPanelFinish.add(jLabel86, null);
      jPanelFinish.add(jLabel87, null);
      jPanelFinish.add(jLabel88, null);
      jPanelFinish.add(jLabel90, null);
    }
    return jPanelFinish;
  }

  /**
   * This method initializes jButtonPub 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButtonPub() {
    if (jButtonPub == null) {
      jButtonPub = new JButton();
      jButtonPub.setBounds(new Rectangle(135, 389, 196, 22));
      jButtonPub.setText("Generate PUBLICATION File");
      jButtonPub.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          if (jTextFieldTitle.getText().equalsIgnoreCase("")
              || jTextFieldAuthors.getText().equalsIgnoreCase("")
              || jTextFieldYear.getText().equalsIgnoreCase("")  ) {
            errorDialog = getErrorDialog();
            errorDialog.pack();
            Point loc = getJFrame().getLocation();
            loc.translate(60, 60);
            errorDialog.setLocation(loc);
            errorDialog.setVisible(true);
          }
          else {
            publicationFilePath = filePath+ "/PUBLICATION";
            try {
              outputPublication = new PrintWriter(new FileWriter(publicationFilePath));
            } catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }   
            String publicationInfo = getPublicationInfo();
            outputPublication.println(publicationInfo);
            outputPublication.close();
          }
        }
      });
    }
    return jButtonPub;
  }

  /**
   * This method  getPublicationInfo 
   *  
   * @return String
   */
  private String getPublicationInfo() {
    String publicationInfo;
    publicationInfo  = "TYPE:    Pub\n";
    if (!jTextFieldMed.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "MEDUID:  " + jTextFieldMed.getText() + "\n";
    }
    if (!jTextFieldTitle.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "TITLE:   \n";
      publicationInfo = publicationInfo + jTextFieldTitle.getText() + "\n";
    }
    if (!jTextFieldAuthors.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "AUTHORS: \n";
      publicationInfo = publicationInfo + jTextFieldAuthors.getText() + "\n";
    }
    if (!jTextFieldJournal.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "JOURNAL: " + jTextFieldJournal.getText() + "\n";
    }
    if (!jTextFieldVolume.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "VOLUME:  " + jTextFieldVolume.getText() + "\n";
    }
    if (!jTextFieldSuppl.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "Suppl:   " + jTextFieldSuppl.getText() + "\n";
    }
    if (!jTextFieldIssue.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "ISSUE:   " + jTextFieldIssue.getText() + "\n";
    }
    if (!jTextFieldI_Suppl.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "I_Suppl: " + jTextFieldI_Suppl.getText() + "\n";
    }
    if (!jTextFieldPages.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "PAGES:   " + jTextFieldPages.getText() + "\n";
    }
    if (!jTextFieldYear.getText().equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "YEAR:    " + jTextFieldYear.getText() + "\n";
    }
    if (!((String) jComboBoxStatus.getSelectedItem()).equalsIgnoreCase("") ) {
      publicationInfo = publicationInfo + "STATUS:  " + jComboBoxStatus.getSelectedItem() + "\n";
    }
    publicationInfo = publicationInfo + "||" + "\n";
    return publicationInfo;
    }
 
  /**
   * This method initializes jButtonLib 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButtonLib() {
    if (jButtonLib == null) {
      jButtonLib = new JButton();
      jButtonLib.setBounds(new Rectangle(121, 359, 190, 23));
      jButtonLib.setText("Generate LIBRARY File");
      jButtonLib.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          if (jTextFieldLibName.getText().equalsIgnoreCase("")
              || jTextFieldOrganism.getText().equalsIgnoreCase("") ) {
            errorDialog = getErrorDialog();
            errorDialog.pack();
            Point loc = getJFrame().getLocation();
            loc.translate(60, 60);
            errorDialog.setLocation(loc);
            errorDialog.setVisible(true);
          }
          else {
            libraryFilePath = filePath+ "/LIBRARY";
            try {
              outputLibrary = new PrintWriter(new FileWriter(libraryFilePath));
            } catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }   
            String libraryInfo = getLibraryInfo();
            outputLibrary.println(libraryInfo);
            outputLibrary.close();
          }
        }
      });
    }
    return jButtonLib;
  }

  /**
   * This method  getLibraryInfo 
   *  
   * @return String
   */
  private String getLibraryInfo() {
    String libraryInfo;
    libraryInfo  = "TYPE:      Lib\n";
    if (!jTextFieldLibName.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "NAME:      " + jTextFieldLibName.getText() + "\n";
    }
    if (!jTextFieldOrganism.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "ORGANISM:  " + jTextFieldOrganism.getText() + "\n";
    }
    if (!jTextFieldStrain.getText().equalsIgnoreCase("") ) {    
      libraryInfo = libraryInfo + "STRAIN:    " + jTextFieldStrain.getText() + "\n";
    }
    if (!jTextFieldCultivar.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "CULTIVAR:  " + jTextFieldCultivar.getText() + "\n";
    }
    if (!jTextFieldIsolate.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "ISOLATE:   " + jTextFieldIsolate.getText() + "\n";
    }
    if (!((String) jComboBoxSex.getSelectedItem()).equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "SEX:       " + jComboBoxSex.getSelectedItem() + "\n";
    }
    if (!jTextFieldOrgan.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "ORGAN:     " + jTextFieldOrgan.getText() + "\n";
    }
    if (!jTextFieldTissue.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "TISSUE:    " + jTextFieldTissue.getText() + "\n";
    }
    if (!jTextFieldCell_Type.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "CELL_TYPE: " + jTextFieldCell_Type.getText() + "\n";
    }
    if (!jTextFieldCell_Line.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "CELL_LINE: " + jTextFieldCell_Line.getText() + "\n";
    }
    if (!jTextFieldStage.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "STAGE:     " + jTextFieldStage.getText() + "\n";
    }
    if (!jTextFieldHost.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "HOST:      " + jTextFieldHost.getText() + "\n";
    }
    if (!jTextFieldVector.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "VECTOR:    " + jTextFieldVector.getText() + "\n";
    }
    if (!((String) jComboBoxV_Type.getSelectedItem()).equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "V_TYPE:    " + jComboBoxV_Type.getSelectedItem() + "\n";
    }
    if (!jTextFieldRE_1.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "RE_1:      " + jTextFieldRE_1.getText() + "\n";
    }
    if (!jTextFieldRE_2.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "RE_2:      " + jTextFieldRE_2.getText() + "\n";
    }
    if (!jTextFieldDescr.getText().equalsIgnoreCase("") ) {
      libraryInfo = libraryInfo + "DESCR:     \n";
      libraryInfo = libraryInfo + jTextFieldDescr.getText() + "\n";
    }
    libraryInfo = libraryInfo + "||" + "\n";
    return libraryInfo;
    }
 
  /**
   * This method initializes jTextFieldDna_Type 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldDna_Type() {
    if (jTextFieldDna_Type == null) {
      jTextFieldDna_Type = new JTextField();
      jTextFieldDna_Type.setBounds(new Rectangle(132, 119, 185, 22));
    }
    return jTextFieldDna_Type;
  }

  /**
   * This method initializes jTextFieldComment 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldComment() {
    if (jTextFieldComment == null) {
      jTextFieldComment = new JTextField();
      jTextFieldComment.setBounds(new Rectangle(405, 120, 197, 17));
    }
    return jTextFieldComment;
  }

  /**
   * This method initializes jTextFieldSeq_Primer 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldSeq_Primer() {
    if (jTextFieldSeq_Primer == null) {
      jTextFieldSeq_Primer = new JTextField();
      jTextFieldSeq_Primer.setBounds(new Rectangle(134, 148, 182, 21));
    }
    return jTextFieldSeq_Primer;
  }

  /**
   * This method initializes jTextFieldP_End 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldP_End() {
    if (jTextFieldP_End == null) {
      jTextFieldP_End = new JTextField();
      jTextFieldP_End.setBounds(new Rectangle(405, 150, 199, 17));
    }
    return jTextFieldP_End;
  }

  /**
   * This method initializes jFrameAdvanced 
   *  
   * @return javax.swing.JFrame 
   */
  private JFrame getJFrameAdvanced() {
    if (jFrameAdvanced == null) {
      jFrameAdvanced = new JFrame();
      jFrameAdvanced.setSize(new Dimension(585, 208));
      jFrameAdvanced.setTitle("Advanced options for EST");
      jFrameAdvanced.setContentPane(getJContentPaneAdvance());
    }
    return jFrameAdvanced;
  }

  /**
   * This method initializes jContentPaneAdvance 
   *  
   * @return javax.swing.JPanel 
   */
  private JPanel getJContentPaneAdvance() {
    if (jContentPaneAdvance == null) {
      jContentPaneAdvance = new JPanel();
      jContentPaneAdvance.setLayout(null);
      jContentPaneAdvance.add(jLabel44, null);
      jContentPaneAdvance.add(jLabel45, null);
      jContentPaneAdvance.add(jLabel46, null);
      jContentPaneAdvance.add(jLabel47, null);
      jContentPaneAdvance.add(jLabel49, null);
      jContentPaneAdvance.add(jLabel50, null);
      jContentPaneAdvance.add(jLabel51, null);
      jContentPaneAdvance.add(jLabel54, null);
      jContentPaneAdvance.add(jLabel55, null);
      jContentPaneAdvance.add(jLabel56, null);
      jContentPaneAdvance.add(jLabel53, null);
      jContentPaneAdvance.add(jLabel64, null);
      jContentPaneAdvance.add(jLabel57, null);
      jContentPaneAdvance.add(jLabel58, null);
      jContentPaneAdvance.add(jLabel68, null);
      jContentPaneAdvance.add(jLabel69, null);
      jContentPaneAdvance.add(jLabel70, null);
      jContentPaneAdvance.add(jLabel65, null);
      jContentPaneAdvance.add(jLabel71, null);
      jContentPaneAdvance.add(jLabel72, null);
      jContentPaneAdvance.add(jLabel52, null);
      jContentPaneAdvance.add(jLabel48, null);
      jContentPaneAdvance.add(jLabel59, null);
      jContentPaneAdvance.add(jLabel60, null);
      jContentPaneAdvance.add(jLabel61, null);
    }
    return jContentPaneAdvance;
  }

  /**
   * This method initializes jButtonAdvanced 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButtonAdvanced() {
    if (jButtonAdvanced == null) {
      jButtonAdvanced = new JButton();
      jButtonAdvanced.setBounds(new Rectangle(446, 290, 156, 25));
      jButtonAdvanced.setText("Advanced Options");
      jButtonAdvanced.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          getJFrameAdvanced();
          Point loc = getJFrame().getLocation();
          loc.translate(100, 100);
          jFrameAdvanced.setLocation(loc);
          jFrameAdvanced.setVisible(true);
        }
      });
    }
    return jButtonAdvanced;
  }

  /**
   * This method initializes jScrollPane 
   *  
   * @return javax.swing.JScrollPane 
   */
  private JScrollPane getJScrollPane() {
    if (jScrollPane == null) {
      jScrollPane = new JScrollPane();
      jScrollPane.setBounds(new Rectangle(134, 289, 281, 118));
      jScrollPane.setViewportView(getJTable());
    }
    return jScrollPane;
  }

  /**
   * This method initializes jTable 
   *  
   * @return javax.swing.JTable 
   */
  private JTable getJTable() {
    if (jTable == null) {
      jTable = new JTable();
      jTable.setToolTipText("In the table, EST id assigned by contact lab (Obligatory field); ");
      String[] columnNames = {"EST#"};
      Object[][] data = { };
      DefaultTableModel model = new DefaultTableModel(data,columnNames);
      jTable.setModel(model);
    }
    return jTable;
  }

  /**
   * This method initializes jTextFieldInputFasta 
   *  
   * @return javax.swing.JTextField 
   */
  private JTextField getJTextFieldInputFasta() {
    if (jTextFieldInputFasta == null) {
      jTextFieldInputFasta = new JTextField();
      jTextFieldInputFasta.setBounds(new Rectangle(135, 195, 374, 21));
    }
    return jTextFieldInputFasta;
  }

  /**
   * This method initializes jButtonFasta 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButtonFasta() {
    if (jButtonFasta == null) {
      jButtonFasta = new JButton();
      jButtonFasta.setBounds(new Rectangle(522, 194, 80, 24));
      jButtonFasta.setText("Browse");
      jButtonFasta.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          if (filePath == null) {
            filePath = new String(".");
          }
          JFileChooser fc = new JFileChooser(filePath);
          fc.showOpenDialog(jButtonFasta);
          File fastaFile = fc.getSelectedFile();
          String fastaPath = fastaFile.getAbsolutePath();
          jTextFieldInputFasta.setText(fastaPath);
          jButtonLoad.setEnabled(true);
        }
      });
    }
    return jButtonFasta;
  }

  /**
   * This method initializes jButtonLoad 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButtonLoad() {
    if (jButtonLoad == null) {
      jButtonLoad = new JButton();
      jButtonLoad.setBounds(new Rectangle(135, 261, 182, 24));
      jButtonLoad.setText("Preview EST# in Table");
      if (jTextFieldInputFasta.getText().equalsIgnoreCase("")) {
        jButtonLoad.setEnabled(false);
      }
      jButtonLoad.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          String[] columnNames = {"EST#"};
          Object[][] data = {{}};
          DefaultTableModel model = new DefaultTableModel(data,columnNames);
         
          try {
            inputFasta = new BufferedReader(
                new FileReader(jTextFieldInputFasta.getText()));
          } catch (FileNotFoundException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
          }
          String inputLine;
          int row_num = 0;
          try {
            while ((inputLine = inputFasta.readLine()) != null) {
              if (inputLine.startsWith(">")) {
           
                // print EST# etc
                row_num++;
                String[] seqAcc = inputLine.substring(1).split(" ");
                String[] current_row =  {seqAcc[0]};
                model.insertRow(row_num, current_row);
                jTable.setModel(model);
               
              }
            }
          } catch (IOException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
          }

          // Close file handles
          try {
            inputFasta.close();
          } catch (IOException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
          }
        }
      });
    }
    return jButtonLoad;
  }

  /**
   * This method initializes jButtonEst 
   *  
   * @return javax.swing.JButton 
   */
  private JButton getJButtonEst() {
    if (jButtonEst == null) {
      jButtonEst = new JButton();
      jButtonEst.setBounds(new Rectangle(135, 411, 153, 24));
      jButtonEst.setText("Generate EST File");
      jButtonEst.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          if (jTextFieldContEST.getText().equalsIgnoreCase("")
              || jTextFieldCitationEST.getText().equalsIgnoreCase("")
              || jTextFieldLibEST.getText().equalsIgnoreCase("")
              || jTextFieldPublic.getText().equalsIgnoreCase("")
              || jTextFieldInputFasta.getText().equalsIgnoreCase("")
            ) {
            errorDialog = getErrorDialog();
            errorDialog.pack();
            Point loc = getJFrame().getLocation();
            loc.translate(60, 60);
            errorDialog.setLocation(loc);
            errorDialog.setVisible(true);
          }
          else {
            estFilePath = filePath+ "/EST";
            try {
              outputEst = new PrintWriter(new FileWriter(estFilePath));
            } catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }   
           
            try {
              inputFasta = new BufferedReader(
                  new FileReader(jTextFieldInputFasta.getText()));
            } catch (FileNotFoundException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }
            String inputLine;
            int sequence_num = 0;
            try {
              while ((inputLine = inputFasta.readLine()) != null) {
                if (inputLine.startsWith(">")) {
                 
                  //Print recodr separator
                  if (sequence_num > 0) {
                    outputEst.print("||" + "\n");
                  }
                 
                  // Ptint part 1
                  String estInfoPart1 = getEstInfoPart1();
                  outputEst.print(estInfoPart1);
                 
                  // print EST# etc
                  String[] seqAcc = inputLine.substring(1).split(" ");
                  outputEst.print("EST:    " + seqAcc[0] + "\n");
                 
                  // Print part 2
                  String estInfoPart2 = getEstInfoPart2();
                  outputEst.print(estInfoPart2);
                 
                  sequence_num++;
                }
                // Print sequence
                else {
                  outputEst.print(inputLine+ "\n");
                }
              }
            } catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }

            // Close file handles
            outputEst.close();
            try {
              inputFasta.close();
            } catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }
           
          }
        }
      });
    }
    return jButtonEst;
  }

  /**
   * This method  getEstInfoPart1 
   *  
   * @return String
   */
  private String getEstInfoPart1() {
    String estInfo;
    estInfo  = "TYPE:      EST\n";
    if (!((String) jComboBoxStatusEST.getSelectedItem()).equalsIgnoreCase("") ) {
      estInfo = estInfo + "Status:    " + jComboBoxStatusEST.getSelectedItem() + "\n";
    }
    if (!jTextFieldContEST.getText().equalsIgnoreCase("") ) {
      estInfo = estInfo + "CONT_NAME: " + jTextFieldContEST.getText() + "\n";
    }
    if (!jTextFieldCitationEST.getText().equalsIgnoreCase("") ) {    
      estInfo = estInfo + "CITATION:  " + jTextFieldCitationEST.getText() + "\n";
    }
    if (!jTextFieldLibEST.getText().equalsIgnoreCase("") ) {
      estInfo = estInfo + "LIBRARY:   " + jTextFieldLibEST.getText() + "\n";
    }
    return estInfo;
  }
 
  /**
   * This method  getEstInfoPart2 
   *  
   * @return String
   */
  private String getEstInfoPart2() {
    String estInfo;
    estInfo  = "";
    if (!jTextFieldSeq_Primer.getText().equalsIgnoreCase("") ) {
      estInfo = estInfo + "SEQ_PRIMER:" + jTextFieldSeq_Primer.getText() + "\n";
    }
    if (!jTextFieldP_End.getText().equalsIgnoreCase("") ) {
      estInfo = estInfo + "P_END:     " + jTextFieldP_End.getText() + "\n";
    }
    if (!jTextFieldDna_Type.getText().equalsIgnoreCase("") ) {
      estInfo = estInfo + "DNA_TYPE:  " + jTextFieldDna_Type.getText() + "\n";
    }
    if (!jTextFieldPublic.getText().equalsIgnoreCase("") ) {
      estInfo = estInfo + "PUBLIC:    " + jTextFieldPublic.getText() + "\n";
    }
    if (!jTextFieldComment.getText().equalsIgnoreCase("") ) {
      estInfo = estInfo + "Comment:"  + "\n";
      estInfo = estInfo + jTextFieldComment.getText() + "\n";
    }
    estInfo = estInfo + "SEQUENCE:" + "\n";
    return estInfo;
  }
 
 
  /**
   * Launches this application
   */
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        ESTsSubmitter application = new ESTsSubmitter();
        application.getJFrame().setVisible(true);
        jButtonCont.setEnabled(false);
        jButtonPub.setEnabled(false);
        jButtonLib.setEnabled(false);
        jButtonEst.setEnabled(false);
      }
    });
  }

}
TOP

Related Classes of easiest.ESTsSubmitter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.