diff options
| author | Starla Insigna <hatkirby@fourisland.com> | 2009-02-08 17:21:05 -0500 |
|---|---|---|
| committer | Starla Insigna <hatkirby@fourisland.com> | 2009-02-08 17:21:05 -0500 |
| commit | 06192cc71f591e4770883b504fa68c09a8141520 (patch) | |
| tree | 267d3a811ff139fede7d18a721132e8d75fc2481 | |
| parent | 50928c2d12bf145711df877bb86aadfb1306860b (diff) | |
| download | fourpuzzle-06192cc71f591e4770883b504fa68c09a8141520.tar.gz fourpuzzle-06192cc71f591e4770883b504fa68c09a8141520.tar.bz2 fourpuzzle-06192cc71f591e4770883b504fa68c09a8141520.zip | |
Added flickering to Selector window
| -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 | } |
