package view; import java.util.Collection; import javax.swing.JPanel; import javax.swing.JButton; enum WeekDay {Monday, Tuesday, Wednesday, Thursday, Friday} /** * represents the main container for the Schedule viewing screen * @author igood */ abstract class ScheduleView { JPanel mainWindow; JButton filters, listTab, courseTab, insTab, roomTab; ScheduleViewInterior currentInterior; Schedule currentSchedule; } /** * represents the basic setup of a Schedule view * @author igood */ abstract class ScheduleViewInterior { Collection scheduleGrid; Collection
scheduleGridData; Filter viewFilter; /** * prints the current Schedule * @author igood */ public abstract void print(); } /** * represents the basic setup of the filter selection view * @author igood */ abstract class FilterTab extends ScheduleViewInterior { public Collection instructors; public Collection courses; public Collection rooms; /** * marks all elements in the collection as selected * @author igood */ /*@ ensures // all items in the colllection will have their isSelected field set to // true (\forall Teacher instructor; toMark.contains(instructor); instructor.isSelected == true); @*/ public abstract void selectAllTeachers(Collection toMark); /** * marks all elements in the collection as selected * @author igood */ /*@ ensures // all items in the colllection will have their isSelected field set to // true (\forall Course courseId; toMark.contains(courseId); courseId.isSelected == true); @*/ public abstract void selectAllCourses(Collection toMark); /** * marks all elements in the collection as selected * @author igood */ /*@ ensures // all items in the colllection will have their isSelected field set to // true (\forall Room courseRoom; toMark.contains(courseRoom); courseRoom.isSelected == true); @*/ public abstract void selectAllRooms(Collection toMark); /** * marks all elements in the collection as not selected * @author igood */ /*@ ensures // all items in the colllection will have their isSelected field set to // false (\forall Teacher instructor; toMark.contains(instructor); instructor.isSelected == false); @*/ public abstract void deSelectAllTeachers(Collection toMark); /** * marks all elements in the collection as not selected * @author igood */ /*@ ensures // all items in the colllection will have their isSelected field set to // false (\forall Course courseId; toMark.contains(courseId); courseId.isSelected == false); @*/ public abstract void deSelectAllCourses(Collection toMark); /** * marks all elements in the collection as not selected * @author igood */ /*@ ensures // all items in the colllection will have their isSelected field set to // false (\forall Room courseRoom; toMark.contains(courseRoom); courseRoom.isSelected == false); @*/ public abstract void deSelectAllRooms(Collection toMark); } /** * represents the view by course tab of the Schedule view * @author igood */ abstract class ByCourseTab extends ScheduleViewInterior { Collection courseSelect; } /** * represents the view by instructor tab of the Schedule view * @author igood */ abstract class ByInstructorTab extends ScheduleViewInterior { Collection instructorSelect; } /** * represents the view by room tab of the Schedule view * @author igood */ abstract class ByRoomTab extends ScheduleViewInterior { Collection buildingSelect; Collection roomSelect; } /** * represents the list view tab of the Schedule view * @author igood */ abstract class ListTab extends ScheduleViewInterior { Collection instructorSelect; Collection courseSelect; Collection roomSelect; } /** * represents a single section of a course * @author igood */ abstract class Section { Teacher courseInstructor; Room courseRoom; TimeBlock courseTime; Course courseId; Collection days; } /** * represents a filter to be used to constrain what is * shown in the various view interfaces * @author igood */ abstract class Filter { Collection validRooms; Collection validTeachers; Collection validCourses; } /** * represents a blocked out time of day * using a startTime and endTime, in minutes since midnight * @author igood */ abstract class TimeBlock { int startTime; int endTime; } /** * represents a single room in a building * @author igood */ abstract class Room { public int buildingNumber; public int roomNumber; public boolean isSelected; } /** * represents a course instructor * @author igood */ abstract class Teacher { public String lastName; public String firstName; public boolean isSelected; } /** * represents a course to be taught * @author igood */ abstract class Course { public String courseId; public int courseNum; public boolean isSelected; } /** * represents a building * @author igood */ abstract class Building { String name; int buildingNumber; }