Java Reference
In-Depth Information
Controller
View
Model
Scheduler
ScheduleCommand
schedule()
reset( )
showParameters(. . .)
ScheduleManager
Problem
setProblem( p : Problem )
reset()
schedule()
ScheduleSheet
addResource( r : Resource)
addTask( t : Task)
getResource(id : int) : Resource
getActivity(t : int, a : int) : Activity
init()
paintComponent()
SchedulePerformance
paintComponent()
ConcreteProblem
init()
Figure 3.7
The model
-
view
-
controller architecture of the scheduling tool
ScheduleCommand scheduleCommand;
SchedulePerformance schedulePerformance;
Problem problem
#
null
;
/**Construct the application*/
public
ScheduleManager(HashMap problemList) {
this
.problemList
#
problemList;
scheduleSheet
#
new
ScheduleSheet(
this
);
scheduleCommand
#
new
ScheduleCommand(
this
);
schedulePerformance
#
new
SchedulePerformance(
this
);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
this
.getContentPane().setLayout(
new
BorderLayout());
this
.setSize(new Dimension(870, 550));
this
.setTitle("The Schedule Manager");
JSplitPane hSplit
#
new
JSplitPane
(JSplitPane.VERTICAL_SPLIT,
scheduleCommand, scheduleSheet);
JSplitPane hSplit2
#
new
JSplitPane
(JSplitPane.VERTICAL_SPLIT,
hSplit, schedulePerformance);
this
.getContentPane().add(hSplit2);
this
.validate();
this
.setVisible(
true
);
}