/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.cnr.iasi.giant.frame;

import it.cnr.iasi.giant.Application;
import it.cnr.iasi.giant.Controller;
import it.cnr.iasi.giant.action.GiantHelpAction;
import java.awt.Dimension;
import java.awt.Window;
import java.awt.event.WindowAdapter;
import java.io.File;
import java.util.HashMap;
import javax.swing.*;

/**
 *
 * @author Fabio Cumbo
 * @info GIANT
 * @version v1.0
 * @organization IASI-CNR : Istituto di Analisi dei Sistemi ed Informatica 
 *                  "Antonio Ruberti" - Consiglio Nazionale delle Ricerche
 * 
 */
public class GIANT_NT extends javax.swing.JFrame implements Application {

    /**
     * Creates new form GIANT
     */
    public GIANT_NT() {
        initComponents();
        initMap();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        networkField = new javax.swing.JTextField();
        selectNet_button = new javax.swing.JButton();
        selectNet_button.addActionListener(new Controller());
        jSeparator2 = new javax.swing.JSeparator();
        jLabel5 = new javax.swing.JLabel();
        clusterField = new javax.swing.JTextField();
        selectClusters_button = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JSeparator();
        computePZ_button = new javax.swing.JButton();
        computePZ_button.addActionListener(new Controller());
        jSeparator5 = new javax.swing.JSeparator();
        loadCluster_radio = new javax.swing.JRadioButton();
        computeCluster_radio = new javax.swing.JRadioButton();
        clusteringList = new javax.swing.JComboBox();
        runClustering_button = new javax.swing.JButton();
        jLabel19 = new javax.swing.JLabel();
        jSeparator6 = new javax.swing.JSeparator();
        attrib_button = new javax.swing.JButton();
        attrib_button.addActionListener(new Controller());
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jSeparator4 = new javax.swing.JSeparator();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        giantHelp_menu = new javax.swing.JMenuItem();
        giantHelp_menu.addActionListener(new Controller());

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("GIANT v1.0");
        setMinimumSize(new java.awt.Dimension(372, 406));
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jLabel4.setText("Load Network:");

        networkField.setEditable(false);

        selectNet_button.setText("Select File...");

        jLabel5.setText("Load Clusters:");

        clusterField.setEditable(false);

        selectClusters_button.setText("Select File...");
        selectClusters_button.addActionListener(new Controller());

        computePZ_button.setText("Compute");
        computePZ_button.setEnabled(false);

        buttonGroup1.add(loadCluster_radio);
        loadCluster_radio.setSelected(true);
        loadCluster_radio.setText("Load Cluster Data");
        loadCluster_radio.addActionListener(new Controller());

        buttonGroup1.add(computeCluster_radio);
        computeCluster_radio.setText("Use Built-In Clustering Algorithms");
        computeCluster_radio.addActionListener(new Controller());

        clusteringList.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "MCL", "KMeans", "Spectral Clustering" }));
        clusteringList.setEnabled(false);

        runClustering_button.setText("Run");
        runClustering_button.setEnabled(false);
        runClustering_button.addActionListener(new Controller());

        jLabel19.setText("Run Clustering Algorithm:");

        attrib_button.setText("Load Node Attributes...");
        attrib_button.setEnabled(false);

        jButton1.setText("?");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("?");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("?");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton5.setText("?");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(loadCluster_radio, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel19, javax.swing.GroupLayout.Alignment.LEADING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(computeCluster_radio, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(clusteringList, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(runClustering_button, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jSeparator6, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jSeparator3)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addGap(0, 122, Short.MAX_VALUE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(clusterField)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(selectClusters_button))
                    .addComponent(jSeparator5)
                    .addComponent(jSeparator2)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(attrib_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(computePZ_button, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(networkField)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(selectNet_button, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(networkField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(selectNet_button)
                    .addComponent(jButton2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 5, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(loadCluster_radio)
                    .addComponent(computeCluster_radio))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(clusterField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(selectClusters_button)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(clusteringList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(runClustering_button)
                    .addComponent(jButton3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(attrib_button)
                    .addComponent(computePZ_button)
                    .addComponent(jButton5))
                .addGap(18, 18, 18))
        );

        jTabbedPane1.addTab("Loader", jPanel2);

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel6.setText("Definitions:");

        jLabel7.setText("1. Within-module degree, Z:");

        jLabel8.setText("the within-module degree z-score measures how \"well connected\"");

        jLabel9.setText("node i is to other nodes in the module.");

        jLabel10.setText("2. Participation Coefficient, P:");

        jLabel11.setText("the participation coefficient of a node is therefore close to one if ");

        jLabel12.setText("its links are uniformly distributed among all the modules and zero if");

        jLabel13.setText("all its links are within its own module.");

        jLabel14.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel14.setText("Developer Contacts and Information:");

        jLabel15.setText("1. Developer:");

        jLabel16.setText("2. eMail:");

        jLabel17.setText("Fabio Cumbo");

        jLabel18.setText("fabio.cumbo@hotmail.it");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)
                            .addComponent(jLabel10)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel11)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel12)
                                    .addComponent(jLabel13)))
                            .addComponent(jLabel14)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel15)
                                    .addComponent(jLabel16))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel18)
                                    .addComponent(jLabel17))))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jSeparator4, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel11)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel13)
                .addGap(18, 18, 18)
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE)
                .addComponent(jLabel14)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jLabel17))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jLabel18))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Info", jPanel3);

        jLabel2.setText("IASI-CNR");

        jLabel3.setText("GIANT - v1.0");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel3))
                    .addComponent(jTabbedPane1))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3))
                .addContainerGap())
        );

        jMenu1.setText("Help");

        giantHelp_menu.setText("GIANT v1.0 Help");
        jMenu1.add(giantHelp_menu);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        if (GiantHelpAction.getTmpPath()!=null && !GiantHelpAction.getTmpPath().equals("")) {
            File tmp = new File(GiantHelpAction.getTmpPath());
            tmp.delete();
        }
        this.dispose();
    }//GEN-LAST:event_formWindowClosing

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        HelpWindow help = new HelpWindow();
        help.setText("GIANT uses the native Cytoscape loader to import a network.\n"
                + "Cytoscape supports the import of networks from delimited\n"
                + "files and Excel workbooks. An interactive GUI allows users\n"
                + "to specify parsing options for specified files. The screen\n"
                + "provides a preview that shows how the file will be parsed\n"
                + "given the current configuration. As the configuration\n"
                + "changes, the preview updates automatically. In addition\n"
                + "to specify how the file will be parsed, the user must also\n"
                + "choose the columns that represent the Source nodes, the \n"
                + "Target nodes, and an optional edge interaction type.\n\n"
                + "The 'Import Network from Table' function supports\n"
                + "delimited text files and single-sheet Microsoft Excel\n"
                + "Workbooks. The following is a sample table file:\n\n"
                + "source\ttarget\tinteraction\n"
                + "YJR022W\tYNR053C\tpp\n"
                + "YER116C\tYDL013W\tpp\n"
                + "YNL307C\tYAL038W\tpp\n"
                + "YNL216W\tYCR012W\tpp\n"
                + "YNL216W\tYGR254W\tpp\n\n"
                + "The network table file should contain at least\n"
                + "two columns: source nodes and target nodes.\n"
                + "The interaction type is optional in this format.\n\n"
                + "Therefore, a minimal network table looks like the\n"
                + "following:\n\n"
                + "YJR022W\tYNR053C\n"
                + "YER116C\tYDL013W\n"
                + "YNL307C\tYAL038W\n"
                + "YNL216W\tYCR012W\n"
                + "YNL216W\tYGR254W\n\n");
        help.setVisible(true);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        HelpWindow help = new HelpWindow();
        help.setText("If you already have a file containing information\n"
                + "about clusters, you can load it and compute P and Z\n"
                + "information about the current loaded network.\n"
                + "The file with clusters information must have the\n"
                + "IDX format.\n\n"
                + "The file extension IDX is the generic file format\n"
                + "for indexing. An example is shown below:\n\n"
                + "YJR022W\t1\n"
                + "YER116C\t1\n"
                + "YNR053C\t1\n"
                + "YAL038W\t2\n"
                + "YGR254W\t2\n"
                + "...\n\n"
                + "The first column contains the node identification\n"
                + "name, the second column contains the cluster ID.");
        help.setVisible(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        HelpWindow help = new HelpWindow();
        help.setText("Built-In Clustering Algorithms Information:\n\n\n"
                + "MCL - MARKOV CLUSTER ALGORITHM:\n"
                + "The MCL algorithm is short for the Markov Cluster Algorithm,\n"
                + "a fast and scalable unsupervised cluster algorithm for\n"
                + "networks (also known as graphs) based on simulation of\n"
                + "(stochastic) flow in graphs.\n\n\n"
                + "K-MEANS CLUSTERING:\n"
                + "K-Means clustering is a method of cluster analysis which\n"
                + "aims to partition n observations into k clusters in which\n"
                + "each observation belongs to the cluster with the nearest mean.\n\n\n"
                + "SPECTRAL CLUSTERING:\n"
                + "In multivariate statistics and the clustering of data, spectral\n"
                + "clustering techniques make use of the spectrum (eigenvalues)\n"
                + "of the similarity matrix of the data to perform dimensionality\n"
                + "reduction before clustering in fewer dimensions.");
        help.setVisible(true);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        HelpWindow help = new HelpWindow();
        help.setText("The attribute table file should contain a primary\n"
                + "key column and at least one attribute column.\n"
                + "The maximum number of attribute columns is unlimited.\n\n"
                + "The first row is the header of the attribute file.\n"
                + "The identifier for the key column must be ID as in\n"
                + "the example shown below:\n\n"
                + "ID\tATTRIBUTE1\tATTRIBUTE2\tATTRIBUTEn\n"
                + "YJR022W\t1000000001\tS000000534\tYES\n"
                + "YER116C\t1000000002\tS000004017\tYES\n"
                + "YNR053C\t1000000003\tS000000289\tNO\n"
                + "YAL038W\t2000000001\tS000005301\tNO\n"
                + "YGR254W\t2000000002\tS000000429\tYES\n"
                + "...");
        help.setVisible(true);
    }//GEN-LAST:event_jButton5ActionPerformed

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private static javax.swing.JButton attrib_button;
    private javax.swing.ButtonGroup buttonGroup1;
    private static javax.swing.JTextField clusterField;
    private static javax.swing.JComboBox clusteringList;
    private static javax.swing.JRadioButton computeCluster_radio;
    private static javax.swing.JButton computePZ_button;
    private static javax.swing.JMenuItem giantHelp_menu;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private static javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private static javax.swing.JRadioButton loadCluster_radio;
    private static javax.swing.JTextField networkField;
    private static javax.swing.JButton runClustering_button;
    private static javax.swing.JButton selectClusters_button;
    private static javax.swing.JButton selectNet_button;
    // End of variables declaration//GEN-END:variables

    public static HashMap<Object, String> map;
    
    private void initMap() {
        map = new HashMap<Object, String>();
        map.put(selectNet_button, "selectNet_button");
        map.put(selectClusters_button, "selectClusters_button");
        map.put(computePZ_button, "computePZ_button");
        map.put(loadCluster_radio, "loadCluster_radio");
        map.put(computeCluster_radio, "computeCluster_radio");
        map.put(runClustering_button, "runClustering_button");
        map.put(attrib_button, "attrib_button");
        map.put(giantHelp_menu, "giantHelp_menu");
    }

    public JMenuItem getGiantHelp_menu() {
        return giantHelp_menu;
    }

    public JButton getAttrib_button() {
        return attrib_button;
    }
    
    public HashMap<Object, String> getControllerMap() {
        return map;
    }

    public JButton getSelectNet_button() {
        return selectNet_button;
    }

    public JTextField getClusterField() {
        return clusterField;
    }

    public JTextField getNetworkField() {
        return networkField;
    }

    public JButton getComputePZ_button() {
        return computePZ_button;
    }

    public JRadioButton getLoadClusterRadio() {
        return loadCluster_radio;
    }
    
    public JRadioButton getComputeClusterRadio() {
        return computeCluster_radio;
    }
    
    public JComboBox getClusteringList() {
        return clusteringList;
    }
    
    public JButton getSelectClustersButton() {
        return selectClusters_button;
    }
    
    public JButton getRunClusteringButton() {
        return runClustering_button;
    }

    public void setVisibleOverride(boolean value) {
        this.setVisible(value);
    }

    public void setDefaultCloseOperationOverride(int value) {
        this.setDefaultCloseOperation(value);
    }

    public void addWindowListenerOverride(WindowAdapter windowsAdapter) {
        this.addWindowListener(windowsAdapter);
    }
    
    public void setPreferredSizeOverride(Dimension dim) {
        this.setPreferredSize(dim);
    }

    @Override
    public Window getFrameOverride() {
        return getWindows()[0];
    }

}
