diff options
Diffstat (limited to 'ardor3d-core/src/main')
33 files changed, 85 insertions, 104 deletions
diff --git a/ardor3d-core/src/main/java/com/ardor3d/image/Image.java b/ardor3d-core/src/main/java/com/ardor3d/image/Image.java index 9acc762..b6b07ca 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/image/Image.java +++ b/ardor3d-core/src/main/java/com/ardor3d/image/Image.java @@ -20,7 +20,6 @@ import java.util.List; import com.ardor3d.util.export.InputCapsule; import com.ardor3d.util.export.OutputCapsule; import com.ardor3d.util.export.Savable; -import com.google.common.collect.Lists; /** * <code>Image</code> defines a data format for a graphical image. The image is defined by a format, a height and width, @@ -98,7 +97,7 @@ public class Image implements Serializable, Savable { */ public Image(final ImageDataFormat format, final PixelDataType type, final int width, final int height, final ByteBuffer data, final int[] mipMapSizes) { - this(format, type, width, height, Lists.newArrayList(data), mipMapSizes); + this(format, type, width, height, new ArrayList<ByteBuffer>(Arrays.asList(data)), mipMapSizes); } /** @@ -123,7 +122,7 @@ public class Image implements Serializable, Savable { * the data that contains the image information. */ public void setData(final ByteBuffer data) { - _data = Lists.newArrayList(data); + _data = new ArrayList<ByteBuffer>(Arrays.asList(data)); } /** diff --git a/ardor3d-core/src/main/java/com/ardor3d/image/util/dds/DdsLoader.java b/ardor3d-core/src/main/java/com/ardor3d/image/util/dds/DdsLoader.java index 494c76c..3c28364 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/image/util/dds/DdsLoader.java +++ b/ardor3d-core/src/main/java/com/ardor3d/image/util/dds/DdsLoader.java @@ -18,6 +18,7 @@ import static com.ardor3d.image.util.dds.DdsUtils.shiftCount; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; +import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; @@ -28,7 +29,6 @@ import com.ardor3d.image.util.ImageLoader; import com.ardor3d.image.util.ImageUtils; import com.ardor3d.util.LittleEndianDataInput; import com.ardor3d.util.geom.BufferUtils; -import com.google.common.collect.Lists; /** * <p> @@ -254,7 +254,7 @@ public class DdsLoader implements ImageLoader { } // Go through and load in image data - final List<ByteBuffer> imageData = Lists.newArrayList(); + final List<ByteBuffer> imageData = new ArrayList<ByteBuffer>(); for (int i = 0; i < image.getDepth(); i++) { // read in compressed data if (compressedFormat) { diff --git a/ardor3d-core/src/main/java/com/ardor3d/input/ControllerInfo.java b/ardor3d-core/src/main/java/com/ardor3d/input/ControllerInfo.java index a7e7c92..e9175bf 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/input/ControllerInfo.java +++ b/ardor3d-core/src/main/java/com/ardor3d/input/ControllerInfo.java @@ -13,8 +13,6 @@ package com.ardor3d.input; import java.util.ArrayList; import java.util.List; -import com.google.common.collect.Lists; - public class ControllerInfo { private final String _controllerName; @@ -23,8 +21,8 @@ public class ControllerInfo { public ControllerInfo(final String controllerName, final List<String> axisNames, final List<String> buttonNames) { _controllerName = controllerName; - _axisNames = Lists.newArrayList(axisNames); - _buttonNames = Lists.newArrayList(buttonNames); + _axisNames = new ArrayList<String>(axisNames); + _buttonNames = new ArrayList<String>(buttonNames); } public String getControllerName() { diff --git a/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java b/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java index 28f4c6d..bd3ed45 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java @@ -19,16 +19,14 @@ import java.util.Map; import java.util.Map.Entry; import com.ardor3d.annotation.Immutable; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; @Immutable public class ControllerState { public static final ControllerState NOTHING = new ControllerState(0); - protected final Map<String, Map<String, Float>> _controllerStates = Maps.newLinkedHashMap(); - protected final List<ControllerEvent> _eventsSinceLastState = Lists.newArrayList(); + protected final Map<String, Map<String, Float>> _controllerStates = new LinkedHashMap<String, Map<String, Float>>(); + protected final List<ControllerEvent> _eventsSinceLastState = new ArrayList<ControllerEvent>(); protected ControllerState(final int ignore) {} @@ -96,7 +94,7 @@ public class ControllerState { private void duplicateStates(final Map<String, Map<String, Float>> store) { store.clear(); for (final Entry<String, Map<String, Float>> entry : _controllerStates.entrySet()) { - store.put(entry.getKey(), Maps.newLinkedHashMap(entry.getValue())); + store.put(entry.getKey(), new LinkedHashMap<String, Float>(entry.getValue())); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/input/MouseButton.java b/ardor3d-core/src/main/java/com/ardor3d/input/MouseButton.java index 6d2e378..8b49757 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/input/MouseButton.java +++ b/ardor3d-core/src/main/java/com/ardor3d/input/MouseButton.java @@ -12,8 +12,6 @@ package com.ardor3d.input; import java.util.EnumMap; -import com.google.common.collect.Maps; - public enum MouseButton { LEFT, RIGHT, MIDDLE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE; @@ -28,7 +26,7 @@ public enum MouseButton { if (middle == null) { throw new NullPointerException("middle"); } - final EnumMap<MouseButton, ButtonState> map = Maps.newEnumMap(MouseButton.class); + final EnumMap<MouseButton, ButtonState> map = new EnumMap<MouseButton, ButtonState>(MouseButton.class); map.put(LEFT, left); map.put(RIGHT, right); map.put(MIDDLE, middle); diff --git a/ardor3d-core/src/main/java/com/ardor3d/input/MouseState.java b/ardor3d-core/src/main/java/com/ardor3d/input/MouseState.java index 8ee44ce..b1f4faa 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/input/MouseState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/input/MouseState.java @@ -17,9 +17,8 @@ import com.ardor3d.annotation.Immutable; import com.google.common.collect.EnumMultiset; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultiset; -import com.google.common.collect.Maps; -import com.google.common.collect.Multiset; import com.google.common.collect.ImmutableMultiset.Builder; +import com.google.common.collect.Multiset; /** * Describes the mouse state at some point in time. @@ -139,7 +138,7 @@ public class MouseState { public EnumMap<MouseButton, ButtonState> getButtonStates(final EnumMap<MouseButton, ButtonState> store) { EnumMap<MouseButton, ButtonState> rVal = store; if (store == null) { - rVal = Maps.newEnumMap(MouseButton.class); + rVal = new EnumMap<MouseButton, ButtonState>(MouseButton.class); } rVal.clear(); rVal.putAll(_buttonStates); diff --git a/ardor3d-core/src/main/java/com/ardor3d/input/logical/MouseButtonCondition.java b/ardor3d-core/src/main/java/com/ardor3d/input/logical/MouseButtonCondition.java index 54625ae..880765e 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/input/logical/MouseButtonCondition.java +++ b/ardor3d-core/src/main/java/com/ardor3d/input/logical/MouseButtonCondition.java @@ -17,14 +17,13 @@ import com.ardor3d.input.ButtonState; import com.ardor3d.input.InputState; import com.ardor3d.input.MouseButton; import com.google.common.base.Predicate; -import com.google.common.collect.Maps; /** * A condition that checks the state of the two most commonly used mouse buttons. */ @Immutable public final class MouseButtonCondition implements Predicate<TwoInputStates> { - private final EnumMap<MouseButton, ButtonState> _states = Maps.newEnumMap(MouseButton.class); + private final EnumMap<MouseButton, ButtonState> _states = new EnumMap<MouseButton, ButtonState>(MouseButton.class); public MouseButtonCondition(final EnumMap<MouseButton, ButtonState> states) { _states.putAll(states); diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextManager.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextManager.java index a72ffd5..efcd33a 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextManager.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/ContextManager.java @@ -10,17 +10,17 @@ package com.ardor3d.renderer; +import java.util.ArrayList; import java.util.List; import java.util.Map; -import com.google.common.collect.Lists; import com.google.common.collect.MapMaker; public class ContextManager { protected static RenderContext currentContext = null; - private static List<ContextCleanListener> _cleanListeners = Lists.newArrayList(); + private static List<ContextCleanListener> _cleanListeners = new ArrayList<ContextCleanListener>(); protected static final Map<Object, RenderContext> contextStore = new MapMaker().weakKeys().makeMap(); diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectManager.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectManager.java index c5780bd..bc40f1d 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectManager.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectManager.java @@ -10,7 +10,9 @@ package com.ardor3d.renderer.effect; +import java.util.ArrayList; import java.util.EnumMap; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -27,14 +29,12 @@ import com.ardor3d.scenegraph.Mesh; import com.ardor3d.scenegraph.hint.CullHint; import com.ardor3d.scenegraph.hint.LightCombineMode; import com.ardor3d.util.geom.BufferUtils; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; public class EffectManager { protected final DisplaySettings _canvasSettings; - protected final List<RenderEffect> _effects = Lists.newArrayList(); - protected final Map<String, RenderTarget> _renderTargetMap = Maps.newHashMap(); + protected final List<RenderEffect> _effects = new ArrayList<RenderEffect>(); + protected final Map<String, RenderTarget> _renderTargetMap = new HashMap<String, RenderTarget>(); protected Renderer _currentRenderer = null; protected RenderTarget _currentRenderTarget = null; protected Camera _fsqCamera, _sceneCamera; diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectStep_RenderScreenOverlay.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectStep_RenderScreenOverlay.java index 777daee..588b95a 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectStep_RenderScreenOverlay.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectStep_RenderScreenOverlay.java @@ -11,18 +11,18 @@ package com.ardor3d.renderer.effect; import java.util.EnumMap; +import java.util.HashMap; import java.util.Map; import com.ardor3d.renderer.state.RenderState; -import com.ardor3d.renderer.state.TextureState; import com.ardor3d.renderer.state.RenderState.StateType; -import com.google.common.collect.Maps; +import com.ardor3d.renderer.state.TextureState; public class EffectStep_RenderScreenOverlay implements EffectStep { - private final EnumMap<StateType, RenderState> _states = Maps.newEnumMap(StateType.class); + private final EnumMap<StateType, RenderState> _states = new EnumMap<StateType, RenderState>(StateType.class); private final TextureState _texState = new TextureState(); - private final Map<String, Integer> _targetMap = Maps.newHashMap(); + private final Map<String, Integer> _targetMap = new HashMap<String, Integer>(); public EffectStep_RenderScreenOverlay() { _states.put(StateType.Texture, _texState); diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectStep_RenderSpatials.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectStep_RenderSpatials.java index ee03266..a07df8b 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectStep_RenderSpatials.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/EffectStep_RenderSpatials.java @@ -10,6 +10,7 @@ package com.ardor3d.renderer.effect; +import java.util.ArrayList; import java.util.EnumMap; import java.util.List; @@ -17,12 +18,10 @@ import com.ardor3d.renderer.Camera; import com.ardor3d.renderer.state.RenderState; import com.ardor3d.renderer.state.RenderState.StateType; import com.ardor3d.scenegraph.Spatial; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; public class EffectStep_RenderSpatials implements EffectStep { - private final EnumMap<StateType, RenderState> _states = Maps.newEnumMap(StateType.class); - private final List<Spatial> _spatials = Lists.newArrayList(); + private final EnumMap<StateType, RenderState> _states = new EnumMap<StateType, RenderState>(StateType.class); + private final List<Spatial> _spatials = new ArrayList<Spatial>(); private final Camera _trackedCamera; public EffectStep_RenderSpatials(final Camera trackedCamera) { diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/RenderEffect.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/RenderEffect.java index 6fda5a9..409e443 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/RenderEffect.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/RenderEffect.java @@ -10,10 +10,9 @@ package com.ardor3d.renderer.effect; +import java.util.ArrayList; import java.util.List; -import com.google.common.collect.Lists; - /** * A RenderEffect object represents a complete set of instructions necessary for applying a specific effect to our * render output. Each effect is comprised of a set of 1 or more steps (EffectStep). @@ -21,7 +20,7 @@ import com.google.common.collect.Lists; public abstract class RenderEffect { /** A list of logical steps that comprise our effect. */ - protected final List<EffectStep> _steps = Lists.newArrayList(); + protected final List<EffectStep> _steps = new ArrayList<EffectStep>(); /** Is this render effect active? */ protected boolean _enabled = true; diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/TextureRendererPool.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/TextureRendererPool.java index 4f42df3..82af301 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/TextureRendererPool.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/effect/TextureRendererPool.java @@ -11,18 +11,18 @@ package com.ardor3d.renderer.effect; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import com.ardor3d.renderer.ContextManager; import com.ardor3d.renderer.Renderer; import com.ardor3d.renderer.TextureRenderer; import com.ardor3d.renderer.TextureRendererFactory; -import com.google.common.collect.Lists; public enum TextureRendererPool { INSTANCE; - private final List<TextureRenderer> renderers = Lists.newLinkedList(); + private final List<TextureRenderer> renderers = new LinkedList<TextureRenderer>(); public static TextureRenderer fetch(final int width, final int height, final Renderer renderer) { for (final Iterator<TextureRenderer> it = INSTANCE.renderers.iterator(); it.hasNext();) { diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/queue/RenderQueue.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/queue/RenderQueue.java index facd51c..34a28ba 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/queue/RenderQueue.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/queue/RenderQueue.java @@ -10,6 +10,7 @@ package com.ardor3d.renderer.queue; +import java.util.LinkedHashMap; import java.util.Map; import com.ardor3d.renderer.Renderer; @@ -18,11 +19,10 @@ import com.ardor3d.scenegraph.Mesh; import com.ardor3d.scenegraph.Spatial; import com.ardor3d.util.Ardor3dException; import com.ardor3d.util.Constants; -import com.google.common.collect.Maps; public class RenderQueue { - private final Map<RenderBucketType, RenderBucket> renderBuckets = Maps.newLinkedHashMap(); + private final Map<RenderBucketType, RenderBucket> renderBuckets = new LinkedHashMap<RenderBucketType, RenderBucket>(); public RenderQueue() { setupDefaultBuckets(); diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/RenderState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/RenderState.java index 4f4bef5..bbe1b64 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/RenderState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/RenderState.java @@ -24,7 +24,6 @@ import com.ardor3d.util.Constants; import com.ardor3d.util.export.InputCapsule; import com.ardor3d.util.export.OutputCapsule; import com.ardor3d.util.export.Savable; -import com.google.common.collect.Maps; /** * <code>RenderState</code> is the base class for all states that affect the rendering of a piece of geometry. They @@ -96,8 +95,8 @@ public abstract class RenderState implements Savable { static public class StateStack implements Poolable { - private final EnumMap<RenderState.StateType, Stack<RenderState>> stacks = Maps - .newEnumMap(RenderState.StateType.class); + private final EnumMap<RenderState.StateType, Stack<RenderState>> stacks = new EnumMap<StateType, Stack<RenderState>>( + RenderState.StateType.class); public StateStack() {} diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/ShaderObjectsStateRecord.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/ShaderObjectsStateRecord.java index b542051..2fa77e4 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/ShaderObjectsStateRecord.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/ShaderObjectsStateRecord.java @@ -10,11 +10,11 @@ package com.ardor3d.renderer.state.record; +import java.util.ArrayList; import java.util.List; import com.ardor3d.renderer.state.GLSLShaderObjectsState; import com.ardor3d.util.shader.ShaderVariable; -import com.google.common.collect.Lists; public class ShaderObjectsStateRecord extends StateRecord { // XXX NOTE: This is non-standard. Due to the fact that shader implementations @@ -22,7 +22,7 @@ public class ShaderObjectsStateRecord extends StateRecord { // XXX checking system. GLSLShaderObjectsState reference = null; - public List<ShaderVariable> enabledAttributes = Lists.newArrayList(); + public List<ShaderVariable> enabledAttributes = new ArrayList<ShaderVariable>(); public int shaderId = -1; diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/TextureStateRecord.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/TextureStateRecord.java index 062c555..3e63a6b 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/TextureStateRecord.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/TextureStateRecord.java @@ -20,7 +20,6 @@ import com.ardor3d.math.Vector3; import com.ardor3d.math.type.ReadOnlyVector4; import com.ardor3d.renderer.state.TextureState; import com.ardor3d.util.geom.BufferUtils; -import com.google.common.collect.Maps; public class TextureStateRecord extends StateRecord { @@ -47,7 +46,7 @@ public class TextureStateRecord extends StateRecord { public final DoubleBuffer tmp_matrixBuffer = BufferUtils.createDoubleBuffer(16); public TextureStateRecord() { - textures = Maps.newHashMap(); + textures = new HashMap<Integer, TextureRecord>(); units = new TextureUnitRecord[TextureState.MAX_TEXTURES]; for (int i = 0; i < units.length; i++) { units[i] = new TextureUnitRecord(); diff --git a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/InstancingManager.java b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/InstancingManager.java index e6673a5..320e4e4 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/InstancingManager.java +++ b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/InstancingManager.java @@ -11,6 +11,7 @@ package com.ardor3d.scenegraph; import java.nio.FloatBuffer; +import java.util.ArrayList; import java.util.List; import com.ardor3d.math.Matrix4; @@ -21,12 +22,11 @@ import com.ardor3d.renderer.Renderer; import com.ardor3d.renderer.state.GLSLShaderObjectsState; import com.ardor3d.util.Ardor3dException; import com.ardor3d.util.geom.BufferUtils; -import com.google.common.collect.Lists; public class InstancingManager { private int _maxBatchSize = 30; - private final List<Mesh> _visibleMeshes = Lists.newArrayListWithCapacity(_maxBatchSize); + private final List<Mesh> _visibleMeshes = new ArrayList<Mesh>(_maxBatchSize); private FloatBuffer _transformBuffer; private int _primCount; private int _meshesToDraw = 0; diff --git a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/Mesh.java b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/Mesh.java index f238cb4..bc3882d 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/Mesh.java +++ b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/Mesh.java @@ -12,6 +12,7 @@ package com.ardor3d.scenegraph; import java.io.IOException; import java.nio.FloatBuffer; +import java.util.ArrayList; import java.util.EnumMap; import java.util.List; @@ -47,7 +48,6 @@ import com.ardor3d.util.geom.BufferUtils; import com.ardor3d.util.scenegraph.RenderDelegate; import com.ardor3d.util.stat.StatCollector; import com.ardor3d.util.stat.StatType; -import com.google.common.collect.Lists; /** * A Mesh is a spatial describing a renderable geometric object. Data about the mesh is stored locally using MeshData. @@ -559,7 +559,7 @@ public class Mesh extends Spatial implements Renderable, Pickable { @Override public IntersectionRecord intersectsPrimitivesWhere(final Ray3 ray) { - final List<PrimitiveKey> primitives = Lists.newArrayList(); + final List<PrimitiveKey> primitives = new ArrayList<PrimitiveKey>(); // What about Lines and Points? final CollisionTree ct = CollisionTreeManager.getInstance().getCollisionTree(this); diff --git a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java index 3c02967..9b13518 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java +++ b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/MeshData.java @@ -32,7 +32,6 @@ import com.ardor3d.util.export.InputCapsule; import com.ardor3d.util.export.OutputCapsule; import com.ardor3d.util.export.Savable; import com.ardor3d.util.geom.BufferUtils; -import com.google.common.collect.Lists; import com.google.common.collect.MapMaker; /** @@ -58,7 +57,7 @@ public class MeshData implements Savable { protected FloatBufferData _colorCoords; protected FloatBufferData _fogCoords; protected FloatBufferData _tangentCoords; - protected List<FloatBufferData> _textureCoords = Lists.newArrayListWithCapacity(1); + protected List<FloatBufferData> _textureCoords = new ArrayList<FloatBufferData>(1); /** Interleaved data (for VBO id use). */ protected FloatBufferData _interleaved; diff --git a/ardor3d-core/src/main/java/com/ardor3d/ui/text/BMFont.java b/ardor3d-core/src/main/java/com/ardor3d/ui/text/BMFont.java index c9cb42e..657f56d 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/ui/text/BMFont.java +++ b/ardor3d-core/src/main/java/com/ardor3d/ui/text/BMFont.java @@ -14,6 +14,7 @@ import java.io.IOException; import java.io.OutputStream; import java.net.MalformedURLException; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -42,8 +43,6 @@ import com.ardor3d.util.export.InputCapsule; import com.ardor3d.util.export.OutputCapsule; import com.ardor3d.util.export.Savable; import com.ardor3d.util.resource.ResourceSource; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; /** * Loads a font generated by BMFont (http://www.angelcode.com/products/bmfont/). @@ -56,8 +55,8 @@ import com.google.common.collect.Maps; public class BMFont implements Savable { private static Logger logger = Logger.getLogger(BMFont.class.getName()); - private final Map<Integer, Char> _charMap = Maps.newHashMap(); - private final Map<Integer, Map<Integer, Integer>> _kernMap = Maps.newHashMap(); + private final Map<Integer, Char> _charMap = new HashMap<Integer, Char>(); + private final Map<Integer, Map<Integer, Integer>> _kernMap = new HashMap<Integer, Map<Integer, Integer>>(); private String _styleName; // e.g. "Courier-12-bold" private final ArrayList<Page> _pages = new ArrayList<Page>(); @@ -425,7 +424,7 @@ public class BMFont implements Savable { } public List<Integer> getMappedChars() { - return Lists.newArrayList(_charMap.keySet()); + return new ArrayList<Integer>(_charMap.keySet()); } public Map<Integer, Integer> getKerningsForCharacter(final int val) { @@ -557,7 +556,7 @@ public class BMFont implements Savable { Map<Integer, Integer> amtHash; amtHash = _kernMap.get(first); if (amtHash == null) { - amtHash = Maps.newHashMap(); + amtHash = new HashMap<Integer, Integer>(); _kernMap.put(first, amtHash); } amtHash.put(second, amount); @@ -939,7 +938,7 @@ public class BMFont implements Savable { Map<Integer, Integer> amtHash; amtHash = _kernMap.get(k.first); if (amtHash == null) { - amtHash = Maps.newHashMap(); + amtHash = new HashMap<Integer, Integer>(); _kernMap.put(k.first, amtHash); } amtHash.put(k.second, k.amount); diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/ContextIdReference.java b/ardor3d-core/src/main/java/com/ardor3d/util/ContextIdReference.java index 427b6cd..e2517fb 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/ContextIdReference.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/ContextIdReference.java @@ -12,11 +12,11 @@ package com.ardor3d.util; import java.lang.ref.PhantomReference; import java.lang.ref.ReferenceQueue; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import com.google.common.collect.Lists; import com.google.common.collect.MapMaker; public class ContextIdReference<T> extends PhantomReference<T> { @@ -24,7 +24,7 @@ public class ContextIdReference<T> extends PhantomReference<T> { /** * Keep a strong reference to these objects until their reference is cleared. */ - private static final List<ContextIdReference<?>> REFS = Lists.newLinkedList(); + private static final List<ContextIdReference<?>> REFS = new LinkedList<ContextIdReference<?>>(); private final Map<Object, Integer> _idCache; private Integer _singleContextId; diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/SimpleContextIdReference.java b/ardor3d-core/src/main/java/com/ardor3d/util/SimpleContextIdReference.java index 74adc79..21ff6e3 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/SimpleContextIdReference.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/SimpleContextIdReference.java @@ -12,16 +12,15 @@ package com.ardor3d.util; import java.lang.ref.PhantomReference; import java.lang.ref.ReferenceQueue; +import java.util.LinkedList; import java.util.List; -import com.google.common.collect.Lists; - public class SimpleContextIdReference<T> extends PhantomReference<T> { /** * Keep a string reference to these objects until their reference is cleared. */ - private static final List<SimpleContextIdReference<?>> REFS = Lists.newLinkedList(); + private static final List<SimpleContextIdReference<?>> REFS = new LinkedList<SimpleContextIdReference<?>>(); private final int _id; private final Object _glContext; diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/TextureKey.java b/ardor3d-core/src/main/java/com/ardor3d/util/TextureKey.java index fe0274b..b0d83ce 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/TextureKey.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/TextureKey.java @@ -12,7 +12,9 @@ package com.ardor3d.util; import java.io.IOException; import java.lang.ref.WeakReference; +import java.util.ArrayList; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; @@ -26,7 +28,6 @@ import com.ardor3d.util.export.InputCapsule; import com.ardor3d.util.export.OutputCapsule; import com.ardor3d.util.export.Savable; import com.ardor3d.util.resource.ResourceSource; -import com.google.common.collect.Lists; /** * <code>TextureKey</code> provides a way for the TextureManager to cache and retrieve <code>Texture</code> objects. @@ -73,7 +74,7 @@ final public class TextureKey implements Savable { protected transient int _code = Integer.MAX_VALUE; /** cache of texturekey objects allowing us to find an existing texture key. */ - protected static final List<WeakReference<TextureKey>> _keyCache = Lists.newLinkedList(); + protected static final List<WeakReference<TextureKey>> _keyCache = new LinkedList<WeakReference<TextureKey>>(); private static final Integer ZERO = new Integer(0); @@ -83,7 +84,7 @@ final public class TextureKey implements Savable { /** DO NOT USE. FOR INTERNAL USE ONLY */ protected TextureKey() { if (Constants.useMultipleContexts) { - _dirtyContexts = Lists.newArrayList(); + _dirtyContexts = new ArrayList<WeakReference<Object>>(); } else { _dirtyContexts = null; } diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/export/binary/BinaryExporter.java b/ardor3d-core/src/main/java/com/ardor3d/util/export/binary/BinaryExporter.java index 471e053..61090b2 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/export/binary/BinaryExporter.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/export/binary/BinaryExporter.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.HashMap; +import java.util.IdentityHashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; @@ -28,8 +29,6 @@ import com.ardor3d.math.MathUtils; import com.ardor3d.util.export.Ardor3dExporter; import com.ardor3d.util.export.ByteUtils; import com.ardor3d.util.export.Savable; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; /** * Exports to the ardor3d Binary Format. Format descriptor: (each numbered item denotes a series of bytes that follows @@ -124,14 +123,14 @@ public class BinaryExporter implements Ardor3dExporter { protected int _aliasCount = 1; protected int _idCount = 1; - protected final Map<Savable, BinaryIdContentPair> _contentTable = Maps.newIdentityHashMap(); + protected final Map<Savable, BinaryIdContentPair> _contentTable = new IdentityHashMap<Savable, BinaryIdContentPair>(); - protected final Map<Integer, Integer> _locationTable = Maps.newHashMap(); + protected final Map<Integer, Integer> _locationTable = new HashMap<Integer, Integer>(); // key - class name, value = bco - protected final Map<String, BinaryClassObject> _classes = Maps.newHashMap(); + protected final Map<String, BinaryClassObject> _classes = new HashMap<String, BinaryClassObject>(); - protected final List<Savable> _contentKeys = Lists.newArrayList(); + protected final List<Savable> _contentKeys = new ArrayList<Savable>(); public BinaryExporter() { this(DEFAULT_COMPRESSION); diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/export/binary/BinaryImporter.java b/ardor3d-core/src/main/java/com/ardor3d/util/export/binary/BinaryImporter.java index 3c0a4d2..c9944a2 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/export/binary/BinaryImporter.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/export/binary/BinaryImporter.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.HashMap; +import java.util.IdentityHashMap; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -31,19 +32,18 @@ import com.ardor3d.util.export.Ardor3dImporter; import com.ardor3d.util.export.ByteUtils; import com.ardor3d.util.export.ReadListener; import com.ardor3d.util.export.Savable; -import com.google.common.collect.Maps; public class BinaryImporter implements Ardor3dImporter { private static final Logger logger = Logger.getLogger(BinaryImporter.class.getName()); // Key - alias, object - bco - protected final Map<String, BinaryClassObject> _classes = Maps.newHashMap(); + protected final Map<String, BinaryClassObject> _classes = new HashMap<String, BinaryClassObject>(); // Key - id, object - the savable - protected final Map<Integer, Savable> _contentTable = Maps.newHashMap(); + protected final Map<Integer, Savable> _contentTable = new HashMap<Integer, Savable>(); // Key - savable, object - capsule - protected final Map<Savable, BinaryInputCapsule> _capsuleTable = Maps.newIdentityHashMap(); + protected final Map<Savable, BinaryInputCapsule> _capsuleTable = new IdentityHashMap<Savable, BinaryInputCapsule>(); // Key - id, opject - location in the file - protected final Map<Integer, Integer> _locationTable = Maps.newHashMap(); + protected final Map<Integer, Integer> _locationTable = new HashMap<Integer, Integer>(); protected byte[] _dataArray = null; protected int _aliasWidth = 0; diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMInputCapsule.java b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMInputCapsule.java index 2a92b9e..54de7e4 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMInputCapsule.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMInputCapsule.java @@ -39,7 +39,6 @@ import com.ardor3d.util.TextureManager; import com.ardor3d.util.export.InputCapsule; import com.ardor3d.util.export.Savable; import com.ardor3d.util.geom.BufferUtils; -import com.google.common.collect.Lists; /** * Part of the ardor3d XML IO system @@ -985,7 +984,7 @@ public class DOMInputCapsule implements InputCapsule { final String s = tmpEl.getAttribute("size"); final int size = Integer.parseInt(s); @SuppressWarnings("rawtypes") - final List tmp = Lists.newArrayList(); + final List tmp = new ArrayList(); _currentElem = findFirstChildElement(tmpEl); for (int i = 0; i < size; i++) { tmp.add(readSavableFromCurrentElem(null)); diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/geom/GeometryTool.java b/ardor3d-core/src/main/java/com/ardor3d/util/geom/GeometryTool.java index a9f4f3f..709318b 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/geom/GeometryTool.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/geom/GeometryTool.java @@ -11,6 +11,7 @@ package com.ardor3d.util.geom; import java.util.EnumSet; +import java.util.HashMap; import java.util.Map; import java.util.logging.Logger; @@ -21,7 +22,6 @@ import com.ardor3d.scenegraph.IndexBufferData; import com.ardor3d.scenegraph.Mesh; import com.ardor3d.scenegraph.Node; import com.ardor3d.scenegraph.Spatial; -import com.google.common.collect.Maps; /** * This tool assists in reducing geometry information.<br> @@ -111,8 +111,8 @@ public class GeometryTool { } } - final Map<VertKey, Integer> store = Maps.newHashMap(); - final Map<Integer, Integer> indexRemap = Maps.newHashMap(); + final Map<VertKey, Integer> store = new HashMap<VertKey, Integer>(); + final Map<Integer, Integer> indexRemap = new HashMap<Integer, Integer>(); int good = 0; long group; for (int x = 0, max = verts.length; x < max; x++) { diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/geom/MeshCombiner.java b/ardor3d-core/src/main/java/com/ardor3d/util/geom/MeshCombiner.java index fdc3f7c..369afb6 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/geom/MeshCombiner.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/geom/MeshCombiner.java @@ -12,6 +12,8 @@ package com.ardor3d.util.geom; import java.nio.FloatBuffer; import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.EnumMap; import java.util.List; @@ -28,7 +30,6 @@ import com.ardor3d.scenegraph.Node; import com.ardor3d.scenegraph.Spatial; import com.ardor3d.scenegraph.visitor.Visitor; import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Lists; import com.google.common.collect.Multimap; /** @@ -62,7 +63,7 @@ public class MeshCombiner { } public final static Mesh combine(final Spatial source, final MeshCombineLogic logic) { - final List<Mesh> sources = Lists.newArrayList(); + final List<Mesh> sources = new ArrayList<Mesh>(); source.acceptVisitor(new Visitor() { @Override public void visit(final Spatial spatial) { @@ -85,7 +86,7 @@ public class MeshCombiner { * @return the combined Mesh. */ public final static Mesh combine(final Mesh... sources) { - return combine(Lists.newArrayList(sources)); + return combine(new ArrayList<Mesh>(Arrays.asList(sources))); } /** @@ -128,7 +129,7 @@ public class MeshCombiner { protected EnumMap<StateType, RenderState> states = null; protected MeshData data = new MeshData(); protected BoundingVolume volumeType = null; - protected List<Mesh> sources = Lists.newArrayList(); + protected List<Mesh> sources = new ArrayList<Mesh>(); private FloatBufferData vertices; private FloatBufferData colors; private FloatBufferData normals; @@ -236,7 +237,7 @@ public class MeshCombiner { normals = useNormals ? new FloatBufferData(totalVertices * 3, 3) : null; data.setNormalCoords(normals); - texCoordsList = Lists.newArrayListWithCapacity(maxTextures); + texCoordsList = new ArrayList<FloatBufferData>(maxTextures); for (int i = 0; i < maxTextures; i++) { texCoordsList.add(new FloatBufferData(totalVertices * texCoords, texCoords)); } @@ -358,8 +359,8 @@ class IndexCombiner { } public void saveTo(final MeshData data) { - final List<IntBuffer> sections = Lists.newArrayList(); - final List<IndexMode> modes = Lists.newArrayList(); + final List<IntBuffer> sections = new ArrayList<IntBuffer>(); + final List<IndexMode> modes = new ArrayList<IndexMode>(); int max = 0; // walk through index modes and combine those we can. for (final IndexMode mode : sectionMap.keySet()) { diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/geom/VertGroupData.java b/ardor3d-core/src/main/java/com/ardor3d/util/geom/VertGroupData.java index 91bc14a..429fece 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/geom/VertGroupData.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/geom/VertGroupData.java @@ -11,16 +11,16 @@ package com.ardor3d.util.geom; import java.util.EnumSet; +import java.util.HashMap; import java.util.Map; import com.ardor3d.util.geom.GeometryTool.MatchCondition; -import com.google.common.collect.Maps; public class VertGroupData { public static final int DEFAULT_GROUP = 0; - private final Map<Long, EnumSet<MatchCondition>> _groupConditions = Maps.newHashMap(); + private final Map<Long, EnumSet<MatchCondition>> _groupConditions = new HashMap<Long, EnumSet<MatchCondition>>(); private long[] _vertGroups = null; public VertGroupData() {} diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/resource/ResourceLocatorTool.java b/ardor3d-core/src/main/java/com/ardor3d/util/resource/ResourceLocatorTool.java index 93b6597..353c45a 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/resource/ResourceLocatorTool.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/resource/ResourceLocatorTool.java @@ -18,14 +18,13 @@ import java.net.URLDecoder; import java.util.ArrayList; import java.util.Enumeration; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -import com.google.common.collect.Sets; - /** * Manager class for locator utility classes used to find various assets. (XXX: Needs more documentation) */ @@ -163,7 +162,7 @@ public class ResourceLocatorTool { * @return a set containing the located URLs of the named resource. */ public static Set<URL> getClassPathResources(final Class<?> clazz, final String name) { - final Set<URL> results = Sets.newHashSet(); + final Set<URL> results = new HashSet<URL>(); Enumeration<URL> urls = null; try { urls = Thread.currentThread().getContextClassLoader().getResources(name); diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/stat/MultiStatSample.java b/ardor3d-core/src/main/java/com/ardor3d/util/stat/MultiStatSample.java index 1674c86..0b85ad2 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/stat/MultiStatSample.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/stat/MultiStatSample.java @@ -13,10 +13,8 @@ package com.ardor3d.util.stat; import java.util.HashMap; import java.util.Set; -import com.google.common.collect.Maps; - public class MultiStatSample { - private final HashMap<StatType, StatValue> _values = Maps.newHashMap(); + private final HashMap<StatType, StatValue> _values = new HashMap<StatType, StatValue>(); private double _elapsedTime = 0.0; public static MultiStatSample createNew(final HashMap<StatType, StatValue> current) { diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/stat/StatCollector.java b/ardor3d-core/src/main/java/com/ardor3d/util/stat/StatCollector.java index 51e3432..0c54a43 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/stat/StatCollector.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/stat/StatCollector.java @@ -10,6 +10,7 @@ package com.ardor3d.util.stat; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -19,7 +20,6 @@ import java.util.Stack; import java.util.logging.Logger; import com.ardor3d.util.Timer; -import com.google.common.collect.Lists; /** * This class acts as a centralized data store for statistics. As data is added to the collector, a sum total is kept as @@ -51,7 +51,7 @@ public abstract class StatCollector { protected static double lastTimeCheckMS = 0; - protected static List<StatListener> listeners = Lists.newArrayList(); + protected static List<StatListener> listeners = new ArrayList<StatListener>(); protected static double startOffset = 0; |