More import cleanups to go with r662, along with a little bit of foreaching, widening, etc.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@664 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2008-09-26 17:29:23 +00:00
parent b481c48791
commit b473318b12
48 changed files with 235 additions and 231 deletions
@@ -21,10 +21,11 @@
package com.threerings.cast;
import java.awt.Point;
import java.io.Serializable;
import java.awt.Point;
/**
* The action sequence class describes a particular character animation
* sequence. An animation sequence consists of one or more frames of
@@ -21,13 +21,13 @@
package com.threerings.cast;
import java.awt.Point;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.awt.Point;
import com.google.common.collect.Maps;
import com.samskivert.util.LRUHashMap;
@@ -21,7 +21,13 @@
package com.threerings.cast.bundle.tools;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.zip.Deflater;
import java.util.ArrayList;
import java.util.HashMap;
@@ -43,6 +49,8 @@ import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import org.apache.commons.digester.Digester;
@@ -53,31 +53,26 @@ public abstract class AbstractMedia
}
/**
* Called periodically by this media's manager to give it
* a chance to do its thing.
* Called periodically by this media's manager to give it a chance to do its thing.
*
* @param tickStamp a time stamp associated with this tick.
* <em>Note:</em> this is not obtained from a call to {@link
* System#currentTimeMillis} and cannot be compared to timestamps
* @param tickStamp a time stamp associated with this tick. <em>Note:</em> this is not obtained
* from a call to {@link System#currentTimeMillis} and cannot be compared to timestamps
* obtained there from.
*/
public abstract void tick (long tickStamp);
/**
* Called by the appropriate manager to request that the
* media render itself with the given graphics context. The
* media may wish to inspect the clipping region that has been set
* on the graphics context to render itself more efficiently. This
* method will only be called after it has been established that this
* media's bounds intersect the clipping region.
* Called by the appropriate manager to request that the media render itself with the given
* graphics context. The media may wish to inspect the clipping region that has been set on the
* graphics context to render itself more efficiently. This method will only be called after it
* has been established that this media's bounds intersect the clipping region.
*/
public abstract void paint (Graphics2D gfx);
/**
* Called when the appropriate media manager has been paused for some
* length of time and is then unpaused. Media should adjust any time stamps
* that are maintained internally forward by the delta so that time
* maintains the illusion of flowing smoothly forward.
* Called when the appropriate media manager has been paused for some length of time and is
* then unpaused. Media should adjust any time stamps that are maintained internally forward by
* the delta so that time maintains the illusion of flowing smoothly forward.
*/
public void fastForward (long timeDelta)
{
@@ -176,12 +171,10 @@ public abstract class AbstractMedia
}
/**
* Sets the render order associated with this media. Media
* can be rendered in two layers; those with negative render order and
* those with positive render order. In the same layer, they
* will be rendered according to their render order's cardinal value
* (least to greatest). Those with the same render order value will be
* rendered in arbitrary order.
* Sets the render order associated with this media. Media can be rendered in two layers; those
* with negative render order and those with positive render order. In the same layer, they
* will be rendered according to their render order's cardinal value (least to greatest). Those
* with the same render order value will be rendered in arbitrary order.
*
* <p>This method may not be called during a tick.
*
@@ -207,8 +200,7 @@ public abstract class AbstractMedia
}
/**
* Queues the supplied notification up to be dispatched to this
* abstract media's observers.
* Queues the supplied notification up to be dispatched to this abstract media's observers.
*/
public void queueNotification (ObserverList.ObserverOp<Object> amop)
{
@@ -216,15 +208,14 @@ public abstract class AbstractMedia
if (_mgr != null) {
_mgr.queueNotification(_observers, amop);
} else {
log.warning("Have no manager, dropping notification " +
"[media=" + this + ", op=" + amop + "].");
log.warning("Have no manager, dropping notification", "media", this, "op", amop);
}
}
}
/**
* Called by the {@link AbstractMediaManager} when we are in a
* {@link VirtualMediaPanel} that just scrolled.
* Called by the {@link AbstractMediaManager} when we are in a {@link VirtualMediaPanel} that
* just scrolled.
*/
public void viewLocationDidChange (int dx, int dy)
{
@@ -254,24 +245,21 @@ public abstract class AbstractMedia
/**
* Called when the media has had its manager set.
* Derived classes may override this method, but should be sure to
* call <code>super.init()</code>.
* Derived classes may override this method, but should be sure to call
* <code>super.init()</code>.
*/
protected void init ()
{
}
/**
* Prior to the first call to {@link #tick} on an abstract media, this
* method is called by the {@link AbstractMediaManager}. It is called
* during the normal tick cycle, immediately prior to the first call
* to {@link #tick}.
* Prior to the first call to {@link #tick} on an abstract media, this method is called by the
* {@link AbstractMediaManager}. It is called during the normal tick cycle, immediately prior
* to the first call to {@link #tick}.
*
* <p><em>Note:</em> It is imperative that
* <code>super.willStart()</code> is called by any entity that
* overrides this method because the {@link AbstractMediaManager}
* depends on the setting of the {@link #_firstTick} value to know
* whether or not to call this method.
* <p><em>Note:</em> It is imperative that <code>super.willStart()</code> is called by any
* entity that overrides this method because the {@link AbstractMediaManager} depends on the
* setting of the {@link #_firstTick} value to know whether or not to call this method.
*/
protected void willStart (long tickStamp)
{
@@ -279,17 +267,15 @@ public abstract class AbstractMedia
}
/**
* If this media's size or location are changing, it should create a new
* rectangle from its old bounds (new Rectangle(_bounds)), then effect the
* bounds changes and then call this method with the old bounds. This
* method will either merge the new bounds with the old to create a single
* dirty rectangle or dirty them separately depending on which is more
* appropriate. It will also behave properly if this media is not currently
* managed (not being rendered) by NOOPing.
* If this media's size or location are changing, it should create a new rectangle from its old
* bounds (new Rectangle(_bounds)), then effect the bounds changes and then call this method
* with the old bounds. This method will either merge the new bounds with the old to create a
* single dirty rectangle or dirty them separately depending on which is more appropriate. It
* will also behave properly if this media is not currently managed (not being rendered) by
* NOOPing.
*
* <em>Do not</em> pass {@link #_bounds} to this method. The rectangle
* passed in will be modified and then passed on to the region manager
* which will modify it further.
* <em>Do not</em> pass {@link #_bounds} to this method. The rectangle passed in will be
* modified and then passed on to the region manager which will modify it further.
*/
protected void invalidateAfterChange (Rectangle obounds)
{
@@ -23,6 +23,9 @@ package com.threerings.media;
import java.applet.Applet;
import java.util.Iterator;
import java.util.Map;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
@@ -627,7 +627,7 @@ public abstract class FrameManager
}
}
/** Used to effect periodic calls to {@link #tick}. */
/** Used to effect periodic calls to {@link FrameManager#tick}. */
protected class Ticker extends Thread
{
public Ticker ()
@@ -701,7 +701,7 @@ public abstract class FrameManager
_ticking = false;
}
/** Used to invoke the call to {@link #tick} on the AWT event queue thread. */
/** Used to invoke the call to {@link FrameManager#tick} on the AWT event queue thread. */
protected Runnable _awtTicker = new Runnable () {
public void run () {
long elapsed = _timer.getElapsedMillis();
@@ -21,6 +21,8 @@
package com.threerings.media;
import java.util.ArrayList;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
@@ -21,10 +21,10 @@
package com.threerings.media.animation;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.awt.Rectangle;
import com.samskivert.swing.util.SwingUtil;
import static com.threerings.media.Log.log;
@@ -21,11 +21,11 @@
package com.threerings.media.animation;
import java.util.ArrayList;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.util.ArrayList;
import com.samskivert.util.StringUtil;
import static com.threerings.media.Log.log;
@@ -21,7 +21,6 @@
package com.threerings.media.image;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Iterator;
@@ -33,6 +32,8 @@ import java.io.Serializable;
import java.text.ParseException;
import java.awt.Color;
import com.samskivert.util.HashIntMap;
import com.samskivert.util.RandomUtil;
import com.samskivert.util.StringUtil;
@@ -21,6 +21,7 @@
package com.threerings.media.image;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -21,6 +21,9 @@
package com.threerings.media.image;
import java.util.Arrays;
import java.util.Iterator;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Dimension;
@@ -39,9 +42,6 @@ import java.awt.image.IndexColorModel;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
import java.util.Arrays;
import java.util.Iterator;
import com.samskivert.swing.Label;
/**
@@ -24,6 +24,7 @@ package com.threerings.media.sprite;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import com.threerings.media.AbstractMedia;
import com.threerings.media.image.Mirage;
import com.threerings.media.util.MultiFrameImage;
import com.threerings.media.util.SingleFrameImageImpl;
@@ -55,11 +56,10 @@ public class ImageSprite extends Sprite
public static final int TIME_SEQUENTIAL = 3;
/**
* Constructs an image sprite without any associated frames and with
* an invalid default initial location. The sprite should be populated
* with a set of frames used to display it via a subsequent call to
* {@link #setFrames}, and its location updated with {@link
* #setLocation}.
* Constructs an image sprite without any associated frames and with an invalid default initial
* location. The sprite should be populated with a set of frames used to display it via a
* subsequent call to {@link #setFrames}, and its location updated with
* {@link AbstractMedia#setLocation}.
*/
public ImageSprite ()
{
@@ -81,8 +81,7 @@ public class ImageSprite extends Sprite
}
/**
* Constructs an image sprite that will display the supplied single
* image when rendering itself.
* Constructs an image sprite that will display the supplied single image when rendering itself.
*/
public ImageSprite (Mirage image)
{
@@ -94,22 +93,19 @@ public class ImageSprite extends Sprite
{
super.init();
// now that we have our sprite manager, we can lay ourselves out
// and initialize our frames
// now that we have our sprite manager, we can lay ourselves out and initialize our frames
layout();
}
/**
* Returns true if the sprite's bounds contain the specified point,
* and if there is a non-transparent pixel in the sprite's image at
* the specified point, false if not.
* Returns true if the sprite's bounds contain the specified point, and if there is a
* non-transparent pixel in the sprite's image at the specified point, false if not.
*/
@Override
public boolean hitTest (int x, int y)
{
// first check to see that we're in the sprite's bounds and that
// we've got a frame image (if we've got no image, there's nothing
// to be hit)
// first check to see that we're in the sprite's bounds and that we've got a frame image
// (if we've got no image, there's nothing to be hit)
if (!super.hitTest(x, y) || _frames == null) {
return false;
}
@@ -136,9 +132,8 @@ public class ImageSprite extends Sprite
}
/**
* Sets the number of frames per second desired for the sprite
* animation. This is only used when the animation mode is
* <code>TIME_BASED</code>.
* Sets the number of frames per second desired for the sprite animation. This is only used
* when the animation mode is <code>TIME_BASED</code>.
*
* @param fps the desired frames per second.
*/
@@ -163,13 +158,11 @@ public class ImageSprite extends Sprite
public void setFrames (MultiFrameImage frames)
{
if (frames == null) {
// Log.warning("Someone set up us the null frames! " +
// "[sprite=" + this + "].");
// log.warning("Someone set up us the null frames!", "sprite", this);
return;
}
// if these are the same frames we already had, no need to do a
// bunch of pointless business
// if these are the same frames we already had, no need to do a bunch of pointless business
if (frames == _frames) {
return;
}
@@ -181,8 +174,7 @@ public class ImageSprite extends Sprite
}
/**
* Instructs this sprite to lay out its current frame and any
* accoutrements.
* Instructs this sprite to lay out its current frame and any accoutrements.
*/
public void layout ()
{
@@ -224,10 +216,9 @@ public class ImageSprite extends Sprite
}
/**
* Must adjust the bounds to accomodate the our new frame. This
* includes changing the width and height to reflect the size of the
* new frame and also updating the render origin (if necessary) and
* calling {@link #updateRenderOrigin} to reflect those changes in the
* Must adjust the bounds to accommodate the our new frame. This includes changing the width
* and height to reflect the size of the new frame and also updating the render origin (if
* necessary) and calling {@link Sprite#updateRenderOrigin} to reflect those changes in the
* sprite's bounds.
*
* @param frameIdx the index of our new frame.
@@ -266,11 +257,11 @@ public class ImageSprite extends Sprite
if (_frames == null) {
return;
}
int fcount = _frames.getFrameCount();
boolean moved = false;
// move the sprite along toward its destination, if any
// move the sprite along toward its destination, if any
moved = tickPath(timestamp);
// increment the display image if performing image animation
@@ -21,6 +21,7 @@
package com.threerings.media.sprite;
import com.threerings.media.FrameManager;
import com.threerings.media.util.Path;
/**
@@ -42,7 +43,7 @@ public interface PathObserver
* @param sprite the sprite that completed its path.
* @param path the path that was completed.
* @param when the tick stamp of the media tick on which the path was
* completed (see {@link SpriteManager#tick}) (this may not be in the
* completed (see {@link FrameManager#tick}) (this may not be in the
* same time domain as {@link System#currentTimeMillis}).
*/
public void pathCompleted (Sprite sprite, Path path, long when);
@@ -34,20 +34,18 @@ import com.threerings.media.util.Path;
import com.threerings.media.util.Pathable;
/**
* The sprite class represents a single moveable object in an animated
* view. A sprite has a position and orientation within the view, and can
* be moved along a path.
* The sprite class represents a single moveable object in an animated view. A sprite has a
* position and orientation within the view, and can be moved along a path.
*/
public abstract class Sprite extends AbstractMedia
implements DirectionCodes, Pathable
{
/**
* Constructs a sprite with an initially invalid location. Because
* sprite derived classes generally want to get in on the business
* when a sprite's location is set, it is not safe to do so in the
* constructor because their derived methods will be called before
* their constructor has been called. Thus a sprite should be fully
* constructed and <em>then</em> its location should be set.
* Constructs a sprite with an initially invalid location. Because sprite derived classes
* generally want to get in on the business when a sprite's location is set, it is not safe to
* do so in the constructor because their derived methods will be called before their
* constructor has been called. Thus a sprite should be fully constructed and <em>then</em> its
* location should be set.
*/
public Sprite ()
{
@@ -55,12 +53,11 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Constructs a sprite with the supplied dimensions. Because
* sprite derived classes generally want to get in on the business
* when a sprite's location is set, it is not safe to do so in the
* constructor because their derived methods will be called before
* their constructor has been called. Thus a sprite should be fully
* constructed and <em>then</em> its location should be set.
* Constructs a sprite with the supplied dimensions. Because sprite derived classes generally
* want to get in on the business when a sprite's location is set, it is not safe to do so in
* the constructor because their derived methods will be called before their constructor has
* been called. Thus a sprite should be fully constructed and <em>then</em> its location should
* be set.
*/
public Sprite (int width, int height)
{
@@ -68,9 +65,8 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns the sprite's x position in screen coordinates. This is the
* x coordinate of the sprite's origin, not the upper left of its
* bounds.
* Returns the sprite's x position in screen coordinates. This is the x coordinate of the
* sprite's origin, not the upper left of its bounds.
*/
public int getX ()
{
@@ -78,9 +74,8 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns the sprite's y position in screen coordinates. This is the
* y coordinate of the sprite's origin, not the upper left of its
* bounds.
* Returns the sprite's y position in screen coordinates. This is the y coordinate of the
* sprite's origin, not the upper left of its bounds.
*/
public int getY ()
{
@@ -88,8 +83,7 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns the offset to the sprite's origin from the upper-left of
* the sprite's image.
* Returns the offset to the sprite's origin from the upper-left of the sprite's image.
*/
public int getXOffset ()
{
@@ -97,8 +91,7 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns the offset to the sprite's origin from the upper-left of
* the sprite's image.
* Returns the offset to the sprite's origin from the upper-left of the sprite's image.
*/
public int getYOffset ()
{
@@ -122,11 +115,10 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Sprites have an orientation in one of the eight cardinal
* directions: <code>NORTH</code>, <code>NORTHEAST</code>, etc.
* Derived classes can choose to override this member function and
* select a different set of images based on their orientation, or
* they can ignore the orientation information.
* Sprites have an orientation in one of the eight cardinal directions: <code>NORTH</code>,
* <code>NORTHEAST</code>, etc. Derived classes can choose to override this member function and
* select a different set of images based on their orientation, or they can ignore the
* orientation information.
*
* @see DirectionCodes
*/
@@ -136,8 +128,8 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns the sprite's orientation as one of the eight cardinal
* directions: <code>NORTH</code>, <code>NORTHEAST</code>, etc.
* Returns the sprite's orientation as one of the eight cardinal directions:
* <code>NORTH</code>, <code>NORTHEAST</code>, etc.
*
* @see DirectionCodes
*/
@@ -160,8 +152,7 @@ public abstract class Sprite extends AbstractMedia
_ox = x;
_oy = y;
// we need to update our draw position which is based on the size
// of our current bounds
// we need to update our draw position which is based on the size of our current bounds
updateRenderOrigin();
// this method will invalidate our old and new bounds efficiently
@@ -187,8 +178,7 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns true if the sprite's bounds contain the specified point,
* false if not.
* Returns true if the sprite's bounds contain the specified point, false if not.
*/
public boolean contains (int x, int y)
{
@@ -196,8 +186,7 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns true if the sprite's bounds contain the specified point,
* false if not.
* Returns true if the sprite's bounds contain the specified point, false if not.
*/
public boolean hitTest (int x, int y)
{
@@ -205,8 +194,7 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns whether the sprite is inside the given shape in pixel
* coordinates.
* Returns whether the sprite is inside the given shape in pixel coordinates.
*/
public boolean inside (Shape shape)
{
@@ -214,8 +202,7 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns whether the sprite's drawn rectangle intersects the given
* shape in pixel coordinates.
* Returns whether the sprite's drawn rectangle intersects the given shape in pixel coordinates.
*/
public boolean intersects (Shape shape)
{
@@ -223,8 +210,7 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns true if this sprite is currently following a path, false if
* it is not.
* Returns true if this sprite is currently following a path, false if it is not.
*/
public boolean isMoving ()
{
@@ -232,9 +218,9 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Set the sprite's active path and start moving it along its merry
* way. If the sprite is already moving along a previous path the old
* path will be lost and the new path will begin to be traversed.
* Set the sprite's active path and start moving it along its merry way. If the sprite is
* already moving along a previous path the old path will be lost and the new path will begin
* to be traversed.
*
* @param path the path to follow.
*/
@@ -266,8 +252,7 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Returns the path being followed by this sprite or null if the
* sprite is not following a path.
* Returns the path being followed by this sprite or null if the sprite is not following a path.
*/
public Path getPath ()
{
@@ -318,9 +303,8 @@ public abstract class Sprite extends AbstractMedia
_path.init(this, _pathStamp = tickStamp);
}
// it's possible that as a result of init() the path completed and
// removed itself with a call to pathCompleted(), so we have to be
// careful here
// it's possible that as a result of init() the path completed and removed itself with a
// call to pathCompleted(), so we have to be careful here
return (_path == null) ? true : _path.tick(this, tickStamp);
}
@@ -334,8 +318,8 @@ public abstract class Sprite extends AbstractMedia
}
/**
* Update the coordinates at which the sprite image is drawn to
* reflect the sprite's current position.
* Update the coordinates at which the sprite image is drawn to reflect the sprite's current
* position.
*/
protected void updateRenderOrigin ()
{
@@ -21,13 +21,13 @@
package com.threerings.media.tile;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.io.IOException;
import java.io.ObjectInputStream;
import com.samskivert.util.StringUtil;
/**
+2 -1
View File
@@ -21,10 +21,11 @@
package com.threerings.media.tile;
import java.awt.Graphics2D;
import java.util.Arrays;
import java.awt.Graphics2D;
import com.threerings.media.image.Colorization;
import com.threerings.media.image.Mirage;
@@ -21,12 +21,13 @@
package com.threerings.media.tile;
import java.awt.Rectangle;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Serializable;
import java.awt.Rectangle;
import com.samskivert.util.ListUtil;
import com.samskivert.util.StringUtil;
@@ -21,7 +21,7 @@
package com.threerings.media.tile.bundle;
import java.awt.image.BufferedImage;
import java.util.Iterator;
import java.util.Iterator;
@@ -30,6 +30,8 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.awt.image.BufferedImage;
import com.samskivert.util.HashIntMap;
import com.threerings.resource.FastImageIO;
@@ -21,6 +21,11 @@
package com.threerings.media.util;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
import java.awt.Point;
import java.util.ArrayList;
@@ -136,7 +141,7 @@ public class AStarPathUtil
* @return the list of points in the path.
*/
public static List<Point> getPath (
TraversalPred tpred, Stepper stepper, Object trav, int longest,
TraversalPred tpred, Stepper stepper, Object trav, int longest,
int ax, int ay, int bx, int by, boolean partial)
{
Info info = new Info(tpred, trav, longest, bx, by);
@@ -166,7 +171,7 @@ public class AStarPathUtil
if (n.x == bx && n.y == by) {
// construct and return the acceptable path
return getNodePath(n);
} else if (partial) {
float pathdist = MathUtil.distance(n.x, n.y, bx, by);
if (pathdist < bestdist) {
@@ -21,12 +21,12 @@
package com.threerings.media.util;
import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
import java.util.Comparator;
import java.util.TreeSet;
import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
/**
* Display mode related utilities.
*/
@@ -21,11 +21,11 @@
package com.threerings.media.util;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
import java.awt.Graphics2D;
import static com.threerings.media.Log.log;
/**
@@ -21,11 +21,12 @@
package com.threerings.miso.client;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.Comparator;
import java.awt.Graphics2D;
import com.samskivert.util.SortableArrayList;
import com.threerings.media.sprite.Sprite;
@@ -21,6 +21,8 @@
package com.threerings.miso.client;
import java.util.HashMap;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
@@ -29,9 +31,6 @@ import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.geom.AffineTransform;
import java.util.HashMap;
import java.util.Iterator;
import javax.swing.JPanel;
import com.samskivert.util.IntTuple;
@@ -119,8 +118,8 @@ public class ResolutionView extends JPanel
gfx.scale(0.25, 0.25);
// draw our block glyphs
for (Iterator<BlockGlyph> iter = _blocks.values().iterator(); iter.hasNext(); ) {
iter.next().paint(gfx);
for (BlockGlyph blockGlyph : _blocks.values()) {
blockGlyph.paint(gfx);
}
// draw the view bounds
@@ -21,14 +21,15 @@
package com.threerings.miso.client;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
import java.awt.Polygon;
import java.awt.Rectangle;
import com.samskivert.util.ArrayUtil;
import com.samskivert.util.IntMap;
import com.samskivert.util.StringUtil;
@@ -21,6 +21,8 @@
package com.threerings.miso.client;
import java.util.Collection;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
@@ -28,7 +30,6 @@ import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.util.Collection;
import javax.swing.Icon;
import javax.swing.UIManager;
@@ -21,10 +21,11 @@
package com.threerings.miso.client;
import java.awt.Point;
import java.util.List;
import java.awt.Point;
import com.threerings.util.DirectionCodes;
import com.threerings.media.sprite.Sprite;
@@ -21,10 +21,11 @@
package com.threerings.miso.data;
import java.awt.Rectangle;
import java.util.List;
import java.awt.Rectangle;
import com.samskivert.util.ArrayUtil;
import com.samskivert.util.IntListUtil;
import com.samskivert.util.ListUtil;
@@ -21,11 +21,12 @@
package com.threerings.miso.data;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Iterator;
import java.awt.Rectangle;
import com.samskivert.util.ArrayUtil;
import com.samskivert.util.ListUtil;
import com.samskivert.util.StringUtil;
@@ -328,11 +328,11 @@ public class DirectionUtil implements DirectionCodes
/* NNW -> */ NORTHWEST, /* NNE -> */ NORTH,
/* ENE -> */ NORTHEAST, /* ESE -> */ EAST,
/* SSE -> */ SOUTHEAST, /* SSW -> */ SOUTH
};
};
/** Used to map an angle to a fine compass direction. */
protected static final int[] ANGLE_MAP = {
WEST, WESTNORTHWEST, NORTHWEST, NORTHNORTHWEST, NORTH, NORTHNORTHEAST,
NORTHEAST, EASTNORTHEAST, EAST, EASTSOUTHEAST, SOUTHEAST,
SOUTHSOUTHEAST, SOUTH, SOUTHSOUTHWEST, SOUTHWEST, WESTSOUTHWEST };
}
}
@@ -21,6 +21,9 @@
package com.threerings.util;
import java.util.ArrayList;
import java.util.LinkedList;
import java.awt.Component;
import java.awt.KeyEventDispatcher;
import java.awt.KeyboardFocusManager;
@@ -30,9 +33,6 @@ import java.awt.event.KeyListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
import java.util.ArrayList;
import java.util.LinkedList;
import javax.swing.JComboBox;
import javax.swing.JRootPane;
import javax.swing.JTable;
@@ -23,9 +23,8 @@ package com.threerings.cast;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
@@ -34,11 +33,13 @@ import javax.swing.JPanel;
import com.samskivert.swing.util.SwingUtil;
import com.threerings.media.image.ClientImageManager;
import com.threerings.resource.ResourceManager;
import com.threerings.util.DirectionCodes;
import com.threerings.util.DirectionUtil;
import com.threerings.resource.ResourceManager;
import com.threerings.media.image.ClientImageManager;
import com.threerings.cast.bundle.BundledComponentRepository;
/**
@@ -22,13 +22,15 @@
package com.threerings.cast.builder;
import java.io.IOException;
import javax.swing.JFrame;
import com.samskivert.swing.util.SwingUtil;
import com.threerings.media.image.ClientImageManager;
import com.threerings.resource.ResourceManager;
import com.threerings.media.image.ClientImageManager;
import com.threerings.cast.CharacterManager;
import com.threerings.cast.ComponentRepository;
import com.threerings.cast.bundle.BundledComponentRepository;
@@ -21,16 +21,19 @@
package com.threerings.cast.bundle;
import java.awt.Component;
import java.util.Iterator;
import com.threerings.cast.ComponentClass;
import com.threerings.media.image.ClientImageManager;
import com.threerings.resource.ResourceManager;
import java.awt.Component;
import junit.framework.Test;
import junit.framework.TestCase;
import com.threerings.resource.ResourceManager;
import com.threerings.media.image.ClientImageManager;
import com.threerings.cast.ComponentClass;
public class BundledComponentRepositoryTest extends TestCase
{
public BundledComponentRepositoryTest ()
@@ -25,7 +25,6 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
@@ -25,7 +25,6 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
@@ -21,10 +21,13 @@
package com.threerings.media;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.*;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import com.threerings.resource.FastImageIO;
@@ -22,14 +22,18 @@
package com.threerings.media;
import java.awt.BorderLayout;
import javax.swing.*;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.samskivert.swing.HGroupLayout;
import com.samskivert.swing.util.SwingUtil;
import com.threerings.resource.ResourceManager;
import com.threerings.media.image.ClientImageManager;
import com.threerings.media.tile.TileManager;
import com.threerings.resource.ResourceManager;
/**
* Does something extraordinary.
@@ -21,16 +21,18 @@
package com.threerings.media.tile.bundle;
import java.awt.Component;
import java.util.Iterator;
import com.threerings.media.image.ClientImageManager;
import com.threerings.media.tile.TileSet;
import com.threerings.resource.ResourceManager;
import java.awt.Component;
import junit.framework.Test;
import junit.framework.TestCase;
import com.threerings.resource.ResourceManager;
import com.threerings.media.image.ClientImageManager;
import com.threerings.media.tile.TileSet;
public class BundledTileSetRepositoryTest extends TestCase
{
public BundledTileSetRepositoryTest ()
@@ -21,9 +21,10 @@
package com.threerings.media.tile.bundle.tools;
import java.util.HashMap;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import com.samskivert.io.PersistenceException;
import com.samskivert.test.TestUtil;
@@ -21,15 +21,16 @@
package com.threerings.media.tile.tools.xml;
import java.io.IOException;
import java.util.Iterator;
import java.util.HashMap;
import java.util.Iterator;
import com.threerings.media.tile.TileSet;
import java.io.IOException;
import junit.framework.Test;
import junit.framework.TestCase;
import com.threerings.media.tile.TileSet;
public class XMLTileSetParserTest extends TestCase
{
public XMLTileSetParserTest ()
@@ -26,12 +26,12 @@ import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import javax.swing.JFrame;
import com.threerings.media.FrameManager;
import com.threerings.media.ManagedJFrame;
import com.threerings.media.MediaPanel;
import com.threerings.media.sprite.Sprite;
/**
@@ -21,15 +21,14 @@
package com.threerings.media.util;
import java.io.File;
import java.io.IOException;
import java.awt.Color;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
@@ -21,11 +21,11 @@
package com.threerings.miso.client;
import java.awt.Rectangle;
import java.util.Iterator;
import java.util.Random;
import java.awt.Rectangle;
import com.samskivert.io.PersistenceException;
import com.threerings.media.tile.NoSuchTileSetException;
@@ -33,11 +33,11 @@ import com.threerings.media.tile.TileSet;
import com.threerings.media.tile.TileSetRepository;
import com.threerings.miso.data.MisoSceneModel;
import com.threerings.miso.data.ObjectInfo;
import com.threerings.miso.tile.BaseTile;
import com.threerings.miso.tile.BaseTileSet;
import com.threerings.miso.util.MisoContext;
import com.threerings.miso.util.ObjectSet;
import com.threerings.miso.data.ObjectInfo;
/**
* Provides an infinite array of tiles in which to scroll.
@@ -21,27 +21,30 @@
package com.threerings.miso.client;
import java.io.IOException;
import java.awt.DisplayMode;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.io.IOException;
import com.samskivert.util.Config;
import com.samskivert.swing.util.SwingUtil;
import com.samskivert.util.Config;
import com.threerings.resource.ResourceManager;
import com.threerings.media.FrameManager;
import com.threerings.media.image.ClientImageManager;
import com.threerings.media.sprite.PathAdapter;
import com.threerings.media.sprite.Sprite;
import com.threerings.media.tile.bundle.BundledTileSetRepository;
import com.threerings.media.util.LinePath;
import com.threerings.media.util.Path;
import com.threerings.media.sprite.PathAdapter;
import com.threerings.media.sprite.Sprite;
import com.threerings.media.tile.bundle.BundledTileSetRepository;
import com.threerings.miso.MisoConfig;
import com.threerings.miso.tile.MisoTileManager;
import com.threerings.miso.util.MisoContext;
import com.threerings.cast.CharacterComponent;
import com.threerings.cast.CharacterDescriptor;
@@ -50,10 +53,6 @@ import com.threerings.cast.CharacterSprite;
import com.threerings.cast.NoSuchComponentException;
import com.threerings.cast.bundle.BundledComponentRepository;
import com.threerings.miso.MisoConfig;
import com.threerings.miso.tile.MisoTileManager;
import com.threerings.miso.util.MisoContext;
import static com.threerings.miso.Log.log;
/**
@@ -21,11 +21,12 @@
package com.threerings.miso.viewer;
import java.io.IOException;
import java.awt.DisplayMode;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.io.IOException;
import com.samskivert.swing.util.SwingUtil;
@@ -35,14 +36,14 @@ import com.threerings.media.FrameManager;
import com.threerings.media.image.ClientImageManager;
import com.threerings.media.tile.bundle.BundledTileSetRepository;
import com.threerings.cast.CharacterManager;
import com.threerings.cast.bundle.BundledComponentRepository;
import com.threerings.miso.data.SimpleMisoSceneModel;
import com.threerings.miso.tile.MisoTileManager;
import com.threerings.miso.tools.xml.SimpleMisoSceneParser;
import com.threerings.miso.util.MisoContext;
import com.threerings.cast.CharacterManager;
import com.threerings.cast.bundle.BundledComponentRepository;
import static com.threerings.miso.Log.log;
/**
@@ -27,17 +27,10 @@ import java.awt.event.MouseEvent;
import com.samskivert.util.RandomUtil;
import com.threerings.cast.CharacterDescriptor;
import com.threerings.cast.CharacterManager;
import com.threerings.cast.CharacterSprite;
import com.threerings.cast.ComponentRepository;
import com.threerings.cast.util.CastUtil;
import com.threerings.media.sprite.PathObserver;
import com.threerings.media.sprite.Sprite;
import com.threerings.media.sprite.SpriteManager;
import com.threerings.media.util.LineSegmentPath;
import com.threerings.media.util.Path;
import com.threerings.media.util.PerformanceMonitor;
import com.threerings.media.util.PerformanceObserver;
@@ -47,6 +40,12 @@ import com.threerings.miso.client.MisoScenePanel;
import com.threerings.miso.data.MisoSceneModel;
import com.threerings.miso.util.MisoContext;
import com.threerings.cast.CharacterDescriptor;
import com.threerings.cast.CharacterManager;
import com.threerings.cast.CharacterSprite;
import com.threerings.cast.ComponentRepository;
import com.threerings.cast.util.CastUtil;
import static com.threerings.miso.Log.log;
public class ViewerSceneViewPanel extends MisoScenePanel
@@ -25,7 +25,6 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;