diff options
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.java | 40 |
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 @@ | |||
1 | package fr.umlv.java.wallj.viewer; | ||
2 | |||
3 | import fr.umlv.java.wallj.context.GraphicsContext; | ||
4 | import fr.umlv.zen5.ApplicationContext; | ||
5 | import fr.umlv.zen5.ScreenInfo; | ||
6 | import org.jbox2d.common.Vec2; | ||
7 | |||
8 | import java.awt.Graphics2D; | ||
9 | import java.util.Objects; | ||
10 | |||
11 | /** | ||
12 | * Generates a clean GraphicsContext | ||
13 | * | ||
14 | * @author Adam NAILI | ||
15 | */ | ||
16 | public 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 | } | ||