Skip to content

Commit

Permalink
change folder structure for better scalability
Browse files Browse the repository at this point in the history
  • Loading branch information
einaskoi committed Apr 22, 2026
1 parent bc7155b commit 0b3b28e
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package edu.ntnu.idi.idatt2003.gruppe42.Controller.AppController;
package edu.ntnu.idi.idatt2003.gruppe42.Controller.AppControllers;

import edu.ntnu.idi.idatt2003.gruppe42.Controller.MarketController;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.StockPopup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Apps.StockApp;

public class StockAppController {
private MarketController marketController;

public StockAppController(StockPopup stockPopup) {
public StockAppController(StockApp stockPopup) {
marketController = new MarketController();

stockPopup.getStockList().getItems().addAll(marketController.getMarket());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edu.ntnu.idi.idatt2003.gruppe42.Controller;

import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.Popup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popup;
import javafx.scene.layout.Pane;
import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package edu.ntnu.idi.idatt2003.gruppe42.Controller;
package edu.ntnu.idi.idatt2003.gruppe42.Controller.ViewControllers;

import edu.ntnu.idi.idatt2003.gruppe42.Controller.PopupController;
import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.AppStorePopup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.BankPopup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.HustlersPopup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.MailPopup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.NewsPopup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.Popup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popups.StockPopup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Apps.AppStoreApp;
import edu.ntnu.idi.idatt2003.gruppe42.View.Apps.BankApp;
import edu.ntnu.idi.idatt2003.gruppe42.View.Apps.HustlersApp;
import edu.ntnu.idi.idatt2003.gruppe42.View.Apps.MailApp;
import edu.ntnu.idi.idatt2003.gruppe42.View.Apps.NewsApp;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popup;
import edu.ntnu.idi.idatt2003.gruppe42.View.Apps.StockApp;
import javafx.beans.binding.Bindings;
import javafx.scene.control.Button;
import javafx.scene.input.ClipboardContent;
Expand Down Expand Up @@ -88,12 +89,12 @@ public Button createAppButton(App type) {
*/
private void openPopup(App type) {
Popup popup = switch (type) {
case APPSTORE -> new AppStorePopup(400, 300, 100, 100);
case HUSTLERS -> new HustlersPopup(400, 300, 140, 140);
case STOCK -> new StockPopup(400, 300, 200, 200);
case MAIL -> new MailPopup(400, 300, 160, 160);
case NEWS -> new NewsPopup(400, 300, 180, 180);
case BANK -> new BankPopup(400, 300, 120, 120);
case APPSTORE -> new AppStoreApp(400, 300, 100, 100);
case HUSTLERS -> new HustlersApp(400, 300, 140, 140);
case STOCK -> new StockApp(400, 300, 200, 200);
case MAIL -> new MailApp(400, 300, 160, 160);
case NEWS -> new NewsApp(400, 300, 180, 180);
case BANK -> new BankApp(400, 300, 120, 120);
};

if (popupController.add(popup)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package edu.ntnu.idi.idatt2003.gruppe42.Controller;
package edu.ntnu.idi.idatt2003.gruppe42.Controller.ViewControllers;

import edu.ntnu.idi.idatt2003.gruppe42.Millions;
import edu.ntnu.idi.idatt2003.gruppe42.Model.Player;
import edu.ntnu.idi.idatt2003.gruppe42.View.StartView;
import edu.ntnu.idi.idatt2003.gruppe42.View.Views.StartView;
import java.math.BigDecimal;
import java.util.List;
import java.util.Random;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Millions.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package edu.ntnu.idi.idatt2003.gruppe42;

import edu.ntnu.idi.idatt2003.gruppe42.Controller.StartViewController;
import edu.ntnu.idi.idatt2003.gruppe42.View.DesktopView;
import edu.ntnu.idi.idatt2003.gruppe42.View.StartView;
import edu.ntnu.idi.idatt2003.gruppe42.Controller.ViewControllers.StartViewController;
import edu.ntnu.idi.idatt2003.gruppe42.View.Views.DesktopView;
import edu.ntnu.idi.idatt2003.gruppe42.View.Views.StartView;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package edu.ntnu.idi.idatt2003.gruppe42.View.Popups;
package edu.ntnu.idi.idatt2003.gruppe42.View.Apps;

import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popup;

/**
* A popup for the AppStore app.
*/
public class AppStorePopup extends Popup {
public class AppStoreApp extends Popup {

/**
* Constructs a new AppStore popup.
Expand All @@ -15,7 +16,7 @@ public class AppStorePopup extends Popup {
* @param x x-position of the popup
* @param y y-position of the popup
*/
public AppStorePopup(int width, int height, int x, int y) {
public AppStoreApp(int width, int height, int x, int y) {
super(width, height, x, y, App.APPSTORE);
// Add AppStore specific content here
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package edu.ntnu.idi.idatt2003.gruppe42.View.Popups;
package edu.ntnu.idi.idatt2003.gruppe42.View.Apps;

import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popup;

/**
* A popup for the Bank app.
*/
public class BankPopup extends Popup {
public class BankApp extends Popup {

/**
* Constructs a new Bank popup.
Expand All @@ -15,7 +16,7 @@ public class BankPopup extends Popup {
* @param x x-position of the popup
* @param y y-position of the popup
*/
public BankPopup(int width, int height, int x, int y) {
public BankApp(int width, int height, int x, int y) {
super(width, height, x, y, App.BANK);
// Add Bank specific content here
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package edu.ntnu.idi.idatt2003.gruppe42.View.Popups;
package edu.ntnu.idi.idatt2003.gruppe42.View.Apps;

import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popup;

/**
* A popup for the Hustlers app.
*/
public class HustlersPopup extends Popup {
public class HustlersApp extends Popup {

/**
* Constructs a new Hustlers popup.
Expand All @@ -15,7 +16,7 @@ public class HustlersPopup extends Popup {
* @param x x-position of the popup
* @param y y-position of the popup
*/
public HustlersPopup(int width, int height, int x, int y) {
public HustlersApp(int width, int height, int x, int y) {
super(width, height, x, y, App.HUSTLERS);
// Add Hustlers specific content here
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package edu.ntnu.idi.idatt2003.gruppe42.View.Popups;
package edu.ntnu.idi.idatt2003.gruppe42.View.Apps;

import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popup;

/**
* A popup for the Mail app.
*/
public class MailPopup extends Popup {
public class MailApp extends Popup {

/**
* Constructs a new Mail popup.
Expand All @@ -15,7 +16,7 @@ public class MailPopup extends Popup {
* @param x x-position of the popup
* @param y y-position of the popup
*/
public MailPopup(int width, int height, int x, int y) {
public MailApp(int width, int height, int x, int y) {
super(width, height, x, y, App.MAIL);
// Add Mail specific content here
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package edu.ntnu.idi.idatt2003.gruppe42.View.Popups;
package edu.ntnu.idi.idatt2003.gruppe42.View.Apps;

import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popup;

/**
* A popup for the News app.
*/
public class NewsPopup extends Popup {
public class NewsApp extends Popup {

/**
* Constructs a new News popup.
Expand All @@ -15,7 +16,7 @@ public class NewsPopup extends Popup {
* @param x x-position of the popup
* @param y y-position of the popup
*/
public NewsPopup(int width, int height, int x, int y) {
public NewsApp(int width, int height, int x, int y) {
super(width, height, x, y, App.NEWS);
// Add News specific content here
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package edu.ntnu.idi.idatt2003.gruppe42.View.Popups;
package edu.ntnu.idi.idatt2003.gruppe42.View.Apps;

import edu.ntnu.idi.idatt2003.gruppe42.Controller.AppController.StockAppController;
import edu.ntnu.idi.idatt2003.gruppe42.Controller.MarketController;
import edu.ntnu.idi.idatt2003.gruppe42.Controller.AppControllers.StockAppController;
import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import edu.ntnu.idi.idatt2003.gruppe42.Model.Stock;
import edu.ntnu.idi.idatt2003.gruppe42.View.Popup;
import javafx.geometry.Pos;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;

/**
* A popup for the Stock app.
*/
public class StockPopup extends Popup {
public class StockApp extends Popup {

private StockAppController stockAppController;
private ListView<Stock> stockList;
Expand All @@ -25,7 +25,7 @@ public class StockPopup extends Popup {
* @param x x-position of the popup
* @param y y-position of the popup
*/
public StockPopup(int width, int height, int x, int y) {
public StockApp(int width, int height, int x, int y) {
super(width, height, x, y, App.STOCK);

searchField = new TextField();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.ntnu.idi.idatt2003.gruppe42.View.Popups;
package edu.ntnu.idi.idatt2003.gruppe42.View;

import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import javafx.scene.control.Button;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edu.ntnu.idi.idatt2003.gruppe42.View;
package edu.ntnu.idi.idatt2003.gruppe42.View.Views;

import edu.ntnu.idi.idatt2003.gruppe42.Controller.DesktopViewController;
import edu.ntnu.idi.idatt2003.gruppe42.Controller.ViewControllers.DesktopViewController;
import edu.ntnu.idi.idatt2003.gruppe42.Controller.PopupController;
import edu.ntnu.idi.idatt2003.gruppe42.Model.App;
import javafx.geometry.Pos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.ntnu.idi.idatt2003.gruppe42.View;
package edu.ntnu.idi.idatt2003.gruppe42.View.Views;

import javafx.geometry.Pos;
import javafx.scene.control.Button;
Expand Down

0 comments on commit 0b3b28e

Please sign in to comment.