From 06192cc71f591e4770883b504fa68c09a8141520 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sun, 8 Feb 2009 17:21:05 -0500 Subject: Added flickering to Selector window --- src/com/fourisland/fourpuzzle/window/Window.java | 33 +++++++++++++++++++----- 1 file 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 @@ package com.fourisland.fourpuzzle.window; +import com.fourisland.fourpuzzle.util.Interval; import com.fourisland.fourpuzzle.util.TransparentPixelFilter; import java.awt.Graphics2D; import java.awt.Image; @@ -20,9 +21,29 @@ import java.awt.image.FilteredImageSource; public enum Window { Default(32), - Selector(64); + Selector(64) + { + Interval in = Interval.createTickInterval(4); + boolean isFlashing = false; + + @Override + protected int getX(SystemArea sa) + { + if (in.isElapsed()) + { + isFlashing = !isFlashing; + } + + if (isFlashing) + { + return (super.getX(sa)+32); + } else { + return super.getX(sa); + } + } + }; - private enum SystemArea + protected enum SystemArea { TOP(15, 0, 1, 9), TOP_RIGHT(24, 0, 8, 9), @@ -52,22 +73,22 @@ public enum Window this.x = x; } - private int getX(SystemArea sa) + protected int getX(SystemArea sa) { return x+sa.x; } - private int getY(SystemArea sa) + protected int getY(SystemArea sa) { return sa.y; } - private int getWidth(SystemArea sa) + protected int getWidth(SystemArea sa) { return sa.width; } - private int getHeight(SystemArea sa) + protected int getHeight(SystemArea sa) { return sa.height; } -- cgit 1.4.1