Example #1
0
  // Método que genera los distintos Spinners
  private void createCombos() {
    infoLabel = new JLabel();
    soldiersinfoLabel = new JLabel();
    cannoninfoLabel = new JLabel();
    missileinfoLabel = new JLabel();
    icbminfoLabel = new JLabel();
    tattackedinfoLabel = new JLabel();

    // Creo el combo de soldados
    final int numsoldiers = destinyt.getNumSoldiers();
    soldiersCombo = new JComboBox();
    for (int i = 0; i <= numsoldiers; i++) {
      soldiersCombo.addItem(i);
    }

    // Creo el combo de monedas
    final int nummoney = destinyt.getPlayer().getMoney();
    moneyCombo = new JComboBox();
    for (int i = 0; i <= nummoney; i++) {
      moneyCombo.addItem(i);
    }

    // Genero la info del ataque del oponente
    final String attackinfo =
        "Está siendo atacado desde " + sourcet.getName() + " por " + sourcet.getPlayer().getName();
    infoLabel.setText(attackinfo);
    soldiersinfoLabel.setText("con " + arsenal.getSoldiers() + " soldados");
    cannoninfoLabel.setText("con " + arsenal.getCannons() + " cañones");
    missileinfoLabel.setText("con " + arsenal.getMissiles() + " misiles");
    icbminfoLabel.setText("con " + arsenal.getICBMs() + " icbms");
    tattackedinfoLabel.setText("" + destinyt.getName());
  }
  public void testgetclone1() {
    final TerritoryDecorator T1C = (TerritoryDecorator) map.getTerritoryAt(0).clone();
    assertEquals(map.getTerritoryAt(0), T1C);
    assertEquals(map.getTerritoryAt(0).getId(), T1C.getId());

    final TerritoryDecorator T2C = (TerritoryDecorator) map.getTerritoryAt(14).clone();
    assertEquals(map.getTerritoryAt(14), T2C);
    assertEquals(map.getTerritoryAt(14).getId(), T2C.getId());

    final TerritoryDecorator T3C = (TerritoryDecorator) map.getTerritoryAt(6).clone();
    assertEquals(map.getTerritoryAt(6), T3C);
    assertEquals(map.getTerritoryAt(6).getId(), T3C.getId());
  }