scheduler.scheduler_ui
Class SchedulerUI

java.lang.Object
  extended by mvp.View
      extended by scheduler.scheduler_ui.SchedulerUI
All Implemented Interfaces:
java.io.Serializable, java.util.Observer

public class SchedulerUI
extends mvp.View

Class SchedulerUI is a companion view to the Scheduler model class. The window component of the SchedulerUI is a free-floating JMenuBar, containing JMenus for the pulldown command menus.

SchedulerUI contains an instance of the view classes that are companion to each of the Scheduler Model classes. Here is the correspondence:

     Model Class              Companion View Class
     -----------------------------------------------
     file.File                file_ui.FileUI
     edit.Edit                edit_ui.EditUI
     view.View                view_ui.ViewUI
     help.Help                help_ui.HelpUI
                                                                       
Each of these view classes contains all of the interface components needed for UI access to their companion model's methods and data.

SchedulerUI extends the abstract View class as follows. First, the constructor is sent a Screen and Scheduler model. The screen and model inputs come from the top-level Main function, which calls the SchedulerUI constructor. These inputs are passed up to the parent View constructor, which initializes the inherited screen and model data fields, respectively. The SchedulerUI constructor then creates its own JMenuBar and calls the constructors for each of the component views. These component view constructors in turn call the constructors for their components, and so on until all interface components are constructed.

SchedulerUI specializes the View.compose method to compose its own top-level window with the menubar. SchedulerUI.compose then calls the compose methods for each of its component views, which in turn do their own composition, call their components' compose methods, and so on until all interface components are composed.

Displaywise, all of the subviews are autonomous units that are not controlled by the top-level SchedulerUI. All that this top-level class does is construct and compose the menubar, construct and compose the subviews, and set up the initial display state.

See also the companion model class Scheduler.

Author:
Aaron Rivera
See Also:
Serialized Form

Field Summary
protected  EditUI editUI
          The pulldown Edit menu.
protected  FileUI fileUI
          The pulldown File menu.
protected  HelpUI helpUI
          The pulldown Help menu.
protected  javax.swing.JMenuBar menuBar
          The top-level menu bar.
protected  scheduler.schedule.schedule_ui.ScheduleUI scheduleUI
           
protected  ViewUI viewUI
          The pulldown View menu.
 
Fields inherited from class mvp.View
closeAdapter, editable, model, screen, shown, widget, window
 
Constructor Summary
SchedulerUI(mvp.Screen screen, scheduler.Scheduler scheduler)
          Construct this with the given UI screen and Scheduler model.
 
Method Summary
 java.awt.Component compose()
          Compose this by (1) creating a new window, (2) setting the window's menubar to this' menubar, (3) populating the menubar with the menus, (4) calling compose in turn for each menu, and (5) setting the window title.
protected  java.awt.Component composeHelpSpacing()
          Compose a piece of horizontal glue to be inserted between the options menu and the help menu in the menubar.
protected  void composeMenuBar()
          Compose this' menubar by adding each composed menu to it.
protected  void constructSubviews(SchedulerUI this2)
          Call the constructor for each of the component views.
 mvp.Window getTopLevelWindow()
           
protected  void initialize()
          Configure the initial display based on the tool's option settings.
 
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

menuBar

protected javax.swing.JMenuBar menuBar
The top-level menu bar.


fileUI

protected FileUI fileUI
The pulldown File menu.


editUI

protected EditUI editUI
The pulldown Edit menu.


viewUI

protected ViewUI viewUI
The pulldown View menu.


helpUI

protected HelpUI helpUI
The pulldown Help menu.


scheduleUI

protected scheduler.schedule.schedule_ui.ScheduleUI scheduleUI
Constructor Detail

SchedulerUI

public SchedulerUI(mvp.Screen screen,
                   scheduler.Scheduler scheduler)
Construct this with the given UI screen and Scheduler model. Also construct the pulldown menu subviews and display the initial calendar view(s) based on the tool option settings.

Method Detail

compose

public java.awt.Component compose()
Compose this by (1) creating a new window, (2) setting the window's menubar to this' menubar, (3) populating the menubar with the menus, (4) calling compose in turn for each menu, and (5) setting the window title.

Since this is the top-level window, call setExitOnClose(true) to have a close of this window exit the entire application. This means that the companion model must implement the exit method to do the right thing.

Overrides:
compose in class mvp.View

getTopLevelWindow

public mvp.Window getTopLevelWindow()

constructSubviews

protected void constructSubviews(SchedulerUI this2)
Call the constructor for each of the component views. Pass each constructor its companion model.


composeMenuBar

protected void composeMenuBar()
Compose this' menubar by adding each composed menu to it.


composeHelpSpacing

protected java.awt.Component composeHelpSpacing()
Compose a piece of horizontal glue to be inserted between the options menu and the help menu in the menubar.


initialize

protected void initialize()
Configure the initial display based on the tool's option settings. The standard default is to display a monthly view immediately below the menubar. This standard default can be changed by the user to other display windows, including no windows at all. Details TBD.