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 occursvoid
changedUpdate(javax.swing.event.DocumentEvent e)
Gives notification that an attribute or set of attributes changedboolean
checkInput(java.lang.String ageStr)
Returnstrue
if the patient's age, as supplied by the user, is a nonnegative number;false
, otherwisevoid
insertUpdate(javax.swing.event.DocumentEvent e)
Gives notification that there was an insert into the documentvoid
removeUpdate(javax.swing.event.DocumentEvent e)
Gives notification that a portion of the document has been removed
-
Constructor Details
-
InitScreenController
Creates a controller object with the initialization screen GUI and the expert system as parameters- Parameters:
scr
- graphical user interface for the initialization screenexpert
- 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 interfacejava.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 interfacejavax.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 interfacejavax.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 interfacejavax.swing.event.DocumentListener
- Parameters:
e
- document event corresponding to a document change
-
checkInput
public boolean checkInput(java.lang.String ageStr)Returnstrue
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
-