module View; from Lecture import all; from Draw import all; from Roster import all except ChangeStudentName, BanStudent, SetStudentMode, AnswerStudentQuestion, AnswerStudentComment; export all; object StudentScreen is components: ls:LectureScreen, ft:FontToolbar, ct:CurrentTool, np:Notepad, cp:ColorPalette; description: (* A StudentScreen is the student user interface. *); end StudentScreen; object FontToolbar is components: fl:FontName*, cf:CurrentFontName, s:CurrentSize, b:BoldStatus, i:ItalicStatus, u:UnderlinedStatus; operations: ChangeStyle, ChangeSize, SetBold, SetItalic, SetUnderlined; description:(* FontToolbar changes the font of text. *); end FontToolbar; object FontName is string description:(* Font is the style of text. *); end FontName; object CurrentFontName is FontName description:(* CurrentFont is the font that will be used when typing. *); end CurrentFontName; object CurrentSize is integer description:(* CurrentSize is the size of the font that will be used when typing. *); end CurrentSize; object BoldStatus is boolean description:(* Font used when typing is bold when the BoldStatus is true. *); end BoldStatus; object ItalicStatus is boolean description:(* Font used when typing is bold when the ItalicStatus is true. *); end ItalicStatus; object UnderlinedStatus is boolean description:(* Font used when typing is bold when the UnderlinedStatus is true. *); end UnderlinedStatus; operation ChangeStyle is inputs:ft:FontToolbar, f:FontName; outputs:ft':FontToolbar; precondition: (*f must be a predefinded font*) (f != nil); postcondition: (*The current font style is changed*) ft'.cf = f; description:(* This operation changes the font style. *); end ChangeStyle; operation ChangeSize is inputs:ft:FontToolbar, s:CurrentSize; outputs:ft':FontToolbar; precondition: (*s must be positive*) (s > 0); postcondition: (*The current font size is changed*) ft'.s = s; description:(* This operation changes the font size. *); end ChangeSize; operation SetBold is inputs:ft:FontToolbar; outputs:ft':FontToolbar; precondition: (*none*); postcondition: (*The bold status is changed*) ft'.b = not ft.b; description:(* This operation changes the font to bold. *); end SetBold; operation SetItalic is inputs:ft:FontToolbar; outputs:ft':FontToolbar; precondition: (*none*); postcondition: (*The italic status is changed*) ft'.i = not ft.i; description:(* This operation changes the font to italic. *); end SetItalic; operation SetUnderlined is inputs:ft:FontToolbar; outputs:ft':FontToolbar; precondition: (*none*); postcondition: (*The underlined status is changed*) ft'.u = not ft.u; description:(* This operation changes the font to underlined. *); end SetUnderlined; object Notepad is string description:(* Notes is an entry field of text. *); end Notepad; operation RequestComment is inputs:stu:Student, oosr:OnlineOfflineStudentRoster; outputs:stu':Student, oosr':OnlineOfflineStudentRoster; precondition:(*student's activity is set to NoActivity*) stu.act?noact; postcondition:(*student's activity is set to Comment *) stu.act?com; description:(* This operation notifies the teacher that a student has a comment. *); end RequestComment; operation AskQuestion is inputs:stu:Student, oosr:OnlineOfflineStudentRoster; outputs:stu':Student, oosr':OnlineOfflineStudentRoster; precondition:(*student's activity is set to NoActivity*) stu.act?noact; postcondition:(*student's activity is set to Question *) stu'.act?ques; description:(* This operation notifies the teacher that a student has a question. *); end RequestComment; end View;