Newer
Older
Jason Dittmer (jcd763)
committed
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package ui;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
import model.RunProgramDetection;
/**
* RunningProgramsView is the view screen for viewing whch of selected programs are running.
* The back button returns the user to the main UI view
*/
public class RunningProgramsView extends Pane {
public RunningProgramsView() {
this.setStyle("-fx-background-color: #99aab5;");
Text title = new Text();
title.setLayoutY(100);
title.setLayoutX(50);
title.setText("Current Programs: ");
title.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
Text discord = new Text();
discord.setLayoutX(150);
discord.setLayoutY(230);
Text chrome = new Text();
chrome.setLayoutX(150);
chrome.setLayoutY(340);
Text notepad = new Text();
notepad.setLayoutX(150);
notepad.setLayoutY(450);
Text explorer = new Text();
explorer.setLayoutX(150);
explorer.setLayoutY(560);
Boolean[] isRunning = RunProgramDetection.ProgramsRunning();
if (isRunning[0]){
discord.setText("Discord: Currently running");
discord.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
} else {
discord.setText("Discord: Not currently running");
discord.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
}
if (isRunning[1]){
chrome.setText("Google Chrome: Currently running");
chrome.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
} else {
chrome.setText("Google Chrome: Not currently running");
chrome.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
}
if (isRunning[2]){
notepad.setText("Notepad: Currently running");
notepad.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
} else {
notepad.setText("Notepad: Not currently running");
notepad.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
}
if (isRunning[3]){
explorer.setText("File Explorer: Currently running");
explorer.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
} else {
explorer.setText("File Explorer: Not currently running");
explorer.setStyle("-fx-text-fill: #2c2f33; -fx-font-size: 30;");
}
this.getChildren().addAll(title, discord, chrome, notepad, explorer);
}
}