コード例 #1
0
  /** Overrides positionChanged(PositionChangedEvent) to clear the board of any arrows/circles. */
  public void positionChanged(PositionChangedEvent evt) {
    super.positionChanged(evt);

    if (evt.getGame() != game) return;

    ((ChessclubJBoard) board).removeAllArrows();
    ((ChessclubJBoard) board).removeAllCircles();
  }
コード例 #2
0
  /** Overrides moveMade(MoveMadeEvent) to clear the board of any arrows/circles. */
  public void moveMade(MoveMadeEvent evt) {
    super.moveMade(evt);

    if (evt.getGame() != game) return;

    ((ChessclubJBoard) board).removeAllArrows();
    ((ChessclubJBoard) board).removeAllCircles();
  }
コード例 #3
0
  /** Overrides illegalMoveAttempted(IllegalMoveEvent) to clear the board of any arrows/circles. */
  public void illegalMoveAttempted(IllegalMoveEvent evt) {
    super.illegalMoveAttempted(evt);

    if (evt.getGame() != game) return;

    ((ChessclubJBoard) board).removeAllArrows();
    ((ChessclubJBoard) board).removeAllCircles();
  }
コード例 #4
0
  /**
   * Override configureBoard(Game, JinBoard) to add ourselves as an ArrowCircleListener to the
   * board.
   */
  protected void configureBoard(Game game, JinBoard board) {
    super.configureBoard(game, board);

    if ((game.getGameType() == Game.MY_GAME) && !game.isPlayed()) {
      board.addArrowCircleListener(this);
      board.setArrowCircleEnabled(true);
    } else ((ChessclubJBoard) board).setArrowCircleEnabled(false);
  }
コード例 #5
0
  /** Overrides takebackOccurred(TakebackEvent) to clear the board of any arrows/circles. */
  public void takebackOccurred(TakebackEvent evt) {
    super.takebackOccurred(evt);

    if (evt.getGame() != game) return;

    ((ChessclubJBoard) board).removeAllArrows();
    ((ChessclubJBoard) board).removeAllCircles();
  }