/*
* 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.ui;
import org.jax.qtl.cross.Cross;
import org.jax.qtl.graph.FigureProperties;
import org.jax.qtl.graph.GenoPlotPanel;
import org.jax.qtl.project.QtlDataModel;
import org.jax.qtl.project.QtlProjectManager;
/**
*
* @author <A HREF="mailto:keith.sheppard@jax.org">Keith Sheppard</A>
*/
public class GenoPlotDialog extends javax.swing.JDialog
{
/**
* every {@link java.io.Serializable} is supposed to have one of these
*/
private static final long serialVersionUID = 6357020282785474027L;
/**
* the plot panel
*/
private final GenoPlotPanel genoPlotPanel;
/**
* Constructor
* @param parent
* the parent frame to use
*/
public GenoPlotDialog(java.awt.Frame parent)
{
super(parent, true);
// FIXME add in cross selection
QtlDataModel dataModel = QtlProjectManager.getInstance().getActiveProject().getDataModel();
dataModel.updateAll();
if(dataModel.getCrossMap().size() > 0)
{
Cross firstCross = dataModel.getCrossMap().values().iterator().next();
this.genoPlotPanel = new GenoPlotPanel(
firstCross,
FigureProperties.defaultGenoPlotProperties());
}
else
{
throw new IllegalStateException();
}
this.initComponents();
}
/** 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() {
genoPlotPanelDownCast = this.genoPlotPanel;
actionButtonPanel = new javax.swing.JPanel();
closeButton = new javax.swing.JButton();
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);
}
});
actionButtonPanel.add(closeButton);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(actionButtonPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.add(genoPlotPanelDownCast, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.add(genoPlotPanelDownCast, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(actionButtonPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
);
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 actionButtonPanel;
private javax.swing.JButton closeButton;
private javax.swing.JPanel genoPlotPanelDownCast;
// End of variables declaration//GEN-END:variables
}