Example usage for javax.swing ScrollPaneConstants HORIZONTAL_SCROLLBAR_ALWAYS

List of usage examples for javax.swing ScrollPaneConstants HORIZONTAL_SCROLLBAR_ALWAYS

Introduction

In this page you can find the example usage for javax.swing ScrollPaneConstants HORIZONTAL_SCROLLBAR_ALWAYS.

Prototype

int HORIZONTAL_SCROLLBAR_ALWAYS

To view the source code for javax.swing ScrollPaneConstants HORIZONTAL_SCROLLBAR_ALWAYS.

Click Source Link

Document

Used to set the horizontal scroll bar policy so that horizontal scrollbars are always displayed.

Usage

From source file:gui.images.ImageHubExplorer.java

/**
 * 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.//from w w w .java 2s. co m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    hubTab = new javax.swing.JTabbedPane();
    dataMainPanel = new javax.swing.JPanel();
    selectedImagePanelClassNeighborMain = new gui.images.ImagePanel();
    selectedImageLabelClassNeighborMain = new javax.swing.JLabel();
    mdsScrollPane = new javax.swing.JScrollPane();
    mdsCollectionPanel = new gui.images.ImagesDisplayPanel();
    workspaceLabelTxt = new javax.swing.JLabel();
    collectionSizeLabelTxt = new javax.swing.JLabel();
    workspaceLabelValue = new javax.swing.JLabel();
    collectionSizeLabelValue = new javax.swing.JLabel();
    kSelectionSlider = new javax.swing.JSlider();
    nhSizeLabelTxt = new javax.swing.JLabel();
    numClassesLabelTxt = new javax.swing.JLabel();
    numClassesLabelValue = new javax.swing.JLabel();
    hRelatedPropTxt = new javax.swing.JLabel();
    skewnwessLabelTxt = new javax.swing.JLabel();
    skewnessLabelValue = new javax.swing.JLabel();
    kurtosisLabelTxt = new javax.swing.JLabel();
    kurtosisLabelValue = new javax.swing.JLabel();
    nkEntropyLabelTxt = new javax.swing.JLabel();
    nkEntropyLabelValue = new javax.swing.JLabel();
    jLabel1 = new javax.swing.JLabel();
    rnkEntropyValue = new javax.swing.JLabel();
    nkEntropySkewnessTxt = new javax.swing.JLabel();
    rnkEntropySkewnessTxt = new javax.swing.JLabel();
    nkEntropySkewnessValues = new javax.swing.JLabel();
    rnkEntropySkewnessValue = new javax.swing.JLabel();
    percAboveLabelTxt = new javax.swing.JLabel();
    percAboveLabelValue = new javax.swing.JLabel();
    hubsLabelTxt = new javax.swing.JLabel();
    orphansLabelTxt = new javax.swing.JLabel();
    regularLabelTxt = new javax.swing.JLabel();
    majorDegLabelTxt = new javax.swing.JLabel();
    hubsLabelValue = new javax.swing.JLabel();
    orphansLabelValue = new javax.swing.JLabel();
    regularLabelValue = new javax.swing.JLabel();
    majorDegLabelValue = new javax.swing.JLabel();
    badHubnessLabelTxt = new javax.swing.JLabel();
    badHubnessLabelValue = new javax.swing.JLabel();
    chartHoldingPanelOccDistribution = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    selectedImagePathLabelClassNeighborMain = new javax.swing.JLabel();
    neighborPanel = new javax.swing.JPanel();
    selectedImagePanelClassNeighbor = new gui.images.ImagePanel();
    selectedImageLabelClassNeighbor = new javax.swing.JLabel();
    nnScrollPane = new javax.swing.JScrollPane();
    nnPanel = new javax.swing.JPanel();
    rnnScrollPane = new javax.swing.JScrollPane();
    rnnPanel = new javax.swing.JPanel();
    nnScrollLabelTxt = new javax.swing.JLabel();
    rnnScrollLabelTxt = new javax.swing.JLabel();
    occProfileChartHolder = new javax.swing.JPanel();
    noccProfLabelTxt = new javax.swing.JLabel();
    neighborGraphScrollPane = new javax.swing.JScrollPane();
    addSelectedButton = new javax.swing.JButton();
    addNNsButton = new javax.swing.JButton();
    addRNNsButton = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    selectedImagePathLabelClassNeighbor = new javax.swing.JLabel();
    removeVertexButton = new javax.swing.JButton();
    removeAllButton = new javax.swing.JButton();
    classPanel = new javax.swing.JPanel();
    selectedImagePanelClass = new gui.images.ImagePanel();
    selectedImageLabelClass = new javax.swing.JLabel();
    confusionMatScrollPane = new javax.swing.JScrollPane();
    classHubnessTable = new javax.swing.JTable();
    classesScrollPane = new javax.swing.JScrollPane();
    classesScrollPanel = new javax.swing.JPanel();
    classDistributionHolder = new javax.swing.JPanel();
    jScrollPane3 = new javax.swing.JScrollPane();
    selectedImagePathLabelClass = new javax.swing.JLabel();
    cNamesScrollPane = new javax.swing.JScrollPane();
    jScrollPane5 = new javax.swing.JScrollPane();
    classColorAndNamesPanel = new javax.swing.JPanel();
    searchPanel = new javax.swing.JPanel();
    selectedImagePanelSearch = new gui.images.ImagePanel();
    selectedImageLabelSearch = new javax.swing.JLabel();
    searchQLabelTxt = new javax.swing.JLabel();
    queryImagePanel = new gui.images.ImagePanel();
    imageBrowseButton = new javax.swing.JButton();
    jTextField1 = new javax.swing.JTextField();
    queryQTextLabelTxt = new javax.swing.JLabel();
    queryNNScrollPane = new javax.swing.JScrollPane();
    queryNNPanel = new javax.swing.JPanel();
    simResLabelTxt = new javax.swing.JLabel();
    searchButton = new javax.swing.JButton();
    prClassLabelTxt = new javax.swing.JLabel();
    prClassScrollPane = new javax.swing.JScrollPane();
    classifierPredictionsPanel = new javax.swing.JPanel();
    collectionSearchButton = new javax.swing.JButton();
    jScrollPane4 = new javax.swing.JScrollPane();
    selectedImagePathLabelSearch = new javax.swing.JLabel();
    reRankingButton = new javax.swing.JButton();
    menuBar = new javax.swing.JMenuBar();
    collectionMenu = new javax.swing.JMenu();
    workspaceMenuItem = new javax.swing.JMenuItem();
    importItem = new javax.swing.JMenuItem();
    dMatrixMenu = new javax.swing.JMenu();
    distImportItem = new javax.swing.JMenuItem();
    distCalculateMenu = new javax.swing.JMenu();
    manhattanDistItem = new javax.swing.JMenuItem();
    distCalcEuclideanItem = new javax.swing.JMenuItem();
    distCalcCosineItem = new javax.swing.JMenuItem();
    tanimotoMenuItem = new javax.swing.JMenuItem();
    klMenuItem = new javax.swing.JMenuItem();
    bcMenuItem = new javax.swing.JMenuItem();
    canMenuItem = new javax.swing.JMenuItem();
    neighborStatsItem = new javax.swing.JMenuItem();
    mdsVisualizeItem = new javax.swing.JMenuItem();
    selImgPathMenuItem = new javax.swing.JMenuItem();
    majorHubSelectionItem = new javax.swing.JMenuItem();
    metricLearningMenu = new javax.swing.JMenu();
    secondaryMetricMenu = new javax.swing.JMenu();
    simcosMenuItem = new javax.swing.JMenuItem();
    simhubMenuItem = new javax.swing.JMenuItem();
    mpMenuItem = new javax.swing.JMenuItem();
    localScalingItem = new javax.swing.JMenuItem();
    nicdmItem = new javax.swing.JMenuItem();
    loadSecondaryDistancesItem = new javax.swing.JMenuItem();
    editMenu = new javax.swing.JMenu();
    previousMenuItem = new javax.swing.JMenuItem();
    nextMenuItem = new javax.swing.JMenuItem();
    screenCaptureMenu = new javax.swing.JMenu();
    mdsScreenCaptureItem = new javax.swing.JMenuItem();
    graphScreenCaptureItem = new javax.swing.JMenuItem();
    codebookMenu = new javax.swing.JMenu();
    loadCodebookItem = new javax.swing.JMenuItem();
    loadCodebookProfileMenuItem = new javax.swing.JMenuItem();
    classificationMenu = new javax.swing.JMenu();
    trainModelsItem = new javax.swing.JMenuItem();
    selImageMenu = new javax.swing.JMenu();
    selSIFTmenuItem = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Image Hub Explorer");

    javax.swing.GroupLayout selectedImagePanelClassNeighborMainLayout = new javax.swing.GroupLayout(
            selectedImagePanelClassNeighborMain);
    selectedImagePanelClassNeighborMain.setLayout(selectedImagePanelClassNeighborMainLayout);
    selectedImagePanelClassNeighborMainLayout.setHorizontalGroup(selectedImagePanelClassNeighborMainLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE));
    selectedImagePanelClassNeighborMainLayout.setVerticalGroup(selectedImagePanelClassNeighborMainLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 257, Short.MAX_VALUE));

    selectedImageLabelClassNeighborMain.setText("Current Image");

    mdsScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    mdsScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    mdsCollectionPanel.setName(""); // NOI18N
    mdsCollectionPanel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            mdsCollectionPanelMouseClicked(evt);
        }
    });

    javax.swing.GroupLayout mdsCollectionPanelLayout = new javax.swing.GroupLayout(mdsCollectionPanel);
    mdsCollectionPanel.setLayout(mdsCollectionPanelLayout);
    mdsCollectionPanelLayout.setHorizontalGroup(mdsCollectionPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 2000, Short.MAX_VALUE));
    mdsCollectionPanelLayout.setVerticalGroup(mdsCollectionPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 2000, Short.MAX_VALUE));

    mdsScrollPane.setViewportView(mdsCollectionPanel);

    workspaceLabelTxt.setText("Workspace:");

    collectionSizeLabelTxt.setText("Collection size:");

    workspaceLabelValue.setText("...");

    collectionSizeLabelValue.setText("...");

    kSelectionSlider.setMaximum(50);
    kSelectionSlider.setPaintLabels(true);
    kSelectionSlider.setPaintTicks(true);
    kSelectionSlider.setToolTipText("Select the neighborhood size, k");
    kSelectionSlider.setValue(1);

    nhSizeLabelTxt.setText("Neighborhood size (k):");

    numClassesLabelTxt.setText("Num. Classes:");

    numClassesLabelValue.setText("...");

    hRelatedPropTxt.setBackground(new java.awt.Color(102, 153, 255));
    hRelatedPropTxt.setText("Hubness-related properties:");

    skewnwessLabelTxt.setText("Occ. Skewness: ");

    skewnessLabelValue.setText("...");

    kurtosisLabelTxt.setText("Occ. Kurtosis:");

    kurtosisLabelValue.setText("...");

    nkEntropyLabelTxt.setText("Nk Entropy:");

    nkEntropyLabelValue.setText("...");

    jLabel1.setText("RNk Entropy:");

    rnkEntropyValue.setText("...");

    nkEntropySkewnessTxt.setText("Nk Ent. Skew:");

    rnkEntropySkewnessTxt.setText("RNk Ent Skew:");

    nkEntropySkewnessValues.setText("...");

    rnkEntropySkewnessValue.setText("...");

    percAboveLabelTxt.setText("Perc Nk(x) > 0");

    percAboveLabelValue.setText("...");

    hubsLabelTxt.setText("Hubs:");

    orphansLabelTxt.setText("Orphans:");

    regularLabelTxt.setText("Regular:");

    majorDegLabelTxt.setText("Major Deg:");

    hubsLabelValue.setText("...");

    orphansLabelValue.setText("...");

    regularLabelValue.setText("...");

    majorDegLabelValue.setText("...");

    badHubnessLabelTxt.setText("Mislabel perc:");

    badHubnessLabelValue.setText("...");

    chartHoldingPanelOccDistribution.setMaximumSize(new java.awt.Dimension(497, 191));
    chartHoldingPanelOccDistribution.setMinimumSize(new java.awt.Dimension(497, 191));

    javax.swing.GroupLayout chartHoldingPanelOccDistributionLayout = new javax.swing.GroupLayout(
            chartHoldingPanelOccDistribution);
    chartHoldingPanelOccDistribution.setLayout(chartHoldingPanelOccDistributionLayout);
    chartHoldingPanelOccDistributionLayout.setHorizontalGroup(chartHoldingPanelOccDistributionLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 497, Short.MAX_VALUE));
    chartHoldingPanelOccDistributionLayout.setVerticalGroup(chartHoldingPanelOccDistributionLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 221, Short.MAX_VALUE));

    jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    selectedImagePathLabelClassNeighborMain.setText("Path:");
    jScrollPane1.setViewportView(selectedImagePathLabelClassNeighborMain);

    javax.swing.GroupLayout dataMainPanelLayout = new javax.swing.GroupLayout(dataMainPanel);
    dataMainPanel.setLayout(dataMainPanelLayout);
    dataMainPanelLayout.setHorizontalGroup(dataMainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dataMainPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(mdsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 536,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(dataMainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(dataMainPanelLayout.createSequentialGroup().addGroup(dataMainPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(rnkEntropySkewnessTxt).addComponent(nkEntropySkewnessTxt)
                                    .addComponent(jLabel1).addComponent(nkEntropyLabelTxt)
                                    .addComponent(hRelatedPropTxt, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(dataMainPanelLayout.createSequentialGroup()
                                            .addComponent(workspaceLabelTxt)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(workspaceLabelValue,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 169,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(dataMainPanelLayout.createSequentialGroup()
                                            .addGroup(dataMainPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                    .addComponent(numClassesLabelTxt,
                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE)
                                                    .addComponent(collectionSizeLabelTxt,
                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(dataMainPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING, false)
                                                    .addComponent(numClassesLabelValue,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE)
                                                    .addComponent(collectionSizeLabelValue,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE, 68,
                                                            Short.MAX_VALUE)))
                                    .addComponent(kSelectionSlider, javax.swing.GroupLayout.Alignment.TRAILING,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 249,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(dataMainPanelLayout.createSequentialGroup()
                                            .addGroup(dataMainPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                    .addComponent(kurtosisLabelTxt,
                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE)
                                                    .addComponent(skewnwessLabelTxt,
                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(dataMainPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(nkEntropySkewnessValues)
                                                    .addGroup(dataMainPanelLayout.createSequentialGroup()
                                                            .addGroup(dataMainPanelLayout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                                    .addComponent(skewnessLabelValue)
                                                                    .addComponent(kurtosisLabelValue)
                                                                    .addComponent(nkEntropyLabelValue)
                                                                    .addComponent(rnkEntropyValue)
                                                                    .addComponent(rnkEntropySkewnessValue))
                                                            .addGap(28, 28, 28)
                                                            .addGroup(dataMainPanelLayout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                                    .addGroup(dataMainPanelLayout
                                                                            .createSequentialGroup()
                                                                            .addComponent(badHubnessLabelTxt)
                                                                            .addPreferredGap(
                                                                                    javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                            .addComponent(badHubnessLabelValue))
                                                                    .addGroup(dataMainPanelLayout
                                                                            .createSequentialGroup()
                                                                            .addComponent(majorDegLabelTxt)
                                                                            .addPreferredGap(
                                                                                    javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                            .addComponent(majorDegLabelValue))
                                                                    .addGroup(dataMainPanelLayout
                                                                            .createSequentialGroup()
                                                                            .addComponent(regularLabelTxt)
                                                                            .addGap(18, 18, 18)
                                                                            .addComponent(regularLabelValue))
                                                                    .addGroup(dataMainPanelLayout
                                                                            .createSequentialGroup()
                                                                            .addGroup(dataMainPanelLayout
                                                                                    .createParallelGroup(
                                                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                                                    .addComponent(hubsLabelTxt)
                                                                                    .addComponent(
                                                                                            orphansLabelTxt))
                                                                            .addGap(18, 18, 18)
                                                                            .addGroup(dataMainPanelLayout
                                                                                    .createParallelGroup(
                                                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                                                    .addComponent(
                                                                                            orphansLabelValue)
                                                                                    .addComponent(
                                                                                            hubsLabelValue)))))))
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    false)
                                            .addGroup(dataMainPanelLayout.createSequentialGroup()
                                                    .addComponent(percAboveLabelTxt).addGap(18, 18, 18)
                                                    .addComponent(percAboveLabelValue,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE))
                                            .addComponent(nhSizeLabelTxt,
                                                    javax.swing.GroupLayout.Alignment.LEADING)))
                                    .addGap(7, 7, 7)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(selectedImageLabelClassNeighborMain,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(selectedImagePanelClassNeighborMain,
                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    241, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(chartHoldingPanelOccDistribution,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));
    dataMainPanelLayout.setVerticalGroup(dataMainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dataMainPanelLayout.createSequentialGroup().addContainerGap().addGroup(dataMainPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(mdsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 593,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(dataMainPanelLayout.createSequentialGroup().addGroup(dataMainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(dataMainPanelLayout.createSequentialGroup()
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(workspaceLabelTxt).addComponent(workspaceLabelValue))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(collectionSizeLabelTxt,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(collectionSizeLabelValue,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGap(19, 19, 19)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(numClassesLabelTxt,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(numClassesLabelValue,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGap(17, 17, 17).addComponent(hRelatedPropTxt).addGap(15, 15, 15)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(skewnwessLabelTxt).addComponent(skewnessLabelValue)
                                            .addComponent(hubsLabelTxt).addComponent(hubsLabelValue))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(kurtosisLabelTxt).addComponent(kurtosisLabelValue)
                                            .addComponent(orphansLabelTxt).addComponent(orphansLabelValue))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(nkEntropyLabelTxt).addComponent(nkEntropyLabelValue)
                                            .addComponent(regularLabelTxt).addComponent(regularLabelValue))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel1).addComponent(rnkEntropyValue)
                                            .addComponent(majorDegLabelTxt).addComponent(majorDegLabelValue))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(nkEntropySkewnessTxt)
                                            .addComponent(nkEntropySkewnessValues))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(rnkEntropySkewnessTxt)
                                            .addComponent(rnkEntropySkewnessValue)
                                            .addComponent(badHubnessLabelTxt)
                                            .addComponent(badHubnessLabelValue))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(dataMainPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(percAboveLabelTxt).addComponent(percAboveLabelValue)))
                            .addComponent(selectedImagePanelClassNeighborMain,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(dataMainPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(selectedImageLabelClassNeighborMain,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
                                    .addComponent(nhSizeLabelTxt, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(dataMainPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(kSelectionSlider, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 53,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(
                                    chartHoldingPanelOccDistribution, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));

    hubTab.addTab("Data Overview", dataMainPanel);

    javax.swing.GroupLayout selectedImagePanelClassNeighborLayout = new javax.swing.GroupLayout(
            selectedImagePanelClassNeighbor);
    selectedImagePanelClassNeighbor.setLayout(selectedImagePanelClassNeighborLayout);
    selectedImagePanelClassNeighborLayout.setHorizontalGroup(selectedImagePanelClassNeighborLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 222, Short.MAX_VALUE));
    selectedImagePanelClassNeighborLayout.setVerticalGroup(selectedImagePanelClassNeighborLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 224, Short.MAX_VALUE));

    selectedImageLabelClassNeighbor.setText("Current Image");

    nnScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    nnScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    javax.swing.GroupLayout nnPanelLayout = new javax.swing.GroupLayout(nnPanel);
    nnPanel.setLayout(nnPanelLayout);
    nnPanelLayout.setHorizontalGroup(nnPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 353, Short.MAX_VALUE));
    nnPanelLayout.setVerticalGroup(nnPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE));

    nnScrollPane.setViewportView(nnPanel);

    rnnScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    rnnScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    javax.swing.GroupLayout rnnPanelLayout = new javax.swing.GroupLayout(rnnPanel);
    rnnPanel.setLayout(rnnPanelLayout);
    rnnPanelLayout.setHorizontalGroup(rnnPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 373, Short.MAX_VALUE));
    rnnPanelLayout.setVerticalGroup(rnnPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100, Short.MAX_VALUE));

    rnnScrollPane.setViewportView(rnnPanel);

    nnScrollLabelTxt.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    nnScrollLabelTxt.setText("NNs:");

    rnnScrollLabelTxt.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
    rnnScrollLabelTxt.setText("RNNs:");

    javax.swing.GroupLayout occProfileChartHolderLayout = new javax.swing.GroupLayout(occProfileChartHolder);
    occProfileChartHolder.setLayout(occProfileChartHolderLayout);
    occProfileChartHolderLayout.setHorizontalGroup(occProfileChartHolderLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 236, Short.MAX_VALUE));
    occProfileChartHolderLayout.setVerticalGroup(occProfileChartHolderLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 185, Short.MAX_VALUE));

    noccProfLabelTxt.setText("Selected image neighbor occurrence profile");

    neighborGraphScrollPane
            .setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    neighborGraphScrollPane
            .setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    addSelectedButton.setText("Add selected");
    addSelectedButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addSelectedButtonActionPerformed(evt);
        }
    });

    addNNsButton.setText("Add NNs");
    addNNsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addNNsButtonActionPerformed(evt);
        }
    });

    addRNNsButton.setText("Add RNNs");
    addRNNsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addRNNsButtonActionPerformed(evt);
        }
    });

    selectedImagePathLabelClassNeighbor.setText("Path:");
    jScrollPane2.setViewportView(selectedImagePathLabelClassNeighbor);

    removeVertexButton.setText("Remove Sel.");
    removeVertexButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeVertexButtonActionPerformed(evt);
        }
    });

    removeAllButton.setText("Remove All");
    removeAllButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeAllButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout neighborPanelLayout = new javax.swing.GroupLayout(neighborPanel);
    neighborPanel.setLayout(neighborPanelLayout);
    neighborPanelLayout.setHorizontalGroup(neighborPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(neighborPanelLayout.createSequentialGroup().addContainerGap()
                    .addComponent(neighborGraphScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 529,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(neighborPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(neighborPanelLayout.createSequentialGroup().addGap(31, 31, 31)
                                    .addGroup(neighborPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(nnScrollLabelTxt,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 46,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(rnnScrollLabelTxt,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 68,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(44, 44, 44)
                                    .addGroup(neighborPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(nnScrollPane, 0, 0, Short.MAX_VALUE)
                                            .addComponent(rnnScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    361, Short.MAX_VALUE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    neighborPanelLayout.createSequentialGroup().addGroup(neighborPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    neighborPanelLayout.createSequentialGroup()
                                                            .addGroup(neighborPanelLayout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING)
                                                                    .addComponent(occProfileChartHolder,
                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(noccProfLabelTxt,
                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                            276,
                                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addPreferredGap(
                                                                    javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    Short.MAX_VALUE))
                                            .addGroup(neighborPanelLayout.createSequentialGroup()
                                                    .addGroup(neighborPanelLayout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(neighborPanelLayout
                                                                    .createSequentialGroup()
                                                                    .addComponent(addRNNsButton)
                                                                    .addPreferredGap(
                                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                    .addComponent(addNNsButton))
                                                            .addComponent(removeAllButton))
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(neighborPanelLayout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                                    false)
                                                            .addComponent(removeVertexButton,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    Short.MAX_VALUE)
                                                            .addComponent(addSelectedButton,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    Short.MAX_VALUE))
                                                    .addGap(18, 18, 18)))
                                            .addGroup(neighborPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(selectedImageLabelClassNeighbor,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE)
                                                    .addComponent(selectedImagePanelClassNeighbor,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jScrollPane2,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE))))
                    .addContainerGap()));
    neighborPanelLayout.setVerticalGroup(neighborPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(neighborPanelLayout.createSequentialGroup().addContainerGap().addGroup(neighborPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(neighborGraphScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 593,
                            Short.MAX_VALUE)
                    .addGroup(neighborPanelLayout.createSequentialGroup().addGroup(neighborPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(neighborPanelLayout.createSequentialGroup()
                                    .addComponent(occProfileChartHolder, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(noccProfLabelTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 36,
                                            Short.MAX_VALUE))
                            .addComponent(selectedImagePanelClassNeighbor,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(neighborPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(neighborPanelLayout.createSequentialGroup()
                                            .addGroup(neighborPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                            neighborPanelLayout.createSequentialGroup()
                                                                    .addComponent(
                                                                            selectedImageLabelClassNeighbor)
                                                                    .addPreferredGap(
                                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                    .addComponent(jScrollPane2,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            68, Short.MAX_VALUE))
                                                    .addGroup(neighborPanelLayout.createSequentialGroup()
                                                            .addGroup(neighborPanelLayout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                                    .addComponent(removeVertexButton)
                                                                    .addComponent(removeAllButton))
                                                            .addPreferredGap(
                                                                    javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addGroup(neighborPanelLayout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                                    .addComponent(addSelectedButton,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            47, Short.MAX_VALUE)
                                                                    .addComponent(addNNsButton,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            47, Short.MAX_VALUE))))
                                            .addGap(16, 16, 16))
                                    .addGroup(neighborPanelLayout.createSequentialGroup()
                                            .addComponent(addRNNsButton, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    45, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)))
                            .addGroup(neighborPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(nnScrollLabelTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 125,
                                            Short.MAX_VALUE)
                                    .addComponent(nnScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 115,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(neighborPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(rnnScrollLabelTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 122,
                                            Short.MAX_VALUE)
                                    .addComponent(rnnScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 111,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap()));

    hubTab.addTab("Neighbor View", neighborPanel);

    javax.swing.GroupLayout selectedImagePanelClassLayout = new javax.swing.GroupLayout(
            selectedImagePanelClass);
    selectedImagePanelClass.setLayout(selectedImagePanelClassLayout);
    selectedImagePanelClassLayout.setHorizontalGroup(selectedImagePanelClassLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 222, Short.MAX_VALUE));
    selectedImagePanelClassLayout.setVerticalGroup(selectedImagePanelClassLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 224, Short.MAX_VALUE));

    selectedImageLabelClass.setText("Current Image");

    confusionMatScrollPane
            .setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    confusionMatScrollPane
            .setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    classHubnessTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    classHubnessTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    classHubnessTable.setMaximumSize(new java.awt.Dimension(2000, 2000));
    classHubnessTable.setMinimumSize(new java.awt.Dimension(120, 120));
    classHubnessTable.setRowHeight(30);
    confusionMatScrollPane.setViewportView(classHubnessTable);

    classesScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    classesScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    classesScrollPanel.setPreferredSize(new java.awt.Dimension(760, 1508));

    javax.swing.GroupLayout classesScrollPanelLayout = new javax.swing.GroupLayout(classesScrollPanel);
    classesScrollPanel.setLayout(classesScrollPanelLayout);
    classesScrollPanelLayout.setHorizontalGroup(classesScrollPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 760, Short.MAX_VALUE));
    classesScrollPanelLayout.setVerticalGroup(classesScrollPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1508, Short.MAX_VALUE));

    classesScrollPane.setViewportView(classesScrollPanel);

    javax.swing.GroupLayout classDistributionHolderLayout = new javax.swing.GroupLayout(
            classDistributionHolder);
    classDistributionHolder.setLayout(classDistributionHolderLayout);
    classDistributionHolderLayout.setHorizontalGroup(classDistributionHolderLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 428, Short.MAX_VALUE));
    classDistributionHolderLayout.setVerticalGroup(classDistributionHolderLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));

    selectedImagePathLabelClass.setText("Path:");
    jScrollPane3.setViewportView(selectedImagePathLabelClass);

    cNamesScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    cNamesScrollPane.setMaximumSize(new java.awt.Dimension(100, 100));
    cNamesScrollPane.setMinimumSize(new java.awt.Dimension(100, 100));

    javax.swing.GroupLayout classColorAndNamesPanelLayout = new javax.swing.GroupLayout(
            classColorAndNamesPanel);
    classColorAndNamesPanel.setLayout(classColorAndNamesPanelLayout);
    classColorAndNamesPanelLayout.setHorizontalGroup(classColorAndNamesPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 350, Short.MAX_VALUE));
    classColorAndNamesPanelLayout.setVerticalGroup(classColorAndNamesPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 255, Short.MAX_VALUE));

    jScrollPane5.setViewportView(classColorAndNamesPanel);

    cNamesScrollPane.setViewportView(jScrollPane5);

    javax.swing.GroupLayout classPanelLayout = new javax.swing.GroupLayout(classPanel);
    classPanel.setLayout(classPanelLayout);
    classPanelLayout.setHorizontalGroup(classPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(classPanelLayout.createSequentialGroup().addContainerGap().addGroup(classPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(classesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 764, Short.MAX_VALUE)
                    .addGroup(classPanelLayout.createSequentialGroup()
                            .addComponent(classDistributionHolder, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18).addComponent(cNamesScrollPane,
                                    javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(classPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(classPanelLayout.createSequentialGroup().addGroup(classPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(classPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    false)
                                            .addComponent(selectedImageLabelClass,
                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(selectedImagePanelClass,
                                                    javax.swing.GroupLayout.Alignment.LEADING,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addComponent(confusionMatScrollPane,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 262,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(21, 21, 21))
                            .addGroup(classPanelLayout
                                    .createSequentialGroup().addComponent(jScrollPane3,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 278, Short.MAX_VALUE)
                                    .addContainerGap()))));
    classPanelLayout.setVerticalGroup(classPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(classPanelLayout.createSequentialGroup().addContainerGap()
                    .addComponent(selectedImagePanelClass, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(selectedImageLabelClass, javax.swing.GroupLayout.PREFERRED_SIZE, 27,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
                    .addGap(18, 18, 18).addComponent(confusionMatScrollPane,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 237,
                            javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, classPanelLayout.createSequentialGroup()
                    .addGroup(classPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(classDistributionHolder, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(classPanelLayout.createSequentialGroup()
                                    .addComponent(cNamesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 244,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 32, Short.MAX_VALUE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(classesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 331,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(11, 11, 11)));

    hubTab.addTab("Class View", classPanel);

    javax.swing.GroupLayout selectedImagePanelSearchLayout = new javax.swing.GroupLayout(
            selectedImagePanelSearch);
    selectedImagePanelSearch.setLayout(selectedImagePanelSearchLayout);
    selectedImagePanelSearchLayout.setHorizontalGroup(selectedImagePanelSearchLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 222, Short.MAX_VALUE));
    selectedImagePanelSearchLayout.setVerticalGroup(selectedImagePanelSearchLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 224, Short.MAX_VALUE));

    selectedImageLabelSearch.setText("Current Image");

    searchQLabelTxt.setText("Do you want to search the image collection?");

    javax.swing.GroupLayout queryImagePanelLayout = new javax.swing.GroupLayout(queryImagePanel);
    queryImagePanel.setLayout(queryImagePanelLayout);
    queryImagePanelLayout.setHorizontalGroup(queryImagePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 237, Short.MAX_VALUE));
    queryImagePanelLayout.setVerticalGroup(queryImagePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 237, Short.MAX_VALUE));

    imageBrowseButton.setText("Browse");
    imageBrowseButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            imageBrowseButtonActionPerformed(evt);
        }
    });

    jTextField1.setText("                       -- Enter text --");
    jTextField1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jTextField1ActionPerformed(evt);
        }
    });

    queryQTextLabelTxt.setText("You can also search with a textual query:");

    queryNNScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    queryNNScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    javax.swing.GroupLayout queryNNPanelLayout = new javax.swing.GroupLayout(queryNNPanel);
    queryNNPanel.setLayout(queryNNPanelLayout);
    queryNNPanelLayout.setHorizontalGroup(queryNNPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 184, Short.MAX_VALUE));
    queryNNPanelLayout.setVerticalGroup(queryNNPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 432, Short.MAX_VALUE));

    queryNNScrollPane.setViewportView(queryNNPanel);

    simResLabelTxt.setText("Here is a list of most similar results:");

    searchButton.setText("SEARCH");
    searchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchButtonActionPerformed(evt);
        }
    });

    prClassLabelTxt.setText("Predicted class for k = 10:");

    prClassScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    prClassScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    javax.swing.GroupLayout classifierPredictionsPanelLayout = new javax.swing.GroupLayout(
            classifierPredictionsPanel);
    classifierPredictionsPanel.setLayout(classifierPredictionsPanelLayout);
    classifierPredictionsPanelLayout.setHorizontalGroup(classifierPredictionsPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE));
    classifierPredictionsPanelLayout.setVerticalGroup(classifierPredictionsPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 432, Short.MAX_VALUE));

    prClassScrollPane.setViewportView(classifierPredictionsPanel);

    collectionSearchButton.setText("Select from collection");
    collectionSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            collectionSearchButtonActionPerformed(evt);
        }
    });

    selectedImagePathLabelSearch.setText("Path:");
    jScrollPane4.setViewportView(selectedImagePathLabelSearch);

    reRankingButton.setText("Re-rank");
    reRankingButton.setToolTipText("Perform Secondary\nHubness-aware Re-ranking");
    reRankingButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            reRankingButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout searchPanelLayout = new javax.swing.GroupLayout(searchPanel);
    searchPanel.setLayout(searchPanelLayout);
    searchPanelLayout.setHorizontalGroup(searchPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(searchPanelLayout.createSequentialGroup().addContainerGap().addGroup(searchPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(searchQLabelTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 319,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(searchPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(queryQTextLabelTxt, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(searchButton, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addGroup(searchPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                    searchPanelLayout.createSequentialGroup().addComponent(imageBrowseButton)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(collectionSearchButton,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(queryImagePanel, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(searchPanelLayout.createSequentialGroup().addGap(18, 18, 18)
                                    .addGroup(searchPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(simResLabelTxt, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(queryNNScrollPane))
                                    .addGroup(searchPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(searchPanelLayout.createSequentialGroup()
                                                    .addGap(44, 44, 44).addComponent(prClassLabelTxt,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 226,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(searchPanelLayout.createSequentialGroup()
                                                    .addGap(29, 29, 29).addComponent(prClassScrollPane,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 260,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(searchPanelLayout.createSequentialGroup().addGap(59, 59, 59).addComponent(
                                    reRankingButton, javax.swing.GroupLayout.PREFERRED_SIZE, 119,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 236,
                                    Short.MAX_VALUE)
                            .addGroup(searchPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(selectedImageLabelSearch,
                                            javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(selectedImagePanelSearch,
                                            javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addContainerGap()));
    searchPanelLayout.setVerticalGroup(searchPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(searchPanelLayout.createSequentialGroup().addContainerGap().addGroup(searchPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(searchPanelLayout.createSequentialGroup().addGroup(searchPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(searchPanelLayout.createSequentialGroup().addGroup(searchPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(searchQLabelTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(simResLabelTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 51,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(prClassLabelTxt))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(searchPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(imageBrowseButton)
                                            .addComponent(collectionSearchButton).addComponent(reRankingButton))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(queryImagePanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(searchPanelLayout.createSequentialGroup()
                                    .addComponent(selectedImagePanelSearch,
                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(selectedImageLabelSearch,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 27,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 69,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(13, 13, 13).addComponent(queryQTextLabelTxt).addGap(18, 18, 18)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 103,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(
                                    searchButton, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            searchPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(prClassScrollPane).addComponent(queryNNScrollPane)))
                    .addContainerGap()));

    hubTab.addTab("Search", searchPanel);

    collectionMenu.setLabel("Collection");

    workspaceMenuItem.setText("Select workspace");
    workspaceMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            workspaceMenuItemActionPerformed(evt);
        }
    });
    collectionMenu.add(workspaceMenuItem);

    importItem.setLabel("Import data");
    importItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            importItemActionPerformed(evt);
        }
    });
    collectionMenu.add(importItem);

    dMatrixMenu.setText("Distances and Neighbor Sets");

    distImportItem.setText("Import");
    distImportItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            distImportItemActionPerformed(evt);
        }
    });
    dMatrixMenu.add(distImportItem);

    distCalculateMenu.setText("Calculate");

    manhattanDistItem.setText("Manhattan");
    manhattanDistItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            manhattanDistItemActionPerformed(evt);
        }
    });
    distCalculateMenu.add(manhattanDistItem);

    distCalcEuclideanItem.setText("Euclidean");
    distCalcEuclideanItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            distCalcEuclideanItemActionPerformed(evt);
        }
    });
    distCalculateMenu.add(distCalcEuclideanItem);

    distCalcCosineItem.setText("Cosine");
    distCalcCosineItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            distCalcCosineItemActionPerformed(evt);
        }
    });
    distCalculateMenu.add(distCalcCosineItem);

    tanimotoMenuItem.setText("Tanimoto");
    tanimotoMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            tanimotoMenuItemActionPerformed(evt);
        }
    });
    distCalculateMenu.add(tanimotoMenuItem);

    klMenuItem.setText("KL divergence");
    klMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            klMenuItemActionPerformed(evt);
        }
    });
    distCalculateMenu.add(klMenuItem);

    bcMenuItem.setText("Bray-Curtis");
    bcMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bcMenuItemActionPerformed(evt);
        }
    });
    distCalculateMenu.add(bcMenuItem);

    canMenuItem.setText("Canberra");
    canMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            canMenuItemActionPerformed(evt);
        }
    });
    distCalculateMenu.add(canMenuItem);

    dMatrixMenu.add(distCalculateMenu);

    collectionMenu.add(dMatrixMenu);

    neighborStatsItem.setText("Calculate Neighbor Stats");
    neighborStatsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            neighborStatsItemActionPerformed(evt);
        }
    });
    collectionMenu.add(neighborStatsItem);

    mdsVisualizeItem.setText("MDS Visualize");
    mdsVisualizeItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            mdsVisualizeItemActionPerformed(evt);
        }
    });
    collectionMenu.add(mdsVisualizeItem);

    selImgPathMenuItem.setText("Select image by browsing");
    selImgPathMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            selImgPathMenuItemActionPerformed(evt);
        }
    });
    collectionMenu.add(selImgPathMenuItem);

    majorHubSelectionItem.setText("Select major hub");
    majorHubSelectionItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            majorHubSelectionItemActionPerformed(evt);
        }
    });
    collectionMenu.add(majorHubSelectionItem);

    menuBar.add(collectionMenu);

    metricLearningMenu.setText("Metric Learning");

    secondaryMetricMenu.setText("Calculate secondary metric");

    simcosMenuItem.setText("simcos shared neighbor sim");
    simcosMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            simcosMenuItemActionPerformed(evt);
        }
    });
    secondaryMetricMenu.add(simcosMenuItem);

    simhubMenuItem.setText("simhub shared neighbor sim");
    simhubMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            simhubMenuItemActionPerformed(evt);
        }
    });
    secondaryMetricMenu.add(simhubMenuItem);

    mpMenuItem.setText("mutual proximity");
    mpMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            mpMenuItemActionPerformed(evt);
        }
    });
    secondaryMetricMenu.add(mpMenuItem);

    localScalingItem.setText("local scaling");
    localScalingItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            localScalingItemActionPerformed(evt);
        }
    });
    secondaryMetricMenu.add(localScalingItem);

    nicdmItem.setText("NICDM");
    nicdmItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            nicdmItemActionPerformed(evt);
        }
    });
    secondaryMetricMenu.add(nicdmItem);

    metricLearningMenu.add(secondaryMetricMenu);

    loadSecondaryDistancesItem.setText("Load secondary distance matrix");
    loadSecondaryDistancesItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            loadSecondaryDistancesItemActionPerformed(evt);
        }
    });
    metricLearningMenu.add(loadSecondaryDistancesItem);

    menuBar.add(metricLearningMenu);

    editMenu.setText("Edit");

    previousMenuItem.setText("Previous");
    previousMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            previousMenuItemActionPerformed(evt);
        }
    });
    editMenu.add(previousMenuItem);

    nextMenuItem.setText("Next");
    nextMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            nextMenuItemActionPerformed(evt);
        }
    });
    editMenu.add(nextMenuItem);

    screenCaptureMenu.setText("Screen capture");

    mdsScreenCaptureItem.setText("MDS screen");
    mdsScreenCaptureItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            mdsScreenCaptureItemActionPerformed(evt);
        }
    });
    screenCaptureMenu.add(mdsScreenCaptureItem);

    graphScreenCaptureItem.setText("Graph screen");
    graphScreenCaptureItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            graphScreenCaptureItemActionPerformed(evt);
        }
    });
    screenCaptureMenu.add(graphScreenCaptureItem);

    editMenu.add(screenCaptureMenu);

    menuBar.add(editMenu);

    codebookMenu.setText("Codebook");

    loadCodebookItem.setText("load Codebook");
    loadCodebookItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            loadCodebookItemActionPerformed(evt);
        }
    });
    codebookMenu.add(loadCodebookItem);

    loadCodebookProfileMenuItem.setText("load Codebook Profile");
    loadCodebookProfileMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            loadCodebookProfileMenuItemActionPerformed(evt);
        }
    });
    codebookMenu.add(loadCodebookProfileMenuItem);

    menuBar.add(codebookMenu);

    classificationMenu.setText("Classification");

    trainModelsItem.setText("Train models");
    trainModelsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            trainModelsItemActionPerformed(evt);
        }
    });
    classificationMenu.add(trainModelsItem);

    menuBar.add(classificationMenu);

    selImageMenu.setText("Selected Image");

    selSIFTmenuItem.setText("Visual words assessment view");
    selSIFTmenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            selSIFTmenuItemActionPerformed(evt);
        }
    });
    selImageMenu.add(selSIFTmenuItem);

    menuBar.add(selImageMenu);

    setJMenuBar(menuBar);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addComponent(hubTab, javax.swing.GroupLayout.PREFERRED_SIZE, 1073, Short.MAX_VALUE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addComponent(hubTab).addContainerGap()));

    pack();
}

From source file:org.jcurl.demo.smack.JCurlSmackClient.java

@Override
protected void startup() {
    getMainFrame().setJMenuBar(createMenuBar());
    miRoster.setSelected(true);/*from w  ww  .ja v a 2 s  . c om*/

    final JComponent pv = new JPanel();
    pv.setLayout(new BorderLayout());
    final Box conversation = Box.createVerticalBox();
    pv.add(new JScrollPane(conversation, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);
    pv.add(new JScrollPane(sca, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS), BorderLayout.SOUTH);

    final JSplitPane ph = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    ph.setResizeWeight(0.8);
    ph.add(pv, JSplitPane.LEFT);
    ph.add(new JScrollPane(sro), JSplitPane.RIGHT);

    xmppRoster();
    show(ph);

    // connect the jabber account
    new Thread(new Runnable() {
        public void run() {
            try {
                // get uid + pwd from a .properties file
                final Properties p = loadClassProps(JCurlSmackClient.class, null);
                acc.setUid(XmppAddress.parse(p.getProperty("acc_uid")));
                acc.setPwd(p.getProperty("acc_pwd"));
                // login and get the present buddies
                acc.login(resource);
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        sro.setConn(acc.getConn());
                        // Wire up xmpp stuff:
                        final ChatManager cm = sro.getChatManager();
                        cm.addChatListener(sca);
                        cm.addChatListener(slo);
                    }
                });
            } catch (final IOException e) {
                throw new RuntimeException("Unhandled", e);
            } catch (final XMPPException e) {
                throw new RuntimeException("Unhandled", e);
            }
        }
    }).start();
}

