diff --git a/src/main/java/edu/ntnu/idi/idatt/view/components/ui/UIFactory.java b/src/main/java/edu/ntnu/idi/idatt/view/components/ui/UIFactory.java index d852d6c..076c1bb 100644 --- a/src/main/java/edu/ntnu/idi/idatt/view/components/ui/UIFactory.java +++ b/src/main/java/edu/ntnu/idi/idatt/view/components/ui/UIFactory.java @@ -14,10 +14,8 @@ import edu.ntnu.idi.idatt.view.util.ResourceUtils; import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleStringProperty; -import javafx.beans.property.StringProperty; import javafx.geometry.Insets; import javafx.geometry.Pos; -import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.control.Button; import javafx.scene.control.Label; @@ -204,7 +202,7 @@ private static Parent createDefaultNavigation(Label titleLabel, List but navigationBuilder.addContent(previous); } - Button progress = new Button("Advance to next week"); + Button progress = new Button("Advance To Next Week"); progress.setOnAction((e) -> { UserSession.getInstance().getExchange().advance(); UserSession.getInstance().updateGameState(); @@ -308,7 +306,7 @@ public static Parent createToolbar(ActionEventHandler menuHandle, ActionEventHan // Player status only advances at purchases, doesn't need to be a observable // value when saving game state. - Label playerStatus = new Label("Status:" + UserSession.getInstance().getPlayer().getStatus()); + Label playerStatus = new Label("Status: " + UserSession.getInstance().getPlayer().getStatus()); Label playerNetWorth = new Label(); playerNetWorth.textProperty().bind( diff --git a/src/main/java/edu/ntnu/idi/idatt/view/entry/StartView.java b/src/main/java/edu/ntnu/idi/idatt/view/entry/StartView.java index 080bbcc..ece4e5a 100644 --- a/src/main/java/edu/ntnu/idi/idatt/view/entry/StartView.java +++ b/src/main/java/edu/ntnu/idi/idatt/view/entry/StartView.java @@ -110,7 +110,7 @@ public Parent createContent() { VBox.setMargin(importCsvWrapper, new Insets(0.0, 0.0, 0.0, 50.0)); // Start game button and error log - startButton = new Button("Start Game"); + startButton = new Button("Proceed"); startButton.getStyleClass().add("button"); startButton.setMaxWidth(200); VBox.setMargin(startButton, new Insets(40.0)); diff --git a/src/main/java/edu/ntnu/idi/idatt/view/primary/finish/FinishView.java b/src/main/java/edu/ntnu/idi/idatt/view/primary/finish/FinishView.java index ab69c37..1fef67c 100644 --- a/src/main/java/edu/ntnu/idi/idatt/view/primary/finish/FinishView.java +++ b/src/main/java/edu/ntnu/idi/idatt/view/primary/finish/FinishView.java @@ -1,6 +1,5 @@ package edu.ntnu.idi.idatt.view.primary.finish; -import java.math.BigDecimal; import java.util.List; import edu.ntnu.idi.idatt.view.SceneFactory; @@ -14,6 +13,7 @@ import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.HBox; +import javafx.scene.layout.Region; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; @@ -67,8 +67,8 @@ public Parent createContent() { labels.forEach(l -> CssUtils.apply(l, CssUtils.MED_TEXT_16)); - newGame = new Button("New game.."); - exit = new Button("Exit.."); + newGame = new Button("New Game"); + exit = new Button("Quit"); newGame.getStyleClass().add("button"); exit.getStyleClass().add("button"); @@ -84,6 +84,7 @@ public Parent createContent() { .wrap(new HBox(10)) .growWithAlignment(Pos.CENTER) .addAllContent(newGame, exit) + .properties(p -> p.getChildren().forEach(c -> ((Region) c).setPrefWidth(200))) .unwrap(); return finishUIBuilder.build().makeUI(); diff --git a/src/main/java/edu/ntnu/idi/idatt/view/primary/portfolio/sections/PlayerInfoSection.java b/src/main/java/edu/ntnu/idi/idatt/view/primary/portfolio/sections/PlayerInfoSection.java index 4a2347a..2968661 100644 --- a/src/main/java/edu/ntnu/idi/idatt/view/primary/portfolio/sections/PlayerInfoSection.java +++ b/src/main/java/edu/ntnu/idi/idatt/view/primary/portfolio/sections/PlayerInfoSection.java @@ -46,6 +46,7 @@ public PlayerInfoSection() { finishGameButton = new Button("Finish game"); finishGameButton.getStyleClass().add("button"); + finishGameButton.setMaxWidth(Double.MAX_VALUE); new UICompositor.Builder() .parent(this) diff --git a/src/main/java/edu/ntnu/idi/idatt/view/primary/stock/sections/TradeSection.java b/src/main/java/edu/ntnu/idi/idatt/view/primary/stock/sections/TradeSection.java index 39c5fb6..5cd3117 100644 --- a/src/main/java/edu/ntnu/idi/idatt/view/primary/stock/sections/TradeSection.java +++ b/src/main/java/edu/ntnu/idi/idatt/view/primary/stock/sections/TradeSection.java @@ -16,7 +16,7 @@ public class TradeSection extends VBox { Button buyButton = new Button("Buy"); - Button portfolioButton = new Button("Sell in portfolio..."); + Button portfolioButton = new Button("Sell in Portfolio"); TextField buyInputField = new TextField(); TextValueComponent buyPrice = new TextValueComponent("Price: "); TextValueComponent buyCost = new TextValueComponent("Taxes & Comission: "); @@ -34,12 +34,18 @@ public TradeSection() { HBox wrapper = new HBox(); wrapper.setSpacing(20.0); wrapper.getChildren().addAll(buyButton, portfolioButton); + wrapper.setPadding(new Insets(10, 0, 10, 0)); // Detailing + + buyButton.getStyleClass().add("button-outlined"); + portfolioButton.getStyleClass().add("button-outlined"); + buyInputField.setPromptText("Amount of stocks..."); + buyInputField.getStyleClass().add("searchbar-field"); - this.setPadding(new Insets(20)); - this.setMaxWidth(400); + this.setPadding(new Insets(0, 20, 0, 20)); + this.setMaxWidth(305); this.getChildren().addAll(wrapper, buyInputField, buyPrice, buyCost, totalPrice, resultMessage); } diff --git a/src/test/java/edu/ntnu/idi/idatt/model/player/PlayerTest.java b/src/test/java/edu/ntnu/idi/idatt/model/player/PlayerTest.java index c858ce9..32aa2d0 100644 --- a/src/test/java/edu/ntnu/idi/idatt/model/player/PlayerTest.java +++ b/src/test/java/edu/ntnu/idi/idatt/model/player/PlayerTest.java @@ -66,7 +66,7 @@ void getNetWorth_shouldReturnTotalNetWorth() { } @Test - void getStatus_shouldBeAllStatuses() { + void getStatus_shouldCalculateCorrectStatuses() { assertEquals("Novice", player.getStatus()); // Simulate progress