package nxm.sys.test;

/** A Class to test a tabbed-pane list using the netbeans guibuilder.
    See Bug 2228 for more details.
    Created on Aug 3, 2010, 9:30:26 AM
    @author J Bauer
 */
@SuppressWarnings("serial")
public class test_list_jsetup extends javax.swing.JFrame {

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

    jPanel1 = new javax.swing.JPanel();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    list1 = new nxm.sys.libg.MidasDisplay();
    list2 = new nxm.sys.libg.MidasDisplay();
    addRow = new javax.swing.JButton();
    fail = new javax.swing.JButton();
    pass = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    instructions = new javax.swing.JTextArea();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    javax.swing.GroupLayout list1Layout = new javax.swing.GroupLayout(list1);
    list1.setLayout(list1Layout);
    list1Layout.setHorizontalGroup(
      list1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 588, Short.MAX_VALUE)
    );
    list1Layout.setVerticalGroup(
      list1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 232, Short.MAX_VALUE)
    );

    jTabbedPane1.addTab("tab1", list1);

    javax.swing.GroupLayout list2Layout = new javax.swing.GroupLayout(list2);
    list2.setLayout(list2Layout);
    list2Layout.setHorizontalGroup(
      list2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 588, Short.MAX_VALUE)
    );
    list2Layout.setVerticalGroup(
      list2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 232, Short.MAX_VALUE)
    );

    jTabbedPane1.addTab("tab2", list2);

    addRow.setText("Add Row");

    fail.setForeground(new java.awt.Color(255, 0, 102));
    fail.setText("Fail");
    fail.setPreferredSize(new java.awt.Dimension(90, 25));

    pass.setForeground(new java.awt.Color(0, 204, 51));
    pass.setText("Pass");
    pass.setToolTipText("Pass");
    pass.setPreferredSize(new java.awt.Dimension(90, 25));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel1Layout.createSequentialGroup()
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(jPanel1Layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 593, Short.MAX_VALUE))
          .addGroup(jPanel1Layout.createSequentialGroup()
            .addGap(131, 131, 131)
            .addComponent(addRow, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(fail, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))
        .addContainerGap())
    );
    jPanel1Layout.setVerticalGroup(
      jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(fail, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(addRow, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addContainerGap())
    );

    instructions.setColumns(20);
    instructions.setRows(5);
    instructions.setText("You should see a tabbed pane below. Each tab contains a list with four rows of data. \n\nDo NOT click on Tab2, yet.\n\n1. Click on the 'Add Row' button to add a row of data to each list. You should not see \n    the hidden tab data.\n\n2. Click on Tab 2. The row of data that was added should be at the BOTTOM of the list.\n\n3. Click back on Tab 1. The area in the panel that does not contain data should NOT \n    be black, but rather should look like an empty table.\n\n4. Click 'Pass' if the test Passed, or 'Fail' if the test failed.\n ");
    jScrollPane1.setViewportView(instructions);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 617, Short.MAX_VALUE)
          .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addContainerGap())
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap())
    );

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

    /** main
    *   @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new test_list_jsetup().setVisible(true);
            }
        });
    }

  // Variables declaration - do not modify//GEN-BEGIN:variables
  /** The add-row button used for adding new rows to both lists */
  private javax.swing.JButton addRow;
  /** The FAIL button */
  private javax.swing.JButton fail;
  /** The text area containing the test instructions */
  private javax.swing.JTextArea instructions;
  /** The bottom panel containing the tabbed pane, the add-row button, and the pass/fail buttons */
  private javax.swing.JPanel jPanel1;
  /** The scroll pane containing the test instructions text area */
  private javax.swing.JScrollPane jScrollPane1;
  /** The tabbed pane both lists */
  private javax.swing.JTabbedPane jTabbedPane1;
  /** The first list */
  private nxm.sys.libg.MidasDisplay list1;
  /** The second list */
  private nxm.sys.libg.MidasDisplay list2;
  /** The PASS button */
  private javax.swing.JButton pass;
  // End of variables declaration//GEN-END:variables

}