From source file:org.rdv.ui.ConsoleDialog.java

public ConsoleDialog(JDialog owner) {
    super(owner);

    setName("consoleDialog");

    setDefaultCloseOperation(AboutDialog.DISPOSE_ON_CLOSE);

    JPanel container = new JPanel();
    container.setLayout(new BorderLayout());
    container.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    setContentPane(container);//  w w  w .  j  a va  2s. com

    InputMap inputMap = container.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    ActionMap actionMap = container.getActionMap();

    Action disposeAction = new AbstractAction() {
        /** serialized version identifier */
        private static final long serialVersionUID = 4380189911762232261L;

        public void actionPerformed(ActionEvent ae) {
            dispose();
        }
    };

    Action copyAction = new AbstractAction() {

        /** serialized version identifier */
        private static final long serialVersionUID = 2596081241883913660L;

        public void actionPerformed(ActionEvent e) {
            textArea.selectAll();
            textArea.copy();
        }
    };

    //    Action scrollLockAction = new AbstractAction() {
    //      /** serialized version identifier */
    //      private static final long serialVersionUID = -8089076016097529064L;
    //
    //      public void actionPerformed(ActionEvent e) {
    //        //toggle scroll lock
    //        scrollLock_=!scrollLock_;
    //      }
    //    };

    disposeAction.putValue(Action.NAME, "OK");
    inputMap.put(KeyStroke.getKeyStroke("ENTER"), "dispose");
    inputMap.put(KeyStroke.getKeyStroke("ESCAPE"), "dispose");
    actionMap.put("dispose", disposeAction);
    copyAction.putValue(Action.NAME, "Copy");
    actionMap.put("copy", copyAction);
    //    actionMap.put("scroll lock", scrollLockAction);
    //    scrollLockAction.putValue(Action.NAME, "Scroll Lock");

    textArea = new JTextArea();
    textArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    textArea.setBackground(Color.WHITE);
    textArea.setForeground(Color.BLACK);
    textArea.setEditable(false);
    textArea.setLineWrap(false);

    Iterator<String> msgIt = messageBuffer.getMessages().iterator();

    //add all the messages in the buffer to this point
    while (msgIt.hasNext()) {
        addMessage(msgIt.next());
    }

    JScrollPane scrollPane = new JScrollPane(textArea, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    scrollPane.setPreferredSize(new Dimension(640, 480));
    container.add(scrollPane, BorderLayout.CENTER);

    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new BorderLayout());
    buttonPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    JButton okButton = new JButton(disposeAction);
    buttonPanel.add(okButton, BorderLayout.EAST);

    JPanel leftBtnsPanel = new JPanel();
    leftBtnsPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    buttonPanel.add(leftBtnsPanel, BorderLayout.WEST);

    JButton copyButton = new JButton(copyAction);
    leftBtnsPanel.add(copyButton);

    //    JButton scrollLockButton = new JButton(scrollLockAction);
    //    leftBtnsPanel.add(scrollLockButton);

    container.add(buttonPanel, BorderLayout.SOUTH);

    // inject resources from the properties for this component
    ResourceMap resourceMap = RDV.getInstance().getContext().getResourceMap(getClass());
    resourceMap.injectComponents(this);

    pack();
    okButton.requestFocusInWindow();
    setLocationByPlatform(true);
    setVisible(true);

    messageBuffer.addObserver(this);
}

