aboutsummaryrefslogtreecommitdiffstats
path: root/ui-fx/src/main/java
Commit message (Collapse)AuthorAgeFilesLines
* ui-fx: support running as one logged-in user of a server Kostya2026-10-138-8/+164
| | | | | | | | | | | | | | | | | | | | | | | | The shared UI assumed the whole market was local: it showed nothing until a file was loaded, let the user act as anyone in the list and offered to create events by hand. None of that holds for a client of a shared server. AppState and AppView now take an optional session user. When it is set: - the tabs show from the start, since other users' events are there whether or not we loaded a file ourselves; - the acting user is fixed, and the user list becomes a directory of the other users with their balance and role; - the buttons that create events are hidden, and the Users tab gets a Deposit Funds button with a small dialog; - loading a file skips the two-second pause Ex2 asked for. Without a session user everything behaves as before. Also keep the event's Trade and Close buttons from collapsing to an ellipsis when the description is long.
* ui-fx: run engine calls off the JavaFX thread Kostya2026-10-121-41/+71
| | | | | | | | | | | | Resolving, opening and trading called the contexts straight from the JavaFX thread. That was fine while they were in-process, but against a server each one is an HTTP request and would freeze the window while it is in flight. Run them on a background thread and handle the result back on the JavaFX thread.
* ui-fx: move the JavaFX UI into a module that sees only the api Kostya2026-10-1143-0/+4193
Exercise 3 asks for a new desktop client that reuses the Exercise 2 screens, and the course asks that clients depend on the DTO contract, never on the engine. ui-desktop mixed both: its views and controllers only talk to the api interfaces, but AppView and AppState each had a convenience constructor that built a ServiceEngine, which tied every UI class to the service module. Move the screens, controllers, components, FXML, skins and fonts into a new ui-fx module that depends on api alone. Packages are unchanged, so FXML controller names and resource paths keep working as they are. ui-desktop keeps only the Exercise 2 app: Launcher, App, which now builds the ServiceEngine and passes its contexts in, and ServiceEngine itself. The Exercise 3 client can then reuse ui-fx with remote contexts and never put the engine on its classpath. The build proves the split: ui-fx compiles with nothing but api visible. Tests move with the code they cover. AppStateTest drives the real engine, so it stays in ui-desktop.