Package controller

Class InitScreenController

java.lang.Object
controller.InitScreenController
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, javax.swing.event.DocumentListener

public class InitScreenController
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.event.DocumentListener
Class providing the controller for the processes related to getting the personal details of the patient (name, age, and sex).
  • Constructor Summary

    Constructors 
    Constructor Description
    InitScreenController​(InitScreen scr, PrologJavaRunner expert)
    Creates a controller object with the initialization screen GUI and the expert system as parameters
  • Method Summary

    Modifier and Type Method Description
    void actionPerformed​(java.awt.event.ActionEvent e)
    Invoked when an action occurs
    void changedUpdate​(javax.swing.event.DocumentEvent e)
    Gives notification that an attribute or set of attributes changed
    boolean checkInput​(java.lang.String ageStr)
    Returns true if the patient's age, as supplied by the user, is a nonnegative number; false, otherwise
    void insertUpdate​(javax.swing.event.DocumentEvent e)
    Gives notification that there was an insert into the document
    void removeUpdate​(javax.swing.event.DocumentEvent e)
    Gives notification that a portion of the document has been removed

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InitScreenController

      public InitScreenController​(InitScreen scr, PrologJavaRunner expert)
      Creates a controller object with the initialization screen GUI and the expert system as parameters
      Parameters:
      scr - graphical user interface for the initialization screen
      expert - expert system featuring a Java interface and a Prolog knowledge base
  • Method Details

    • actionPerformed

      public void actionPerformed​(java.awt.event.ActionEvent e)
      Invoked when an action occurs
      Specified by:
      actionPerformed in interface java.awt.event.ActionListener
      Parameters:
      e - semantic event indicative that a component-defined action occurred
    • changedUpdate

      public void changedUpdate​(javax.swing.event.DocumentEvent e)
      Gives notification that an attribute or set of attributes changed
      Specified by:
      changedUpdate in interface javax.swing.event.DocumentListener
      Parameters:
      e - document event corresponding to a document change
    • insertUpdate

      public void insertUpdate​(javax.swing.event.DocumentEvent e)
      Gives notification that there was an insert into the document
      Specified by:
      insertUpdate in interface javax.swing.event.DocumentListener
      Parameters:
      e - document event corresponding to a document change
    • removeUpdate

      public void removeUpdate​(javax.swing.event.DocumentEvent e)
      Gives notification that a portion of the document has been removed
      Specified by:
      removeUpdate in interface javax.swing.event.DocumentListener
      Parameters:
      e - document event corresponding to a document change
    • checkInput

      public boolean checkInput​(java.lang.String ageStr)
      Returns true if the patient's age, as supplied by the user, is a nonnegative number; false, otherwise
      Parameters:
      ageStr - age of the patient as entered through the GUI
      Returns:
      true if the patient's age, as supplied by the user, is a nonnegative number; false, otherwise