-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from Vasheel/zoom-panel
Implementation of zoom panel
- Loading branch information
Showing
7 changed files
with
68 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
src/main/java/com/github/creme332/controller/ZoomPanelController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
package com.github.creme332.controller; | ||
|
||
import com.github.creme332.model.AppState; | ||
import com.github.creme332.model.CanvasModel; | ||
import com.github.creme332.view.ZoomPanel; | ||
|
||
/** | ||
* Controller for ZoomPanel in CanvasConsole. | ||
*/ | ||
public class ZoomPanelController { | ||
CanvasModel model; | ||
CanvasModel canvasModel; | ||
ZoomPanel view; | ||
|
||
public ZoomPanelController(CanvasModel model, ZoomPanel view) { | ||
this.model = model; | ||
public ZoomPanelController(AppState appState, ZoomPanel view) { | ||
this.canvasModel = appState.getCanvasModel(); | ||
this.view = view; | ||
|
||
// Add action listeners for the zoom panel buttons | ||
view.getHomeButton().addActionListener(e -> model.resetZoom()); | ||
view.getZoomInButton().addActionListener(e -> model.updateCanvasZoom(true)); | ||
view.getZoomOutButton().addActionListener(e -> model.updateCanvasZoom(false)); | ||
view.getHomeButton().addActionListener(e -> canvasModel.resetZoom()); | ||
view.getZoomInButton().addActionListener(e -> canvasModel.updateCanvasZoom(true)); | ||
view.getZoomOutButton().addActionListener(e -> canvasModel.updateCanvasZoom(false)); | ||
view.getFullScreenButton().addActionListener(e -> appState.setMaximizeFrame(!appState.isMaximizeFrame())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters