-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStockControllerGUI.java
More file actions
55 lines (44 loc) · 1.35 KB
/
StockControllerGUI.java
File metadata and controls
55 lines (44 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package controller.gui;
import controller.IStockController;
import model.IModel;
import model.RetrivableClient;
import view.gui.IViewGUI;
/**
* The StockController class implements the IStockController interface to handle
* the main control flow for user interactions in a stock management application.
* It takes user input through a Readable source and outputs responses through an
* Appendable target.
*/
public class StockControllerGUI implements IStockController {
IModel md;
IViewGUI vd;
private RetrivableClient user;
/**
* Constructs a StockController that takes in a model and a view,It runs the gui and gets inputs
* .
*
* @param md The input stream for reading user input.
* @param vd The output stream for writing messages to the user.
*/
public StockControllerGUI(IModel md, IViewGUI vd) {
this.md = md;
this.vd = vd;
this.user = new RetrivableClient("user");
}
/**
* Starts the main control loop of the application, displaying the main menu
* and processing user input to navigate through different functionalities
* such as viewing stock information or managing portfolios.
*/
@Override
public void goController() {
vd.setText(this);
vd.setVisible();
}
public void setClient(RetrivableClient c) {
user = c;
}
public RetrivableClient getUser() {
return user;
}
}