From 28844bb6db3bf19c9dc009986007c9a010156ee7 Mon Sep 17 00:00:00 2001 From: Minimons Date: Sat, 1 Aug 2026 18:31:09 +0200 Subject: [PATCH] 55: Add TabPane to EMC --- .../impl/ref/EvelynMissionControlImpl.tjava | 62 +++++++++++++++---- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/src/main/tjava/com/r35157/evelyn/emc/impl/ref/EvelynMissionControlImpl.tjava b/src/main/tjava/com/r35157/evelyn/emc/impl/ref/EvelynMissionControlImpl.tjava index 7c6b42f..cef3ad5 100644 --- a/src/main/tjava/com/r35157/evelyn/emc/impl/ref/EvelynMissionControlImpl.tjava +++ b/src/main/tjava/com/r35157/evelyn/emc/impl/ref/EvelynMissionControlImpl.tjava @@ -3,7 +3,9 @@ package com.r35157.evelyn.emc.impl.ref; import com.r35157.evelyn.emc.EvelynMissionControl; import com.r35157.libs.javafx.JavaFxRuntime; import javafx.scene.Scene; -import javafx.scene.control.TextArea; +import javafx.scene.control.Tab; +import javafx.scene.control.TabPane; +import javafx.scene.layout.StackPane; import javafx.stage.Stage; public final class EvelynMissionControlImpl/**/ implements EvelynMissionControl { @@ -18,19 +20,57 @@ public final class EvelynMissionControlImpl/**/ implements EvelynMissionContr } private void showWindow() { - TextArea text = new TextArea(""" - Evelyn Mission Control - - Evelyn is running. - Connected to: %s - """.formatted("Test123"/*evelyn.getClass().getName())*/)); - text.setEditable(false); - Stage window = new Stage(); window.setTitle("Evelyn Mission Control"); - window.setScene(new Scene(text, 600, 400)); + window.setScene(new Scene(createRootTabs(), 600, 400)); window.show(); } - //private final T evelyn; + private TabPane createMissionControlTabs(String color) { + TabPane tabs = new TabPane( + createMissionControlTab("Overview", color), + createMissionControlTab("Portfolio", color), + createMissionControlTab("Perps", color), + createMissionControlTab("Spot", color), + createMissionControlTab("Liquidity Pools", color), + createMissionControlTab("Alarms", color), + createMissionControlTab("Status", color), + createMissionControlTab("Logs", color) + ); + + tabs.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE); + return tabs; + } + + private Tab createMissionControlTab(String title, String color) { + StackPane content = new StackPane(); + content.setStyle("-fx-background-color: " + color + ";"); + + Tab tab = new Tab(title, content); + tab.setStyle("-fx-background-color: " + color + ";"); + + return tab; + } + + private TabPane createRootTabs() { + Tab productionTab = new Tab( + "Production", + createMissionControlTabs(PRODUCTION_COLOR) + ); + productionTab.setStyle("-fx-background-color: " + PRODUCTION_COLOR + ";"); + + Tab testTab = new Tab( + "Test", + createMissionControlTabs(TEST_COLOR) + ); + testTab.setStyle("-fx-background-color: " + TEST_COLOR + ";"); + + TabPane rootTabs = new TabPane(productionTab, testTab); + rootTabs.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE); + + return rootTabs; + } + + private static final String PRODUCTION_COLOR = "#ffd6d6"; + private static final String TEST_COLOR = "#d8f3dc"; }