Package gui
Class MainScreen
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
gui.MainScreen
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public class MainScreen
extends javax.swing.JFrame
Class implementing the main window of the system, displaying the patient's
details, the current inquiry, and the diagnosis log and status.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
Field Summary
Fields inherited from class java.awt.Frame
ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, NORMAL
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Constructor Summary
Constructors Constructor Description MainScreen(java.lang.String name, double age, java.lang.String sex)
Creates the main window of the system, displaying the patient's details, the current inquiry, and the diagnosis log and status -
Method Summary
Modifier and Type Method Description void
clearResponse()
Resets the text field for the user responsejava.lang.String
getResponse()
Retrieves the user's text-based responsevoid
setActionListener(java.awt.event.ActionListener listener)
Sets the action listener for this graphical user interfacevoid
setBtnSubmit(boolean enabled)
Enables the SUBMIT button for the user's text-based responsevoid
setBtnYesNoEnabled(boolean enabled)
Enables the YES and NO buttons for the user responsevoid
setDocumentListener(javax.swing.event.DocumentListener listener)
Sets the document listener for this graphical user interfacevoid
setTextEnabled(boolean enabled)
Enables the text field for the user's text-based responsevoid
setWindowListener(java.awt.event.WindowListener listener)
Sets the window listener for this graphical user interfacevoid
updateEmergency(java.lang.String status)
Updates the diagnosis statusvoid
updateHistory(java.lang.String addedInquiry)
Updates the diagnosis logvoid
updateInquiry(java.lang.String currentInquiry)
Updates the user inquiryMethods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Frame
addNotify, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, paintComponents, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, hasFocus, imageUpdate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, list, list, list, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
MainScreen
public MainScreen(java.lang.String name, double age, java.lang.String sex)Creates the main window of the system, displaying the patient's details, the current inquiry, and the diagnosis log and status- Parameters:
name
- the patient's nameage
- the patient's agesex
- the patient's biological sex (either male or female)
-
-
Method Details
-
updateHistory
public void updateHistory(java.lang.String addedInquiry)Updates the diagnosis log- Parameters:
addedInquiry
- the diagnosis details of the latest inquiry
-
updateInquiry
public void updateInquiry(java.lang.String currentInquiry)Updates the user inquiry- Parameters:
currentInquiry
- the latest user inquiry
-
updateEmergency
public void updateEmergency(java.lang.String status)Updates the diagnosis status- Parameters:
status
- the current diagnosis status (i.e., whether or not there is an emergency)
-
getResponse
public java.lang.String getResponse()Retrieves the user's text-based response- Returns:
- text-based response of the user
-
clearResponse
public void clearResponse()Resets the text field for the user response -
setBtnYesNoEnabled
public void setBtnYesNoEnabled(boolean enabled)Enables the YES and NO buttons for the user response- Parameters:
enabled
- whether or not the buttons are to be enabled
-
setBtnSubmit
public void setBtnSubmit(boolean enabled)Enables the SUBMIT button for the user's text-based response- Parameters:
enabled
- whether or not the button is to be enabled
-
setTextEnabled
public void setTextEnabled(boolean enabled)Enables the text field for the user's text-based response- Parameters:
enabled
- whether or not the button is to be enabled
-
setActionListener
public void setActionListener(java.awt.event.ActionListener listener)Sets the action listener for this graphical user interface- Parameters:
listener
- action listener receiving action events
-
setDocumentListener
public void setDocumentListener(javax.swing.event.DocumentListener listener)Sets the document listener for this graphical user interface- Parameters:
listener
- document listener receiving document events
-
setWindowListener
public void setWindowListener(java.awt.event.WindowListener listener)Sets the window listener for this graphical user interface- Parameters:
listener
- window listener receiving window events
-