diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/fourisland/fourpuzzle/window/Window.java | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/com/fourisland/fourpuzzle/window/Window.java b/src/com/fourisland/fourpuzzle/window/Window.java index fa40cba..582f37e 100644 --- a/src/com/fourisland/fourpuzzle/window/Window.java +++ b/src/com/fourisland/fourpuzzle/window/Window.java | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | package com.fourisland.fourpuzzle.window; | 6 | package com.fourisland.fourpuzzle.window; |
7 | 7 | ||
8 | import com.fourisland.fourpuzzle.util.Interval; | ||
8 | import com.fourisland.fourpuzzle.util.TransparentPixelFilter; | 9 | import com.fourisland.fourpuzzle.util.TransparentPixelFilter; |
9 | import java.awt.Graphics2D; | 10 | import java.awt.Graphics2D; |
10 | import java.awt.Image; | 11 | import java.awt.Image; |
@@ -20,9 +21,29 @@ import java.awt.image.FilteredImageSource; | |||
20 | public enum Window | 21 | public enum Window |
21 | { | 22 | { |
22 | Default(32), | 23 | Default(32), |
23 | Selector(64); | 24 | Selector(64) |
25 | { | ||
26 | Interval in = Interval.createTickInterval(4); | ||
27 | boolean isFlashing = false; | ||
28 | |||
29 | @Override | ||
30 | protected int getX(SystemArea sa) | ||
31 | { | ||
32 | if (in.isElapsed()) | ||
33 | { | ||
34 | isFlashing = !isFlashing; | ||
35 | } | ||
36 | |||
37 | if (isFlashing) | ||
38 | { | ||
39 | return (super.getX(sa)+32); | ||
40 | } else { | ||
41 | return super.getX(sa); | ||
42 | } | ||
43 | } | ||
44 | }; | ||
24 | 45 | ||
25 | private enum SystemArea | 46 | protected enum SystemArea |
26 | { | 47 | { |
27 | TOP(15, 0, 1, 9), | 48 | TOP(15, 0, 1, 9), |
28 | TOP_RIGHT(24, 0, 8, 9), | 49 | TOP_RIGHT(24, 0, 8, 9), |
@@ -52,22 +73,22 @@ public enum Window | |||
52 | this.x = x; | 73 | this.x = x; |
53 | } | 74 | } |
54 | 75 | ||
55 | private int getX(SystemArea sa) | 76 | protected int getX(SystemArea sa) |
56 | { | 77 | { |
57 | return x+sa.x; | 78 | return x+sa.x; |
58 | } | 79 | } |
59 | 80 | ||
60 | private int getY(SystemArea sa) | 81 | protected int getY(SystemArea sa) |
61 | { | 82 | { |
62 | return sa.y; | 83 | return sa.y; |
63 | } | 84 | } |
64 | 85 | ||
65 | private int getWidth(SystemArea sa) | 86 | protected int getWidth(SystemArea sa) |
66 | { | 87 | { |
67 | return sa.width; | 88 | return sa.width; |
68 | } | 89 | } |
69 | 90 | ||
70 | private int getHeight(SystemArea sa) | 91 | protected int getHeight(SystemArea sa) |
71 | { | 92 | { |
72 | return sa.height; | 93 | return sa.height; |
73 | } | 94 | } |