Пример #1
0
  public void setFood(Thing fd) {
    this.food = fd;
    ta.setText("                                     " + this.food.getMyName());
    if (((Food) this.food).perishable) {
      typeOfFood.get(1).setSelected(true);
    } else {
      typeOfFood.get(0).setSelected(true);
    }

    hiddenObstacle.setEnabled(true);
    if (food.returnIfWasHidden()) {
      hiddenObstacle.setSelected(true);

    } else {
      hiddenObstacle.setSelected(false);
    }
    setVisible(false);
  }
Пример #2
0
  public void update() {

    newCreatureButton.setEnabled(false);
    newJewelButton.setEnabled(false);

    if (food != null) {

      for (JRadioButton tof : typeOfFood) {
        tof.setEnabled(false);
      }
      group.setSelected(model, false);

      hiddenObstacle.setEnabled(true);
      if (food.returnIfWasHidden()) {
        hiddenObstacle.setSelected(true);

      } else {
        hiddenObstacle.setSelected(false);
      }
    }
  }