src/de/uapcore/sudoku/Field.java

changeset 2
5179eff8a9b6
parent 1
f1d7de36b01e
child 3
ed931970b4ac
equal deleted inserted replaced
1:f1d7de36b01e 2:5179eff8a9b6
11 11
12 /** 12 /**
13 * 13 *
14 * @author mike 14 * @author mike
15 */ 15 */
16 public class Field extends JPanel { 16 public final class Field extends JPanel {
17 private SudokuTextField[][] cells; 17 private SudokuTextField[][] cells;
18 18
19 public Field() { 19 public Field() {
20 setBackground(Color.WHITE); 20 setBackground(Color.WHITE);
21 21
64 } 64 }
65 65
66 graphics.drawImage(img, 0, 0, this); 66 graphics.drawImage(img, 0, 0, this);
67 } 67 }
68 68
69 public int getCellValue(int x, int y) {
70 return cells[x][y].getValue();
71 }
69 72
73 public void setCellValue(int x, int y, int v) {
74 cells[x][y].setValue(v);
75 }
76
77 public void setAllCellsModified(boolean modified) {
78 for (int x = 0 ; x < 9 ; x++) {
79 for (int y = 0 ; y < 9 ; y++) {
80 cells[x][y].setModified(modified);
81 }
82 }
83 }
84
85 public boolean isAnyCellModified() {
86 for (int x = 0 ; x < 9 ; x++) {
87 for (int y = 0 ; y < 9 ; y++) {
88 if (cells[x][y].isModified()) {
89 return true;
90 }
91 }
92 }
93 return false;
94 }
70 } 95 }

mercurial