Skip to content

Mappe del3 #11

Merged
merged 9 commits into from
May 24, 2026
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Branch test 3
Wireframes: https://www.figma.com/proto/hij5HpFYSpCNvGAZTeBcZo/Stock-Trading-Game?node-id=0-1&t=FXjhcz0tGCcKHnMm-1
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>your.package.MainApp</mainClass>
<mainClass>View.Launcher</mainClass>
</configuration>
</plugin>

Expand Down
236 changes: 236 additions & 0 deletions src/main/Resources/Style/Global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
/* This is the CSS design used in the application */


/* Root / Page background */
.root {

/* Colour pallette */
dark-colour: rgb(28, 53, 45);
light-colour: rgb(249, 246, 243);
green-colour: rgb(166, 178, 139);
light-green-colour: rgba(166, 178, 139, 0.2);
red-colour: rgb(245, 201, 176);
dark-red-colour: rgb(53, 28, 32);


-fx-font-family: Verdana;
-fx-font-size: 13px;
-fx-background-color: green-colour;
}

/* All labels */
.label {
-fx-text-fill: dark-colour;
-fx-font-size: 13px;
}

/* Title */
.label.title-label {
-fx-font-size: 35px;
-fx-font-weight: bold;
-fx-padding: 0 0 12 0;
}

/* Form row labels (setup scene) */
.label.form-label {
-fx-font-size: 14px;
}

/* Status bar label */
.label.status-label {
-fx-font-size: 12px;
-fx-font-weight: bold;
}

/* File name label */
.label.file-label {
-fx-font-size: 12px;
}

/* Card (centered white box in setup scene) */
.card {
-fx-background-color: light-colour;
-fx-padding: 50 60 50 60;
}

/* Content area (main game tab/panel background) */
.content-area {
-fx-background-color: light-colour;
-fx-padding: 10;
}

/* Top status bar */
.top-bar {
-fx-background-color: light-green-colour;
-fx-padding: 8 12 8 12;
}

/* Text fields */
.text-field {
-fx-background-radius: 4;
-fx-padding: 7 10 7 10;
-fx-background-color: green-colour;
-fx-text-fill: dark-colour;
-fx-prompt-text-fill: dark-colour;
-fx-border-width: 0;
}

/* Scroll panes (transparent so card shows through) */
.scroll-pane {
-fx-background-color: transparent;
-fx-border-width: 0;
}

.scroll-pane > .viewport {
-fx-background-color: transparent;
}

/* Base button */
.button {
-fx-font-size: 14px;
-fx-padding: 10 28 10 28;
-fx-background-radius: 4;
-fx-cursor: hand;
-fx-font-weight: bold;
-fx-border-style: solid;
-fx-border-width: 2px;
-fx-border-radius: 4;
-fx-background-color: dark-colour;
-fx-text-fill: light-colour;
-fx-border-color: dark-colour;
}

.button:hover {
-fx-text-fill: dark-colour;
-fx-background-color: green-colour;
}

/* Exit button */
.exit-button {
-fx-background-color: dark-red-colour;
-fx-text-fill: light-colour;
-fx-border-color: dark-red-colour;
}

.exit-button:hover {
-fx-background-color: red-colour;
}

/* Browse button */
.browse-button {
-fx-padding: 6 18 6 18;
-fx-font-size: 12px;
}

/* Table view */
.table-view {
-fx-background-color: light-colour;
-fx-border-color: dark-colour;
-fx-border-width: 1;
}

.table-view .column-header-background {
-fx-background-color: green-colour;
}

.table-view .column-header .label {
-fx-text-fill: dark-colour;
-fx-font-weight: bold;
}

.table-view .table-row-cell {
-fx-background-color: light-colour;
-fx-border-color: transparent;
}

.table-view .table-row-cell:odd {
-fx-background-color: light-green-colour;
}

.table-view .table-row-cell:selected {
-fx-background-color: green-colour;
}

.table-view .table-row-cell:selected .text {
-fx-fill: dark-colour;
-fx-font-weight: bold;
}

/* Tab pane */
.tab-pane {
-fx-background-color: light-colour;
}

.tab-pane .tab-header-area {
-fx-background-color: green-colour;
-fx-padding: 4 0 0 4;
}

.tab-pane .tab {
-fx-background-color: green-colour;
-fx-background-radius: 4 4 0 0;
-fx-padding: 5 16 5 16;
}

.tab-pane .tab:selected {
-fx-background-color: light-colour;
}

.tab-pane .tab .tab-label {
-fx-text-fill: dark-colour;
-fx-font-weight: bold;
-fx-font-size: 12px;
}

.tab-pane .tab-content-area {
-fx-background-color: light-colour;
-fx-padding: 0;
}

/* List view */
.list-view {
-fx-background-color: light-colour;
-fx-border-color: green-colour;
}

.list-view .list-cell {
-fx-background-color: light-colour;
-fx-text-fill: dark-colour;
-fx-padding: 6 8;
}

.list-view .list-cell:odd {
-fx-background-color: green-colour;
}

.list-view .list-cell:selected {
-fx-background-color: dark-colour;
-fx-text-fill: light-colour;
}

/* ComboBox */
.combo-box {
-fx-background-color: green-colour;
-fx-background-radius: 4;
-fx-text-fill: dark-colour;
}

.combo-box .list-cell {
-fx-text-fill: dark-colour;
-fx-background-color: green-colour;
}

.combo-box-popup .list-view .list-cell {
-fx-background-color: light-colour;
-fx-text-fill: dark-colour;
}

.combo-box-popup .list-view .list-cell:selected {
-fx-background-color: green-colour;
}

/* Separator */
.separator .line {
-fx-border-color: dark-colour;
-fx-opacity: 0.4;
}
8 changes: 6 additions & 2 deletions src/main/java/Model/TransactionArchive.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ public List<Transaction> getTransactions(int week) {
}

public List<Purchase> getPurchase(int week) {
return transactions.stream().filter(transaction -> transaction.getWeek() == week).filter(purchase -> transactions instanceof Purchase).map(transaction -> (Purchase) transaction).collect(Collectors.toList());
return transactions.stream().filter(transaction -> transaction.getWeek() == week).filter(purchase -> purchase instanceof Purchase).map(transaction -> (Purchase) transaction).collect(Collectors.toList());
}

public List<Sale> getSale(int week) {
return transactions.stream().filter(transaction -> transaction.getWeek() == week).filter(sale -> transactions instanceof Sale).map(transaction -> (Sale) transaction).collect(Collectors.toList());
return transactions.stream().filter(transaction -> transaction.getWeek() == week).filter(sale -> sale instanceof Sale).map(transaction -> (Sale) transaction).collect(Collectors.toList());
}

public List<Transaction> getAllTransactions() {
return new ArrayList<>(transactions);
}

public int countDistinctWeeks() {
Expand Down
Loading