scheduler.view.view_ui
Class ViewMenu

java.lang.Object
  extended by mvp.View
      extended by scheduler.view.view_ui.ViewMenu
All Implemented Interfaces:
java.io.Serializable, java.util.Observer

public class ViewMenu
extends mvp.View

Class ViewMenu is the pulldown menu view of the model class. The ViewMenu widget is a Java JMenu. Anonymous instances of JMenuItem are defined for each item in the menu.

Author:
Aaron Rivera
See Also:
Serialized Form

Field Summary
protected  javax.swing.JMenuItem conflicts
           
protected  javax.swing.JMenuItem course
           
protected  javax.swing.JMenuItem fairness
           
protected  javax.swing.JMenuItem instructor
           
protected  javax.swing.JMenuItem location
           
protected  javax.swing.JMenu menu
          Pre-cast reference to this' widget, which is a menu
protected  javax.swing.JMenuItem quality
           
(package private)  ViewUI viewUI
          The parent view.
 
Fields inherited from class mvp.View
closeAdapter, editable, model, screen, shown, widget, window
 
Constructor Summary
ViewMenu(mvp.Screen screen, View view, ViewUI viewUI)
          Construct this with the given name as the pulldown label.
 
Method Summary
 void addAdvancedFilterItem()
          Add the 'Advanced Filter' menu item.
 void addConflictsItem()
          Add the 'Conflicts' menu item.
 void addCourseItem()
          Add the 'Course' menu item.
 void addFairnessItem()
          Add the 'Fairness' menu item.
 void addInstructorItem()
          Add the 'Instructor' menu item.
 void addLocationItem()
          Add the 'Location' menu item.
 void addQualityItem()
          Add the 'Quality' menu item.
 java.awt.Component compose()
          Compose this by inserting each of its menu items into the pulldown menu.
 
Methods inherited from class mvp.View
getModel, getWidget, getWindow, hide, isEditable, isShown, run, setEditable, setExitOnClose, setModel, show, show, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

menu

protected javax.swing.JMenu menu
Pre-cast reference to this' widget, which is a menu


course

protected javax.swing.JMenuItem course

instructor

protected javax.swing.JMenuItem instructor

location

protected javax.swing.JMenuItem location

conflicts

protected javax.swing.JMenuItem conflicts

fairness

protected javax.swing.JMenuItem fairness

quality

protected javax.swing.JMenuItem quality

viewUI

ViewUI viewUI
The parent view.

Constructor Detail

ViewMenu

public ViewMenu(mvp.Screen screen,
                View view,
                ViewUI viewUI)
Construct this with the given name as the pulldown label. The given View is the companion model. Also construct the state-changing menu items, that must be persistent so they're text can change.

Method Detail

compose

public java.awt.Component compose()
Compose this by inserting each of its menu items into the pulldown menu. The items are: Item, Day, Week, Month, Year, Next, Previous, Today, Goto Date, Lists, Filter, Other User, Group, Windows, and Calendars. Separators are placed after the Year, Goto Date, Filter, and Group items. A menu item is created with the following general code pattern:
     JMenu.add(new JMenuItem("Item name").addActionListener(
         new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                 model.method()
                                                              

Overrides:
compose in class mvp.View

addCourseItem

public void addCourseItem()
Add the 'Course' menu item.


addInstructorItem

public void addInstructorItem()
Add the 'Instructor' menu item.


addLocationItem

public void addLocationItem()
Add the 'Location' menu item.


addAdvancedFilterItem

public void addAdvancedFilterItem()
Add the 'Advanced Filter' menu item.


addConflictsItem

public void addConflictsItem()
Add the 'Conflicts' menu item.


addFairnessItem

public void addFairnessItem()
Add the 'Fairness' menu item.


addQualityItem

public void addQualityItem()
Add the 'Quality' menu item.