diff --git a/src/java/com/threerings/jme/JmeApp.java b/src/java/com/threerings/jme/JmeApp.java index 4fd3ef84..7643c65e 100644 --- a/src/java/com/threerings/jme/JmeApp.java +++ b/src/java/com/threerings/jme/JmeApp.java @@ -45,7 +45,6 @@ import com.jme.system.lwjgl.LWJGLPropertiesDialog; import com.jme.input.InputHandler; import com.jme.input.KeyInput; -import com.jme.input.Mouse; import com.jme.input.MouseInput; import com.jmex.bui.BRootNode; import com.jmex.bui.PolledRootNode; @@ -203,7 +202,7 @@ public class JmeApp // and process events until it's time to render the next PROCESS_EVENTS: do { - Runnable r = (Runnable)_evqueue.getNonBlocking(); + Runnable r = _evqueue.getNonBlocking(); if (r != null) { r.run(); } @@ -574,7 +573,7 @@ public class JmeApp protected Timer _timer; protected Thread _dispatchThread; - protected Queue _evqueue = new Queue(); + protected Queue _evqueue = Queue.newQueue(); protected long _lastTick; protected float _frameTime; diff --git a/src/java/com/threerings/jme/JmeCanvasApp.java b/src/java/com/threerings/jme/JmeCanvasApp.java index e41f2837..a6164bd1 100644 --- a/src/java/com/threerings/jme/JmeCanvasApp.java +++ b/src/java/com/threerings/jme/JmeCanvasApp.java @@ -30,7 +30,6 @@ import java.awt.event.ComponentEvent; import org.lwjgl.LWJGLException; -import com.jme.renderer.Renderer; import com.jme.renderer.lwjgl.LWJGLRenderer; import com.jme.scene.Node; import com.jme.system.DisplaySystem; diff --git a/src/java/com/threerings/jme/camera/CameraHandler.java b/src/java/com/threerings/jme/camera/CameraHandler.java index f2b05dca..6bba2db4 100644 --- a/src/java/com/threerings/jme/camera/CameraHandler.java +++ b/src/java/com/threerings/jme/camera/CameraHandler.java @@ -28,6 +28,7 @@ import com.jme.math.Vector3f; import com.jme.renderer.Camera; import com.samskivert.util.ObserverList; +import com.threerings.jme.JmeApp; /** * Provides various useful mechanisms for manipulating the camera. @@ -376,21 +377,20 @@ public class CameraHandler } /** Used to dispatch {@link CameraPath.Observer#pathCompleted}. */ - protected static class CompletedOp implements ObserverList.ObserverOp + protected static class CompletedOp implements ObserverList.ObserverOp { public CompletedOp (CameraPath path) { _path = path; } - public boolean apply (Object observer) { - return ((CameraPath.Observer)observer).pathCompleted(_path); + public boolean apply (CameraPath.Observer observer) { + return observer.pathCompleted(_path); } protected CameraPath _path; } protected Camera _camera; protected CameraPath _campath; - protected ObserverList _campathobs = - new ObserverList(ObserverList.SAFE_IN_ORDER_NOTIFY); + protected ObserverList _campathobs = ObserverList.newSafeInOrder(); protected Matrix3f _rotm = new Matrix3f(); protected Vector3f _temp = new Vector3f(); diff --git a/src/java/com/threerings/jme/camera/CameraPath.java b/src/java/com/threerings/jme/camera/CameraPath.java index d2a58850..7939f9c1 100644 --- a/src/java/com/threerings/jme/camera/CameraPath.java +++ b/src/java/com/threerings/jme/camera/CameraPath.java @@ -21,8 +21,6 @@ package com.threerings.jme.camera; -import com.jme.renderer.Camera; - /** * Used to move the camera along a particular path. */ diff --git a/src/java/com/threerings/jme/camera/GodViewHandler.java b/src/java/com/threerings/jme/camera/GodViewHandler.java index 73929042..baccdc8c 100644 --- a/src/java/com/threerings/jme/camera/GodViewHandler.java +++ b/src/java/com/threerings/jme/camera/GodViewHandler.java @@ -22,21 +22,13 @@ package com.threerings.jme.camera; import com.jme.math.FastMath; -import com.jme.math.Matrix3f; -import com.jme.math.Vector3f; -import com.jme.renderer.Camera; import com.jme.input.InputHandler; import com.jme.input.KeyBindingManager; import com.jme.input.KeyInput; -import com.jme.input.RelativeMouse; import com.jme.input.action.*; import com.jme.input.action.InputActionEvent; -import com.threerings.jme.JmeApp; - -import static com.threerings.jme.Log.log; - /** * Sets up camera controls for moving around from a top-down perspective, * suitable for strategy games and their ilk. The "ground" is assumed to be the @@ -47,7 +39,7 @@ public class GodViewHandler extends InputHandler /** * Creates the handler. * - * @param cam The camera to move with this handler. + * @param camhand The camera to move with this handler. */ public GodViewHandler (CameraHandler camhand) { diff --git a/src/java/com/threerings/jme/camera/SplinePath.java b/src/java/com/threerings/jme/camera/SplinePath.java index 2a21c7e2..3dd36a99 100644 --- a/src/java/com/threerings/jme/camera/SplinePath.java +++ b/src/java/com/threerings/jme/camera/SplinePath.java @@ -24,8 +24,6 @@ package com.threerings.jme.camera; import com.jme.math.Vector3f; import com.jme.renderer.Camera; -import static com.threerings.jme.Log.log; - /** * Moves the camera along a cubic Hermite spline path defined by the start and * end locations and directions. Spline formulas obtained from diff --git a/src/java/com/threerings/jme/camera/SwingPath.java b/src/java/com/threerings/jme/camera/SwingPath.java index 9dd018f2..00b5ad37 100644 --- a/src/java/com/threerings/jme/camera/SwingPath.java +++ b/src/java/com/threerings/jme/camera/SwingPath.java @@ -24,7 +24,6 @@ package com.threerings.jme.camera; import com.jme.math.FastMath; import com.jme.math.Quaternion; import com.jme.math.Vector3f; -import com.jme.renderer.Camera; import static com.threerings.jme.Log.log; diff --git a/src/java/com/threerings/jme/chat/ChatView.java b/src/java/com/threerings/jme/chat/ChatView.java index 63408044..be0705c0 100644 --- a/src/java/com/threerings/jme/chat/ChatView.java +++ b/src/java/com/threerings/jme/chat/ChatView.java @@ -21,8 +21,6 @@ package com.threerings.jme.chat; -import java.util.StringTokenizer; - import com.jme.renderer.ColorRGBA; import com.jmex.bui.BButton; @@ -34,8 +32,6 @@ import com.jmex.bui.event.ActionListener; import com.jmex.bui.layout.BorderLayout; import com.jmex.bui.layout.GroupLayout; -import com.threerings.util.Name; - import com.threerings.crowd.chat.client.ChatDirector; import com.threerings.crowd.chat.client.ChatDisplay; import com.threerings.crowd.chat.client.SpeakService; diff --git a/src/java/com/threerings/jme/effect/FadeInOutEffect.java b/src/java/com/threerings/jme/effect/FadeInOutEffect.java index 21445887..e76fd27a 100644 --- a/src/java/com/threerings/jme/effect/FadeInOutEffect.java +++ b/src/java/com/threerings/jme/effect/FadeInOutEffect.java @@ -24,7 +24,6 @@ package com.threerings.jme.effect; import com.jme.math.Vector3f; import com.jme.renderer.ColorRGBA; import com.jme.renderer.Renderer; -import com.jme.scene.Geometry; import com.jme.scene.Node; import com.jme.scene.shape.Quad; import com.jme.scene.state.AlphaState; diff --git a/src/java/com/threerings/jme/model/BillboardController.java b/src/java/com/threerings/jme/model/BillboardController.java index 0d199ede..a03822e7 100644 --- a/src/java/com/threerings/jme/model/BillboardController.java +++ b/src/java/com/threerings/jme/model/BillboardController.java @@ -37,9 +37,6 @@ import com.jme.util.export.JMEImporter; import com.jme.util.export.InputCapsule; import com.jme.util.export.OutputCapsule; -import com.threerings.jme.sprite.PathUtil; -import com.threerings.jme.util.JmeUtil; - /** * Orients its target towards the camera plane. */ diff --git a/src/java/com/threerings/jme/model/Model.java b/src/java/com/threerings/jme/model/Model.java index 7be8e943..eb1cedcd 100644 --- a/src/java/com/threerings/jme/model/Model.java +++ b/src/java/com/threerings/jme/model/Model.java @@ -25,21 +25,19 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; import java.nio.FloatBuffer; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Properties; +import com.google.common.collect.Maps; + import com.jme.bounding.BoundingVolume; -import com.jme.math.FastMath; import com.jme.math.Quaternion; import com.jme.math.Vector3f; import com.jme.renderer.Camera; @@ -140,7 +138,7 @@ public class Model extends ModelNode * * @param pnodes a mapping from prototype nodes to instance nodes */ - public Animation rebind (HashMap pnodes) + public Animation rebind (Map pnodes) { Animation anim = new Animation(); anim.frameRate = frameRate; @@ -176,7 +174,7 @@ public class Model extends ModelNode } // documentation inherited - public Class getClassTag () + public Class getClassTag () { return getClass(); } @@ -224,7 +222,7 @@ public class Model extends ModelNode capsule.write(pxforms, "transforms", null); } - protected Spatial[] rebind (Spatial[] targets, HashMap pnodes) + protected Spatial[] rebind (Spatial[] targets, Map pnodes) { Spatial[] ntargets = new Spatial[targets.length]; for (int ii = 0; ii < targets.length; ii++) { @@ -312,7 +310,7 @@ public class Model extends ModelNode public int random; /** Maps original objects to their copies. */ - public HashMap originalToCopy = new HashMap(); + public Map originalToCopy = Maps.newHashMap(); public CloneCreator (Model toCopy) { @@ -736,8 +734,7 @@ public class Model extends ModelNode } else { _anims = null; } - ArrayList controllers = capsule.readSavableArrayList( - "controllers", null); + List controllers = capsule.readSavableArrayList("controllers", null); if (controllers != null) { for (Object ctrl : controllers) { addController((Controller)ctrl); @@ -877,7 +874,7 @@ public class Model extends ModelNode if (_anims != null) { mstore._anims = new HashMap(); } - mstore._pnodes = (HashMap)properties.originalToCopy.clone(); + mstore._pnodes = Maps.newHashMap(properties.originalToCopy); mstore._animMode = _animMode; return mstore; } @@ -1076,20 +1073,17 @@ public class Model extends ModelNode } } - /** A reference to the prototype, or null if this is a - * prototype. */ + /** A reference to the prototype, or null if this is a prototype. */ protected Model _prototype; - /** For prototype models, a customized clone creator used to generate - * instances. */ + /** For prototype models, a customized clone creator used to generate instances. */ protected CloneCreator _ccreator; /** The animation mode to use for this model. */ protected AnimationMode _animMode; - /** For instances, maps prototype nodes to their corresponding instance - * nodes. */ - protected HashMap _pnodes; + /** For instances, maps prototype nodes to their corresponding instance nodes. */ + protected Map _pnodes; /** The model properties. */ protected Properties _props; diff --git a/src/java/com/threerings/jme/model/ModelController.java b/src/java/com/threerings/jme/model/ModelController.java index 1d0d5cf6..c9221217 100644 --- a/src/java/com/threerings/jme/model/ModelController.java +++ b/src/java/com/threerings/jme/model/ModelController.java @@ -28,7 +28,6 @@ import java.util.HashSet; import java.util.Properties; import com.jme.scene.Controller; -import com.jme.scene.Node; import com.jme.scene.Spatial; import com.jme.util.export.JMEExporter; import com.jme.util.export.JMEImporter; diff --git a/src/java/com/threerings/jme/model/ModelMesh.java b/src/java/com/threerings/jme/model/ModelMesh.java index 4bc43401..c0532d74 100644 --- a/src/java/com/threerings/jme/model/ModelMesh.java +++ b/src/java/com/threerings/jme/model/ModelMesh.java @@ -22,14 +22,10 @@ package com.threerings.jme.model; import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; - import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.util.ArrayList; -import java.util.Arrays; import java.util.Properties; import com.jme.bounding.BoundingBox; @@ -42,8 +38,6 @@ import com.jme.math.Quaternion; import com.jme.math.Vector3f; import com.jme.renderer.ColorRGBA; import com.jme.renderer.Renderer; -import com.jme.scene.Controller; -import com.jme.scene.SharedMesh; import com.jme.scene.Spatial; import com.jme.scene.TriMesh; import com.jme.scene.VBOInfo; @@ -68,8 +62,6 @@ import com.samskivert.util.StringUtil; import com.threerings.jme.util.ShaderCache; -import static com.threerings.jme.Log.log; - /** * A {@link TriMesh} with a serialization mechanism tailored to stored models. */ diff --git a/src/java/com/threerings/jme/model/ModelNode.java b/src/java/com/threerings/jme/model/ModelNode.java index 12362341..8c02a1af 100644 --- a/src/java/com/threerings/jme/model/ModelNode.java +++ b/src/java/com/threerings/jme/model/ModelNode.java @@ -21,17 +21,15 @@ package com.threerings.jme.model; -import java.io.DataOutput; import java.io.IOException; -import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import com.jme.math.Matrix4f; import com.jme.math.Quaternion; import com.jme.math.Vector3f; import com.jme.renderer.Renderer; -import com.jme.scene.Controller; import com.jme.scene.Node; import com.jme.scene.Spatial; import com.jme.scene.state.RenderState; @@ -43,8 +41,6 @@ import com.jme.util.export.OutputCapsule; import com.threerings.jme.util.JmeUtil; import com.threerings.jme.util.ShaderCache; -import static com.threerings.jme.Log.log; - /** * A {@link Node} with a serialization mechanism tailored to stored models. */ @@ -194,7 +190,7 @@ public class ModelNode extends Node "localRotation", null)); setLocalScale((Vector3f)capsule.readSavable( "localScale", null)); - ArrayList children = capsule.readSavableArrayList("children", null); + List children = capsule.readSavableArrayList("children", null); if (children != null) { for (Object child : children) { attachChild((Spatial)child); diff --git a/src/java/com/threerings/jme/model/ModelSpatial.java b/src/java/com/threerings/jme/model/ModelSpatial.java index a56c1244..7829f756 100644 --- a/src/java/com/threerings/jme/model/ModelSpatial.java +++ b/src/java/com/threerings/jme/model/ModelSpatial.java @@ -70,8 +70,7 @@ public interface ModelSpatial * @param frameId the frame id, which uniquely identifies one frame of * one animation * @param blend whether or not the stored frames will be retrieved by - * calls to {@link #blendAnimationFrames} as opposed to - * {@link #setAnimationFrames} + * calls to {@link #blendMeshFrames} as opposed to {@link #setMeshFrame} */ public void storeMeshFrame (int frameId, boolean blend); diff --git a/src/java/com/threerings/jme/model/Rotator.java b/src/java/com/threerings/jme/model/Rotator.java index d530d623..e7fada4c 100644 --- a/src/java/com/threerings/jme/model/Rotator.java +++ b/src/java/com/threerings/jme/model/Rotator.java @@ -34,12 +34,8 @@ import com.jme.util.export.JMEImporter; import com.jme.util.export.InputCapsule; import com.jme.util.export.OutputCapsule; -import com.samskivert.util.StringUtil; - import com.threerings.jme.util.JmeUtil; -import static com.threerings.jme.Log.log; - /** * A procedural animation that rotates a node around at a constant angular * velocity. diff --git a/src/java/com/threerings/jme/model/SkinMesh.java b/src/java/com/threerings/jme/model/SkinMesh.java index 73b50193..bc9c33df 100644 --- a/src/java/com/threerings/jme/model/SkinMesh.java +++ b/src/java/com/threerings/jme/model/SkinMesh.java @@ -22,8 +22,6 @@ package com.threerings.jme.model; import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.Serializable; import java.nio.ByteBuffer; import java.nio.FloatBuffer; @@ -33,12 +31,12 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import org.lwjgl.opengl.GLContext; import com.jme.bounding.BoundingVolume; import com.jme.math.Matrix4f; -import com.jme.math.Vector3f; import com.jme.renderer.Renderer; import com.jme.scene.Spatial; import com.jme.scene.TriMesh; @@ -64,8 +62,6 @@ import com.threerings.jme.util.JmeUtil; import com.threerings.jme.util.ShaderCache; import com.threerings.jme.util.ShaderConfig; -import static com.threerings.jme.Log.log; - /** * A triangle mesh that deforms according to a bone hierarchy. */ @@ -98,7 +94,7 @@ public class SkinMesh extends ModelMesh * * @param bmap the mapping from prototype to instance bones */ - public WeightGroup rebind (HashMap bmap) + public WeightGroup rebind (Map bmap) { WeightGroup wgroup = new WeightGroup(); wgroup.vertexCount = vertexCount; @@ -111,7 +107,7 @@ public class SkinMesh extends ModelMesh } // documentation inherited - public Class getClassTag () + public Class getClassTag () { return getClass(); } @@ -169,7 +165,7 @@ public class SkinMesh extends ModelMesh * * @param pnodes a mapping from prototype nodes to instance nodes */ - public Bone rebind (HashMap pnodes) + public Bone rebind (Map pnodes) { Bone bone = new Bone((ModelNode)pnodes.get(node)); bone.invRefTransform = invRefTransform; @@ -178,7 +174,7 @@ public class SkinMesh extends ModelMesh } // documentation inherited - public Class getClassTag () + public Class getClassTag () { return getClass(); } diff --git a/src/java/com/threerings/jme/model/TextureAnimator.java b/src/java/com/threerings/jme/model/TextureAnimator.java index ea699116..9353b4d3 100644 --- a/src/java/com/threerings/jme/model/TextureAnimator.java +++ b/src/java/com/threerings/jme/model/TextureAnimator.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.Properties; import com.jme.image.Texture; -import com.jme.math.Vector2f; import com.jme.math.Vector3f; import com.jme.scene.Controller; import com.jme.scene.Spatial; @@ -35,13 +34,8 @@ import com.jme.util.export.JMEImporter; import com.jme.util.export.InputCapsule; import com.jme.util.export.OutputCapsule; -import com.samskivert.util.StringUtil; - import com.threerings.jme.util.JmeUtil; import com.threerings.jme.util.JmeUtil.FrameState; -import com.threerings.jme.util.SpatialVisitor; - -import static com.threerings.jme.Log.log; /** * Animates a model's textures by flipping between different parts. diff --git a/src/java/com/threerings/jme/model/TextureController.java b/src/java/com/threerings/jme/model/TextureController.java index 4fcd8cb4..13ee1f27 100644 --- a/src/java/com/threerings/jme/model/TextureController.java +++ b/src/java/com/threerings/jme/model/TextureController.java @@ -23,8 +23,6 @@ package com.threerings.jme.model; import java.util.HashMap; -import org.lwjgl.opengl.Display; - import com.jme.image.Texture; import com.jme.scene.state.RenderState; import com.jme.scene.state.TextureState; diff --git a/src/java/com/threerings/jme/model/TextureTranslator.java b/src/java/com/threerings/jme/model/TextureTranslator.java index bef1d4b5..295bccbd 100644 --- a/src/java/com/threerings/jme/model/TextureTranslator.java +++ b/src/java/com/threerings/jme/model/TextureTranslator.java @@ -37,8 +37,6 @@ import com.jme.util.export.OutputCapsule; import com.samskivert.util.StringUtil; -import com.threerings.jme.util.SpatialVisitor; - import static com.threerings.jme.Log.log; /** diff --git a/src/java/com/threerings/jme/model/Translator.java b/src/java/com/threerings/jme/model/Translator.java index ec40cae8..ffd42713 100644 --- a/src/java/com/threerings/jme/model/Translator.java +++ b/src/java/com/threerings/jme/model/Translator.java @@ -25,7 +25,6 @@ import java.io.IOException; import java.util.Properties; -import com.jme.math.Quaternion; import com.jme.math.Vector3f; import com.jme.scene.Controller; import com.jme.scene.Spatial; @@ -34,12 +33,8 @@ import com.jme.util.export.JMEImporter; import com.jme.util.export.InputCapsule; import com.jme.util.export.OutputCapsule; -import com.samskivert.util.StringUtil; - import com.threerings.jme.util.JmeUtil; -import static com.threerings.jme.Log.log; - /** * A procedural animation that moves a node along a straight line at a constant velocity (then * either repeats or moves it in the other direction). diff --git a/src/java/com/threerings/jme/tile/FringeConfiguration.java b/src/java/com/threerings/jme/tile/FringeConfiguration.java index ac2734f8..e610e79c 100644 --- a/src/java/com/threerings/jme/tile/FringeConfiguration.java +++ b/src/java/com/threerings/jme/tile/FringeConfiguration.java @@ -22,8 +22,11 @@ package com.threerings.jme.tile; import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import com.samskivert.util.StringUtil; @@ -46,7 +49,7 @@ public class FringeConfiguration implements Serializable public int priority; /** A list of the fringe records that can be used for fringing. */ - public ArrayList fringes = new ArrayList(); + public List fringes = Lists.newArrayList(); /** Used when parsing from an XML definition. */ public void addFringe (FringeRecord record) @@ -123,13 +126,13 @@ public class FringeConfiguration implements Serializable */ public int fringesOn (String fringer, String fringed) { - TileRecord f1 = (TileRecord)_trecs.get(fringer); + TileRecord f1 = _trecs.get(fringer); // we better have a fringe record for the fringer if (null != f1) { // it had better have some types defined if (f1.fringes.size() > 0) { - TileRecord f2 = (TileRecord)_trecs.get(fringed); + TileRecord f2 = _trecs.get(fringed); // and we only fringe if fringed doesn't have a fringe // record or has a lower priority if ((null == f2) || (f1.priority > f2.priority)) { @@ -147,12 +150,12 @@ public class FringeConfiguration implements Serializable */ public FringeRecord getFringe (String type, int hashValue) { - TileRecord t = (TileRecord)_trecs.get(type); - return (FringeRecord)t.fringes.get(hashValue % t.fringes.size()); + TileRecord t = _trecs.get(type); + return t.fringes.get(hashValue % t.fringes.size()); } /** The mapping from tile type to tile record. */ - protected HashMap _trecs = new HashMap(); + protected Map _trecs = Maps.newHashMap(); /** Increase this value when object's serialized state is impacted by * a class change (modification of fields, inheritance). */ diff --git a/src/java/com/threerings/jme/tile/TileFringer.java b/src/java/com/threerings/jme/tile/TileFringer.java index ed9c6527..ff65c0c5 100644 --- a/src/java/com/threerings/jme/tile/TileFringer.java +++ b/src/java/com/threerings/jme/tile/TileFringer.java @@ -24,8 +24,10 @@ package com.threerings.jme.tile; import java.awt.Graphics2D; import java.awt.Transparency; import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.common.collect.Lists; import com.samskivert.util.QuickSort; @@ -83,7 +85,7 @@ public class TileFringer * using a fringe mask. */ public BufferedImage getFringeTile ( - TileSource tiles, int col, int row, HashMap masks) + TileSource tiles, int col, int row, Map masks) { // get the type of the tile we are considering String baseType = tiles.getTileType(col, row); @@ -141,7 +143,7 @@ public class TileFringer * Compose a fringe tile out of the various fringe images needed. */ protected BufferedImage composeFringeTile ( - String baseType, FringerRec[] fringers, HashMap masks, int hashValue) + String baseType, FringerRec[] fringers, Map masks, int hashValue) { // sort the array so that higher priority fringers get drawn first QuickSort.sort(fringers); @@ -180,7 +182,7 @@ public class TileFringer */ protected void stampTileImage ( Graphics2D gfx, String fringerType, int index, - HashMap masks, int hashValue) + Map masks, int hashValue) { FringeConfiguration.FringeRecord frec = _config.getFringe(fringerType, hashValue); @@ -195,7 +197,7 @@ public class TileFringer if (frec.mask) { // it's a mask; look for it in the cache String maskkey = fringerType + ":" + frec.name + ":" + index; - BufferedImage mimg = (BufferedImage)masks.get(maskkey); + BufferedImage mimg = masks.get(maskkey); if (mimg == null) { BufferedImage fsrc = getSubimage(fsimg, index); BufferedImage bsrc = _isrc.getTileSource(fringerType); @@ -250,7 +252,7 @@ public class TileFringer return new int[0]; } - ArrayList indexes = new ArrayList(); + List indexes = Lists.newArrayList(); int weebits = 0; for (int ii=(start + 1) % NUM_FRINGEBITS; ii != start; ii = (ii + 1) % NUM_FRINGEBITS) { @@ -274,14 +276,14 @@ public class TileFringer int[] ret = new int[indexes.size()]; for (int ii=0; ii < ret.length; ii++) { - ret[ii] = ((Integer) indexes.get(ii)).intValue(); + ret[ii] = indexes.get(ii).intValue(); } return ret; } /** A record for holding information about a particular fringe as * we're computing what it will look like. */ - protected static class FringerRec implements Comparable + protected static class FringerRec implements Comparable { public String fringerType; public int priority; @@ -310,8 +312,8 @@ public class TileFringer return toArray(0); } - public int compareTo (Object o) { - return priority - ((FringerRec) o).priority; + public int compareTo (FringerRec o) { + return priority - o.priority; } public String toString () { diff --git a/src/java/com/threerings/jme/tile/tools/CompileFringeConfigurationTask.java b/src/java/com/threerings/jme/tile/tools/CompileFringeConfigurationTask.java index 97985c81..4d9669da 100644 --- a/src/java/com/threerings/jme/tile/tools/CompileFringeConfigurationTask.java +++ b/src/java/com/threerings/jme/tile/tools/CompileFringeConfigurationTask.java @@ -27,7 +27,6 @@ import java.io.Serializable; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; -import com.samskivert.io.PersistenceException; import com.threerings.util.CompiledConfig; import com.threerings.jme.tile.tools.xml.FringeConfigurationParser; diff --git a/src/java/com/threerings/jme/tile/tools/xml/FringeConfigurationParser.java b/src/java/com/threerings/jme/tile/tools/xml/FringeConfigurationParser.java index cbf991c4..f924e770 100644 --- a/src/java/com/threerings/jme/tile/tools/xml/FringeConfigurationParser.java +++ b/src/java/com/threerings/jme/tile/tools/xml/FringeConfigurationParser.java @@ -25,7 +25,6 @@ import java.io.Serializable; import org.apache.commons.digester.Digester; -import com.samskivert.util.StringUtil; import com.samskivert.xml.SetPropertyFieldsRule; import com.threerings.tools.xml.CompiledConfigParser; @@ -34,8 +33,6 @@ import com.threerings.jme.tile.FringeConfiguration.TileRecord; import com.threerings.jme.tile.FringeConfiguration.FringeRecord; import com.threerings.jme.tile.FringeConfiguration; -import static com.threerings.jme.Log.log; - /** * Parses fringe config definitions, which look like so (with angle * brackets instead of square): diff --git a/src/java/com/threerings/jme/tools/AnimationDef.java b/src/java/com/threerings/jme/tools/AnimationDef.java index 3e053572..a04a428f 100644 --- a/src/java/com/threerings/jme/tools/AnimationDef.java +++ b/src/java/com/threerings/jme/tools/AnimationDef.java @@ -41,8 +41,6 @@ import com.threerings.jme.util.JmeUtil; import com.threerings.jme.tools.ModelDef.TransformNode; -import static com.threerings.jme.Log.log; - /** * A basic representation for keyframe animations. */ diff --git a/src/java/com/threerings/jme/tools/BuildSphereMap.java b/src/java/com/threerings/jme/tools/BuildSphereMap.java index abd87faf..e8ced2c5 100644 --- a/src/java/com/threerings/jme/tools/BuildSphereMap.java +++ b/src/java/com/threerings/jme/tools/BuildSphereMap.java @@ -28,7 +28,6 @@ import java.io.IOException; import javax.imageio.ImageIO; -import com.jme.image.Texture; import com.jme.math.FastMath; import com.jme.math.Vector3f; @@ -83,9 +82,7 @@ public class BuildSphereMap Vector3f vec = new Vector3f(); for (int y = 0, idx = 0; y < size; y++) { for (int x = 0; x < size; x++, idx++) { - float vx = x / (size*0.5f) - 1f, vy = y / (size*0.5f) - 1f, - d2 = vx*vx + vy*vy; - int p = 0; + float vx = x / (size*0.5f) - 1f, vy = y / (size*0.5f) - 1f, d2 = vx*vx + vy*vy; if (d2 <= 1f) { vec.set(vx, vy, FastMath.sqrt(1f - d2)); rgb[idx] = getCubeMapPixel(vec, sides); diff --git a/src/java/com/threerings/jme/tools/CompileModel.java b/src/java/com/threerings/jme/tools/CompileModel.java index 5fa8aec9..606a2520 100644 --- a/src/java/com/threerings/jme/tools/CompileModel.java +++ b/src/java/com/threerings/jme/tools/CompileModel.java @@ -23,11 +23,7 @@ package com.threerings.jme.tools; import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.util.ArrayList; import java.util.HashMap; import java.util.Properties; import java.util.logging.Level; @@ -41,9 +37,6 @@ import com.samskivert.util.PropertiesUtil; import com.samskivert.util.StringUtil; import com.threerings.jme.model.Model; -import com.threerings.jme.model.ModelMesh; -import com.threerings.jme.model.ModelNode; -import com.threerings.jme.model.SkinMesh; import com.threerings.jme.tools.ModelDef.TransformNode; import com.threerings.jme.tools.xml.AnimationParser; import com.threerings.jme.tools.xml.ModelParser; diff --git a/src/java/com/threerings/jme/tools/ConvertModel.java b/src/java/com/threerings/jme/tools/ConvertModel.java index 9eca44a8..3ac6fd32 100644 --- a/src/java/com/threerings/jme/tools/ConvertModel.java +++ b/src/java/com/threerings/jme/tools/ConvertModel.java @@ -53,7 +53,6 @@ public class ConvertModel // create a dummy display system which the converters need new DummyDisplaySystem(); - ConvertModel app = new ConvertModel(); File source = new File(args[0]); File target = new File(args[1]); diff --git a/src/java/com/threerings/jme/tools/ModelDef.java b/src/java/com/threerings/jme/tools/ModelDef.java index e8197386..61d7ee3c 100644 --- a/src/java/com/threerings/jme/tools/ModelDef.java +++ b/src/java/com/threerings/jme/tools/ModelDef.java @@ -21,14 +21,11 @@ package com.threerings.jme.tools; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -45,7 +42,6 @@ import com.jme.math.Quaternion; import com.jme.math.Vector3f; import com.jme.scene.Node; import com.jme.scene.Spatial; -import com.jme.scene.batch.GeomBatch; import com.jme.util.geom.BufferUtils; import com.samskivert.util.ObjectUtil; @@ -59,7 +55,6 @@ import com.threerings.jme.model.ModelMesh; import com.threerings.jme.model.ModelNode; import com.threerings.jme.model.SkinMesh; import com.threerings.jme.util.JmeUtil; -import com.threerings.jme.util.SpatialVisitor; import static com.threerings.jme.Log.log; diff --git a/src/java/com/threerings/jme/tools/ModelViewer.java b/src/java/com/threerings/jme/tools/ModelViewer.java index 03fc0364..a7311e23 100644 --- a/src/java/com/threerings/jme/tools/ModelViewer.java +++ b/src/java/com/threerings/jme/tools/ModelViewer.java @@ -22,18 +22,14 @@ package com.threerings.jme.tools; import java.awt.BorderLayout; -import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; import java.io.File; import java.io.FileOutputStream; @@ -421,8 +417,7 @@ public class ModelViewer extends JmeCanvasApp protected void updateCameraPosition () { Camera cam = _camhand.getCamera(); - Vector3f pos = cam.getLocation(), dir = cam.getDirection(), - left = cam.getLeft(); + Vector3f pos = cam.getLocation(), dir = cam.getDirection(); float heading = -FastMath.atan2(dir.x, dir.y) * FastMath.RAD_TO_DEG, pitch = FastMath.asin(dir.z) * FastMath.RAD_TO_DEG; _campos.setText( diff --git a/src/java/com/threerings/jme/util/ImageCache.java b/src/java/com/threerings/jme/util/ImageCache.java index 34e6872c..e7254f7e 100644 --- a/src/java/com/threerings/jme/util/ImageCache.java +++ b/src/java/com/threerings/jme/util/ImageCache.java @@ -23,7 +23,6 @@ package com.threerings.jme.util; import java.lang.ref.WeakReference; import java.util.HashMap; -import java.util.logging.Level; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/src/java/com/threerings/jme/util/ShaderCache.java b/src/java/com/threerings/jme/util/ShaderCache.java index f82fe459..6653eb9f 100644 --- a/src/java/com/threerings/jme/util/ShaderCache.java +++ b/src/java/com/threerings/jme/util/ShaderCache.java @@ -23,7 +23,6 @@ package com.threerings.jme.util; import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.nio.ByteBuffer; diff --git a/tests/src/java/com/threerings/jme/client/JabberView.java b/tests/src/java/com/threerings/jme/client/JabberView.java index c0c810fd..26fc814e 100644 --- a/tests/src/java/com/threerings/jme/client/JabberView.java +++ b/tests/src/java/com/threerings/jme/client/JabberView.java @@ -3,7 +3,6 @@ package com.threerings.jme.client; -import com.jmex.bui.BLabel; import com.jmex.bui.BWindow; import com.jmex.bui.layout.BorderLayout; diff --git a/tests/src/java/com/threerings/jme/server/JabberServer.java b/tests/src/java/com/threerings/jme/server/JabberServer.java index 097bd79a..5d73798c 100644 --- a/tests/src/java/com/threerings/jme/server/JabberServer.java +++ b/tests/src/java/com/threerings/jme/server/JabberServer.java @@ -6,7 +6,6 @@ package com.threerings.jme.server; import com.google.inject.Guice; import com.google.inject.Injector; -import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.server.CrowdServer; import com.threerings.crowd.server.PlaceManager; diff --git a/tests/src/java/com/threerings/jme/sprite/PathTestApp.java b/tests/src/java/com/threerings/jme/sprite/PathTestApp.java index 9671b6a2..cda54240 100644 --- a/tests/src/java/com/threerings/jme/sprite/PathTestApp.java +++ b/tests/src/java/com/threerings/jme/sprite/PathTestApp.java @@ -14,7 +14,6 @@ import com.jme.renderer.ColorRGBA; import com.jme.scene.shape.Box; import com.jme.scene.shape.Disk; import com.jme.scene.shape.Quad; -import com.jme.scene.shape.Sphere; import com.jme.scene.state.LightState; import com.jme.util.LoggingSystem;