Exemple #1
0
  @FXML
  protected void initialize() {
    super.initialize();

    persistableController.setStateStore(game);
    persistableController.setUpdate(this);

    playerLevelTextFields = new TextField[] {player1LevelTextField, player2LevelTextField};
    battleships = new IBattleship[] {playerBoard, enemy};
  }
Exemple #2
0
  @FXML
  protected void initialize() {
    super.initialize();

    undoableController.setUndoRedo(sudoku);
    undoableController.setUpdate(this);
    persistableController.setStateStore(sudoku);
    persistableController.setUpdate(this);

    Font assignableFont = Font.font("Courier", 40);
    Font notAssignableFont = Font.font("Arial", 28);
    Color invalid = Color.RED;
    Color normal = Color.BLACK;
    Color selected = Color.WHITE;

    for (int i = 1; i <= ISudoku.BOARD_SIZE; i++) {
      imageGrid.setImage(
          CELL_ASSIGNABLE_INDICATOR + CELL_SELECTED_INDICATOR + i,
          createTextImage(i, assignableFont, Color.BLACK, selected));
      imageGrid.setImage(
          CELL_SELECTED_INDICATOR + i, createTextImage(i, notAssignableFont, Color.BLACK, normal));

      imageGrid.setImage(
          CELL_ASSIGNABLE_INDICATOR + CELL_INVALID_INDICATOR + i,
          createTextImage(i, assignableFont, Color.BLACK, invalid));
      imageGrid.setImage(
          CELL_INVALID_INDICATOR + i, createTextImage(i, notAssignableFont, Color.BLACK, invalid));

      imageGrid.setImage(
          CELL_ASSIGNABLE_INDICATOR + i, createTextImage(i, assignableFont, Color.BLACK, normal));
      imageGrid.setImage(
          Integer.toString(i), createTextImage(i, notAssignableFont, Color.BLACK, normal));
    }

    imageGrid.setImage(
        CELL_ASSIGNABLE_INDICATOR + CELL_SELECTED_INDICATOR,
        createTextImage("|", assignableFont, Color.BLACK, Color.WHITE));

    imageGrid.setCellColors(1, "#F2F2F2");
    imageGrid.setStyle("-fx-background-color: #6E6E6E;");
  }