aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java')
-rw-r--r--src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java b/src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java
deleted file mode 100644
index be16067..0000000
--- a/src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java
+++ /dev/null
@@ -1,40 +0,0 @@
1package fr.umlv.java.wallj.viewer;
2
3import fr.umlv.java.wallj.context.GraphicsContext;
4import fr.umlv.zen5.ApplicationContext;
5import fr.umlv.zen5.ScreenInfo;
6import org.jbox2d.common.Vec2;
7
8import java.awt.Graphics2D;
9import java.util.Objects;
10
11/**
12 * Generates a clean GraphicsContext
13 *
14 * @author Adam NAILI
15 */
16public final class ScreenManager {
17 private final ApplicationContext applicationContext;
18 private final Graphics2D graphics2D;
19
20 /**
21 *
22 * @param applicationContext the current application context
23 * @param graphics2D the current graphics2D
24 */
25 public ScreenManager(ApplicationContext applicationContext, Graphics2D graphics2D) {
26 this.applicationContext = Objects.requireNonNull(applicationContext);
27 this.graphics2D = Objects.requireNonNull(graphics2D);
28 }
29
30 /**
31 *
32 * @return a graphic context
33 */
34 public GraphicsContext clearScreen() {
35 ScreenInfo screenInfo = applicationContext.getScreenInfo();
36 GraphicsContext graphicsContext = new GraphicsContext(graphics2D, screenInfo);
37 graphicsContext.paintRectangle(graphics2D.getBackground(), new Vec2(0, 0), screenInfo.getWidth(), screenInfo.getHeight());
38 return graphicsContext;
39 }
40}