package nxm.sys.mcr;

/**
 * Created on November 1, 2004, 4:44 PM
 * @author  J. Czechowski IV
 */
@SuppressWarnings({"rawtypes","unchecked"}) // <-- NOTE: JDK7 has some rawtypes & unchecked Xlint warnings that CANNOT be fixed since we still support JDK6
public class sd360 extends javax.swing.JFrame {
  /** NOTE: this should be changed if the structure/fields of this class changes. */
  private static final long serialVersionUID = 2012122815331L; // for Serializable interface

  /** Creates new form sd360 */
  public sd360() {
    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.
   */
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    state = new javax.swing.ButtonGroup();
    jPanel1 = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    Shape = new javax.swing.JComboBox();
    sfreq = new javax.swing.JSpinner();
    run = new javax.swing.JToggleButton();
    pause = new javax.swing.JToggleButton();
    exit = new javax.swing.JToggleButton();
    jLabel1 = new javax.swing.JLabel();
    fftsz = new javax.swing.JComboBox();
    jPanel2 = new javax.swing.JPanel();
    plot1 = new nxm.sys.libg.MidasDisplay();
    plot2 = new nxm.sys.libg.MidasDisplay();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); // since 3.7.0
    addWindowListener(new java.awt.event.WindowAdapter() {
      public void windowClosing(java.awt.event.WindowEvent evt) {
        exitForm(evt);
      }
    });

    jPanel1.setPreferredSize(new java.awt.Dimension(400, 400));

    jLabel2.setText("SineFreq");

    jLabel3.setText("Shape");

    Shape.setMaximumRowCount(11);
    Shape.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Sine", "Square", "Triangle", "SawTooth", "Pulse", "Constant", "Zero", "White", "LRS", "Ramp", "Cosine" }));

    sfreq.setModel(new javax.swing.SpinnerNumberModel(10000.0d, -100000.0d, 100000.0d, 5000.0d));

    state.add(run);
    run.setText("Run");

    state.add(pause);
    pause.setText("Pause");

    state.add(exit);
    exit.setText("Exit");

    jLabel1.setText("FFT Size");

    fftsz.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "250", "512", "768", "1K", "2000", "2K", "4000", "4K", "8K" }));
    fftsz.setSelectedIndex(4);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addComponent(run, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addComponent(pause, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addComponent(exit, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addGap(10, 10, 10)
        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addComponent(Shape, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addGap(10, 10, 10)
        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addComponent(sfreq, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addGap(10, 10, 10)
        .addComponent(jLabel1)
        .addGap(33, 33, 33)
        .addComponent(fftsz, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
    );
    jPanel1Layout.setVerticalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(run)
          .addComponent(pause)
          .addComponent(exit))
        .addGap(26, 26, 26)
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(Shape, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(sfreq, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addGap(10, 10, 10)
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel1)
          .addComponent(fftsz, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
    );

    jPanel2.setLayout(new java.awt.GridLayout(2, 1));

    plot1.setMinimumSize(new java.awt.Dimension(400, 400));
    plot1.setLayout(null);
    jPanel2.add(plot1);

    plot2.setMinimumSize(new java.awt.Dimension(400, 400));
    plot2.setLayout(null);
    jPanel2.add(plot2);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 306, Short.MAX_VALUE)
        .addGap(12, 12, 12))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 333, javax.swing.GroupLayout.PREFERRED_SIZE)
      .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 333, Short.MAX_VALUE)
    );

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

  /** Exit the Application */
  private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
//  System.exit(0); // prior to 3.7.0
    dispose();
  }//GEN-LAST:event_exitForm

  /** main
   *  @param args the command line arguments
   */
  public static void main(String args[]) {
    new sd360().setVisible(true);
  }

  // Variables declaration - do not modify//GEN-BEGIN:variables
  /** sd360 shape combo box */
  private javax.swing.JComboBox Shape;
  /** sd360 exit button */
  private javax.swing.JToggleButton exit;
  /** sd360 fft size combo box */
  private javax.swing.JComboBox fftsz;
  /** sd360 fft size jLabel */
  private javax.swing.JLabel jLabel1;
  /** sd360 sine frequency jLabel */
  private javax.swing.JLabel jLabel2;
  /** sd360 shape jLabel */
  private javax.swing.JLabel jLabel3;
  /** sd360 panel with states */
  private javax.swing.JPanel jPanel1;
  /** sd360 panel with plots */
  private javax.swing.JPanel jPanel2;
  /** sd360 pause button */
  private javax.swing.JToggleButton pause;
  /** sd360 line plot */
  private nxm.sys.libg.MidasDisplay plot1;
  /** sd360 raster plot */
  private nxm.sys.libg.MidasDisplay plot2;
  /** sd360 run button */
  private javax.swing.JToggleButton run;
  /** sd360 sine frequency spinner */
  private javax.swing.JSpinner sfreq;
  /** sd360 state (run, pause, exit) button group */
  private javax.swing.ButtonGroup state;
  // End of variables declaration//GEN-END:variables

}
