From f3de9d60016abaf89b418256d38c9703877b3c43 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 13 May 2026 11:35:00 +0200 Subject: [PATCH] Minor changes to MVC impementation --- .../idi/idatt2003/g40/mappe/view/ViewElement.java | 14 -------------- .../idi/idatt2003/g40/mappe/view/ViewManager.java | 4 +++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewElement.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewElement.java index a0b0f1c..0463471 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewElement.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewElement.java @@ -113,20 +113,6 @@ protected void setRootPane(final T pane) { rootPane = pane; } - /** - * Getter method for buttons in this view. - * - *

Gotten by the associated {@link ViewController} object that hooks - * the buttons to functionality.

- * - * @return {@link Map} object containing all buttons - * in this view element. - * - */ - public Map getButtons() { - return buttonMap; - } - /** * Method that initializes the layout for the view element. * diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewManager.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewManager.java index 183fb64..51eb63f 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewManager.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/ViewManager.java @@ -4,6 +4,8 @@ import edu.ntnu.idi.idatt2003.g40.mappe.service.event.EventManager; import edu.ntnu.idi.idatt2003.g40.mappe.service.event.EventSubscriber; import edu.ntnu.idi.idatt2003.g40.mappe.service.event.EventType; + +import java.util.EnumMap; import java.util.HashMap; import java.util.Map; import javafx.scene.Scene; @@ -54,7 +56,7 @@ public ViewManager(final Stage stage, final EventManager eventManager) if (stage == null || eventManager == null) { throw new IllegalArgumentException("Invalid ViewManager constructor arguments!"); } else { - viewMap = new HashMap<>(); + viewMap = new EnumMap<>(ViewEnum.class); eventManager.addSubscriber(this, EventType.SCENE_CHANGE); this.stage = stage; }