From 3bd255a1d21716d350ace504b47277ac9119ea3b Mon Sep 17 00:00:00 2001 From: creme332 <65414576+creme332@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:30:08 +0400 Subject: [PATCH] create canvas console controller --- .../controller/CanvasConsoleController.java | 13 +++++++++++++ .../com/github/creme332/controller/Controller.java | 5 +---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/github/creme332/controller/CanvasConsoleController.java diff --git a/src/main/java/com/github/creme332/controller/CanvasConsoleController.java b/src/main/java/com/github/creme332/controller/CanvasConsoleController.java new file mode 100644 index 00000000..180a3cfa --- /dev/null +++ b/src/main/java/com/github/creme332/controller/CanvasConsoleController.java @@ -0,0 +1,13 @@ +package com.github.creme332.controller; + +import com.github.creme332.model.AppState; +import com.github.creme332.view.CanvasConsole; + +public class CanvasConsoleController { + public CanvasConsoleController(CanvasConsole console, AppState app) { + new ToolBarController(console.getToolbar(), app.getCanvasModel()); + new SideMenuController(app, console.getSidebar()); + new ToastController(app, console.getToast()); + new ZoomPanelController(app.getCanvasModel(), console.getZoomPanel()); + } +} diff --git a/src/main/java/com/github/creme332/controller/Controller.java b/src/main/java/com/github/creme332/controller/Controller.java index f94f4d40..c1462d7c 100644 --- a/src/main/java/com/github/creme332/controller/Controller.java +++ b/src/main/java/com/github/creme332/controller/Controller.java @@ -20,12 +20,9 @@ public Controller() { // create controllers for views new MenuBarController(app, frame.getMyMenuBar()); - new ZoomPanelController(app.getCanvasModel(), frame.getCanvasConsole().getZoomPanel()); new CanvasController(app, frame.getMyCanvas()); new TutorialScreenController(app, frame.getTutorialCenter()); - new ToolBarController(frame.getCanvasConsole().getToolbar(), app.getCanvasModel()); - new SideMenuController(app, frame.getCanvasConsole().getSidebar()); - new ToastController(app, frame.getCanvasConsole().getToast()); + new CanvasConsoleController(frame.getCanvasConsole(), app); // play start animation frameController.playStartAnimation();