From 3307994221e86eccebb1b09c0b8115d108fbcfb3 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 24 Jan 2007 19:32:48 +0000 Subject: [PATCH] Our host need not be a MediaPanel, but we'll preserve the MediaPanel signature because no doubt much code exists in the wild that is compiled against that signature. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@154 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../parlor/media/ScoreAnimation.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/java/com/threerings/parlor/media/ScoreAnimation.java b/src/java/com/threerings/parlor/media/ScoreAnimation.java index 1bb79e86..cb6d2169 100644 --- a/src/java/com/threerings/parlor/media/ScoreAnimation.java +++ b/src/java/com/threerings/parlor/media/ScoreAnimation.java @@ -22,6 +22,7 @@ package com.threerings.parlor.media; import java.awt.Color; +import java.awt.Component; import java.awt.Font; import com.samskivert.swing.Label; @@ -36,8 +37,7 @@ public class ScoreAnimation extends FloatingTextAnimation } /** - * Constructs a score animation for the given score value centered at - * the given coordinates. + * Constructs a score animation for the given score value centered at the given coordinates. */ public ScoreAnimation (Label label, int x, int y) { @@ -45,9 +45,8 @@ public class ScoreAnimation extends FloatingTextAnimation } /** - * Constructs a score animation for the given score value centered at - * the given coordinates. The animation will float up the screen for - * 30 pixels. + * Constructs a score animation for the given score value centered at the given + * coordinates. The animation will float up the screen for 30 pixels. */ public ScoreAnimation (Label label, int x, int y, long floatPeriod) { @@ -55,22 +54,26 @@ public class ScoreAnimation extends FloatingTextAnimation } /** - * Constructs a score animation for the given score value starting at - * the given coordinates and floating toward the specified - * coordinates. + * Constructs a score animation for the given score value starting at the given coordinates and + * floating toward the specified coordinates. */ - public ScoreAnimation (Label label, int sx, int sy, - int destx, int desty, long floatPeriod) + public ScoreAnimation (Label label, int sx, int sy, int destx, int desty, long floatPeriod) { super(label, sx, sy, destx, desty, floatPeriod); } /** - * Create and configure a Label suitable for a ScoreAnimation with - * all the most common options. + * Create and configure a Label suitable for a ScoreAnimation with all the most common options. */ - public static Label createLabel (String score, Color c, Font font, - MediaPanel host) + public static Label createLabel (String score, Color c, Font font, MediaPanel host) + { + return createLabel(score, c, font, host); + } + + /** + * Create and configure a Label suitable for a ScoreAnimation with all the most common options. + */ + public static Label createLabel (String score, Color c, Font font, Component host) { Label label = new Label(score); label.setTargetWidth(host.getWidth()); @@ -80,7 +83,6 @@ public class ScoreAnimation extends FloatingTextAnimation label.setFont(font); label.setAlignment(Label.CENTER); label.layout(host); - return label; } }