package Chat; import java.util.*; /** * The ChatWindow object is derived from an overall view of Sections 2.6.1 - 2.6.4 of the requirements. * The ChatWindow is one of the primary data object of the Chat Tool. * * The data components of the ChatWindow are a Console window for output and a text box for input. */ public abstract class ChatWindow { Console chatOutput; TextBox textInput; Boolean isShowing; /** * Enter is a button that transfers the text from the text box from a given student and adds it to the * list in the console * * pre: // // The textBox isn't empty and the text isn't just whitespace // (textInput != null) && exists(char c; textIput.buffer.contains(c); c == isalpha()); * */ void Enter(TextBox textInput) {} /* SPEST ISSUE: The checker correctly identifies the undefined id "TextIput" on line 27, but produces what I think are extra error messages: line 31:18 extraneous input 'Enter' expecting LPAREN line 36:36 mismatched character 'e' expecting set null line 49:35 mismatched character 'e' expecting set null Invalid id: textIput at line: 27 at character: 24 found: . expecting: at line: 27 at character: 33 found: ; expecting: at line: 27 at character: 52 It would be better if only the second of these six lines of error messages was output. After "TextIput" is changed in the postcond to the correct "TextInput", the checker does correctly identify the problems of buffer.contains not being defined and isalpha not being defined, but again there are a couple extra error message lines: line 31:9 extraneous input 'Enter' expecting LPAREN line 39:36 mismatched character 'e' expecting set null Invalid invocation: contains(antlr.TestGenerator$arguments_return@c294a78) at line: 27 at character: 41 Invalid invocation: isalpha() at line: 27 at character: 59 */ /** * showWindow will pop the window out if isShowing is false / pre: // // isShowing != true // (isShowing != true); * */ abstract void showWindow(Boolean isShowing); /** * hideWindow will minimize the ChatWindow if isShowing is true; / pre: // // isShowing != true // (isShowing != true); * */ abstract void hideWindow(Boolean isShowing); }