|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmvp.View
caltool.caltool_ui.CalendarToolUI
public class CalendarToolUI
Class CalendarToolUI is a companion view to the CalendarTool model class. The window component of the CalendarToolUI is a free-floating JMenuBar, containing JMenus for the pulldown command menus.
CalendarToolUI contains an instance of the view classes that are companion to each of the CalendarTool Model classes. Here is the correspondence:
Model Class Companion View Class ----------------------------------------------- file.File file_ui.FileUI edit.Edit edit_ui.EditUI schedule.Schedule schedule_ui.ScheduleUI view.View view_ui.ViewUI admin.Admin admin_ui.AdminUI options.Options options_ui.OptionsUI help.Help help_ui.HelpUIEach of these view classes contains all of the interface components needed for UI access to their companion model's methods and data.
CalendarToolUI extends the abstract View class as follows. First, the constructor is sent a Screen and CalendarTool model. The screen and model inputs come from the top-level Main function, which calls the CalendarToolUI constructor. These inputs are passed up to the parent View constructor, which initializes the inherited screen and model data fields, respectively. The CalendarToolUI 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.
CalendarToolUI specializes the View.compose method to compose its own top-level window with the menubar. CalendarToolUI.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 CalendarToolUI. 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 CalendarTool.
Field Summary | |
---|---|
protected AdminUI |
adminUI
The pulldown Admin menu. |
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 OptionsUI |
optionsUI
The pulldown Options menu. |
protected ScheduleUI |
scheduleUI
The pulldown Schedule menu. |
protected ViewUI |
viewUI
The pulldown View menu. |
Fields inherited from class mvp.View |
---|
closeAdapter, editable, model, screen, shown, widget, window |
Constructor Summary | |
---|---|
CalendarToolUI(mvp.Screen screen,
CalendarTool calTool)
Construct this with the given UI screen and CalendarTool 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 javax.swing.Box |
composeHelpSpacing()
Compose a piece of horizontal spacing 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(CalendarToolUI this2)
Call the constructor for each of the component views. |
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 |
---|
protected javax.swing.JMenuBar menuBar
protected FileUI fileUI
protected EditUI editUI
protected ScheduleUI scheduleUI
protected ViewUI viewUI
protected AdminUI adminUI
protected OptionsUI optionsUI
protected HelpUI helpUI
Constructor Detail |
---|
public CalendarToolUI(mvp.Screen screen, CalendarTool calTool)
Method Detail |
---|
public java.awt.Component compose()
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.
compose
in class mvp.View
protected void constructSubviews(CalendarToolUI this2)
protected void composeMenuBar()
protected javax.swing.Box composeHelpSpacing()
protected void initialize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |