Whitespace

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@880 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2010-02-10 20:32:37 +00:00
parent bb1f61957c
commit fe544b0046
7 changed files with 46 additions and 67 deletions
@@ -36,9 +36,8 @@ import com.threerings.media.util.TimeFunction;
public class BlendAnimation extends Animation
{
/**
* Blends from the starting image through each successive image in the
* specified amount of time (blending between each image takes place
* in <code>delay</code> milliseconds).
* Blends from the starting image through each successive image in the specified amount of
* time (blending between each image takes place in <code>delay</code> milliseconds).
*/
public BlendAnimation (int x, int y, Mirage[] images, int delay)
{
@@ -77,12 +76,10 @@ public class BlendAnimation extends Animation
float alpha = 1f - (_level % 100) / 100f;
Composite ocomp = gfx.getComposite();
gfx.setComposite(AlphaComposite.getInstance(
AlphaComposite.SRC_OVER, alpha));
gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
_images[index].paint(gfx, _bounds.x, _bounds.y);
if (index < _images.length-1) {
gfx.setComposite(AlphaComposite.getInstance(
AlphaComposite.SRC_OVER, 1f-alpha));
gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f-alpha));
_images[index+1].paint(gfx, _bounds.x, _bounds.y);
}
gfx.setComposite(ocomp);
@@ -29,8 +29,8 @@ import com.samskivert.util.RandomUtil;
import com.threerings.media.image.Mirage;
/**
* An animation that bobbles an image around within a specific horizontal
* and vertical pixel range for a given period of time.
* An animation that bobbles an image around within a specific horizontal and vertical pixel range
* for a given period of time.
*/
public class BobbleAnimation extends Animation
{
@@ -44,11 +44,9 @@ public class BobbleAnimation extends Animation
* @param ry the vertical bobble range.
* @param duration the time to animate in milliseconds.
*/
public BobbleAnimation (
Mirage image, int sx, int sy, int rx, int ry, int duration)
public BobbleAnimation (Mirage image, int sx, int sy, int rx, int ry, int duration)
{
super(new Rectangle(sx - rx, sy - ry, image.getWidth() + rx,
image.getHeight() + ry));
super(new Rectangle(sx - rx, sy - ry, image.getWidth() + rx, image.getHeight() + ry));
// save things off
_image = image;
@@ -34,10 +34,9 @@ import com.samskivert.util.StringUtil;
import com.threerings.media.image.Mirage;
/**
* An animation that displays an object exploding into chunks, fading out
* as they fly apart. The animation ends when all chunks have exited the
* animation bounds, or when the given delay time (if any is specified)
* has elapsed.
* An animation that displays an object exploding into chunks, fading out as they fly apart. The
* animation ends when all chunks have exited the animation bounds, or when the given delay time
* (if any is specified) has elapsed.
*/
public class ExplodeAnimation extends Animation
{
@@ -52,8 +51,7 @@ public class ExplodeAnimation extends Animation
/** The number of image chunks on each axis. */
public int xchunk, ychunk;
/** The maximum chunk velocity on each axis in pixels per
* millisecond. */
/** The maximum chunk velocity on each axis in pixels per millisecond. */
public float xvel, yvel;
/** The y-axis chunk acceleration in pixels per millisecond. */
@@ -62,8 +60,8 @@ public class ExplodeAnimation extends Animation
/** The chunk rotational velocity in rotations per millisecond. */
public float rvel;
/** The animation length in milliseconds, or -1 if the animation
* should continue until all pieces are outside the bounds. */
/** The animation length in milliseconds, or -1 if the animation should continue until
* all pieces are outside the bounds. */
public long delay;
@Override
@@ -74,8 +72,8 @@ public class ExplodeAnimation extends Animation
}
/**
* Constructs an explode animation with the chunks represented as
* filled rectangles of the specified color.
* Constructs an explode animation with the chunks represented as filled rectangles of the
* specified color.
*
* @param color the color to render the chunks in.
* @param info the explode info object.
@@ -84,8 +82,7 @@ public class ExplodeAnimation extends Animation
* @param width the width of the object.
* @param height the height of the object.
*/
public ExplodeAnimation (
Color color, ExplodeInfo info, int x, int y, int width, int height)
public ExplodeAnimation (Color color, ExplodeInfo info, int x, int y, int width, int height)
{
super(info.bounds);
@@ -94,8 +91,8 @@ public class ExplodeAnimation extends Animation
}
/**
* Constructs an explode animation with the chunks represented as
* portions of the actual image.
* Constructs an explode animation with the chunks represented as portions of the actual
* image.
*
* @param image the image to animate.
* @param info the explode info object.
@@ -104,8 +101,7 @@ public class ExplodeAnimation extends Animation
* @param width the width of the object.
* @param height the height of the object.
*/
public ExplodeAnimation (
Mirage image, ExplodeInfo info, int x, int y, int width, int height)
public ExplodeAnimation (Mirage image, ExplodeInfo info, int x, int y, int width, int height)
{
super(info.bounds);
@@ -114,8 +110,7 @@ public class ExplodeAnimation extends Animation
}
/**
* Initializes the animation with the attributes of the given explode
* info object.
* Initializes the animation with the attributes of the given explode info object.
*/
protected void init (ExplodeInfo info, int x, int y, int width, int height)
{
@@ -227,8 +222,7 @@ public class ExplodeAnimation extends Animation
if (_info.delay != -1) {
// set the alpha composite to reflect the current fade-out
ocomp = gfx.getComposite();
gfx.setComposite(
AlphaComposite.getInstance(AlphaComposite.SRC_OVER, _alpha));
gfx.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, _alpha));
}
for (int ii = 0; ii < _chunkcount; ii++) {
@@ -303,8 +297,7 @@ public class ExplodeAnimation extends Animation
/** The individual chunk dimensions in pixels. */
protected int _cwid, _chei;
/** The individual chunk dimensions in pixels, halved for handy use in
* repeated calculations. */
/** The individual chunk dimensions in pixels, halved for handy use in repeated calculations. */
protected int _hcwid, _hchei;
/** The total number of image chunks. */
@@ -34,11 +34,9 @@ public class FadeImageAnimation extends FadeAnimation
/**
* Creates an image fading animation.
*/
public FadeImageAnimation (Mirage image, int x, int y,
float alpha, float step, float target)
public FadeImageAnimation (Mirage image, int x, int y, float alpha, float step, float target)
{
super(new Rectangle(x, y, image.getWidth(), image.getHeight()),
alpha, step, target);
super(new Rectangle(x, y, image.getWidth(), image.getHeight()), alpha, step, target);
_image = image;
}
@@ -37,8 +37,7 @@ public class FadeLabelAnimation extends FadeAnimation
/**
* Creates a label fading animation.
*/
public FadeLabelAnimation (Label label, int x, int y,
float alpha, float step, float target)
public FadeLabelAnimation (Label label, int x, int y, float alpha, float step, float target)
{
super(new Rectangle(x, y, 0, 0), alpha, step, target);
_label = label;
@@ -31,8 +31,7 @@ import com.samskivert.swing.Label;
public class FloatingTextAnimation extends Animation
{
/**
* Constructs an animation for the given text centered at the given
* coordinates.
* Constructs an animation for the given text centered at the given coordinates.
*/
public FloatingTextAnimation (Label label, int x, int y)
{
@@ -40,8 +39,8 @@ public class FloatingTextAnimation extends Animation
}
/**
* Constructs an animation for the given text centered at the given
* coordinates. The animation will float up the screen for 30 pixels.
* Constructs an animation for the given text centered at the given coordinates. The animation
* will float up the screen for 30 pixels.
*/
public FloatingTextAnimation (Label label, int x, int y, long floatPeriod)
{
@@ -49,14 +48,13 @@ public class FloatingTextAnimation extends Animation
}
/**
* Constructs an animation for the given text starting at the given
* coordinates and floating toward the specified coordinates.
* Constructs an animation for the given text starting at the given coordinates and floating
* toward the specified coordinates.
*/
public FloatingTextAnimation (Label label, int sx, int sy,
int destx, int desty, long floatPeriod)
public FloatingTextAnimation (
Label label, int sx, int sy, int destx, int desty, long floatPeriod)
{
super(new Rectangle(sx, sy, label.getSize().width,
label.getSize().height));
super(new Rectangle(sx, sy, label.getSize().width, label.getSize().height));
// save things off
_label = label;
@@ -110,9 +108,8 @@ public class FloatingTextAnimation extends Animation
}
/**
* Sets the duration of this score animation to the specified time in
* milliseconds. This should be called before the animation is added
* to the animation manager.
* Sets the duration of this score animation to the specified time in milliseconds. This
* should be called before the animation is added to the animation manager.
*/
public void setFloatPeriod (long floatPeriod)
{
@@ -151,8 +148,7 @@ public class FloatingTextAnimation extends Animation
_x = _startX + (int)(_dx * pctdone);
_y = _startY + (int)(_dy * pctdone);
// only update our location and dirty ourselves if we actually
// moved or our alpha changed
// only update our location and dirty ourselves if we actually moved or our alpha changed
if (ox != _x || oy != _y) {
// dirty our old location
invalidate();
@@ -192,8 +188,8 @@ public class FloatingTextAnimation extends Animation
}
/**
* Derived classes may wish to extend score animation and render more than
* just the standard single label.
* Derived classes may wish to extend score animation and render more than just the standard
* single label.
*
* @param x the upper left coordinate of the animation.
* @param y the upper left coordinate of the animation.
@@ -35,9 +35,8 @@ import com.threerings.media.util.LinearTimeFunction;
import com.threerings.media.util.TimeFunction;
/**
* Washes all non-transparent pixels in a sprite with a particular color
* (by compositing them with the solid color with progressively higher
* alpha values) and then back again.
* Washes all non-transparent pixels in a sprite with a particular color (by compositing them with
* the solid color with progressively higher alpha values) and then back again.
*/
public class GleamAnimation extends Animation
{
@@ -96,8 +95,7 @@ public class GleamAnimation extends Animation
return;
}
// if the sprite is moved or changed size while we're gleaming it,
// track those changes
// if the sprite is moved or changed size while we're gleaming it, track those changes
if (!_bounds.equals(_sprite.getBounds())) {
Rectangle obounds = new Rectangle(_bounds);
_bounds.setBounds(_sprite.getBounds());
@@ -110,7 +108,7 @@ public class GleamAnimation extends Animation
}
}
@Override // documentation inherited
@Override
public void fastForward (long timeDelta)
{
if (_upfunc != null) {
@@ -120,7 +118,7 @@ public class GleamAnimation extends Animation
}
}
@Override // documentation inherited
@Override
public void paint (Graphics2D gfx)
{
// TODO: recreate our off image if the sprite bounds changed; we
@@ -167,7 +165,7 @@ public class GleamAnimation extends Animation
gfx.setComposite(ocomp);
}
@Override // documentation inherited
@Override
protected void willStart (long tickStamp)
{
_upfunc = new LinearTimeFunction(_minAlpha, _maxAlpha, _upmillis);
@@ -182,7 +180,7 @@ public class GleamAnimation extends Animation
}
}
@Override //documentation inherited
@Override
protected void shutdown ()
{
super.shutdown();