-
Notifications
You must be signed in to change notification settings - Fork 1
/
Closet.java
98 lines (79 loc) · 2.99 KB
/
Closet.java
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// specify the package
// system imports
import java.util.Locale;
import java.util.ResourceBundle;
import java.io.FileOutputStream;
import java.io.File;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;
// project imports
import event.Event;
import event.EventLog;
import common.PropertyFile;
import javafx.scene.image.Image;
import model.Receptionist;
import userinterface.MainStageContainer;
import userinterface.WindowPosition;
/** The class containing the main program for the Professional Clothes Closet application */
//==============================================================
public class Closet extends Application
{
private Receptionist myReceptionist; // the main behavior for the application
/** Main stage of the application */
private Stage mainStage;
// start method for this class, the main application object
//----------------------------------------------------------
public void start(Stage primaryStage)
{
System.out.println("Brockport Professional Clothes Closet Version 1.00");
System.out.println("Copyright 2018 Sandeep Mitra and Students");
// Create the top-level container (main frame) and add contents to it.
MainStageContainer.setStage(primaryStage, "Clothes Closet Version 1.00");
mainStage = MainStageContainer.getInstance();
mainStage.getIcons().add(new Image("/images/BPT_LOGO_All-In-One_Color.png")); // set small icon in top left to bport icon
// Finish setting up the stage (ENABLE THE GUI TO BE CLOSED USING THE TOP RIGHT
// 'X' IN THE WINDOW), and show it.
mainStage.setOnCloseRequest(new EventHandler <javafx.stage.WindowEvent>() {
@Override
public void handle(javafx.stage.WindowEvent event) {
System.exit(0);
}
});
try
{
myReceptionist = new Receptionist();
}
catch(Exception exc)
{
System.err.println("Closet.Closet - could not create Receptionist!");
new Event(Event.getLeafLevelClassName(this), "Closet.<init>", "Unable to create Receptionist object", Event.ERROR);
exc.printStackTrace();
}
WindowPosition.placeCenter(mainStage);
mainStage.show();
}
/**
* The "main" entry point for the application. Carries out actions to
* set up the application
*/
//----------------------------------------------------------
public static void main(String[] args)
{
launch(args);
}
}