Ejemplo n.º 1
0
  @Override
  public void actionPerformed(ActionEvent e) {
    TurnHandler turnHandler = game.getTurnHandler();
    if (e.getSource() == btnBuyProperty) {
      turnHandler.buyProperty(true);
    }
    if (e.getSource() == btnDontBuyProperty) {
      turnHandler.buyProperty(false);
    }

    ActionEvent ae = new ActionEvent(this, 0, "");
    fireActionEvent(ae);
  }
Ejemplo n.º 2
0
  /** recalculates the text displayed on the panel */
  public void refresh() {
    TurnHandler th = game.getTurnHandler();
    BuyableField buyableField = th.getPropertyToBuy();

    String caption = "";
    if (buyableField != null)
      caption =
          "<html><div align=\"center\">"
              + beforeBuy
              + buyableField.getName()
              + " ("
              + buyableField.getPrice()
              + ")"
              + "</div></html>";
    lblYouCanBuy.setText(caption);
  }