From source file:org.spottedplaid.ui.Mainframe.java

/**
 * Create the frame.//from  ww w.j a  v a2  s. c  om
 *
 * @param _Sqliteops the _ sqliteops
 * @param _Crypto the _ crypto
 */
public Mainframe(SQliteOps _Sqliteops, Crypto _Crypto) {

    l_sqliteops = _Sqliteops;
    l_crypto = _Crypto;

    setTitle("The Password Saver - Management");
    setResizable(false);
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 982, 656);

    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);

    JMenu mnFile = new JMenu("File");
    menuBar.add(mnFile);

    JMenuItem mntmExit = new JMenuItem("Exit");
    mntmExit.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            System.exit(0);
        }
    });

    mnFile.add(mntmExit);

    JMenu mnTools = new JMenu("Tools");
    menuBar.add(mnTools);

    JMenuItem mntmChgpwd = new JMenuItem("Change Passphrase");
    mntmChgpwd.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            Changepwd changePwd = new Changepwd(l_crypto, l_sqliteops);
            changePwd.setVisible(true);
        }
    });

    mnTools.add(mntmChgpwd);

    JMenuItem mntmExpirationReport = new JMenuItem("Expiration Report");
    mntmExpirationReport.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            DbRecord dbRecExp = new DbRecord();
            dbRecExp.setType(Pwdtypes.S_EXP_RPT);
            ArrayList<String> arrData = l_sqliteops.getRecords(dbRecExp);
            String[] sRecord = new String[3];
            String sData = "";
            int iElement = 0;

            /// Cycle through the data, output to text file, and open in WordPad
            if (arrData != null && arrData.size() > 0) {
                try {
                    String sFilename = "ExpirationReport.txt";
                    File fileExpRpt = new File(sFilename);

                    BufferedWriter buffWriter = new BufferedWriter(new FileWriter(fileExpRpt));
                    buffWriter.write("URL/Application                Challenge            Expiration");
                    buffWriter.write("\n");
                    buffWriter.write("--------------------------------------------------------------");
                    buffWriter.write("\n");
                    for (int iCount = 0; iCount < arrData.size(); iCount++) {
                        sData = arrData.get(iCount);
                        System.out.println("DEBUG->sData [" + sData + "]");
                        StringTokenizer st = new StringTokenizer(sData, "|");
                        iElement = 0;
                        while (st.hasMoreTokens()) {
                            sRecord[iElement] = st.nextToken();
                            iElement++;
                        }

                        /// Define the padding for the output
                        int iPadValue1 = 35 - sRecord[0].length();
                        if (iPadValue1 < 0) {
                            iPadValue1 = 2;
                        }

                        int iPadValue2 = 55 - (35 + sRecord[1].length());
                        if (iPadValue2 < 0) {
                            iPadValue2 = 2;
                        }

                        iPadValue1 += sRecord[1].length();
                        iPadValue2 += sRecord[2].length();

                        buffWriter.write(sRecord[0] + StringUtils.leftPad(sRecord[1], iPadValue1)
                                + StringUtils.leftPad(sRecord[2], iPadValue2) + "\n");
                        buffWriter.write("\n");
                    }
                    buffWriter.close();

                    /// Opens WordPad on Windows systems.  This could be changed to use a property in order to work on a linux/unix/apple system
                    ProcessBuilder pb = new ProcessBuilder("write.exe", sFilename);
                    pb.start();
                } catch (IOException ie) {
                    System.out.println("Expiration Report IO Exception [" + ie.getMessage() + "]");
                    ie.printStackTrace();
                }

            } else {
                JOptionPane.showMessageDialog(null, "No expiring records found");
            }
        }
    });
    mnTools.add(mntmExpirationReport);

    JMenuItem mntmViewLogs = new JMenuItem("View Logs");
    mntmViewLogs.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            DbRecord dbRecLogs = new DbRecord();
            dbRecLogs.setType(Pwdtypes.S_LOG_TYPE);
            ArrayList<String> arrData = l_sqliteops.getRecords(dbRecLogs);
            String[] sRecord = new String[3];
            String sData = "";
            String sTitle = "Display Data Changes";
            String sDisplay = "Date                  Log Message";
            sDisplay += "\n";
            int iElement = 0;

            /// Cycle through the data, output to text file, and open in WordPad
            if (arrData != null) {
                for (int iCount = 0; iCount < arrData.size(); iCount++) {
                    sData = arrData.get(iCount);
                    System.out.println("DEBUG->sData [" + sData + "]");
                    StringTokenizer st = new StringTokenizer(sData, "|");
                    iElement = 0;
                    while (st.hasMoreTokens()) {
                        sRecord[iElement] = st.nextToken();
                        iElement++;
                    }
                    sDisplay += sRecord[2] + ":" + sRecord[1];
                    sDisplay += "\n";
                }

                if (arrData.size() > 0) {
                    JOptionPane.showMessageDialog(null, sDisplay, sTitle, JOptionPane.INFORMATION_MESSAGE);
                }

            }
        }
    });

    mnTools.add(mntmViewLogs);

    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);

    JLabel lblThePasswordSaver = new JLabel("The Password Saver - Manage Passwords");
    lblThePasswordSaver.setFont(new Font("Arial", Font.BOLD, 16));
    lblThePasswordSaver.setHorizontalAlignment(SwingConstants.CENTER);

    JLabel lblUrlapplication = new JLabel("URL/Application");

    jtxtApp = new JTextField();
    jtxtApp.setColumns(10);

    JLabel lblDescription = new JLabel("Description");

    jtxtDesc = new JTextField();
    jtxtDesc.setColumns(10);

    /// Button - Add button for clients/apps
    JButton btnAdd = new JButton("Add");
    btnAdd.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (FormValidation.verifyAppData(jtxtApp.getText().toString(), jtxtDesc.getText().toString()) < 0) {
                JOptionPane.showMessageDialog(null, "URL/Application and Description are required");
            } else {
                dbRec = new DbRecord();
                dbRec.setType(Pwdtypes.S_CLIENT_TYPE);
                dbRec.setClientName(jtxtApp.getText().toString());
                dbRec.setClientDesc(jtxtDesc.getText().toString());
                int l_iClientId = l_sqliteops.insertRecord(dbRec);
                if (l_iClientId <= 0) {
                    JOptionPane.showMessageDialog(null, "Insert record failed [" + dbRec.getResult() + "]");
                } else {
                    dbRec.setClientId(l_iClientId);
                    addToTable();
                }
            }
        }
    });

    /// Buttons - Replace button for clients/apps
    btnReplace = new JButton("Replace");
    btnReplace.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            if (iClientId <= 0) {
                JOptionPane.showMessageDialog(null, "Update record warning: Please select record to continue");
                return;
            }
            dbRec = new DbRecord();
            dbRec.setType(Pwdtypes.S_CLIENT_TYPE);
            dbRec.setClientId(iClientId);
            dbRec.setClientName(jtxtApp.getText().toString());
            dbRec.setClientDesc(jtxtDesc.getText().toString());
            if (l_sqliteops.updateRecord(dbRec) < 0) {
                JOptionPane.showMessageDialog(null, "Update record failed [" + dbRec.getResult() + "]");
            } else {
                int iRow = jtabApps.getSelectedRow();
                jtabApps.setValueAt(jtxtApp.getText().toString(), iRow, 1);
                jtabApps.setValueAt(jtxtDesc.getText().toString(), iRow, 2);

                clearFields();
            }
        }
    });

    btnReplace.setEnabled(false);

    /// Button - Delete button for clients/apps
    btnDelete = new JButton("Delete");
    btnDelete.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (iClientId <= 0) {
                JOptionPane.showMessageDialog(null,
                        "Delete record failed: Please select a record then click Delete");
                return;
            }
            dbRec = new DbRecord();
            dbRec.setType("clients");
            dbRec.setClientId(iClientId);
            dbRec.setDelCreds(0);

            if (chkDelAssoc.isSelected()) {
                dbRec.setDelCreds(1);
            }

            if (l_sqliteops.deleteRecord(dbRec) < 0) {
                JOptionPane.showMessageDialog(null, "Delete record failed [" + dbRec.getResult() + "]");
            } else {
                DefaultTableModel jtabModel = (DefaultTableModel) jtabApps.getModel();
                jtabModel.removeRow(jtabApps.getSelectedRow());
                if (chkDelAssoc.isSelected()) {
                    DefaultTableModel model = (DefaultTableModel) jtabCreds.getModel();
                    model.setRowCount(0);
                }
                clearFields();
            }
        }
    });
    btnDelete.setEnabled(false);

    /// Buttons - Search button for clients/apps
    btnSearch = new JButton("Search");
    btnSearch.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            dbRec = new DbRecord();
            dbRec.setType(Pwdtypes.S_CLIENT_TYPE);
            dbRec.setClientName(jtxtApp.getText().toString());
            dbRec.setClientDesc(jtxtDesc.getText().toString());
            loadTable(dbRec);
        }
    });

    btnClear = new JButton("Clear");
    btnClear.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            clearFields();
        }
    });

    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    /// Begin section for credentials challenges/responses - text fields and buttons
    JLabel lblChallenge = new JLabel("Challenge");

    JLabel lblResponse = new JLabel("Response");

    jtxtChlng = new JTextField();
    jtxtChlng.setColumns(10);

    jtxtRsp = new JTextField();
    jtxtRsp.setColumns(10);

    /// Buttons - Add button for credentials
    btnCredAdd = new JButton("Add");
    btnCredAdd.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (FormValidation.verifyCredData(jtxtChlng.getText().toString(),
                    jtxtRsp.getText().toString()) < 0) {
                JOptionPane.showMessageDialog(null, "Challenge and Response are required");
            } else {
                dbRec = new DbRecord();
                dbRec.setType(Pwdtypes.S_CREDS_TYPE);
                dbRec.setClientId(iClientId);
                dbRec.setChallenge(jtxtChlng.getText().toString());
                dbRec.setResponse(l_crypto.encrypt(jtxtRsp.getText().toString()));
                dbRec.setTrack(jcbTrack.getSelectedItem().toString());

                /// Set the modify date if the track days are > 0
                if (!jcbTrack.getSelectedItem().toString().equals("0")) {
                    Calendar calNow = Calendar.getInstance();
                    SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
                    int iDaysToAdd = Integer.parseInt(jcbTrack.getSelectedItem().toString());

                    calNow.add(Calendar.DATE, iDaysToAdd);
                    String sValue = sdf.format(calNow.getTime());
                    dbRec.setModifyDate(sValue);
                }

                int l_iClientId = l_sqliteops.insertRecord(dbRec);
                if (l_iClientId <= 0) {
                    JOptionPane.showMessageDialog(null, "Insert record failed [" + dbRec.getResult() + "]");
                } else {
                    dbRec.setCredId(l_iClientId);
                    addToCredsTable();
                }
            }
        }
    });

    /// Button - Replace button for credentials
    btnCredReplace = new JButton("Replace");
    btnCredReplace.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            DbRecord dbRecLog = new DbRecord();
            int iDaysToAdd = 0;
            Calendar calNow = Calendar.getInstance();
            SimpleDateFormat sdf1 = new SimpleDateFormat("MM/dd/yyyy");

            String sCurDate = sdf1.format(calNow.getTime());
            String sValue = sDateModified;
            String sLogMsg = "";
            StringBuilder sbLogMsg = new StringBuilder(sLogMsg);

            if (dbRec.getType().equals(Pwdtypes.S_CREDS_TYPE) && (dbRec.getCredId() > 0)) {
                dbRec.setClientId(iClientId);
                dbRec.setCredId(iCredId);
                dbRec.setChallenge(jtxtChlng.getText().toString());
                dbRec.setResponse(l_crypto.encrypt(jtxtRsp.getText().toString()));
                dbRec.setTrack(jcbTrack.getSelectedItem().toString());

                /** Check for changes and insert log if necessary */
                if (!sChallenge.equals(jtxtChlng.getText())) {
                    sbLogMsg.append("Application [" + jtxtApp.getText() + "], Challenge modified, old ["
                            + sChallenge + "], new [" + jtxtChlng.getText() + "]");
                }

                if (!sResponse.equals(jtxtRsp.getText())) {
                    if (sbLogMsg.toString().length() > 0) {
                        sbLogMsg.append(",");
                    } else {
                        sbLogMsg.append("Application [" + jtxtApp.getText() + "],");
                    }
                    sbLogMsg.append("Response modified, old [" + sResponse + "]");
                }

                if (sbLogMsg.toString().length() > 0) {
                    dbRecLog.setType(Pwdtypes.S_LOG_TYPE);
                    dbRecLog.setLog(sbLogMsg.toString());
                    dbRecLog.setModifyDate(sCurDate);
                    if (l_sqliteops.insertRecord(dbRecLog) < 0) {
                        JOptionPane.showMessageDialog(null,
                                "Insert log record failed [" + dbRecLog.getResult() + "]");
                    }
                }

                if (!jcbTrack.getSelectedItem().toString().equals("0")) {
                    iDaysToAdd = Integer.parseInt(jcbTrack.getSelectedItem().toString());

                    calNow.add(Calendar.DATE, iDaysToAdd);
                    sValue = sdf1.format(calNow.getTime());

                    System.out.println("DEBUG->Date (sValue) [" + sValue + "]");
                    dbRec.setModifyDate(sValue);
                }
                /// Update the record
                if (l_sqliteops.updateRecord(dbRec) < 0) {
                    JOptionPane.showMessageDialog(null, "Update record failed [" + dbRec.getResult() + "]");
                } else {
                    int iRow = jtabCreds.getSelectedRow();
                    jtabCreds.setValueAt(jtxtChlng.getText().toString(), iRow, 1);
                    jtabCreds.setValueAt(l_crypto.encrypt(jtxtRsp.getText().toString()), iRow, 2);
                    jtabCreds.setValueAt(jcbTrack.getSelectedItem().toString(), iRow, 3);
                    jtabCreds.setValueAt(sValue, iRow, 4);

                    jtabCreds.setValueAt(sValue, iRow, 4);
                    clearCredsFields();
                    enableCredsButtons();
                }
            }
        }
    });

    /// Button - Delete button for credentials
    btnCredDelete = new JButton("Delete");
    btnCredDelete.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            dbRec.setType(Pwdtypes.S_CREDS_TYPE);
            dbRec.setCredId(iCredId);
            dbRec.setChallenge(jtxtChlng.getText().toString());
            dbRec.setResponse(jtxtRsp.getText().toString());
            if (l_sqliteops.deleteRecord(dbRec) < 0) {
                JOptionPane.showMessageDialog(null,
                        "Delete credential record failed [" + dbRec.getResult() + "]");
            } else {
                DefaultTableModel jtabModel = (DefaultTableModel) jtabCreds.getModel();
                jtabModel.removeRow(jtabCreds.getSelectedRow());
                clearCredsFields();
                enableCredsButtons();
            }
        }
    });

    /// Button - Clear button for credentials
    btnCredClear = new JButton("Clear");
    btnCredClear.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            clearCredsFields();
            enableCredsButtons();
        }
    });

    /// End section for credentials challenges/responses - text fields and buttons

    JScrollPane scrollPane_1 = new JScrollPane();
    scrollPane_1.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    btnShowAssoc = new JButton("Display Associated Challenges/Responses in new window");

    /// Display the challenges/responses associated to the application in a popup window. 
    /// This is to make it easier to view when all of the values are needed
    btnShowAssoc.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String sTitle = "Credentials for: " + jtxtApp.getText();
            String sDisplay = "";

            sDisplay += "\n";
            DefaultTableModel jTmpModel = (DefaultTableModel) jtabCreds.getModel();
            for (int i = 0; i < jTmpModel.getRowCount(); i++) {
                sDisplay += "Q. " + jTmpModel.getValueAt(i, 1).toString() + "  A. "
                        + l_crypto.decrypt(jTmpModel.getValueAt(i, 2).toString()) + "\n";
            }

            JOptionPane.showMessageDialog(null, sDisplay, sTitle, JOptionPane.INFORMATION_MESSAGE);
        }
    });

    JLabel lblTrackUpdates = new JLabel("Exp Days");

    /// Values for expiration days are hardcoded, may want to move to a table for metadata
    jcbTrack.addItem("0");
    jcbTrack.addItem("30");
    jcbTrack.addItem("45");
    jcbTrack.addItem("60");
    jcbTrack.addItem("90");
    jcbTrack.addItem("180");
    jcbTrack.addItem("365");
    jcbTrack.setSelectedItem("0");

    btnEdit = new JButton("Edit");
    btnEdit.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            jtxtChlng.setEnabled(true);
            jtxtRsp.setEnabled(true);
            jcbTrack.setEnabled(true);
            btnCredReplace.setEnabled(true);
            btnCredAdd.setEnabled(true);
        }
    });
    btnEdit.setEnabled(false);

    GroupLayout gl_contentPane = new GroupLayout(contentPane);
    gl_contentPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_contentPane.createSequentialGroup().addGroup(gl_contentPane
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_contentPane.createSequentialGroup().addGap(207)
                            .addComponent(lblThePasswordSaver))
                    .addGroup(gl_contentPane.createSequentialGroup().addGap(23).addGroup(gl_contentPane
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_contentPane.createSequentialGroup().addComponent(btnAdd)
                                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(btnReplace)
                                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(btnDelete)
                                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(btnSearch)
                                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(btnClear))
                            .addGroup(gl_contentPane.createSequentialGroup().addGroup(gl_contentPane
                                    .createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_contentPane.createSequentialGroup()
                                            .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
                                                    .addComponent(lblUrlapplication)
                                                    .addComponent(lblDescription))
                                            .addPreferredGap(ComponentPlacement.RELATED)
                                            .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
                                                    .addComponent(jtxtApp, GroupLayout.PREFERRED_SIZE, 154,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jtxtDesc, GroupLayout.PREFERRED_SIZE, 260,
                                                            GroupLayout.PREFERRED_SIZE)))
                                    .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 355,
                                            GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                                    .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
                                            .addComponent(btnShowAssoc)
                                            .addGroup(gl_contentPane.createSequentialGroup()
                                                    .addGroup(gl_contentPane
                                                            .createParallelGroup(Alignment.TRAILING)
                                                            .addComponent(lblResponse)
                                                            .addComponent(lblChallenge))
                                                    .addGap(18)
                                                    .addGroup(gl_contentPane
                                                            .createParallelGroup(Alignment.LEADING)
                                                            .addGroup(gl_contentPane.createSequentialGroup()
                                                                    .addComponent(jtxtRsp, 272, 272, 272)
                                                                    .addGap(26).addComponent(lblTrackUpdates)
                                                                    .addPreferredGap(
                                                                            ComponentPlacement.UNRELATED)
                                                                    .addComponent(jcbTrack,
                                                                            GroupLayout.PREFERRED_SIZE, 55,
                                                                            GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jtxtChlng, GroupLayout.PREFERRED_SIZE,
                                                                    440, GroupLayout.PREFERRED_SIZE)))
                                            .addGroup(gl_contentPane
                                                    .createParallelGroup(Alignment.LEADING, false)
                                                    .addGroup(gl_contentPane.createSequentialGroup()
                                                            .addComponent(btnCredAdd,
                                                                    GroupLayout.PREFERRED_SIZE, 78,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(ComponentPlacement.RELATED)
                                                            .addComponent(btnCredReplace)
                                                            .addPreferredGap(ComponentPlacement.RELATED)
                                                            .addComponent(btnCredDelete,
                                                                    GroupLayout.PREFERRED_SIZE, 75,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(ComponentPlacement.UNRELATED)
                                                            .addComponent(btnCredClear)
                                                            .addPreferredGap(ComponentPlacement.RELATED,
                                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                            .addComponent(btnEdit))
                                                    .addComponent(scrollPane_1, GroupLayout.PREFERRED_SIZE,
                                                            GroupLayout.DEFAULT_SIZE,
                                                            GroupLayout.PREFERRED_SIZE))))))
                    .addGroup(gl_contentPane.createSequentialGroup().addGap(36).addComponent(chkDelAssoc)))
                    .addContainerGap(57, Short.MAX_VALUE)));
    gl_contentPane.setVerticalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_contentPane.createSequentialGroup().addContainerGap().addComponent(lblThePasswordSaver)
                    .addGap(45)
                    .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
                            .addGroup(gl_contentPane.createSequentialGroup().addGroup(gl_contentPane
                                    .createParallelGroup(Alignment.BASELINE).addComponent(lblUrlapplication)
                                    .addComponent(jtxtApp, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblChallenge)).addPreferredGap(ComponentPlacement.UNRELATED)
                                    .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(lblDescription)
                                            .addComponent(jtxtDesc, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblResponse)))
                            .addGroup(gl_contentPane.createSequentialGroup()
                                    .addComponent(jtxtChlng, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.UNRELATED)
                                    .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(jtxtRsp, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblTrackUpdates)
                                            .addComponent(jcbTrack, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
                    .addGap(18)
                    .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE).addComponent(btnAdd)
                            .addComponent(btnReplace).addComponent(btnDelete).addComponent(btnSearch)
                            .addComponent(btnClear).addComponent(btnCredAdd).addComponent(btnCredReplace)
                            .addComponent(btnCredDelete).addComponent(btnCredClear).addComponent(btnEdit))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 208,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(scrollPane_1, GroupLayout.PREFERRED_SIZE, 109,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_contentPane.createSequentialGroup().addGap(120)
                                    .addComponent(btnShowAssoc)))
                    .addGap(18).addComponent(chkDelAssoc).addContainerGap(170, Short.MAX_VALUE)));

    /// JTable - Credentials table setup/definition - BEGIN
    jtabCreds = new JTable();
    jtabCreds.setModel(new DefaultTableModel(new Object[][] {},
            new String[] { "ID", "Challenge", "Response", "Exp Days", "Expiration Date" }) {
        Class[] columnTypes = new Class[] { Integer.class, String.class, String.class, String.class,
                String.class };

        public Class getColumnClass(int columnIndex) {
            return columnTypes[columnIndex];
        }
    });
    jtabCreds.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    scrollPane_1.setViewportView(jtabCreds);
    /// JTable - Credentials table setup/definition - END

    jtabApps = new JTable();
    scrollPane.setViewportView(jtabApps);

    jtabApps.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jtabApps.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
    jtabApps.setModel(
            new DefaultTableModel(new Object[][] {}, new String[] { "ID", "URL/Application", "Description" }) {
                Class[] columnTypes = new Class[] { Integer.class, String.class, String.class };

                public Class getColumnClass(int columnIndex) {
                    return columnTypes[columnIndex];
                }

                @Override
                public boolean isCellEditable(int row, int column) {
                    //all cells false
                    return false;
                }
            });
    jtabApps.getColumnModel().getColumn(1).setMinWidth(55);
    jtabApps.getColumnModel().getColumn(2).setMinWidth(55);
    contentPane.setLayout(gl_contentPane);
    contentPane.setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[] { jtxtChlng,
            lblThePasswordSaver, jtxtApp, jtxtDesc, btnAdd, btnReplace, btnDelete, btnSearch, btnClear, jtxtRsp,
            btnCredAdd, btnCredReplace, btnCredDelete, btnCredClear, scrollPane, jtabApps, lblUrlapplication,
            lblDescription, chkDelAssoc, lblChallenge, lblResponse, scrollPane_1, jtabCreds }));
    setFocusTraversalPolicy(new FocusTraversalOnArray(
            new Component[] { menuBar, jtxtApp, jtxtDesc, btnAdd, btnReplace, btnDelete, btnSearch, btnClear,
                    jtxtChlng, jtxtRsp, btnCredAdd, btnCredReplace, btnCredDelete, btnCredClear, contentPane,
                    mnFile, mntmExit, lblThePasswordSaver, scrollPane, jtabApps, lblUrlapplication,
                    lblDescription, chkDelAssoc, lblChallenge, lblResponse, scrollPane_1, jtabCreds }));

    /// Initial data load
    dbRec = new DbRecord();
    dbRec.setType(Pwdtypes.S_CLIENT_TYPE);
    dbRec.setClientName("");
    dbRec.setClientDesc("");
    loadTable(dbRec);
    disableCredsButtons();

    ListSelectionModel rowSM = jtabApps.getSelectionModel();

    //Listener for client row change;
    rowSM.addListSelectionListener(new ListSelectionListener() {

        /// Fill the form values when a row is selected in the JTable
        @Override
        public void valueChanged(ListSelectionEvent e) {
            ListSelectionModel lsmData = (ListSelectionModel) e.getSource();
            if (!lsmData.isSelectionEmpty()) {
                int iRow = lsmData.getMinSelectionIndex();
                iClientId = Integer.parseInt(jtabApps.getValueAt(iRow, 0).toString());
                jtxtApp.setText(jtabApps.getValueAt(iRow, 1).toString());
                jtxtDesc.setText(jtabApps.getValueAt(iRow, 2).toString());

                dbRec.setType(Pwdtypes.S_CREDS_TYPE);
                dbRec.setClientId(iClientId);
                loadTable(dbRec);
                enableButtons();
                clearCredsFields();
                enableCredsButtons();
            }
        }
    });

    ListSelectionModel rowCred = jtabCreds.getSelectionModel();

    //Listener for credential row change;
    rowCred.addListSelectionListener(new ListSelectionListener() {

        /// Fill the form values when a row is selected in the JTable
        @Override
        public void valueChanged(ListSelectionEvent e) {
            ListSelectionModel lsmData = (ListSelectionModel) e.getSource();
            if (!lsmData.isSelectionEmpty()) {
                int iRow = lsmData.getMinSelectionIndex();
                iCredId = Integer.parseInt(jtabCreds.getValueAt(iRow, 0).toString());
                jtxtChlng.setText(jtabCreds.getValueAt(iRow, 1).toString());
                jtxtRsp.setText(l_crypto.decrypt(jtabCreds.getValueAt(iRow, 2).toString()));
                jcbTrack.setSelectedItem(jtabCreds.getValueAt(iRow, 3).toString());
                if (null == jtabCreds.getValueAt(iRow, 4)) {
                    sDateModified = "";
                } else {
                    sDateModified = jtabCreds.getValueAt(iRow, 4).toString();
                }
                sChallenge = jtxtChlng.getText();
                sResponse = jtxtRsp.getText();
                dbRec.setType(Pwdtypes.S_CREDS_TYPE);
                dbRec.setCredId(iClientId);
                jtxtChlng.setEnabled(false);
                jtxtRsp.setEnabled(false);
                jcbTrack.setEnabled(false);
                btnEdit.setEnabled(true);
                btnCredDelete.setEnabled(true);
                btnCredClear.setEnabled(true);
            }
        }
    });

}