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)); }