-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added swing based visual cue for lower latency
- Loading branch information
1 parent
f8716e3
commit ac563c9
Showing
5 changed files
with
57 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package stringflow.cheatontimer; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class TimerPanel extends JPanel { | ||
|
||
private static final Color BLACK = new Color(0, false); | ||
private static final Color BLANK = new Color(0, true); | ||
|
||
private boolean visualCue; | ||
|
||
public TimerPanel() { | ||
visualCue = false; | ||
repaint(); | ||
} | ||
|
||
public void paint(Graphics g) { | ||
super.paint(g); | ||
g.setColor(visualCue ? BLACK : BLANK); | ||
g.fillRect(0, 0, 150, 150); | ||
} | ||
|
||
public void setVisualCue(boolean value) { | ||
visualCue = value; | ||
} | ||
|
||
public void toggleVisualCue() { | ||
visualCue = !visualCue; | ||
} | ||
} |