diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
commit | 556d92b63555a085b25e32b1cd55afce24edd07a (patch) | |
tree | 6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/com/jogamp/graph/curve | |
parent | a90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve')
6 files changed, 75 insertions, 74 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java index d4977669e..939035c69 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java +++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java @@ -106,7 +106,7 @@ public class OutlineShape implements Comparable<OutlineShape> { public final int state; - VerticesState(int state){ + VerticesState(final int state){ this.state = state; } } @@ -149,7 +149,7 @@ public class OutlineShape implements Comparable<OutlineShape> { /** Create a new Outline based Shape */ - public OutlineShape(Vertex.Factory<? extends Vertex> factory) { + public OutlineShape(final Vertex.Factory<? extends Vertex> factory) { this.vertexFactory = factory; this.outlines = new ArrayList<Outline>(3); this.outlines.add(new Outline()); @@ -235,7 +235,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @param outline Outline object to be added * @throws NullPointerException if the {@link Outline} element is null */ - public final void addOutline(Outline outline) throws NullPointerException { + public final void addOutline(final Outline outline) throws NullPointerException { addOutline(outlines.size(), outline); } @@ -251,7 +251,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @throws NullPointerException if the {@link Outline} element is null * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber()) */ - public final void addOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException { + public final void addOutline(final int position, final Outline outline) throws NullPointerException, IndexOutOfBoundsException { if (null == outline) { throw new NullPointerException("outline is null"); } @@ -285,7 +285,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @throws NullPointerException if the {@link OutlineShape} is null * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber()) */ - public final void addOutlineShape(OutlineShape outlineShape) throws NullPointerException { + public final void addOutlineShape(final OutlineShape outlineShape) throws NullPointerException { if (null == outlineShape) { throw new NullPointerException("OutlineShape is null"); } @@ -304,7 +304,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @throws NullPointerException if the {@link Outline} element is null * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber()) */ - public final void setOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException { + public final void setOutline(final int position, final Outline outline) throws NullPointerException, IndexOutOfBoundsException { if (null == outline) { throw new NullPointerException("outline is null"); } @@ -319,7 +319,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @param position of the to be removed Outline * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber()) */ - public final Outline removeOutline(int position) throws IndexOutOfBoundsException { + public final Outline removeOutline(final int position) throws IndexOutOfBoundsException { dirtyBits |= DIRTY_BOUNDS | DIRTY_TRIANGLES | DIRTY_VERTICES; return outlines.remove(position); } @@ -337,7 +337,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * Returns the {@code Outline} at {@code position} * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber()) */ - public final Outline getOutline(int position) throws IndexOutOfBoundsException { + public final Outline getOutline(final int position) throws IndexOutOfBoundsException { return outlines.get(position); } @@ -345,7 +345,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * Adds a vertex to the last open outline to the shape's tail. * @param v the vertex to be added to the OutlineShape */ - public final void addVertex(Vertex v) { + public final void addVertex(final Vertex v) { final Outline lo = getLastOutline(); lo.addVertex(v); if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) { @@ -360,7 +360,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @param position indx at which the vertex will be added * @param v the vertex to be added to the OutlineShape */ - public final void addVertex(int position, Vertex v) { + public final void addVertex(final int position, final Vertex v) { final Outline lo = getLastOutline(); lo.addVertex(position, v); if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) { @@ -378,7 +378,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @param onCurve flag if this vertex is on the final curve or defines a curved region * of the shape around this vertex. */ - public final void addVertex(float x, float y, boolean onCurve) { + public final void addVertex(final float x, final float y, final boolean onCurve) { addVertex(vertexFactory.create(x, y, 0f, onCurve)); } @@ -391,7 +391,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @param onCurve flag if this vertex is on the final curve or defines a curved region * of the shape around this vertex. */ - public final void addVertex(float x, float y, float z, boolean onCurve) { + public final void addVertex(final float x, final float y, final float z, final boolean onCurve) { addVertex(vertexFactory.create(x, y, z, onCurve)); } @@ -407,7 +407,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @param onCurve flag if this vertex is on the final curve or defines a curved region * of the shape around this vertex. */ - public final void addVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) { + public final void addVertex(final float[] coordsBuffer, final int offset, final int length, final boolean onCurve) { addVertex(vertexFactory.create(coordsBuffer, offset, length, onCurve)); } @@ -421,7 +421,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @param closeTail if true, a clone of the first vertex will be appended, * otherwise a clone of the last vertex will be prepended. */ - public final void closeLastOutline(boolean closeTail) { + public final void closeLastOutline(final boolean closeTail) { if( getLastOutline().setClosed(true) ) { dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES; } @@ -443,7 +443,7 @@ public class OutlineShape implements Comparable<OutlineShape> { // checkPossibleOverlaps = false; } - private void subdivideTriangle(final Outline outline, Vertex a, Vertex b, Vertex c, int index){ + private void subdivideTriangle(final Outline outline, final Vertex a, final Vertex b, final Vertex c, final int index){ VectorUtil.midVec3(tmpV1, a.getCoord(), b.getCoord()); VectorUtil.midVec3(tmpV3, b.getCoord(), c.getCoord()); VectorUtil.midVec3(tmpV2, tmpV1, tmpV3); @@ -516,7 +516,7 @@ public class OutlineShape implements Comparable<OutlineShape> { final int count = getOutlineNumber(); for (int cc = 0; cc < count; cc++) { final Outline outline = getOutline(cc); - int vertexCount = outline.getVertexCount(); + final int vertexCount = outline.getVertexCount(); for(int i=0; i < vertexCount; i++) { final Vertex current = outline.getVertex(i); if(current.isOnCurve() || current == a || current == b || current == c) { @@ -549,7 +549,7 @@ public class OutlineShape implements Comparable<OutlineShape> { final int count = getOutlineNumber(); for (int cc = 0; cc < count; cc++) { final Outline outline = getOutline(cc); - int vertexCount = outline.getVertexCount(); + final int vertexCount = outline.getVertexCount(); for(int i=0; i < vertexCount; i++) { final Vertex current = outline.getVertex(i); if(current.isOnCurve() || current == a || current == b || current == c) { @@ -679,7 +679,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * @return an arraylist of triangles representing the filled region * which is produced by the combination of the outlines */ - public ArrayList<Triangle> getTriangles(VerticesState destinationType) { + public ArrayList<Triangle> getTriangles(final VerticesState destinationType) { final boolean updated; if(destinationType != VerticesState.QUADRATIC_NURBS) { throw new IllegalStateException("destinationType "+destinationType.name()+" not supported (currently "+outlineState.name()+")"); @@ -724,7 +724,7 @@ public class OutlineShape implements Comparable<OutlineShape> { private static Comparator<Outline> reversSizeComparator = new Comparator<Outline>() { @Override - public int compare(Outline o1, Outline o2) { + public int compare(final Outline o1, final Outline o2) { return o2.compareTo(o1); // reverse ! } }; @@ -767,7 +767,7 @@ public class OutlineShape implements Comparable<OutlineShape> { * same outlineState, equal bounds and equal outlines in the same order */ @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { if( obj == this) { return true; } diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java index e101be33f..350e3ef41 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/Region.java +++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java @@ -115,15 +115,15 @@ public abstract class Region { protected final AABBox box = new AABBox(); protected Frustum frustum = null; - public static boolean isVBAA(int renderModes) { + public static boolean isVBAA(final int renderModes) { return 0 != (renderModes & Region.VBAA_RENDERING_BIT); } - public static boolean isMSAA(int renderModes) { + public static boolean isMSAA(final int renderModes) { return 0 != (renderModes & Region.MSAA_RENDERING_BIT); } - public static boolean isTwoPass(int renderModes) { + public static boolean isTwoPass(final int renderModes) { return 0 != ( renderModes & ( Region.VBAA_RENDERING_BIT | Region.MSAA_RENDERING_BIT) ); } @@ -132,7 +132,7 @@ public abstract class Region { * i.e. the bit {@link #VARWEIGHT_RENDERING_BIT} is set, * otherwise false. */ - public static boolean hasVariableWeight(int renderModes) { + public static boolean hasVariableWeight(final int renderModes) { return 0 != (renderModes & Region.VARWEIGHT_RENDERING_BIT); } @@ -141,7 +141,7 @@ public abstract class Region { * i.e. the bit {@link #COLORCHANNEL_RENDERING_BIT} is set, * otherwise false. */ - public static boolean hasColorChannel(int renderModes) { + public static boolean hasColorChannel(final int renderModes) { return 0 != (renderModes & Region.COLORCHANNEL_RENDERING_BIT); } @@ -150,11 +150,11 @@ public abstract class Region { * i.e. the bit {@link #COLORTEXTURE_RENDERING_BIT} is set, * otherwise false. */ - public static boolean hasColorTexture(int renderModes) { + public static boolean hasColorTexture(final int renderModes) { return 0 != (renderModes & Region.COLORTEXTURE_RENDERING_BIT); } - public static String getRenderModeString(int renderModes) { + public static String getRenderModeString(final int renderModes) { final String curveS = hasVariableWeight(renderModes) ? "-curve" : ""; final String cChanS = hasColorChannel(renderModes) ? "-cols" : ""; final String cTexS = hasColorTexture(renderModes) ? "-ctex" : ""; @@ -167,7 +167,7 @@ public abstract class Region { } } - protected Region(int regionRenderModes) { + protected Region(final int regionRenderModes) { this.renderModes = regionRenderModes; this.quality = MAX_QUALITY; } @@ -187,7 +187,7 @@ public abstract class Region { public final int getQuality() { return quality; } /** See {@link #MAX_QUALITY} */ - public final void setQuality(int q) { quality=q; } + public final void setQuality(final int q) { quality=q; } protected void clearImpl() { dirty = DIRTY_SHAPE | DIRTY_STATE; @@ -241,13 +241,13 @@ public abstract class Region { /** * Set {@link Frustum} culling for {@link #addOutlineShape(OutlineShape, AffineTransform, float[])}. */ - public final void setFrustum(Frustum frustum) { + public final void setFrustum(final Frustum frustum) { this.frustum = frustum; } final float[] coordsEx = new float[3]; - private void pushNewVertexImpl(final Vertex vertIn, final AffineTransform transform, float[] rgba) { + private void pushNewVertexImpl(final Vertex vertIn, final AffineTransform transform, final float[] rgba) { if( null != transform ) { final float[] coordsIn = vertIn.getCoord(); transform.transform(coordsIn, coordsEx); @@ -261,7 +261,7 @@ public abstract class Region { numVertices++; } - private void pushNewVertexIdxImpl(final Vertex vertIn, final AffineTransform transform, float[] rgba) { + private void pushNewVertexIdxImpl(final Vertex vertIn, final AffineTransform transform, final float[] rgba) { pushIndex(numVertices); pushNewVertexImpl(vertIn, transform, rgba); } @@ -308,7 +308,7 @@ public abstract class Region { final int idxOffset = numVertices; int vertsVNewIdxCount = 0, vertsTMovIdxCount = 0, vertsTNewIdxCount = 0, tris = 0; - int vertsDupCountV = 0, vertsDupCountT = 0, vertsKnownMovedT = 0; + final int vertsDupCountV = 0, vertsDupCountT = 0, vertsKnownMovedT = 0; if( vertsIn.size() >= 3 ) { if(DEBUG_INSTANCE) { System.err.println("Region.addOutlineShape(): Processing Vertices"); @@ -399,7 +399,7 @@ public abstract class Region { /** * See {@link #markShapeDirty()} and {@link #markStateDirty()}. */ - protected final void clearDirtyBits(int v) { + protected final void clearDirtyBits(final int v) { dirty &= ~v; } protected final int getDirtyBits() { return dirty; } diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java index 568b8ddac..8f3a10d9d 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java @@ -75,7 +75,7 @@ public abstract class GLRegion extends Region { protected final TextureSequence colorTexSeq;
- protected GLRegion(int renderModes, TextureSequence colorTexSeq) {
+ protected GLRegion(final int renderModes, final TextureSequence colorTexSeq) {
super(renderModes);
this.colorTexSeq = colorTexSeq;
}
@@ -103,7 +103,7 @@ public abstract class GLRegion extends Region { /**
* Delete and clear the associated OGL objects.
*/
- public final void destroy(GL2ES2 gl) {
+ public final void destroy(final GL2ES2 gl) {
clear(gl);
destroyImpl(gl);
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java index 754eb56e8..9a175c030 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java @@ -207,7 +207,7 @@ public class RegionRenderer { initialized = true; } - public final void destroy(GL2ES2 gl) { + public final void destroy(final GL2ES2 gl) { if(!initialized){ if(DEBUG_INSTANCE) { System.err.println("TextRenderer: Not initialized!"); @@ -234,7 +234,7 @@ public class RegionRenderer { * </p> * @see #create(RenderState, GLCallback, GLCallback) */ - public final void enable(GL2ES2 gl, boolean enable) { + public final void enable(final GL2ES2 gl, final boolean enable) { if( enable ) { if( null != enableCallback ) { enableCallback.run(gl, this); @@ -253,12 +253,12 @@ public class RegionRenderer { } /** No PMVMatrix operation is performed here. PMVMatrix is marked dirty. */ - public final void reshapeNotify(int width, int height) { + public final void reshapeNotify(final int width, final int height) { this.vp_width = width; this.vp_height = height; } - public final void reshapePerspective(float angle, int width, int height, float near, float far) { + public final void reshapePerspective(final float angle, final int width, final int height, final float near, final float far) { this.vp_width = width; this.vp_height = height; final float ratio = (float)width/(float)height; @@ -268,7 +268,7 @@ public class RegionRenderer { p.gluPerspective(angle, ratio, near, far); } - public final void reshapeOrtho(int width, int height, float near, float far) { + public final void reshapeOrtho(final int width, final int height, final float near, final float far) { this.vp_width = width; this.vp_height = height; final PMVMatrix p = rs.getMatrix(); @@ -298,7 +298,7 @@ public class RegionRenderer { // FIXME: Really required to have sampler2D def. precision ? If not, we can drop getFragmentShaderPrecision(..) and use default ShaderCode .. private static final String es2_precision_fp = "\nprecision mediump float;\nprecision mediump int;\nprecision mediump sampler2D;\n"; - private final String getFragmentShaderPrecision(GL2ES2 gl) { + private final String getFragmentShaderPrecision(final GL2ES2 gl) { if( gl.isGLES() ) { return es2_precision_fp; } @@ -489,7 +489,7 @@ public class RegionRenderer { try { posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "uniforms.glsl"); posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "varyings.glsl"); - } catch (IOException ioe) { + } catch (final IOException ioe) { throw new RuntimeException("Failed to read: includes", ioe); } if( 0 > posFp ) { @@ -514,7 +514,7 @@ public class RegionRenderer { } try { posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, shaderSegment); - } catch (IOException ioe) { + } catch (final IOException ioe) { throw new RuntimeException("Failed to read: "+shaderSegment, ioe); } if( 0 > posFp ) { diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java index f991855c0..6ff9bf9cd 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java @@ -34,6 +34,7 @@ import javax.media.opengl.GL2ES2; import javax.media.opengl.GLException; import javax.media.opengl.GLUniformData; +import jogamp.common.os.PlatformPropsImpl; import jogamp.graph.curve.opengl.shader.UniformNames; import com.jogamp.common.os.Platform; @@ -64,7 +65,7 @@ public class RenderState { * </p> */ public static final int BITHINT_BLENDING_ENABLED = 1 << 0 ; - + /** * Bitfield hint, {@link #isHintMaskSet(int) if set} * stating globally <i>enabled</i> {@link GL#GL_DEPTH_TEST}, otherwise <i>disabled</i>. @@ -81,15 +82,15 @@ public class RenderState { */ public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED = 1 << 1 ; - public static RenderState createRenderState(Vertex.Factory<? extends Vertex> pointFactory) { + public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory) { return new RenderState(pointFactory, null); } - public static RenderState createRenderState(Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) { + public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory, final PMVMatrix pmvMatrix) { return new RenderState(pointFactory, pmvMatrix); } - public static final RenderState getRenderState(GL2ES2 gl) { + public static final RenderState getRenderState(final GL2ES2 gl) { return (RenderState) gl.getContext().getAttachedObject(thisKey); } @@ -167,13 +168,13 @@ public class RenderState { return res; } - public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) { + public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) { if(null==sb) { sb = new StringBuilder(); } - sb.append("ProgramLocal[rsID ").append(rsId).append(Platform.NEWLINE); + sb.append("ProgramLocal[rsID ").append(rsId).append(PlatformPropsImpl.NEWLINE); // pmvMatrix.toString(sb, "%.2f"); - sb.append(gcu_PMVMatrix01).append(", ").append(Platform.NEWLINE); + sb.append(gcu_PMVMatrix01).append(", ").append(PlatformPropsImpl.NEWLINE); sb.append(gcu_ColorStatic).append(", "); sb.append(gcu_Weight).append("]"); return sb; @@ -185,7 +186,7 @@ public class RenderState { } } - protected RenderState(Vertex.Factory<? extends Vertex> vertexFactory, PMVMatrix pmvMatrix) { + protected RenderState(final Vertex.Factory<? extends Vertex> vertexFactory, final PMVMatrix pmvMatrix) { this.id = getNextID(); this.sp = null; this.vertexFactory = vertexFactory; @@ -226,11 +227,11 @@ public class RenderState { public final PMVMatrix getMatrix() { return pmvMatrix; } - public static boolean isWeightValid(float v) { + public static boolean isWeightValid(final float v) { return 0.0f <= v && v <= 1.9f ; } public final float getWeight() { return weight[0]; } - public final void setWeight(float v) { + public final void setWeight(final float v) { if( !isWeightValid(v) ) { throw new IllegalArgumentException("Weight out of range"); } @@ -238,11 +239,11 @@ public class RenderState { } - public final float[] getColorStatic(float[] rgbaColor) { + public final float[] getColorStatic(final float[] rgbaColor) { System.arraycopy(colorStatic, 0, rgbaColor, 0, 4); return rgbaColor; } - public final void setColorStatic(float r, float g, float b, float a){ + public final void setColorStatic(final float r, final float g, final float b, final float a){ colorStatic[0] = r; colorStatic[1] = g; colorStatic[2] = b; @@ -301,7 +302,7 @@ public class RenderState { * @param throwOnError TODO * @return true if no error occured, i.e. all locations found, otherwise false. */ - public final boolean updateAttributeLoc(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, boolean throwOnError) { + public final boolean updateAttributeLoc(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, final boolean throwOnError) { if( updateLocation || 0 > data.getLocation() ) { final boolean ok = 0 <= data.setLocation(gl, sp.program()); if( throwOnError && !ok ) { @@ -314,29 +315,29 @@ public class RenderState { } - public final boolean isHintMaskSet(int mask) { + public final boolean isHintMaskSet(final int mask) { return mask == ( hintBitfield & mask ); } - public final void setHintMask(int mask) { + public final void setHintMask(final int mask) { hintBitfield |= mask; } - public final void clearHintMask(int mask) { + public final void clearHintMask(final int mask) { hintBitfield &= ~mask; } - public void destroy(GL2ES2 gl) { + public void destroy(final GL2ES2 gl) { if( null != sp ) { sp.destroy(gl); sp = null; } } - public final RenderState attachTo(GL2ES2 gl) { + public final RenderState attachTo(final GL2ES2 gl) { return (RenderState) gl.getContext().attachObject(thisKey, this); } - public final boolean detachFrom(GL2ES2 gl) { - RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey); + public final boolean detachFrom(final GL2ES2 gl) { + final RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey); if(_rs == this) { gl.getContext().detachObject(thisKey); return true; diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java index aadbecc91..0fa1f49f1 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java @@ -88,7 +88,7 @@ public class TextRegionUtil { */ public static void processString(final ShapeVisitor visitor, final AffineTransform transform, final Font font, final float pixelSize, final CharSequence str, - final AffineTransform temp1, AffineTransform temp2) { + final AffineTransform temp1, final AffineTransform temp2) { final int charCount = str.length(); // region.setFlipped(true); @@ -248,7 +248,7 @@ public class TextRegionUtil { /** * Clear all cached {@link GLRegions}. */ - public void clear(GL2ES2 gl) { + public void clear(final GL2ES2 gl) { // fluchCache(gl) already called final Iterator<GLRegion> iterator = stringCacheMap.values().iterator(); while(iterator.hasNext()){ @@ -269,7 +269,7 @@ public class TextRegionUtil { * * @see #DEFAULT_CACHE_LIMIT */ - public final void setCacheLimit(int newLimit ) { stringCacheLimit = newLimit; } + public final void setCacheLimit(final int newLimit ) { stringCacheLimit = newLimit; } /** * Sets the cache limit, see {@link #setCacheLimit(int)} and validates the cache. @@ -279,7 +279,7 @@ public class TextRegionUtil { * @param gl current GL used to remove cached objects if required * @param newLimit new cache size */ - public final void setCacheLimit(GL2ES2 gl, int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); } + public final void setCacheLimit(final GL2ES2 gl, final int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); } /** * @return the current cache limit @@ -291,7 +291,7 @@ public class TextRegionUtil { */ public final int getCacheSize() { return stringCacheArray.size(); } - protected final void validateCache(GL2ES2 gl, int space) { + protected final void validateCache(final GL2ES2 gl, final int space) { if ( getCacheLimit() > 0 ) { while ( getCacheSize() + space > getCacheLimit() ) { removeCachedRegion(gl, 0); @@ -299,11 +299,11 @@ public class TextRegionUtil { } } - protected final GLRegion getCachedRegion(Font font, CharSequence str, float pixelSize, int special) { + protected final GLRegion getCachedRegion(final Font font, final CharSequence str, final float pixelSize, final int special) { return stringCacheMap.get(getKey(font, str, pixelSize, special)); } - protected final void addCachedRegion(GL2ES2 gl, Font font, CharSequence str, float pixelSize, int special, GLRegion glyphString) { + protected final void addCachedRegion(final GL2ES2 gl, final Font font, final CharSequence str, final float pixelSize, final int special, final GLRegion glyphString) { if ( 0 != getCacheLimit() ) { final String key = getKey(font, str, pixelSize, special); final GLRegion oldRegion = stringCacheMap.put(key, glyphString); @@ -315,7 +315,7 @@ public class TextRegionUtil { } } - protected final void removeCachedRegion(GL2ES2 gl, Font font, CharSequence str, int pixelSize, int special) { + protected final void removeCachedRegion(final GL2ES2 gl, final Font font, final CharSequence str, final int pixelSize, final int special) { final String key = getKey(font, str, pixelSize, special); final GLRegion region = stringCacheMap.remove(key); if(null != region) { @@ -324,7 +324,7 @@ public class TextRegionUtil { stringCacheArray.remove(key); } - protected final void removeCachedRegion(GL2ES2 gl, int idx) { + protected final void removeCachedRegion(final GL2ES2 gl, final int idx) { final String key = stringCacheArray.remove(idx); if( null != key ) { final GLRegion region = stringCacheMap.remove(key); @@ -334,7 +334,7 @@ public class TextRegionUtil { } } - protected final String getKey(Font font, CharSequence str, float pixelSize, int special) { + protected final String getKey(final Font font, final CharSequence str, final float pixelSize, final int special) { final StringBuilder sb = new StringBuilder(); return font.getName(sb, Font.NAME_UNIQUNAME) .append(".").append(str.hashCode()).append(".").append(Float.floatToIntBits(pixelSize)).append(special).toString(); |