package view_ui; 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 and a monthly view. */ public ViewUI() { constructMenu(); monthlyAgendaDisplay = new MonthlyAgendaDisplay(); } /** * Build the simplest form of menu, with actionless items. */ public void constructMenu() { viewMenu = new JMenu("View"); viewMenu.add(new JMenuItem("Item")); viewMenu.add(new JMenuItem("Day")); viewMenu.add(new JMenuItem("Week")); viewMenu.add(new JMenuItem("Month")); viewMenu.add(new JMenuItem("Year")); viewMenu.add(new JSeparator()); viewMenu.add(new JMenuItem("Next")); viewMenu.add(new JMenuItem("Previous")); viewMenu.add(new JMenuItem("Today")); viewMenu.add(new JMenuItem("Goto Date ...")); viewMenu.add(new JSeparator()); viewMenu.add(new JMenuItem("Lists ...")); viewMenu.add(new JMenuItem("Filter ...")); viewMenu.add(new JSeparator()); viewMenu.add(new JMenuItem("Other User ...")); viewMenu.add(new JMenuItem("Group ...")); viewMenu.add(new JSeparator()); viewMenu.add(new JMenuItem("Windows ->")); viewMenu.add(new JMenuItem("Calendars ->")); } /** * 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 JFrame getMonthlyAgendaDisplay() { return monthlyAgendaDisplay; } /** The View menu */ protected JMenu viewMenu; /** The monthly agenda display window. */ protected JFrame monthlyAgendaDisplay; }