/*
* Copyright (c) 2009 The Jackson Laboratory
*
* This software was developed by Gary Churchill's Lab at The Jackson
* Laboratory (see http://research.jax.org/faculty/churchill).
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
package org.jax.qtl.scan.gui;
import java.awt.Frame;
import javax.help.CSH;
import javax.help.HelpSet;
import javax.help.SecondaryWindow;
import org.jax.analyticgraph.framework.GraphVisualSettingsPanel;
import org.jax.qtl.QTL;
/**
* Dialog for scanone settings.
* @author <A HREF="mailto:keith.sheppard@jax.org">Keith Sheppard</A>
*/
public class ScanOneSettingsDialog extends javax.swing.JDialog
{
/**
* every {@link java.io.Serializable} is supposed to have one of these
*/
private static final long serialVersionUID = -9126226848869336285L;
private static final String HELP_ID_STRING = "One_QTL_Scan_Plot_Settings";
private final ScanOneIntervalPanel scanOneIntervalPanel;
private final GraphVisualSettingsPanel graphVisualSettingsPanel;
private final ScanOneThresholdPanel scanOneThresholdPanel;
/**
* Constructor
* @param parent
* the parent for this dialog
* @param graphToEdit
* the graph that we're editing
*/
public ScanOneSettingsDialog(
Frame parent,
ScanOneGraph graphToEdit)
{
super(parent, "One QTL Scan Plot Settings", true);
this.scanOneIntervalPanel = new ScanOneIntervalPanel(
graphToEdit.getScanOneIntervalCommandBuilder());
this.graphVisualSettingsPanel = new GraphVisualSettingsPanel(graphToEdit);
this.initComponents();
if(graphToEdit.getScanOneResult().getPermutationsWereCalculated())
{
this.scanOneThresholdPanel = new ScanOneThresholdPanel(graphToEdit);
this.mainContentPanel.addTab(
"Thresholds",
this.scanOneThresholdPanel);
}
else
{
this.scanOneThresholdPanel = null;
}
// initialize the help stuff
HelpSet hs = QTL.getInstance().getMenubar().getHelpSet();
CSH.setHelpIDString(
this.helpButton,
HELP_ID_STRING);
this.helpButton.addActionListener(
new CSH.DisplayHelpFromSource(
hs,
SecondaryWindow.class.getName(),
null));
}
/**
* This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("all")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
actionPanel = new javax.swing.JPanel();
closeButton = new javax.swing.JButton();
helpButton = new javax.swing.JButton();
mainContentPanel = new javax.swing.JTabbedPane();
visualSettingsPanelDownCast = this.graphVisualSettingsPanel;
intervalsPanelDownCast = this.scanOneIntervalPanel;
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
closeButton.setText("Close");
closeButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
closeButtonActionPerformed(evt);
}
});
actionPanel.add(closeButton);
helpButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/action/help-16x16.png"))); // NOI18N
helpButton.setText("Help ...");
actionPanel.add(helpButton);
getContentPane().add(actionPanel, java.awt.BorderLayout.SOUTH);
mainContentPanel.addTab("Labels", visualSettingsPanelDownCast);
mainContentPanel.addTab("Intervals", intervalsPanelDownCast);
getContentPane().add(mainContentPanel, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>//GEN-END:initComponents
private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
this.dispose();
}//GEN-LAST:event_closeButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel actionPanel;
private javax.swing.JButton closeButton;
private javax.swing.JButton helpButton;
private javax.swing.JPanel intervalsPanelDownCast;
private javax.swing.JTabbedPane mainContentPanel;
private javax.swing.JPanel visualSettingsPanelDownCast;
// End of variables declaration//GEN-END:variables
}