コード例 #1
0
 /** Updater */
 protected void update() {
   mValues
       .get("Plants in Operation")
       .setText("" + mModel.getEnergyManager().getFossil().getAmount());
   mValues
       .get("Supply Provided")
       .setText(String.format(FORMAT, mModel.getEnergyManager().getFossil().getPower()));
   mValues
       .get("Cost")
       .setText(String.format(FORMAT, mModel.getEnergyManager().getFossil().getCostBuild()));
   mValues
       .get("Public Approval")
       .setText(String.format(FORMAT, mModel.getEnergyManager().getFossil().getApproval()));
   mValues
       .get("Emissions")
       .setText(String.format(FORMAT, mModel.getEnergyManager().getFossil().getEmissions()));
   mValues
       .get("Security")
       .setText(String.format(FORMAT, mModel.getEnergyManager().getFossil().getSecurity()));
   mValues
       .get("Profit")
       .setText(String.format(FORMAT, mModel.getEnergyManager().getFossil().getProfit()));
 }
コード例 #2
0
  /** Setup of the Pane */
  protected void setup() {
    setLabels();
    add(getTitleLabel(), 0, 0, 7, 1);
    add(mApply, 0, 3, 7, 1);
    add(mFossilUpgrades, 1, 12, 1, 1);
    add(mUp, 5, 1, 1, 1);
    add(mDown, 5, 2, 1, 1);

    add(mLabels.get("Plants in Operation"), 1, 1, 4, 2);
    add(mLabels.get("Supply Provided"), 1, 4, 3, 1);
    add(mLabels.get("Cost"), 1, 5, 3, 1);
    add(mLabels.get("Public Approval"), 1, 6, 3, 1);
    add(mLabels.get("Emissions"), 1, 8, 3, 1);
    add(mLabels.get("Security"), 1, 9, 3, 1);
    add(mLabels.get("Profit"), 1, 10, 3, 1);
    add(mLabels.get(mUpgradeName), 3, 12, 3, 1);

    add(mValues.get("Plants in Operation"), 4, 1, 1, 2);
    add(mValues.get("Supply Provided"), 5, 4, 1, 1);
    add(mValues.get("Cost"), 5, 5, 1, 1);
    add(mValues.get("Public Approval"), 5, 6, 1, 1);
    add(mValues.get("Emissions"), 5, 8, 1, 1);
    add(mValues.get("Security"), 5, 9, 1, 1);
    add(mValues.get("Profit"), 5, 10, 1, 1);
  }