Exemplo n.º 1
0
  /**
   * Create a new position view.
   *
   * @param position the position to display
   * @param bottomPlayer the player at the lower edge
   */
  public PositionView(AbstractMutablePosition position, int bottomPlayer) {
    m_position = position;
    m_bottom = bottomPlayer;
    m_showSqiEP = false;
    m_whiteSquareColor = new Color(128, 128, 192);
    m_blackSquareColor = new Color(0, 0, 192);
    m_whiteColor = Color.WHITE;
    m_blackColor = Color.BLACK;
    m_solidStones = true;
    setFont(new Font("Chess Cases", Font.PLAIN, 32));

    m_draggedStone = Chess.NO_STONE;
    m_draggedFrom = Chess.NO_SQUARE;
    m_draggedPartnerSqi = Chess.NO_SQUARE;
    m_positionMotionListener = null;
    m_position.addPositionListener(this); // TODO: when do we remove it?
    addMouseListener(this);
    addMouseMotionListener(this);
  }