aboutsummaryrefslogtreecommitdiff
path: root/Week14 Route 66/src/com/camilstaps/route66/Route66.java
diff options
context:
space:
mode:
Diffstat (limited to 'Week14 Route 66/src/com/camilstaps/route66/Route66.java')
-rw-r--r--Week14 Route 66/src/com/camilstaps/route66/Route66.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/Week14 Route 66/src/com/camilstaps/route66/Route66.java b/Week14 Route 66/src/com/camilstaps/route66/Route66.java
new file mode 100644
index 0000000..8f9a2e9
--- /dev/null
+++ b/Week14 Route 66/src/com/camilstaps/route66/Route66.java
@@ -0,0 +1,44 @@
+package com.camilstaps.route66;
+
+/**
+ * OO1route66 initial class
+ *
+ * Route66 class constructs model, view and controller
+ *
+ * @author Pieter Koopman
+ */
+public class Route66
+{
+ Controller controller;
+ /**
+ * the main method for OO13route66
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ Route66 r66 = new Route66();
+ }
+
+ /**
+ * the main constructor:
+ * - creates model, controller and views
+ */
+ public Route66() {
+ Model model = new Model();
+
+ RoadView rview = new RoadView(model);
+ TableView tview = new TableView(model);
+ model.addView(tview);
+ model.addView(rview);
+
+ controller = new Controller(model);
+
+ KeyHandler keyHandler = new KeyHandler(controller);
+ rview.addKeyListener(keyHandler);
+ tview.addKeyListener(keyHandler);
+
+ tview.setVisible(true);
+ rview.setVisible(true);
+
+ controller.run();
+ }
+}