Code hygiene. Not as pedantic as I'd like, but I couldn't resist the huge time

saver that is Eclipse's "Infer generic types" which leaves HashMap and
ArrayList as the declared type where I would normally prefer to change those to
Map and List and use Maps and Lists to instantiate them.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@593 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2008-08-01 15:56:37 +00:00
parent 60622c3590
commit 659f5bc5e2
64 changed files with 393 additions and 388 deletions
@@ -123,7 +123,7 @@ public abstract class Animation extends AbstractMedia
protected boolean _finished = false;
/** Used to dispatch {@link AnimationObserver#animationStarted}. */
protected static class AnimStartedOp implements ObserverList.ObserverOp
protected static class AnimStartedOp implements ObserverList.ObserverOp<Object>
{
public AnimStartedOp (Animation anim, long when) {
_anim = anim;
@@ -140,7 +140,7 @@ public abstract class Animation extends AbstractMedia
}
/** Used to dispatch {@link AnimationObserver#animationCompleted}. */
protected static class AnimCompletedOp implements ObserverList.ObserverOp
protected static class AnimCompletedOp implements ObserverList.ObserverOp<Object>
{
public AnimCompletedOp (Animation anim, long when) {
_anim = anim;
@@ -42,7 +42,8 @@ public class AnimationArranger
public void positionAvoidAnimation (Animation anim, Rectangle viewBounds)
{
Rectangle abounds = new Rectangle(anim.getBounds());
ArrayList avoidables = (ArrayList) _avoidAnims.clone();
@SuppressWarnings("unchecked") ArrayList<Animation> avoidables =
(ArrayList<Animation>) _avoidAnims.clone();
// if we are able to place it somewhere, do so
if (SwingUtil.positionRect(abounds, viewBounds, avoidables)) {
anim.setLocation(abounds.x, abounds.y);
@@ -55,7 +56,7 @@ public class AnimationArranger
}
/** The animations that other animations may wish to avoid. */
protected ArrayList _avoidAnims = new ArrayList();
protected ArrayList<Animation> _avoidAnims = new ArrayList<Animation>();
/** Automatically removes avoid animations when they're done. */
protected AnimationAdapter _avoidAnimObs = new AnimationAdapter() {
@@ -234,7 +234,7 @@ public interface AnimationFrameSequencer extends FrameSequencer
protected Animation _animation;
/** Used to dispatch {@link SequencedAnimationObserver#frameReached}. */
protected static class FrameReachedOp implements ObserverList.ObserverOp
protected static class FrameReachedOp implements ObserverList.ObserverOp<Object>
{
public FrameReachedOp (Animation anim, long when,
int frameIdx, int frameSeq) {
@@ -89,11 +89,11 @@ public class AnimationSequencer extends Animation
if (_queued.size() > 0) {
// if there are queued animations we want the most
// recently queued animation
trigger = (AnimRecord)_queued.get(_queued.size()-1);
trigger = _queued.get(_queued.size()-1);
} else if (_running.size() > 0) {
// otherwise, if there are running animations, we want the
// last one in that list
trigger = (AnimRecord)_running.get(_running.size()-1);
trigger = _running.get(_running.size()-1);
}
// otherwise we have no trigger, we'll just start ASAP
}
@@ -122,7 +122,7 @@ public class AnimationSequencer extends Animation
// add all animations whose time has come
while (_queued.size() > 0) {
AnimRecord arec = (AnimRecord)_queued.get(0);
AnimRecord arec = _queued.get(0);
if (!arec.readyToFire(tickStamp, _lastStamp)) {
// if it's not time to add this animation, all subsequent
// animations must surely wait as well
@@ -284,10 +284,10 @@ public class AnimationSequencer extends Animation
protected AnimationManager _animmgr;
/** Animations that have not been fired. */
protected ArrayList _queued = new ArrayList();
protected ArrayList<AnimRecord> _queued = new ArrayList<AnimRecord>();
/** Animations that are currently running. */
protected ArrayList _running = new ArrayList();
protected ArrayList<AnimRecord> _running = new ArrayList<AnimRecord>();
/** The timestamp at which we fired the last animation. */
protected long _lastStamp;