View Javadoc
1   package org.woehlke.computer.kurzweil.conwaysgameoflive.view.canvas.food;
2   
3   import lombok.Getter;
4   import lombok.ToString;
5   import lombok.extern.log4j.Log4j2;
6   import org.woehlke.computer.kurzweil.conwaysgameoflive.view.ConwaysGameOfLiveTab;
7   
8   import javax.swing.*;
9   import java.io.Serializable;
10  
11  /**
12   * © 2006 - 2008 Thomas Woehlke.
13   * @author Thomas Woehlke
14   *
15   * @see <a href="https://github.com/Computer-Kurzweil/conwaysgameoflife">Github Repository</a>
16   * @see <a href="https://java.woehlke.org/conwaysgameoflife/">Maven Project Repository</a>
17   */
18  @Log4j2
19  @Getter
20  @ToString(callSuper = true)
21  @Deprecated
22  public class FoodPerDayTextField extends JTextField implements Serializable {
23  
24      static final long serialVersionUID = 242L;
25  
26      @ToString.Exclude
27      private final ConwaysGameOfLiveTab tab;
28      private final String foodPerDayTextFieldString;
29      private final int foodPerDayTextFieldCols;
30  
31      public FoodPerDayTextField(ConwaysGameOfLiveTab tab) {
32          super(
33              tab.getComputerKurzweilProperties().getSimulatedevolution().getFood().getFoodPerDay()+"",
34              tab.getComputerKurzweilProperties().getSimulatedevolution().getFood().getFoodPerDayFieldColumns()
35          );
36          this.tab = tab;
37          this.foodPerDayTextFieldString = tab.getComputerKurzweilProperties().getSimulatedevolution().getFood().getFoodPerDay()+"";
38          this.foodPerDayTextFieldCols = tab.getComputerKurzweilProperties().getSimulatedevolution().getFood().getFoodPerDayFieldColumns();
39      }
40  
41      public void setFoodPerDay(int foodPerDay){
42          this.setText(""+foodPerDay);
43      }
44  }