View Javadoc
1   package de.spiritscorp.datasync.theme;
2   
3   /*-
4    * 		Data Sync
5    *
6    * 		Copyright ©   2022    The Spirit
7    * 		@email                        thespirit@spiritscorp.network
8    *
9    * 		This program is free software; you can redistribute it and/or modify
10   * 		it under the terms of the GNU General Public License as published by
11   * 		the Free Software Foundation; either version 3 of the License, or
12   * 		(at your option) any later version.
13   *
14   * 		This program is distributed in the hope that it will be useful,
15   * 		but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * 		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17   * 		See the GNU General Public License for more details.
18   *
19   * 		You should have received a copy of the GNU General Public License
20   * 		along with this program. If not, see <http://www.gnu.org/licenses/>.
21   */
22  
23  import javafx.scene.Scene;
24  
25  /**
26   * MatrixTheme provides a retro cyberpunk/terminal look with high-contrast green text
27   * on a pitch-black background.
28   */
29  public class MatrixTerminalTheme implements AppTheme {
30  	@Override
31  	public void apply( final Scene scene ) {
32  		scene.getRoot().setStyle( "-fx-font-size: 13; -fx-font-family: 'Consolas', 'Courier New', monospace; -fx-background-color: #050505; -fx-text-fill: #00ff00;" );
33  		final String css = """
34  				/* Extended JavaFX Controls */
35  				.tooltip { -fx-background-color: #002200 !important; -fx-text-fill: #00ff00 !important; -fx-font-weight: normal !important; }
36  				.label { -fx-text-fill: #00ff00; }
37  				.button { -fx-background-color: #002200; -fx-text-fill: #00ff00; -fx-border-color: #00ff00; -fx-background-radius: 12px; -fx-border-radius: 12px; -fx-cursor: hand; }
38  				.button:hover { -fx-background-color: #00ff00; -fx-text-fill: #002200; }
39  
40  				/* List View */
41  				.list-view { -fx-background-color: #050505; -fx-border-color: #003300; -fx-border-width: 1px; }
42  				.list-cell { -fx-background-color: #050505; -fx-text-fill: #00ff00; -fx-padding: 12px; -fx-border-color: #003300; -fx-border-width: 0 0 1px 0; -fx-cursor: hand; }
43  				.list-cell:hover { -fx-background-color: #001a00; }
44  				.list-cell:selected { -fx-background-color: #003300; -fx-text-fill: #ffffff; -fx-border-color: #00ff00; }
45  
46  				/* Form Inputs & Dropdowns */
47  				.text-field, .text-area { -fx-background-color: #002200; -fx-text-fill: #00ff00; -fx-border-color: #00ff00;  -fx-background-radius: 10px; -fx-border-radius: 10px; }
48  				.text-field:focused, .combo-box:focused, .text-area:focused { -fx-border-color: #000000; }
49  				.text-area, .text-area .content { -fx-background-color: #050505 !important; -fx-text-fill: #00ff00 !important; }
50  
51  				/* Dropdown Menu Button */
52  				.menu-button, .menu-item { -fx-background-color: #002200; -fx-text-fill: #00ff00; -fx-border-color: #00ff00; -fx-background-radius: 16px; -fx-border-radius: 16px; }
53  				.menu-button .label { -fx-text-fill: #00ff00; }
54  				.menu-button:hover { -fx-background-color: #006600;  -fx-border-color: #00ff00; -fx-cursor: hand; }
55  				.menu-button:hover .label { -fx-text-fill: #00ff00 !important; }
56  
57  				/* Context Menu */
58  				.context-menu { -fx-background-color: #002200; -fx-border-color: #00ff00; -fx-border-width: 1px; -fx-padding: 5px; -fx-background-radius: 10px; -fx-border-radius: 10px; }
59  				.context-menu .menu-item { -fx-background-color: #002200; -fx-background-radius: 16px; -fx-border-radius: 16px; }
60  				.context-menu .menu-item .label { -fx-text-fill: #00ff00; }
61  				.context-menu .menu-item:focused, .context-menu .menu-item:hover { -fx-background-color: #006600 !important; -fx-cursor: hand; }
62  				.context-menu .menu-item:focused .label, .context-menu .menu-item:hover .label { -fx-text-fill: #00ff00 !important; }
63  				.context-menu .separator .line { -fx-border-color: #006600 !important; }
64  
65  				/* Table View */
66  				.table-view { -fx-background-color: #050505; -fx-border-color: #00ff00; }
67  				.table-view .column-header, .table-view .filler { -fx-background-color: #001a00; -fx-border-color: #003300; }
68  				.table-view .column-header .label { -fx-text-fill: #00ff00; }
69  				.table-row-cell { -fx-background-color: #050505; -fx-text-fill: #00ff00; }
70  				.table-row-cell:odd { -fx-background-color: #0a0a0a; }
71  				.table-row-cell:selected { -fx-background-color: #003300; }
72  				.table-row-cell:selected .text { -fx-fill: #000000; }
73  
74  				/* Scroll Pane */
75  				.scroll-pane { -fx-background-color: #002200; -fx-background: #050505 !important; -fx-text-fill: #00ff00; -fx-border-color: #00ff00 !important; -fx-border-width: 1px !important; }
76  				.scroll-pane .viewport{ -fx-background-color: #002200; -fx-background: #050505 !important; -fx-text-fill: #b9c0c7; }
77  				.scroll-pane .label { -fx-text-fill: #00ff00 !important; }
78  				.scroll-pane .scroll-bar:vertical, .scroll-pane .scroll-bar:horizontal { -fx-background-color: #0d0d0d !important; }
79  				.scroll-pane .scroll-bar .thumb { -fx-background-color: #002200 !important; -fx-border-color: #00ff00 !important;  -fx-background-radius: 4px !important; }
80  
81  				/* Progress Bar */
82  				.progress-bar .track { -fx-background-color: #404a00; -fx-background-radius: 0; }
83  				.progress-bar .bar { -fx-background-color: #006fa0; -fx-background-radius: 0; }
84  
85  				/* Dialog */
86  				.dialog-pane { -fx-background-color: #050505; -fx-border-color: #00ff00; -fx-border-width: 1px; }
87  				.dialog-pane .header-panel { -fx-background-color: #050505; -fx-border-color: transparent; }
88  				.dialog-pane .content-panel, .dialog-pane .button-bar { -fx-background-color: #050505; }
89  				.dialog-pane .label, .dialog-custom-icon { -fx-text-fill: #00ff00;  -fx-fill: #00ff00;}
90  				.dialog-pane .button { -fx-background-color: #002200; -fx-text-fill: #00ff00; -fx-border-color: #00ff00;}
91  				.dialog-pane .button:hover { -fx-background-color: #00ff00; -fx-text-fill: #000000; }
92  
93  				/* Combo Box */
94  				.combo-box {
95  				-fx-background-color: #151515; -fx-border-color: #009900; -fx-text-fill: #00ff00 !important;
96  				-fx-background-radius: 10px; -fx-border-radius: 10px; -fx-cursor: hand;
97  				}
98  				.combo-box:hover { -fx-border-color: #00e5ff; }
99  				.combo-box .list-cell { -fx-background-color: #00ff00; -fx-text-fill: #252525; -fx-background-radius: 10px; -fx-border-radius: 10px; -fx-cursor: hand; }
100 				.combo-box .list-cell:hover, .combo-box .list-cell:selected { -fx-background-color: #252525; -fx-text-fill: #00ff00; }
101 
102 				/* Check Box */
103 				.check-box .box { -fx-background-color: #000000;  -fx-text-fill: #00ff00; -fx-border-color: #00ff00;
104 				-fx-border-radius: 15; -fx-background-radius: 15; -fx-border-width: 2px 2px 2px 2px; -fx-cursor: hand; }
105 				.check-box:hover .box { -fx-border-color: #00e5ff; -fx-background-color: rgba(0, 229, 255, 0.3); }
106 				.check-box .text { -fx-fill: #00ff00;  -fx-background-color: #00ff00; -fx-cursor: hand; }
107 				.check-box:selected .mark { -fx-background-color: #00ff00; }
108 
109 				/* Icons */
110 				.menu-icon { -fx-icon-color: black; }
111 				.job-icon { -fx-icon-color: #3498db; }
112 				.button-icon { -fx-icon-color: white; }
113 
114 				/* Sidebar View */
115 				.sidebar-title-label { -fx-font-size: 11px; -fx-font-weight: bold; }
116 				.drag-over-target { -fx-border-color: #2ecc71 transparent transparent transparent; -fx-border-width: 3px 0 0 0; }
117 				.add-job-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 11px; }
118 				.exit-button { -fx-background-color: #e74c3c; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 11px; }
119 
120 				/* Workspace View */
121 				.console-text-area { -fx-font-family: 'Consolas', monospace; -fx-font-size: 12px; }
122 				.workspace-header-label { -fx-font-size: 22px; -fx-font-weight: bold; }
123 				.context-info-label { -fx-font-size: 15px; -fx-font-style: italic; -fx-padding: 0 0 8px 0; }
124 				.action-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 20px; }
125 				.cancel-button { -fx-background-color: #95a5a6; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 20px; }
126 
127 				/* Duplicate Button */
128 				.delete-button { -fx-background-color: #e74c3c; -fx-text-fill: white; }
129 
130 				/* Config Menu */
131 				.settings-grid { -fx-background-color: #050505; }
132 				.mode-label { -fx-font-weight: bold; }
133 				.params-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
134 				.global-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
135 				.save-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 24px; }
136 
137 				/* Directory rendering */
138 				.dir-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
139 				.multi-src-label { -fx-font-weight: bold; }
140 
141 				/*Special button hover */
142 				.cancel-button:hover { -fx-background-color: #7f8c8d;  -fx-text-fill: #d6e0fa;  -fx-icon-color: #d6e0fa; }
143 				.action-button:hover, .save-button:hover, .add-job-button:hover { -fx-background-color: #1abc9c; -fx-text-fill: #d6e0fa; -fx-icon-color: #d6e0fa; }
144 				.delete-button:hover, .exit-button:hover { -fx-background-color: #c0392b; -fx-text-fill: #d6e0fa; -fx-icon-color: #d6e0fa; }
145 
146 				/* Info View */
147 				.info-box { -fx-background-color: #050505; -fx-padding: 15px; }
148 				.app-title-label { -fx-font-size: 18px; -fx-font-weight: bold; }
149 				.legal-text { -fx-font-family: monospace; }
150 
151 				/* Status messages */
152 				.status-success { -fx-text-fill: #22aa22; -fx-font-weight: bold; }
153 				.status-error { -fx-text-fill: #ff3333; -fx-font-weight: bold; }
154 				.status-warning { -fx-text-fill: #ffaa00; -fx-font-weight: bold; }
155 				""";
156 		scene.getStylesheets().clear();
157 		scene.getStylesheets().add( "data:text/css," + css.replace( "\n", "" ).replace( " ", "%20" ) );
158 	}
159 
160 	@Override
161 	public String getName() { return "Matrix Terminal"; }
162 
163 	@Override
164 	public String toString() {
165 		return getName();
166 	}
167 }