package view; import javax.swing.*; import java.awt.*; /**** * * ViewUI is the top-level class for prototype GUIs related to Calendar Tool * view commands. This is a very simple prototype version that constructs a * menu with JMenu items, but without any action listeners. As such, its the * very simplest form of initial GUI prototype for a menu. * */ public class ViewUI { /** * Construct the menu, a monthly view, and an appointments list view. * Content for the latter two are taken directly from pictures in the * requirements scenarios. */ public ViewUI() { constructMenu(); monthlyAgendaDisplay = new MonthlyAgendaDisplay(); appointmentsListDisplay = new AppointmentsListDisplay(); } /** * Call the ViewMenu class to build the pulldown. */ public void constructMenu() { viewMenu = new ViewMenu(this); } /** * Return this' menu. */ public JMenu getMenu() { return viewMenu; } /** * Build a quick and dirty initial approximation of a monthly view. It * uses a JPanel with a grid layout. The outer layout is a vertical box, * with a label on the top, and the month grid below. The month grid is * populated with small day-sized JPanels, each with a number in the upper * left corner. */ public MonthlyAgendaDisplay getMonthlyAgendaDisplay() { return monthlyAgendaDisplay; } /** * Build a quick and dirty initial approximation of an appointments list. * It uses a JTable with a fixed number of rows and columns. */ public AppointmentsListDisplay getAppointmentsListDisplay() { return appointmentsListDisplay; } /** The View menu */ protected JMenu viewMenu; /** The monthly agenda display window. */ protected MonthlyAgendaDisplay monthlyAgendaDisplay; /** The appointments list display window. */ protected AppointmentsListDisplay appointmentsListDisplay; }