public void showInvalid(){ for(int i=0; i < 9; i++){ for(int j=0; j < 9; j++){ board.getButtons().get(i).get(j).setValid(model.isCellValid(i, j)); } } }
public void setSelectedCell(String label, Position p) { if (!model.isCellGiven(p.getRow(), p.getCol())) { if(!inputPanel.getCandidateButton().isSelected()){ model.setCellNumber(p.getRow(), p.getCol(), Integer.parseInt(label)); board.getSelectedButton().setNumberLabel(label); }else{ if(model.hasCellCandidate(p.getRow(), p.getCol(), Integer.parseInt(label))){ // System.out.println(label); model.removeCellCandidate(p.getRow(), p.getCol(), Integer.parseInt(label)); board.getSelectedButton().setCandidateLabel(model.getCandidates(p.getRow(), p.getCol())); }else{ // System.out.println(label); model.addCellCandidate(p.getRow(), p.getCol(), Integer.parseInt(label)); board.getSelectedButton().setCandidateLabel(model.getCandidates(p.getRow(), p.getCol())); } } } }
public void showIncorrect(){ int curRow = board.getSelectedCell().getRow(); int curCol = board.getSelectedCell().getCol(); board.getSelectedButton().setCorrect(model.isCellCorrect(curRow, curCol)); }