Mercurial > hg > ristipolku
diff game/IDMButton.java @ 134:4c0dec72e2f0
Whitespace cosmetic cleanup.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 24 Nov 2011 21:51:54 +0200 |
parents | 881deac2daf8 |
children | d6d92845d6a2 |
line wrap: on
line diff
--- a/game/IDMButton.java Thu Nov 24 21:50:41 2011 +0200 +++ b/game/IDMButton.java Thu Nov 24 21:51:54 2011 +0200 @@ -21,7 +21,7 @@ FontMetrics metrics; String text; boolean active; - + public IDMButton(IDMPoint pos, int keyCode, Font font, String text) { super(pos); @@ -35,12 +35,12 @@ state = State.NORMAL; active = false; } - + public IDMButton(float x, float y, int keyCode, Font font, String text) { this(new IDMPoint(x, y), keyCode, font, text); } - + private static void loadImages() { if (imgUp != null && imgPressed != null) @@ -63,7 +63,7 @@ public void scale() { } - + public void paint(Graphics2D g) { BufferedImage img; @@ -82,7 +82,7 @@ if (metrics == null) metrics = g.getFontMetrics(font); - + int textWidth = metrics.stringWidth(text); g.drawImage(img, getScaledX() + xoffs, getScaledY() + yoffs, null); @@ -92,8 +92,8 @@ getScaledX() + xoffs + (getScaledWidth() - textWidth) / 2, getScaledY() + yoffs + getScaledHeight() / 2); } - - + + public boolean mousePressed(MouseEvent e) { state = State.PRESSED;