Package HotelReservationSystem
Class Assets
java.lang.Object
HotelReservationSystem.Assets
Class that contains all the assets of the GUI implementation of the HRS.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JButton
ASSET_ACCENT_BUTTON
(String text) Makes a bright accented buttonASSET_ADD_PANELS
(int count) Created an array of panels.static JButton
ASSET_BASIC_BUTTON
(String text) Makes a basic buttonstatic JMenu
ASSET_MENU
(String name) Creates the options of the menu barstatic JMenuBar
Creates a JMenuBar for the dropdown buttonsstatic JMenuBar
ASSET_MENU_BAR
(HRS hrs, String dummy) Creates a dynamically updating menu bar for the hotel liststatic JTextArea
Not meant to be called.static JTextArea
ASSET_OUTPUT_BOX
(int width, int height, HRS hrs) Creates a dynamically updating output box.static JTextArea
ASSET_OUTPUT_BOX
(int width, int height, String display) Creates a dynamically updating output box.static void
ASSET_PANE
(JFrame f, String information, String title) Creates a subwindow for information regarding the modelstatic JScrollPane
Makes a JScrollPane with the appropriate design.static JPanel
ASSET_SEPARATOR
(int width) Creates a separator for the buttons.static JSpinner
ASSET_SPINNER
(int min, int max) Creates a JSpinner component.static JTextField
ASSET_TEXT_FIELD
(String dummy) Makes a text field for the user to fill instatic JEditorPane
ASSET_TITLE_BOX
(String[] contents, String alignment, int width, int height) Creates a title box.static JMenuItem
CREATE_MENU_ITEM
(String name) Creates a JMenuItem and their actions listenersstatic String
Gets the current time and formats it.static StringBuilder
UPDATE_OUTPUT_BOX
(HRS hrs) Specifically for the hotel list.static String
UPDATE_OUTPUT_BOX
(String out) Specifically for the status bar.static void
UPDATE_TITLE_BOX
(JEditorPane ep, String[] contents, String alignment) Updates the text inside the title box.
-
Constructor Details
-
Assets
public Assets()Assets empty constructor
-
-
Method Details
-
ASSET_BASIC_BUTTON
-
ASSET_ACCENT_BUTTON
-
ASSET_TEXT_FIELD
Makes a text field for the user to fill in- Parameters:
dummy
- the dummy text inside the text field- Returns:
- the text field created
-
ASSET_SCROLL_BOX
Makes a JScrollPane with the appropriate design.- Returns:
- the JScrollPane created.
-
ASSET_OUTPUT_BOX
Not meant to be called. Creates the preliminaries for the ASSET_OUTPUT_BOX- Returns:
- a JTextArea of the output box with preliminary design
-
ASSET_OUTPUT_BOX
-
ASSET_OUTPUT_BOX
-
ASSET_TITLE_BOX
public static JEditorPane ASSET_TITLE_BOX(String[] contents, String alignment, int width, int height) Creates a title box.- Parameters:
contents
- the contents of the title box, as an array of strings.alignment
- the alignment of the textwidth
- the width of the boxheight
- the height of the box- Returns:
- the created title box
-
ASSET_SEPARATOR
Creates a separator for the buttons.- Parameters:
width
- the width of the buttons (the entire width of the JPanel)- Returns:
- the created separator.
-
ASSET_ADD_PANELS
-
UPDATE_TITLE_BOX
Updates the text inside the title box. For the clock.- Parameters:
ep
- the editor pane of the title boxcontents
- the contents of the title boxalignment
- the alignment of the text
-
UPDATE_OUTPUT_BOX
Specifically for the hotel list. Updates the list of hotels inside the output box- Parameters:
hrs
- the hotel reservation system- Returns:
- a StringBuilder of the list of hotels
-
UPDATE_OUTPUT_BOX
-
UPDATE_CLOCK_TIME
Gets the current time and formats it.- Returns:
- the formatted time.
-
ASSET_MENU_BAR
Creates a JMenuBar for the dropdown buttons- Returns:
- the created JMenuBar
-
ASSET_MENU_BAR
-
ASSET_MENU
-
CREATE_MENU_ITEM
-
ASSET_SPINNER
Creates a JSpinner component.- Parameters:
min
- The minimum value for the spinnermax
- The maximum value for the spinner- Returns:
- A JSpinner component with the specified range and custom appearance
-
ASSET_PANE
-