EMMA Coverage Report (generated Sat Apr 29 12:52:00 BST 2006)
[all classes][net.sourceforge.pseudoq.gui]

COVERAGE SUMMARY FOR SOURCE FILE [NewPuzzleWizardStep1.java]

nameclass, %method, %block, %line, %
NewPuzzleWizardStep1.java0%   (0/2)0%   (0/10)0%   (0/221)0%   (0/50)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NewPuzzleWizardStep10%   (0/1)0%   (0/8)0%   (0/210)0%   (0/47)
NewPuzzleWizardStep1 (): void 0%   (0/1)0%   (0/9)0%   (0/4)
access$000 (NewPuzzleWizardStep1, ActionEvent): void 0%   (0/1)0%   (0/4)0%   (0/1)
addDescriptionPanels (): void 0%   (0/1)0%   (0/38)0%   (0/5)
applyState (): void 0%   (0/1)0%   (0/10)0%   (0/3)
init (WizardModel): void 0%   (0/1)0%   (0/8)0%   (0/3)
initComponents (): void 0%   (0/1)0%   (0/116)0%   (0/26)
jComboBox1ActionPerformed (ActionEvent): void 0%   (0/1)0%   (0/3)0%   (0/2)
updateDescription (): void 0%   (0/1)0%   (0/22)0%   (0/3)
     
class NewPuzzleWizardStep1$10%   (0/1)0%   (0/2)0%   (0/11)0%   (0/3)
NewPuzzleWizardStep1$1 (NewPuzzleWizardStep1): void 0%   (0/1)0%   (0/6)0%   (0/1)
actionPerformed (ActionEvent): void 0%   (0/1)0%   (0/5)0%   (0/2)

1/*
2 * Copyright (c) 2005 The PseudoQ Project.
3 *
4 * This file is part of PseudoQ.
5 *
6 * PseudoQ is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * PseudoQ is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with PseudoQ; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 */
20 
21package net.sourceforge.pseudoq.gui;
22 
23import java.awt.CardLayout;
24 
25import net.sourceforge.pseudoq.model.PuzzleTypeEnum;
26 
27/**
28 * First page of the {@link NewPuzzleWizard}.  This would be an inner class,
29 * except Netbeans' GUI form designer cannot handle that.
30 * @author <a href="http://sourceforge.net/users/stevensa">Andrew Stevens</a>
31 */
32public class NewPuzzleWizardStep1 extends org.pietschy.wizard.PanelWizardStep {
33    private NewPuzzleWizard.Model model;
34 
35    /**
36     * Creates new form NewPuzzleWizardStep1 
37     */
38    public NewPuzzleWizardStep1() {
39        super("Select puzzle type", "Choose the size & style of puzzle");
40        initComponents();
41        updateDescription();
42    }
43 
44    public void applyState() throws org.pietschy.wizard.InvalidStateException {
45        model.setPuzzleType((PuzzleTypeEnum) jComboBox1.getSelectedItem());
46        super.applyState();
47    }
48 
49    public void init(org.pietschy.wizard.WizardModel wizardModel) {
50        this.model = (NewPuzzleWizard.Model) wizardModel;
51        super.init(wizardModel);
52    }
53 
54    /** This method is called from within the constructor to
55     * initialize the form.
56     * WARNING: Do NOT modify this code. The content of this method is
57     * always regenerated by the Form Editor.
58     */
59    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
60    private void initComponents() {
61        java.awt.GridBagConstraints gridBagConstraints;
62 
63        jLabel1 = new javax.swing.JLabel();
64        jComboBox1 = new javax.swing.JComboBox();
65        jPanel1 = new javax.swing.JPanel();
66 
67        setLayout(new java.awt.GridBagLayout());
68 
69        setComplete(true);
70        jLabel1.setText("Puzzle type:");
71        gridBagConstraints = new java.awt.GridBagConstraints();
72        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
73        add(jLabel1, gridBagConstraints);
74 
75        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(
76            PuzzleTypeEnum.values())
77    );
78    jComboBox1.setSelectedIndex(PuzzleTypeEnum.STANDARD.ordinal());
79    jComboBox1.addActionListener(new java.awt.event.ActionListener() {
80        public void actionPerformed(java.awt.event.ActionEvent evt) {
81            jComboBox1ActionPerformed(evt);
82        }
83    });
84 
85    gridBagConstraints = new java.awt.GridBagConstraints();
86    gridBagConstraints.gridx = 0;
87    gridBagConstraints.gridy = 1;
88    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
89    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
90    add(jComboBox1, gridBagConstraints);
91 
92    jPanel1.setLayout(new java.awt.CardLayout());
93 
94    jPanel1.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(10, 0, 0, 0)));
95    addDescriptionPanels();
96    gridBagConstraints = new java.awt.GridBagConstraints();
97    gridBagConstraints.gridx = 0;
98    gridBagConstraints.gridy = 2;
99    add(jPanel1, gridBagConstraints);
100 
101    }
102    // </editor-fold>//GEN-END:initComponents
103 
104    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
105        updateDescription();
106    }//GEN-LAST:event_jComboBox1ActionPerformed
107 
108    private void addDescriptionPanels() {
109        for(PuzzleTypeEnum puzzleType : PuzzleTypeEnum.values()) {
110            javax.swing.JTextArea jTextArea = new javax.swing.JTextArea();
111            jTextArea.setText(puzzleType.getDescription());
112            jPanel1.add(jTextArea, "card" + puzzleType.ordinal());
113        }
114    }
115 
116    private void updateDescription() {
117        CardLayout layout = (CardLayout) jPanel1.getLayout();
118        layout.show(jPanel1, "card" + ((PuzzleTypeEnum) jComboBox1.getSelectedItem()).ordinal());
119    }
120 
121    // Variables declaration - do not modify//GEN-BEGIN:variables
122    private javax.swing.JComboBox jComboBox1;
123    private javax.swing.JLabel jLabel1;
124    private javax.swing.JPanel jPanel1;
125    // End of variables declaration//GEN-END:variables
126 
127}

[all classes][net.sourceforge.pseudoq.gui]
EMMA 2.0.5312 (C) Vladimir Roubtsov