コード例 #1
0
  private void updateEntireView() {

    // upadte board view entirely
    boardView.update(board, remainMode.isSelected());

    // redraw combination view
    Group group = board.getGroup(board.getCurrentCell().getGroupId());
    combinationView.update(group);
  }
コード例 #2
0
  private void moveFocusTo(int row, int col) {

    // update combination list if new group is selected
    Cell cell = board.getCell(row, col);
    int groupId = cell.getGroupId();
    if (groupId != board.getCurrentCell().getGroupId()) {
      combinationView.update(board.getGroup(groupId));
    }

    // don't update current cell before checking group ID changed
    board.setCurrentCell(row, col);
    boardView.focusOn(row, col);
  }
コード例 #3
0
  private void checkGameIsSolved() {
    if (board.isSolved() == false) {
      return;
    }

    // clear UNDO stack
    steps.clear();

    // stop the timer
    pauseTimer();

    // stop showing combination list
    combinationView.update(new Group(Group.NON_ID));

    // prevent user input
    boardView.setOnKeyPressed(null);

    // congratulate user
    boardView.congratulate();

    // pop up alert
    AlertFactory.createInfo("SUCCESS", null, "Congratulation! You are genius!").showAndWait();
  }