Skip to content

Commit

Permalink
Specified current rent in rent list
Browse files Browse the repository at this point in the history
  • Loading branch information
bulutg committed Dec 20, 2020
1 parent b826547 commit 73a951d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/controllers/popupControllers/CityPopupController.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.layout.BorderPane;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import models.City;

public class CityPopupController extends PopupController {
Expand All @@ -29,6 +32,8 @@ void closeButtonClicked(ActionEvent event) {

public void setCity(City city) {
this.city = city;
double rent = city.getRent();
System.out.println(rent);

if (city.getOwner() != null) cityOwner.setText("Owned by: " + city.getOwner().getName());

Expand All @@ -43,9 +48,18 @@ public void setCity(City city) {
Label label4 = new Label("4 Houses ");
Label label5 = new Label("Hotel ");


for (int i = 0; i < 6; i++) {
rentBoxList[i] = new BorderPane();
rentBoxList[i].setRight(new Label("" + rents[i]));
if (rents[i] == rent){
System.out.println("inloop");
Text rentText = new Text("→ " + rents[i]);
rentText.setFont(Font.font("Arial", FontWeight.BOLD, 16));
rentBoxList[i].setRight(rentText);
}
else {
rentBoxList[i].setRight(new Text("" + rents[i]));
}
}

rentBoxList[0].setLeft(label0);
Expand Down

0 comments on commit 73a951d

Please sign in to comment.