< prev index next >

src/com/sun/interview/wizard/ChoiceQuestionRenderer.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


 168     protected int getRowHeight() {
 169         return 22;
 170     }
 171 
 172     protected static final int DOTS_PER_INCH = Toolkit.getDefaultToolkit().getScreenResolution();
 173 
 174     protected void fireEditedEvent(Object src, ActionListener l) {
 175         ActionEvent e = new ActionEvent(src,
 176                                         ActionEvent.ACTION_PERFORMED,
 177                                         EDITED);
 178         l.actionPerformed(e);
 179     }
 180 
 181 
 182     protected TableModel createTableModel() {
 183         return new TestTableModel();
 184     }
 185 
 186     protected class TestTableModel extends AbstractTableModel {
 187 
 188         public Class getColumnClass(int c) {
 189             return String.class;
 190         }
 191 
 192         public int getColumnCount() {
 193             return 1;
 194         }
 195 
 196         public int getRowCount() {
 197             return displayChoices.length - starts_from;
 198         }
 199 
 200         public Object getValueAt(int r, int c) {
 201             return values[r + starts_from];
 202         }
 203 
 204         public void setValueAt(Object o, int r, int c) {
 205             if (c == 0) {
 206                 q.setValue(values[r + starts_from]);
 207                 fireEditedEvent(this, editedListener);
 208             }




 168     protected int getRowHeight() {
 169         return 22;
 170     }
 171 
 172     protected static final int DOTS_PER_INCH = Toolkit.getDefaultToolkit().getScreenResolution();
 173 
 174     protected void fireEditedEvent(Object src, ActionListener l) {
 175         ActionEvent e = new ActionEvent(src,
 176                                         ActionEvent.ACTION_PERFORMED,
 177                                         EDITED);
 178         l.actionPerformed(e);
 179     }
 180 
 181 
 182     protected TableModel createTableModel() {
 183         return new TestTableModel();
 184     }
 185 
 186     protected class TestTableModel extends AbstractTableModel {
 187 
 188         public Class<?> getColumnClass(int c) {
 189             return String.class;
 190         }
 191 
 192         public int getColumnCount() {
 193             return 1;
 194         }
 195 
 196         public int getRowCount() {
 197             return displayChoices.length - starts_from;
 198         }
 199 
 200         public Object getValueAt(int r, int c) {
 201             return values[r + starts_from];
 202         }
 203 
 204         public void setValueAt(Object o, int r, int c) {
 205             if (c == 0) {
 206                 q.setValue(values[r + starts_from]);
 207                 fireEditedEvent(this, editedListener);
 208             }


< prev index next >