/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * QuizCreationView.java
 *
 * Created on Nov 21, 2009, 5:35:06 PM
 */

package cstutor.quizcreation;

/**
 *
 * @author Josh Robinson
 */
public class QuizCreationView extends javax.swing.JFrame {

    /** Creates new form QuizCreationView */
    public QuizCreationView() {
        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() {

        deleteBranchB = new javax.swing.JButton();
        correspondingSectionL = new javax.swing.JLabel();
        questionL = new javax.swing.JLabel();
        relatedSectionL = new javax.swing.JLabel();
        belowL = new javax.swing.JLabel();
        editBranchB = new javax.swing.JButton();
        weightL = new javax.swing.JLabel();
        randomizeQuestionCB = new javax.swing.JCheckBox();
        cancelB = new javax.swing.JButton();
        displayAnswersCB = new javax.swing.JCheckBox();
        viewB = new javax.swing.JButton();
        numQuestionsTF = new javax.swing.JTextField();
        lockQuizCB = new javax.swing.JCheckBox();
        quizNameTF = new javax.swing.JTextField();
        timeAllottedTF = new javax.swing.JTextField();
        branchesSP = new javax.swing.JScrollPane();
        branchesList = new javax.swing.JList();
        addBranchB = new javax.swing.JButton();
        editQuestionB = new javax.swing.JButton();
        addQuestionB = new javax.swing.JButton();
        timeAllottedL = new javax.swing.JLabel();
        numQuestionsL = new javax.swing.JLabel();
        branchesL = new javax.swing.JLabel();
        quizNameL = new javax.swing.JLabel();
        questionsSP = new javax.swing.JScrollPane();
        questionsList = new javax.swing.JList();
        questionsL = new javax.swing.JLabel();
        typeL = new javax.swing.JLabel();
        quizCreationL = new javax.swing.JLabel();
        randomizeAnswerCB = new javax.swing.JCheckBox();
        deleteQuestionB = new javax.swing.JButton();
        pageBranchL = new javax.swing.JLabel();
        failDialogueL = new javax.swing.JLabel();

        setResizable(false);

        deleteBranchB.setText("Delete");

        correspondingSectionL.setFont(new java.awt.Font("Tahoma", 1, 11));
        correspondingSectionL.setText("Corresponding Section");

        questionL.setFont(new java.awt.Font("Tahoma", 1, 11));
        questionL.setText("Question");

        relatedSectionL.setFont(new java.awt.Font("Tahoma", 1, 11));
        relatedSectionL.setText("Related Section");

        belowL.setFont(new java.awt.Font("Tahoma", 1, 11));
        belowL.setText("Below");

        editBranchB.setText("Edit");

        weightL.setFont(new java.awt.Font("Tahoma", 1, 11));
        weightL.setText("Weight");

        randomizeQuestionCB.setText("Randomize Question Order");

        cancelB.setText("Cancel");
        cancelB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelBActionPerformed(evt);
            }
        });

        displayAnswersCB.setText("Display Answers on Failure");

        viewB.setText("View");

        lockQuizCB.setText("Lock Quiz");

        branchesSP.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        branchesSP.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

        branchesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        branchesList.setVisibleRowCount(7);
        branchesSP.setViewportView(branchesList);

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

        editQuestionB.setText("Edit");

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

        timeAllottedL.setText("Time Allotted (m):");

        numQuestionsL.setText("Number of Questions Displayed:");

        branchesL.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        branchesL.setText("Branches:");

        quizNameL.setText("Quiz Name:");

        questionsSP.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        questionsSP.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

        questionsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        questionsList.setVisibleRowCount(7);
        questionsSP.setViewportView(questionsList);

        questionsL.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        questionsL.setText("Questions:");

        typeL.setFont(new java.awt.Font("Tahoma", 1, 11));
        typeL.setText("Type");

        quizCreationL.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        quizCreationL.setText("Quiz Creation");

        randomizeAnswerCB.setText("Randomize Answer Order");

        deleteQuestionB.setText("Delete");

        pageBranchL.setFont(new java.awt.Font("Tahoma", 1, 11));
        pageBranchL.setText("Page to Branch to");

        failDialogueL.setFont(new java.awt.Font("Tahoma", 1, 11));
        failDialogueL.setText("Fail Dialogue");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(153, 153, 153)
                                .addComponent(addQuestionB)
                                .addGap(18, 18, 18)
                                .addComponent(editQuestionB)
                                .addGap(18, 18, 18)
                                .addComponent(deleteQuestionB))
                            .addComponent(branchesL)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(pageBranchL)
                                    .addGap(18, 18, 18)
                                    .addComponent(belowL)
                                    .addGap(18, 18, 18)
                                    .addComponent(relatedSectionL)
                                    .addGap(18, 18, 18)
                                    .addComponent(failDialogueL))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(cancelB)
                                    .addGap(90, 90, 90)
                                    .addComponent(addBranchB)
                                    .addGap(18, 18, 18)
                                    .addComponent(editBranchB)
                                    .addGap(18, 18, 18)
                                    .addComponent(deleteBranchB)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 87, Short.MAX_VALUE)
                                    .addComponent(viewB))
                                .addComponent(branchesSP, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(questionsL, javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(typeL)
                                    .addGap(50, 50, 50)
                                    .addComponent(weightL)
                                    .addGap(18, 18, 18)
                                    .addComponent(correspondingSectionL)
                                    .addGap(18, 18, 18)
                                    .addComponent(questionL))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(timeAllottedL)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(timeAllottedTF, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(quizNameL)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(quizNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(numQuestionsL)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(numQuestionsTF, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(randomizeQuestionCB)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(randomizeAnswerCB))
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(lockQuizCB)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(displayAnswersCB))))
                                .addComponent(questionsSP, javax.swing.GroupLayout.Alignment.LEADING))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(184, 184, 184)
                        .addComponent(quizCreationL)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(quizCreationL)
                .addGap(17, 17, 17)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(quizNameL)
                            .addComponent(quizNameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(timeAllottedL)
                            .addComponent(timeAllottedTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(numQuestionsL)
                            .addComponent(numQuestionsTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(displayAnswersCB)
                            .addComponent(lockQuizCB))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(randomizeAnswerCB)
                            .addComponent(randomizeQuestionCB))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(questionsL)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(typeL)
                    .addComponent(weightL)
                    .addComponent(correspondingSectionL)
                    .addComponent(questionL))
                .addGap(2, 2, 2)
                .addComponent(questionsSP, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(deleteQuestionB)
                    .addComponent(editQuestionB)
                    .addComponent(addQuestionB))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(branchesL)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(pageBranchL)
                    .addComponent(belowL)
                    .addComponent(relatedSectionL)
                    .addComponent(failDialogueL))
                .addGap(2, 2, 2)
                .addComponent(branchesSP, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(deleteBranchB)
                            .addComponent(editBranchB)
                            .addComponent(addBranchB))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(viewB)
                    .addComponent(cancelB))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

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

    private void addQuestionBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addQuestionBActionPerformed
        // TODO add your handling code here:
        QuestionChoiceView qcv = new QuestionChoiceView();
        qcv.setVisible(true);
    }//GEN-LAST:event_addQuestionBActionPerformed

    private void addBranchBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBranchBActionPerformed
        // TODO add your handling code here:
        BranchView bv = new BranchView();
        bv.setVisible(true);
    }//GEN-LAST:event_addBranchBActionPerformed

    private void cancelBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelBActionPerformed
        // TODO add your handling code here:
        this.setVisible(false);
    }//GEN-LAST:event_cancelBActionPerformed

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

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addBranchB;
    private javax.swing.JButton addQuestionB;
    private javax.swing.JLabel belowL;
    private javax.swing.JLabel branchesL;
    private javax.swing.JList branchesList;
    private javax.swing.JScrollPane branchesSP;
    private javax.swing.JButton cancelB;
    private javax.swing.JLabel correspondingSectionL;
    private javax.swing.JButton deleteBranchB;
    private javax.swing.JButton deleteQuestionB;
    private javax.swing.JCheckBox displayAnswersCB;
    private javax.swing.JButton editBranchB;
    private javax.swing.JButton editQuestionB;
    private javax.swing.JLabel failDialogueL;
    private javax.swing.JCheckBox lockQuizCB;
    private javax.swing.JLabel numQuestionsL;
    private javax.swing.JTextField numQuestionsTF;
    private javax.swing.JLabel pageBranchL;
    private javax.swing.JLabel questionL;
    private javax.swing.JLabel questionsL;
    private javax.swing.JList questionsList;
    private javax.swing.JScrollPane questionsSP;
    private javax.swing.JLabel quizCreationL;
    private javax.swing.JLabel quizNameL;
    private javax.swing.JTextField quizNameTF;
    private javax.swing.JCheckBox randomizeAnswerCB;
    private javax.swing.JCheckBox randomizeQuestionCB;
    private javax.swing.JLabel relatedSectionL;
    private javax.swing.JLabel timeAllottedL;
    private javax.swing.JTextField timeAllottedTF;
    private javax.swing.JLabel typeL;
    private javax.swing.JButton viewB;
    private javax.swing.JLabel weightL;
    // End of variables declaration//GEN-END:variables

}