diff options
author | renanse <[email protected]> | 2012-12-19 17:30:05 -0600 |
---|---|---|
committer | renanse <[email protected]> | 2012-12-19 17:30:05 -0600 |
commit | 580b097cb031ee97180849736f66b1c60fe515e1 (patch) | |
tree | a328d685d4141e6a05f84962dead09f5af93f836 /ardor3d-core/src/main/java | |
parent | d38661526216e2efe7e1d8abf01cf8d4f21fe53a (diff) |
Various audit cleanup suggestions.
Diffstat (limited to 'ardor3d-core/src/main/java')
9 files changed, 60 insertions, 66 deletions
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 dca8689..70e8c1c 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java @@ -75,11 +75,11 @@ public class ControllerState { for (final String controllerStateKey : _controllerStates.keySet()) {
final Map<String, Float> state = _controllerStates.get(controllerStateKey);
- stateString.append("[").append(controllerStateKey);
+ stateString.append('[').append(controllerStateKey);
for (final String stateKey : state.keySet()) {
- stateString.append("[").append(stateKey).append(":").append(state.get(stateKey)).append("]");
+ stateString.append('[').append(stateKey).append(':').append(state.get(stateKey)).append(']');
}
- stateString.append("]");
+ stateString.append(']');
}
return stateString.toString();
diff --git a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/shape/Tube.java b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/shape/Tube.java index 5b93988..4f8773f 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/shape/Tube.java +++ b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/shape/Tube.java @@ -20,12 +20,6 @@ import com.ardor3d.util.geom.BufferUtils; public class Tube extends Mesh { - private static final long serialVersionUID = 1L; - - public static long getSerialVersionUID() { - return serialVersionUID; - } - private int _axisSamples; private int _radialSamples; @@ -137,43 +131,43 @@ public class Tube extends Mesh { // outer cylinder for (int radialCount = 0; radialCount < _radialSamples + 1; radialCount++) { for (int axisCount = 0; axisCount < _axisSamples + 1; axisCount++) { - _meshData.getVertexBuffer().put((float) (cos[radialCount % _radialSamples] * _outerRadius)).put( - (float) (axisStep * axisCount - halfHeight)).put( - (float) (sin[radialCount % _radialSamples] * _outerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount % _radialSamples] * _outerRadius)) + .put((float) (axisStep * axisCount - halfHeight)) + .put((float) (sin[radialCount % _radialSamples] * _outerRadius)); if (_viewInside) { - _meshData.getNormalBuffer().put((float) cos[radialCount % _radialSamples]).put(0).put( - (float) sin[radialCount % _radialSamples]); + _meshData.getNormalBuffer().put((float) cos[radialCount % _radialSamples]).put(0) + .put((float) sin[radialCount % _radialSamples]); } else { - _meshData.getNormalBuffer().put((float) -cos[radialCount % _radialSamples]).put(0).put( - (float) -sin[radialCount % _radialSamples]); + _meshData.getNormalBuffer().put((float) -cos[radialCount % _radialSamples]).put(0) + .put((float) -sin[radialCount % _radialSamples]); } - _meshData.getTextureCoords(0).getBuffer().put((float) (radialCount * inverseRadial)).put( - (float) (axisTextureStep * axisCount)); + _meshData.getTextureCoords(0).getBuffer().put((float) (radialCount * inverseRadial)) + .put((float) (axisTextureStep * axisCount)); } } // inner cylinder for (int radialCount = 0; radialCount < _radialSamples + 1; radialCount++) { for (int axisCount = 0; axisCount < _axisSamples + 1; axisCount++) { - _meshData.getVertexBuffer().put((float) (cos[radialCount % _radialSamples] * _innerRadius)).put( - (float) (axisStep * axisCount - halfHeight)).put( - (float) (sin[radialCount % _radialSamples] * _innerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount % _radialSamples] * _innerRadius)) + .put((float) (axisStep * axisCount - halfHeight)) + .put((float) (sin[radialCount % _radialSamples] * _innerRadius)); if (_viewInside) { - _meshData.getNormalBuffer().put((float) -cos[radialCount % _radialSamples]).put(0).put( - (float) -sin[radialCount % _radialSamples]); + _meshData.getNormalBuffer().put((float) -cos[radialCount % _radialSamples]).put(0) + .put((float) -sin[radialCount % _radialSamples]); } else { - _meshData.getNormalBuffer().put((float) cos[radialCount % _radialSamples]).put(0).put( - (float) sin[radialCount % _radialSamples]); + _meshData.getNormalBuffer().put((float) cos[radialCount % _radialSamples]).put(0) + .put((float) sin[radialCount % _radialSamples]); } - _meshData.getTextureCoords(0).getBuffer().put((float) (radialCount * inverseRadial)).put( - (float) (axisTextureStep * axisCount)); + _meshData.getTextureCoords(0).getBuffer().put((float) (radialCount * inverseRadial)) + .put((float) (axisTextureStep * axisCount)); } } // bottom edge for (int radialCount = 0; radialCount < _radialSamples; radialCount++) { - _meshData.getVertexBuffer().put((float) (cos[radialCount] * _outerRadius)).put((float) -halfHeight).put( - (float) (sin[radialCount] * _outerRadius)); - _meshData.getVertexBuffer().put((float) (cos[radialCount] * _innerRadius)).put((float) -halfHeight).put( - (float) (sin[radialCount] * _innerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount] * _outerRadius)).put((float) -halfHeight) + .put((float) (sin[radialCount] * _outerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount] * _innerRadius)).put((float) -halfHeight) + .put((float) (sin[radialCount] * _innerRadius)); if (_viewInside) { _meshData.getNormalBuffer().put(0).put(1).put(0); _meshData.getNormalBuffer().put(0).put(1).put(0); @@ -181,17 +175,17 @@ public class Tube extends Mesh { _meshData.getNormalBuffer().put(0).put(-1).put(0); _meshData.getNormalBuffer().put(0).put(-1).put(0); } - _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + 0.5 * cos[radialCount])).put( - (float) (0.5 + 0.5 * sin[radialCount])); + _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + 0.5 * cos[radialCount])) + .put((float) (0.5 + 0.5 * sin[radialCount])); _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + innerOuterRatio * 0.5 * cos[radialCount])) .put((float) (0.5 + innerOuterRatio * 0.5 * sin[radialCount])); } // top edge for (int radialCount = 0; radialCount < _radialSamples; radialCount++) { - _meshData.getVertexBuffer().put((float) (cos[radialCount] * _outerRadius)).put((float) halfHeight).put( - (float) (sin[radialCount] * _outerRadius)); - _meshData.getVertexBuffer().put((float) (cos[radialCount] * _innerRadius)).put((float) halfHeight).put( - (float) (sin[radialCount] * _innerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount] * _outerRadius)).put((float) halfHeight) + .put((float) (sin[radialCount] * _outerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount] * _innerRadius)).put((float) halfHeight) + .put((float) (sin[radialCount] * _innerRadius)); if (_viewInside) { _meshData.getNormalBuffer().put(0).put(-1).put(0); _meshData.getNormalBuffer().put(0).put(-1).put(0); @@ -199,8 +193,8 @@ public class Tube extends Mesh { _meshData.getNormalBuffer().put(0).put(1).put(0); _meshData.getNormalBuffer().put(0).put(1).put(0); } - _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + 0.5 * cos[radialCount])).put( - (float) (0.5 + 0.5 * sin[radialCount])); + _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + 0.5 * cos[radialCount])) + .put((float) (0.5 + 0.5 * sin[radialCount])); _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + innerOuterRatio * 0.5 * cos[radialCount])) .put((float) (0.5 + innerOuterRatio * 0.5 * sin[radialCount])); } 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 9e9e343..9d5991e 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 @@ -234,7 +234,7 @@ public class BMFont implements Savable { xml.append(_info.padding[i]);
if (i < (_info.padding.length - 1)) {
- xml.append(",");
+ xml.append(',');
}
}
@@ -244,7 +244,7 @@ public class BMFont implements Savable { xml.append(_info.spacing[i]);
if (i < (_info.spacing.length - 1)) {
- xml.append(",");
+ xml.append(',');
}
}
@@ -859,7 +859,7 @@ public class BMFont implements Savable { void setUseBlend(final boolean blend) {
_useBlend = blend;
- if (blend == false) {
+ if (!_useBlend) {
blendState.setBlendEnabled(false);
blendState.setReference(_blendDisabledTestRef);
zBuffState.setWritable(true);
diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/GameTaskQueue.java b/ardor3d-core/src/main/java/com/ardor3d/util/GameTaskQueue.java index 3ae77d5..0aab109 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/GameTaskQueue.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/GameTaskQueue.java @@ -54,7 +54,7 @@ public class GameTaskQueue { */ public void setExecuteMultiple(final boolean executeMultiple) { _executeMultiple.set(executeMultiple); - if (executeMultiple == true) { + if (executeMultiple) { _executionTime = Integer.MAX_VALUE; } } @@ -79,7 +79,7 @@ public class GameTaskQueue { * @return -1 if executeAll is false, else min time allocated for task execution per frame */ public long getExecutionTime() { - if (_executeMultiple.get() == false) { + if (!_executeMultiple.get()) { return -1; } return _executionTime; diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMOutputCapsule.java b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMOutputCapsule.java index b07df78..ce2e9c7 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMOutputCapsule.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMOutputCapsule.java @@ -86,7 +86,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final byte b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -105,9 +105,9 @@ public class DOMOutputCapsule implements OutputCapsule { for (final byte[] bs : value) { for (final byte b : bs) { buf.append(b); - buf.append(" "); + buf.append(' '); } - buf.append(" "); + buf.append(' '); } // remove last spaces buf.setLength(buf.length() - 2); @@ -137,7 +137,7 @@ public class DOMOutputCapsule implements OutputCapsule { for (final int b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(Math.max(0, buf.length() - 1)); @@ -180,7 +180,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final float b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -203,7 +203,7 @@ public class DOMOutputCapsule implements OutputCapsule { for (final float[] bs : value) { for (final float b : bs) { buf.append(b); - buf.append(" "); + buf.append(' '); } } // remove last space @@ -230,7 +230,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final double b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -273,7 +273,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final long b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -316,7 +316,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final short b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -359,7 +359,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final boolean b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(Math.max(0, buf.length() - 1)); @@ -439,7 +439,7 @@ public class DOMOutputCapsule implements OutputCapsule { final StringBuilder buf = new StringBuilder(); for (int i = value.nextSetBit(0); i >= 0; i = value.nextSetBit(i + 1)) { buf.append(i); - buf.append(" "); + buf.append(' '); } buf.setLength(Math.max(0, buf.length() - 1)); _currentElement.setAttribute(name, buf.toString()); @@ -680,7 +680,7 @@ public class DOMOutputCapsule implements OutputCapsule { value.rewind(); while (value.hasRemaining()) { buf.append(value.get()); - buf.append(" "); + buf.append(' '); } buf.setLength(Math.max(0, buf.length() - 1)); value.position(pos); @@ -703,7 +703,7 @@ public class DOMOutputCapsule implements OutputCapsule { value.rewind(); while (value.hasRemaining()) { buf.append(value.get()); - buf.append(" "); + buf.append(' '); } buf.setLength(buf.length() - 1); value.position(pos); @@ -726,7 +726,7 @@ public class DOMOutputCapsule implements OutputCapsule { value.rewind(); while (value.hasRemaining()) { buf.append(value.get()); - buf.append(" "); + buf.append(' '); } buf.setLength(buf.length() - 1); value.position(pos); @@ -749,7 +749,7 @@ public class DOMOutputCapsule implements OutputCapsule { value.rewind(); while (value.hasRemaining()) { buf.append(value.get()); - buf.append(" "); + buf.append(' '); } buf.setLength(buf.length() - 1); value.position(pos); diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMSerializer.java b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMSerializer.java index eef7b79..34000f0 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMSerializer.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMSerializer.java @@ -53,7 +53,7 @@ public class DOMSerializer { public void setIndent(final int numSpaces) { final StringBuffer buffer = new StringBuffer(); for (int i = 0; i < numSpaces; i++) { - buffer.append("\t"); + buffer.append('\t'); } _indent = buffer.toString(); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/geom/BufferUtils.java b/ardor3d-core/src/main/java/com/ardor3d/util/geom/BufferUtils.java index ebe13ca..6017a8b 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/geom/BufferUtils.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/geom/BufferUtils.java @@ -1683,13 +1683,13 @@ public final class BufferUtils { if (store == null) { store = new StringBuilder(); } - store.append("Existing buffers: ").append(bufs.size()).append("\n"); + store.append("Existing buffers: ").append(bufs.size()).append('\n'); store.append("(b: ").append(bBufs).append(" f: ").append(fBufs).append(" i: ").append(iBufs).append(" s: ") - .append(sBufs).append(" d: ").append(dBufs).append(")").append("\n"); + .append(sBufs).append(" d: ").append(dBufs).append(')').append('\n'); store.append("Total direct memory held: ").append(totalHeld / 1024).append("kb\n"); store.append("(b: ").append(bBufsM / 1024).append("kb f: ").append(fBufsM / 1024).append("kb i: ") .append(iBufsM / 1024).append("kb s: ").append(sBufsM / 1024).append("kb d: ").append(dBufsM / 1024) - .append("kb)").append("\n"); + .append("kb)").append('\n'); if (printStout) { System.out.println(store.toString()); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/geom/NormalGenerator.java b/ardor3d-core/src/main/java/com/ardor3d/util/geom/NormalGenerator.java index aa9d32a..35c4a41 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/geom/NormalGenerator.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/geom/NormalGenerator.java @@ -723,7 +723,7 @@ public class NormalGenerator { for (int i = 0; i < 3; i++) { final Edge edge = edges[i]; if (edge == null) { - result.append("?"); + result.append('?'); } else { if (edge.newI0 > -1) { result.append(edge.newI0); @@ -735,7 +735,7 @@ public class NormalGenerator { result.append(", "); } } - result.append(")"); + result.append(')'); return result.toString(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/stat/graph/TabledLabelGrapher.java b/ardor3d-core/src/main/java/com/ardor3d/util/stat/graph/TabledLabelGrapher.java index 359c158..bd32181 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/stat/graph/TabledLabelGrapher.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/stat/graph/TabledLabelGrapher.java @@ -239,7 +239,7 @@ public class TabledLabelGrapher extends AbstractStatGrapher { final StringBuilder format = new StringBuilder(decimals > 0 ? "0.0" : "0"); for (int x = 1; x < decimals; x++) { - format.append("0"); + format.append('0'); } return new DecimalFormat(format.toString()).format(val) + post; |