aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
committerSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
commit556d92b63555a085b25e32b1cd55afce24edd07a (patch)
tree6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/jogamp/graph
parenta90f4a51dffec3247278e3c683ed4462b1dd9ab5 (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/jogamp/graph')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java28
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java31
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java14
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java4
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java6
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java22
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/HEdge.java22
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/Loop.java42
-rw-r--r--src/jogl/classes/jogamp/graph/font/JavaFontLoader.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java40
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java2
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java22
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java28
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java26
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java2
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java24
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java136
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java180
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java52
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java24
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java32
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java24
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java62
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java38
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java30
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java30
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java26
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java40
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java30
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java22
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java20
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java70
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java34
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java32
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java2
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java20
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java2
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java48
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java30
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java372
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java188
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java40
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java70
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/Crossing.java206
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java2
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java2
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/Path2D.java76
115 files changed, 1488 insertions, 1487 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
index b56a69b28..118c9b136 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
@@ -142,16 +142,16 @@ public class VBORegion2PMSAAES2 extends GLRegion {
final int initialElementCount = 256;
// Pass 1:
- indicesBuffer = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
- gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
if( hasColorChannel() ) {
- gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL2ES2.GL_FLOAT,
+ gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
} else {
gca_ColorsAttr = null;
@@ -173,12 +173,12 @@ public class VBORegion2PMSAAES2 extends GLRegion {
// Pass 2:
gcu_FboTexUnit = new GLUniformData(UniformNames.gcu_FboTexUnit, pass2TexUnit);
- indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesFbo = GLArrayDataServer.createData(3, GL.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
indicesFbo.seal(true);
- gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+ gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL.GL_FLOAT,
false, 4, GL.GL_STATIC_DRAW);
gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(0);
gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(1);
@@ -186,7 +186,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gca_FboTexCoordsAttr.putf(1); gca_FboTexCoordsAttr.putf(0);
gca_FboTexCoordsAttr.seal(true);
- gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, 4, GL.GL_STATIC_DRAW);
}
@@ -234,7 +234,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
}
@Override
- protected final void pushIndex(int idx) {
+ protected final void pushIndex(final int idx) {
indicesBuffer.puts((short)idx);
}
@@ -432,7 +432,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gca_FboTexCoordsAttr.enableBuffer(gl, true);
indicesFbo.bindBuffer(gl, true); // keeps VBO binding
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
indicesFbo.bindBuffer(gl, false);
gca_FboTexCoordsAttr.enableBuffer(gl, false);
@@ -463,7 +463,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
ssink.reset(gl, fboWidth, fboHeight);
// FIXME: shall not use bilinear (GL_LINEAR), due to MSAA ???
// ssink.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
- ssink.attachTexture2D(gl, 0, true, GL2ES2.GL_NEAREST, GL2ES2.GL_NEAREST, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ ssink.attachTexture2D(gl, 0, true, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
if( !blendingEnabled ) {
// no depth-buffer w/ blending
ssink.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
@@ -489,7 +489,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gl.glViewport(0, 0, fboWidth, fboHeight);
if( blendingEnabled ) {
gl.glClearColor(0f, 0f, 0f, 0.0f);
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
// For already pre-multiplied alpha values, use:
// gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
@@ -500,7 +500,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gl.glDisable(GL.GL_DEPTH_TEST);
}
} else {
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
}
renderRegion(gl);
@@ -526,10 +526,10 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
tex.disable(gl); // nop on core
} else {
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
}
indicesBuffer.bindBuffer(gl, false);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
index 861d889c1..8f75e7115 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
@@ -37,6 +37,7 @@ import jogamp.graph.curve.opengl.shader.AttributeNames;
import jogamp.graph.curve.opengl.shader.UniformNames;
import jogamp.opengl.Debug;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.GLRegion;
import com.jogamp.graph.curve.opengl.RegionRenderer;
@@ -79,7 +80,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
static {
Debug.initSingleton();
final String key = "jogl.debug.graph.curve.vbaa.resizeLowerBoundary";
- RESIZE_BOUNDARY = Math.max(0, Debug.getIntProperty(key, true, 0));
+ RESIZE_BOUNDARY = Math.max(0, PropertyAccess.getIntProperty(key, true, 0));
if( RESIZE_BOUNDARY > 0 ) {
System.err.println("key: "+RESIZE_BOUNDARY);
}
@@ -178,15 +179,15 @@ public class VBORegion2PVBAAES2 extends GLRegion {
final int initialElementCount = 256;
// Pass 1:
- indicesBuffer = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
- gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
if( hasColorChannel() ) {
- gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL2ES2.GL_FLOAT,
+ gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
} else {
gca_ColorsAttr = null;
@@ -209,12 +210,12 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gcu_FboTexUnit = new GLUniformData(UniformNames.gcu_FboTexUnit, pass2TexUnit);
gcu_FboTexSize = new GLUniformData(UniformNames.gcu_FboTexSize, 2, FloatBuffer.wrap(new float[2]));
- indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesFbo = GLArrayDataServer.createData(3, GL.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
indicesFbo.seal(true);
- gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+ gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL.GL_FLOAT,
false, 4, GL.GL_STATIC_DRAW);
gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(0);
gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(1);
@@ -222,7 +223,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gca_FboTexCoordsAttr.putf(1); gca_FboTexCoordsAttr.putf(0);
gca_FboTexCoordsAttr.seal(true);
- gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, 4, GL.GL_STATIC_DRAW);
}
@@ -274,7 +275,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
}
@Override
- protected final void pushIndex(int idx) {
+ protected final void pushIndex(final int idx) {
indicesBuffer.puts((short)idx);
}
@@ -549,7 +550,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gca_FboTexCoordsAttr.enableBuffer(gl, true);
indicesFbo.bindBuffer(gl, true); // keeps VBO binding
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
indicesFbo.bindBuffer(gl, false);
gca_FboTexCoordsAttr.enableBuffer(gl, false);
@@ -581,7 +582,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
// Shall not use bilinear (GL_LINEAR), due to own VBAA. Result is smooth w/o it now!
// FIXME: FXAA requires bilinear filtering!
// texA = fbo.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
- texA = fbo.attachTexture2D(gl, 0, true, GL2ES2.GL_NEAREST, GL2ES2.GL_NEAREST, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ texA = fbo.attachTexture2D(gl, 0, true, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
if( !blendingEnabled ) {
// no depth-buffer w/ blending
fbo.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
@@ -610,14 +611,14 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gl.glViewport(0, 0, fboWidth, fboHeight);
if( blendingEnabled ) {
gl.glClearColor(0f, 0f, 0f, 0.0f);
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
// For already pre-multiplied alpha values, use:
// gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
// Multiply RGB w/ Alpha, preserve alpha for renderFBO(..)
gl.glBlendFuncSeparate(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA, GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
} else {
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
}
renderRegion(gl);
@@ -644,10 +645,10 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
tex.disable(gl); // nop on core
} else {
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
}
indicesBuffer.bindBuffer(gl, false);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 8265b014a..46e991866 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -64,16 +64,16 @@ public class VBORegionSPES2 extends GLRegion {
rsLocal = new RenderState.ProgramLocal();
final int initialElementCount = 256;
- indicesBuffer = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
- gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
if( hasColorChannel() ) {
- gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL2ES2.GL_FLOAT,
+ gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
} else {
gca_ColorsAttr = null;
@@ -135,7 +135,7 @@ public class VBORegionSPES2 extends GLRegion {
}
@Override
- protected final void pushIndex(int idx) {
+ protected final void pushIndex(final int idx) {
indicesBuffer.puts((short)idx);
}
@@ -244,10 +244,10 @@ public class VBORegionSPES2 extends GLRegion {
gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
tex.disable(gl); // nop on core
} else {
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
}
indicesBuffer.bindBuffer(gl, false);
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
index d2cfa42a1..4473d040f 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
@@ -100,7 +100,7 @@ public class CDTriangulator2D implements Triangulator {
}
@Override
- public final void generate(List<Triangle> sink) {
+ public final void generate(final List<Triangle> sink) {
final int loopsSize = loops.size();
for(int i=0;i<loopsSize;i++) {
final Loop loop = loops.get(i);
@@ -219,7 +219,7 @@ public class CDTriangulator2D implements Triangulator {
return innerOutline;
}
- private Loop getContainerLoop(Outline polyline) {
+ private Loop getContainerLoop(final Outline polyline) {
final ArrayList<Vertex> vertices = polyline.getVertices();
for(int i=0; i < loops.size(); i++) {
final Loop loop = loops.get(i);
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
index 2e8d4f58f..81e6efdad 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
@@ -44,9 +44,9 @@ public class GraphOutline {
* the curve pieces can be identified by onCurve flag
* of each cp the control polyline is open by default
*/
- public GraphOutline(Outline ol){
+ public GraphOutline(final Outline ol){
this.outline = ol;
- ArrayList<Vertex> vertices = this.outline.getVertices();
+ final ArrayList<Vertex> vertices = this.outline.getVertices();
for(int i = 0; i< vertices.size(); i++){
this.controlpoints.add(new GraphVertex(vertices.get(i)));
}
@@ -64,7 +64,7 @@ public class GraphOutline {
return outline.getVertices();
}
- public void addVertex(GraphVertex v) {
+ public void addVertex(final GraphVertex v) {
controlpoints.add(v);
outline.addVertex(v.getPoint());
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
index 89ad3edf1..391e71011 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
@@ -36,7 +36,7 @@ public class GraphVertex {
private ArrayList<HEdge> edges = null;
private boolean boundaryContained = false;
- public GraphVertex(Vertex point) {
+ public GraphVertex(final Vertex point) {
this.point = point;
}
@@ -59,7 +59,7 @@ public class GraphVertex {
return point.getCoord();
}
- public void setPoint(Vertex point) {
+ public void setPoint(final Vertex point) {
this.point = point;
}
@@ -67,17 +67,17 @@ public class GraphVertex {
return edges;
}
- public void setEdges(ArrayList<HEdge> edges) {
+ public void setEdges(final ArrayList<HEdge> edges) {
this.edges = edges;
}
- public void addEdge(HEdge edge){
+ public void addEdge(final HEdge edge){
if(edges == null){
edges = new ArrayList<HEdge>();
}
edges.add(edge);
}
- public void removeEdge(HEdge edge){
+ public void removeEdge(final HEdge edge){
if(edges == null)
return;
edges.remove(edge);
@@ -85,9 +85,9 @@ public class GraphVertex {
edges = null;
}
}
- public HEdge findNextEdge(GraphVertex nextVert){
+ public HEdge findNextEdge(final GraphVertex nextVert){
for(int i=0; i<edges.size(); i++) {
- HEdge e = edges.get(i);
+ final HEdge e = edges.get(i);
if(e.getNext().getGraphPoint() == nextVert){
return e;
}
@@ -96,16 +96,16 @@ public class GraphVertex {
}
public HEdge findBoundEdge(){
for(int i=0; i<edges.size(); i++) {
- HEdge e = edges.get(i);
+ final HEdge e = edges.get(i);
if((e.getType() == HEdge.BOUNDARY) || (e.getType() == HEdge.HOLE)){
return e;
}
}
return null;
}
- public HEdge findPrevEdge(GraphVertex prevVert){
+ public HEdge findPrevEdge(final GraphVertex prevVert){
for(int i=0; i<edges.size(); i++) {
- HEdge e = edges.get(i);
+ final HEdge e = edges.get(i);
if(e.getPrev().getGraphPoint() == prevVert){
return e;
}
@@ -117,7 +117,7 @@ public class GraphVertex {
return boundaryContained;
}
- public void setBoundaryContained(boolean boundaryContained) {
+ public void setBoundaryContained(final boolean boundaryContained) {
this.boundaryContained = boundaryContained;
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
index acaa3d708..3bdf54590 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
@@ -43,12 +43,12 @@ public class HEdge {
private int type = BOUNDARY;
private Triangle triangle = null;
- public HEdge(GraphVertex vert, int type) {
+ public HEdge(final GraphVertex vert, final int type) {
this.vert = vert;
this.type = type;
}
- public HEdge(GraphVertex vert, HEdge prev, HEdge next, HEdge sibling, int type) {
+ public HEdge(final GraphVertex vert, final HEdge prev, final HEdge next, final HEdge sibling, final int type) {
this.vert = vert;
this.prev = prev;
this.next = next;
@@ -56,7 +56,7 @@ public class HEdge {
this.type = type;
}
- public HEdge(GraphVertex vert, HEdge prev, HEdge next, HEdge sibling, int type, Triangle triangle) {
+ public HEdge(final GraphVertex vert, final HEdge prev, final HEdge next, final HEdge sibling, final int type, final Triangle triangle) {
this.vert = vert;
this.prev = prev;
this.next = next;
@@ -69,7 +69,7 @@ public class HEdge {
return vert;
}
- public void setVert(GraphVertex vert) {
+ public void setVert(final GraphVertex vert) {
this.vert = vert;
}
@@ -77,7 +77,7 @@ public class HEdge {
return prev;
}
- public void setPrev(HEdge prev) {
+ public void setPrev(final HEdge prev) {
this.prev = prev;
}
@@ -85,7 +85,7 @@ public class HEdge {
return next;
}
- public void setNext(HEdge next) {
+ public void setNext(final HEdge next) {
this.next = next;
}
@@ -93,7 +93,7 @@ public class HEdge {
return sibling;
}
- public void setSibling(HEdge sibling) {
+ public void setSibling(final HEdge sibling) {
this.sibling = sibling;
}
@@ -101,7 +101,7 @@ public class HEdge {
return type;
}
- public void setType(int type) {
+ public void setType(final int type) {
this.type = type;
}
@@ -109,16 +109,16 @@ public class HEdge {
return triangle;
}
- public void setTriangle(Triangle triangle) {
+ public void setTriangle(final Triangle triangle) {
this.triangle = triangle;
}
- public static <T extends Vertex> void connect(HEdge first, HEdge next){
+ public static <T extends Vertex> void connect(final HEdge first, final HEdge next){
first.setNext(next);
next.setPrev(first);
}
- public static <T extends Vertex> void makeSiblings(HEdge first, HEdge second){
+ public static <T extends Vertex> void makeSiblings(final HEdge first, final HEdge second){
first.setSibling(second);
second.setSibling(first);
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
index 1f038a930..6563219cc 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
@@ -40,7 +40,7 @@ public class Loop {
private final AABBox box = new AABBox();
private GraphOutline initialOutline = null;
- public Loop(GraphOutline polyline, VectorUtil.Winding winding){
+ public Loop(final GraphOutline polyline, final VectorUtil.Winding winding){
initialOutline = polyline;
this.root = initFromPolyline(initialOutline, winding);
}
@@ -67,7 +67,7 @@ public class Loop {
final GraphVertex v2 = next1.getGraphPoint();
final GraphVertex v3 = next2.getGraphPoint();
- HEdge v3Edge = new HEdge(v3, HEdge.INNER);
+ final HEdge v3Edge = new HEdge(v3, HEdge.INNER);
HEdge.connect(v3Edge, root);
HEdge.connect(next1, v3Edge);
@@ -94,8 +94,8 @@ public class Loop {
* from the boundary profile
* @param reqWinding requested winding of edges (CCW or CW)
*/
- private HEdge initFromPolyline(GraphOutline outline, VectorUtil.Winding reqWinding){
- ArrayList<GraphVertex> vertices = outline.getGraphPoint();
+ private HEdge initFromPolyline(final GraphOutline outline, final VectorUtil.Winding reqWinding){
+ final ArrayList<GraphVertex> vertices = outline.getGraphPoint();
if(vertices.size()<3) {
throw new IllegalArgumentException("outline's vertices < 3: " + vertices.size());
@@ -124,10 +124,10 @@ public class Loop {
}
while(index != max){
- GraphVertex v1 = vertices.get(index);
+ final GraphVertex v1 = vertices.get(index);
box.resize(v1.getX(), v1.getY(), v1.getZ());
- HEdge edge = new HEdge(v1, edgeType);
+ final HEdge edge = new HEdge(v1, edgeType);
v1.addEdge(edge);
if(lastEdge != null) {
@@ -155,15 +155,15 @@ public class Loop {
return firstEdge;
}
- public void addConstraintCurve(GraphOutline polyline) {
+ public void addConstraintCurve(final GraphOutline polyline) {
// GraphOutline outline = new GraphOutline(polyline);
/**needed to generate vertex references.*/
initFromPolyline(polyline, VectorUtil.Winding.CW);
- GraphVertex v3 = locateClosestVertex(polyline);
- HEdge v3Edge = v3.findBoundEdge();
- HEdge v3EdgeP = v3Edge.getPrev();
- HEdge crossEdge = new HEdge(root.getGraphPoint(), HEdge.INNER);
+ final GraphVertex v3 = locateClosestVertex(polyline);
+ final HEdge v3Edge = v3.findBoundEdge();
+ final HEdge v3EdgeP = v3Edge.getPrev();
+ final HEdge crossEdge = new HEdge(root.getGraphPoint(), HEdge.INNER);
HEdge.connect(root.getPrev(), crossEdge);
HEdge.connect(crossEdge, v3Edge);
@@ -184,7 +184,7 @@ public class Loop {
* to search for closestvertices
* @return the vertex that is closest to the newly set root Hedge.
*/
- private GraphVertex locateClosestVertex(GraphOutline polyline) {
+ private GraphVertex locateClosestVertex(final GraphOutline polyline) {
HEdge closestE = null;
GraphVertex closestV = null;
@@ -200,7 +200,7 @@ public class Loop {
final GraphVertex cand = vertices.get(pos);
final float distance = VectorUtil.distVec3(v.getCoord(), cand.getCoord());
if(distance < minDistance){
- for (GraphVertex vert:vertices){
+ for (final GraphVertex vert:vertices){
if(vert == v || vert == nextV || vert == cand)
continue;
inValid = VectorUtil.isInCircleVec2(v.getPoint(), nextV.getPoint(),
@@ -226,19 +226,19 @@ public class Loop {
return closestV;
}
- private HEdge findClosestValidNeighbor(HEdge edge, boolean delaunay) {
- HEdge next = root.getNext();
+ private HEdge findClosestValidNeighbor(final HEdge edge, final boolean delaunay) {
+ final HEdge next = root.getNext();
if(!VectorUtil.ccw(root.getGraphPoint().getPoint(), next.getGraphPoint().getPoint(),
edge.getGraphPoint().getPoint())){
return null;
}
- HEdge candEdge = edge;
+ final HEdge candEdge = edge;
boolean inValid = false;
if(delaunay){
- Vertex cand = candEdge.getGraphPoint().getPoint();
+ final Vertex cand = candEdge.getGraphPoint().getPoint();
HEdge e = candEdge.getNext();
while (e != candEdge){
if(e.getGraphPoint() == root.getGraphPoint()
@@ -269,7 +269,7 @@ public class Loop {
* @param root and edge of this triangle
* @return the triangle iff it satisfies, null otherwise
*/
- private Triangle createTriangle(Vertex v1, Vertex v2, Vertex v3, HEdge rootT){
+ private Triangle createTriangle(final Vertex v1, final Vertex v2, final Vertex v3, final HEdge rootT){
return new Triangle(v1, v2, v3, checkVerticesBoundary(rootT));
}
@@ -287,7 +287,7 @@ public class Loop {
return boundary;
}
- public boolean checkInside(Vertex v) {
+ public boolean checkInside(final Vertex v) {
if(!box.contains(v.getX(), v.getY(), v.getZ())){
return false;
}
@@ -296,8 +296,8 @@ public class Loop {
HEdge current = root;
HEdge next = root.getNext();
do {
- Vertex v2 = current.getGraphPoint().getPoint();
- Vertex v1 = next.getGraphPoint().getPoint();
+ final Vertex v2 = current.getGraphPoint().getPoint();
+ final Vertex v1 = next.getGraphPoint().getPoint();
if ( ((v1.getY() > v.getY()) != (v2.getY() > v.getY())) &&
(v.getX() < (v2.getX() - v1.getX()) * (v.getY() - v1.getY()) / (v2.getY() - v1.getY()) + v1.getX()) ){
diff --git a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
index e3df0af1d..1bb2bb5f3 100644
--- a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
@@ -78,7 +78,7 @@ public class JavaFontLoader implements FontSet {
}
}
- static boolean is(int bits, int bit) {
+ static boolean is(final int bits, final int bit) {
return 0 != ( bits & bit ) ;
}
@@ -88,7 +88,7 @@ public class JavaFontLoader implements FontSet {
}
@Override
- public Font get(int family, int style) throws IOException {
+ public Font get(final int family, final int style) throws IOException {
Font font = (Font)fontMap.get( ( family << 8 ) | style );
if (font != null) {
return font;
@@ -138,7 +138,7 @@ public class JavaFontLoader implements FontSet {
return font;
}
- Font abspath(String fname, int family, int style) throws IOException {
+ Font abspath(final String fname, final int family, final int style) throws IOException {
if(null == javaFontPath) {
throw new GLException("java font path undefined");
}
@@ -151,7 +151,7 @@ public class JavaFontLoader implements FontSet {
return f;
}
throw new IOException (err);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new IOException(err, ioe);
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
index c7efe143b..76947873e 100644
--- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
@@ -76,7 +76,7 @@ public class UbuntuFontLoader implements FontSet {
private UbuntuFontLoader() {
}
- static boolean is(int bits, int bit) {
+ static boolean is(final int bits, final int bit) {
return 0 != ( bits & bit ) ;
}
@@ -86,7 +86,7 @@ public class UbuntuFontLoader implements FontSet {
}
@Override
- public Font get(int family, int style) throws IOException {
+ public Font get(final int family, final int style) throws IOException {
Font font = (Font)fontMap.get( ( family << 8 ) | style );
if (font != null) {
return font;
@@ -132,7 +132,7 @@ public class UbuntuFontLoader implements FontSet {
private static boolean attemptedJARLoading = false;
private static boolean useTempJarCache = false;
- private synchronized Font abspath(String fname, int family, int style) throws IOException {
+ private synchronized Font abspath(final String fname, final int family, final int style) throws IOException {
final String err = "Problem loading font "+fname+", stream "+relFontPath+fname;
final Exception[] privErr = { null };
try {
@@ -150,7 +150,7 @@ public class UbuntuFontLoader implements FontSet {
public Object run() {
try {
TempJarCache.addResources(UbuntuFontLoader.class, uri);
- } catch (Exception e) { privErr[0] = e; }
+ } catch (final Exception e) { privErr[0] = e; }
return null;
} } );
if( null == privErr[0] ) {
@@ -162,7 +162,7 @@ public class UbuntuFontLoader implements FontSet {
}
}
}
- } catch(Exception e) {
+ } catch(final Exception e) {
throw new IOException(err, e);
}
if( null != privErr[0] ) {
@@ -182,7 +182,7 @@ public class UbuntuFontLoader implements FontSet {
try {
final URI uri = TempJarCache.getResource(absFontPath+fname);
privConn[0] = null != uri ? uri.toURL().openConnection() : null;
- } catch (Exception e) { privErr[0] = e; }
+ } catch (final Exception e) { privErr[0] = e; }
return null;
} } );
if( null != privErr[0] ) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index 5fb61387a..c48ef99ca 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -63,15 +63,15 @@ class TypecastFont implements Font {
// FIXME: Generic attempt to find the best CmapTable,
// which is assumed to be the one with the most entries (stupid 'eh?)
- CmapTable cmapTable = font.getCmapTable();
- CmapFormat[] _cmapFormatP = { null, null, null, null };
+ final CmapTable cmapTable = font.getCmapTable();
+ final CmapFormat[] _cmapFormatP = { null, null, null, null };
int platform = -1;
int platformLength = -1;
int encoding = -1;
for(int i=0; i<cmapTable.getNumTables(); i++) {
- CmapIndexEntry cmapIdxEntry = cmapTable.getCmapIndexEntry(i);
- int pidx = cmapIdxEntry.getPlatformId();
- CmapFormat cf = cmapIdxEntry.getFormat();
+ final CmapIndexEntry cmapIdxEntry = cmapTable.getCmapIndexEntry(i);
+ final int pidx = cmapIdxEntry.getPlatformId();
+ final CmapFormat cf = cmapIdxEntry.getFormat();
if(DEBUG) {
System.err.println("CmapFormat["+i+"]: platform " + pidx +
", encoding "+cmapIdxEntry.getEncodingId() + ": "+cf);
@@ -123,7 +123,7 @@ class TypecastFont implements Font {
{
int _cmapentries = 0;
for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
- CmapFormat.Range range = cmapFormat.getRange(i);
+ final CmapFormat.Range range = cmapFormat.getRange(i);
_cmapentries += range.getEndCode() - range.getStartCode() + 1; // end included
}
cmapentries = _cmapentries;
@@ -135,7 +135,7 @@ class TypecastFont implements Font {
System.err.println("num cmap ranges: "+cmapFormat.getRangeCount());
for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
- CmapFormat.Range range = cmapFormat.getRange(i);
+ final CmapFormat.Range range = cmapFormat.getRange(i);
for (int j = range.getStartCode(); j <= range.getEndCode(); ++j) {
final int code = cmapFormat.mapCharCode(j);
if(code < 15) {
@@ -149,15 +149,15 @@ class TypecastFont implements Font {
}
@Override
- public StringBuilder getName(StringBuilder sb, int nameIndex) {
+ public StringBuilder getName(final StringBuilder sb, final int nameIndex) {
return font.getName(nameIndex, sb);
}
@Override
- public String getName(int nameIndex) {
+ public String getName(final int nameIndex) {
return getName(null, nameIndex).toString();
}
@Override
- public StringBuilder getAllNames(StringBuilder sb, String separator) {
+ public StringBuilder getAllNames(final StringBuilder sb, final String separator) {
return font.getAllNames(sb, separator);
}
@Override
@@ -168,7 +168,7 @@ class TypecastFont implements Font {
}
@Override
- public float getAdvanceWidth(int glyphID, float pixelSize) {
+ public float getAdvanceWidth(final int glyphID, final float pixelSize) {
return font.getHmtxTable().getAdvanceWidth(glyphID) * metrics.getScale(pixelSize);
}
@@ -178,7 +178,7 @@ class TypecastFont implements Font {
}
@Override
- public Glyph getGlyph(char symbol) {
+ public Glyph getGlyph(final char symbol) {
TypecastGlyph result = (TypecastGlyph) char2Glyph.get(symbol);
if (null == result) {
// final short code = (short) char2Code.get(symbol);
@@ -226,12 +226,12 @@ class TypecastFont implements Font {
}
@Override
- public final float getPixelSize(float fontSize /* points per inch */, float resolution) {
+ public final float getPixelSize(final float fontSize /* points per inch */, final float resolution) {
return fontSize * resolution / ( 72f /* points per inch */ );
}
@Override
- public float getLineHeight(float pixelSize) {
+ public float getLineHeight(final float pixelSize) {
final Metrics metrics = getMetrics();
final float lineGap = metrics.getLineGap(pixelSize) ; // negative value!
final float ascent = metrics.getAscent(pixelSize) ; // negative value!
@@ -241,7 +241,7 @@ class TypecastFont implements Font {
}
@Override
- public float getMetricWidth(CharSequence string, float pixelSize) {
+ public float getMetricWidth(final CharSequence string, final float pixelSize) {
float width = 0;
final int len = string.length();
for (int i=0; i< len; i++) {
@@ -257,7 +257,7 @@ class TypecastFont implements Font {
}
@Override
- public float getMetricHeight(CharSequence string, float pixelSize, final AABBox tmp) {
+ public float getMetricHeight(final CharSequence string, final float pixelSize, final AABBox tmp) {
int height = 0;
for (int i=0; i<string.length(); i++) {
@@ -272,7 +272,7 @@ class TypecastFont implements Font {
}
@Override
- public AABBox getMetricBounds(CharSequence string, float pixelSize) {
+ public AABBox getMetricBounds(final CharSequence string, final float pixelSize) {
if (string == null) {
return new AABBox();
}
@@ -282,14 +282,14 @@ class TypecastFont implements Font {
float totalWidth = 0;
float curLineWidth = 0;
for (int i=0; i<charCount; i++) {
- char character = string.charAt(i);
+ final char character = string.charAt(i);
if (character == '\n') {
totalWidth = Math.max(curLineWidth, totalWidth);
curLineWidth = 0;
totalHeight += lineHeight;
continue;
}
- Glyph glyph = getGlyph(character);
+ final Glyph glyph = getGlyph(character);
curLineWidth += glyph.getAdvance(pixelSize, true);
}
if (curLineWidth > 0) {
@@ -350,7 +350,7 @@ class TypecastFont implements Font {
}
@Override
- public boolean isPrintableChar( char c ) {
+ public boolean isPrintableChar( final char c ) {
return FontFactory.isPrintableChar(c);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
index d7db981b0..6154484d5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
@@ -45,14 +45,14 @@ public class TypecastFontConstructor implements FontConstructor {
@Override
public Font create(final File ffile) throws IOException {
- Object o = AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ final Object o = AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
OTFontCollection fontset;
try {
fontset = OTFontCollection.create(ffile);
return new TypecastFont(fontset);
- } catch (IOException e) {
+ } catch (final IOException e) {
return e;
}
}
@@ -83,7 +83,7 @@ public class TypecastFontConstructor implements FontConstructor {
}
f = create(tf);
tf.delete();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
return f;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
index 2246b4a3c..7a3962f7c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
@@ -211,7 +211,7 @@ public class TypecastGlyph implements Font.Glyph {
@Override
public final int hashCode() {
// 31 * x == (x << 5) - x
- int hash = 31 + font.getName(Font.NAME_UNIQUNAME).hashCode();
+ final int hash = 31 + font.getName(Font.NAME_UNIQUNAME).hashCode();
return ((hash << 5) - hash) + id;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
index be8ab8f69..d5e30a500 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
@@ -52,12 +52,12 @@ class TypecastHMetrics implements Metrics {
// vheaTable = this.fontImpl.font.getVheaTable();
unitsPerEM_Inv = 1.0f / ( headTable.getUnitsPerEm() );
- int maxWidth = headTable.getXMax() - headTable.getXMin();
- int maxHeight = headTable.getYMax() - headTable.getYMin();
- float lowx= headTable.getXMin();
- float lowy = -(headTable.getYMin()+maxHeight);
- float highx = lowx + maxWidth;
- float highy = lowy + maxHeight;
+ final int maxWidth = headTable.getXMax() - headTable.getXMin();
+ final int maxHeight = headTable.getYMax() - headTable.getYMin();
+ final float lowx= headTable.getXMin();
+ final float lowy = -(headTable.getYMin()+maxHeight);
+ final float highx = lowx + maxWidth;
+ final float highy = lowy + maxHeight;
bbox = new AABBox(lowx, lowy, 0, highx, highy, 0); // invert
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
index b6e9925d4..f78656b52 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
@@ -45,23 +45,23 @@ import com.jogamp.graph.geom.Vertex.Factory;
public class TypecastRenderer {
private static final boolean DEBUG = Debug.debug("graph.font.Renderer");
- private static void addShapeMoveTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1) {
+ private static void addShapeMoveTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1) {
if( DEBUG ) { System.err.println("Shape.MoveTo: "+p1); }
shape.closeLastOutline(false);
shape.addEmptyOutline();
shape.addVertex(0, vertexFactory.create(p1.x, p1.y, 0, p1.onCurve));
}
- private static void addShapeLineTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1) {
+ private static void addShapeLineTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1) {
if( DEBUG ) { System.err.println("Shape.LineTo: "+p1); }
shape.addVertex(0, vertexFactory.create(p1.x, p1.y, 0, p1.onCurve));
}
- private static void addShapeQuadTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1, Point p2) {
+ private static void addShapeQuadTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1, final Point p2) {
if( DEBUG ) { System.err.println("Shape.QuadTo: "+p1+", "+p2); }
shape.addVertex(0, vertexFactory.create(p1.x, p1.y, 0, p1.onCurve));
shape.addVertex(0, vertexFactory.create(p2.x, p2.y, 0, p2.onCurve));
}
- private static void addShapeQuadTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1,
- float p2x, float p2y, boolean p2OnCurve) {
+ private static void addShapeQuadTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1,
+ final float p2x, final float p2y, final boolean p2OnCurve) {
if( DEBUG ) { System.err.println("Shape.QuadTo: "+p1+", p2 "+p2x+", "+p2y+", onCurve "+p2OnCurve); }
shape.addVertex(0, vertexFactory.create(p1.x, p1.y, 0, p1.onCurve));
shape.addVertex(0, vertexFactory.create(p2x, p2y, 0, p2OnCurve));
@@ -73,7 +73,7 @@ public class TypecastRenderer {
shape.addVertex(0, vertexFactory.create(p3.x, p3.y, 0, p3.onCurve));
} */
- public static OutlineShape buildShape(char symbol, OTGlyph glyph, Factory<? extends Vertex> vertexFactory) {
+ public static OutlineShape buildShape(final char symbol, final OTGlyph glyph, final Factory<? extends Vertex> vertexFactory) {
//
// See Typecast: GlyphPathFactory.addContourToPath(..)
//
@@ -108,7 +108,7 @@ public class TypecastRenderer {
}
} */
- private static void buildShapeImpl(final OutlineShape shape, char symbol, OTGlyph glyph, Factory<? extends Vertex> vertexFactory) {
+ private static void buildShapeImpl(final OutlineShape shape, final char symbol, final OTGlyph glyph, final Factory<? extends Vertex> vertexFactory) {
// Iterate through all of the points in the glyph. Each time we find a
// contour end point, add the point range to the path.
int startIndex = 0;
@@ -217,7 +217,7 @@ public class TypecastRenderer {
}
}
- private static float midValue(float a, float b) {
+ private static float midValue(final float a, final float b) {
return a + (b - a)/2f;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
index 8b685659e..181f77ee4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
@@ -22,7 +22,7 @@ public class Disassembler {
* @param ip The current instruction pointer
* @return The new instruction pointer
*/
- public static int advanceIP(short[] instructions, int ip) {
+ public static int advanceIP(final short[] instructions, int ip) {
// The high word specifies font, cvt, or glyph program
int i = ip & 0xffff;
@@ -46,8 +46,8 @@ public class Disassembler {
return ip;
}
- public static short getPushCount(short[] instructions, int ip) {
- short instr = instructions[ip & 0xffff];
+ public static short getPushCount(final short[] instructions, final int ip) {
+ final short instr = instructions[ip & 0xffff];
if ((Mnemonic.NPUSHB == instr) || (Mnemonic.NPUSHW == instr)) {
return instructions[(ip & 0xffff) + 1];
} else if ((Mnemonic.PUSHB == (instr & 0xf8)) || (Mnemonic.PUSHW == (instr & 0xf8))) {
@@ -56,11 +56,11 @@ public class Disassembler {
return 0;
}
- public static int[] getPushData(short[] instructions, int ip) {
- int count = getPushCount(instructions, ip);
- int[] data = new int[count];
- int i = ip & 0xffff;
- short instr = instructions[i];
+ public static int[] getPushData(final short[] instructions, final int ip) {
+ final int count = getPushCount(instructions, ip);
+ final int[] data = new int[count];
+ final int i = ip & 0xffff;
+ final short instr = instructions[i];
if (Mnemonic.NPUSHB == instr) {
for (int j = 0; j < count; j++) {
data[j] = instructions[i + j + 2];
@@ -81,8 +81,8 @@ public class Disassembler {
return data;
}
- public static String disassemble(short[] instructions, int leadingSpaces) {
- StringBuilder sb = new StringBuilder();
+ public static String disassemble(final short[] instructions, final int leadingSpaces) {
+ final StringBuilder sb = new StringBuilder();
int ip = 0;
while (ip < instructions.length) {
for (int i = 0; i < leadingSpaces; i++) {
@@ -91,7 +91,7 @@ public class Disassembler {
sb.append(ip).append(": ");
sb.append(Mnemonic.getMnemonic(instructions[ip]));
if (getPushCount(instructions, ip) > 0) {
- int[] data = getPushData(instructions, ip);
+ final int[] data = getPushData(instructions, ip);
for(int j = 0; j < data.length; j++) {
if ((instructions[ip] == Mnemonic.PUSHW) ||
(instructions[ip] == Mnemonic.NPUSHW)) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
index 0a4786f82..14e83814c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
@@ -812,7 +812,7 @@ public class Fixed {
* @param num Input
* @return Output
*/
- public static int arctan( int num ) {
+ public static int arctan( final int num ) {
return 0;
}
@@ -822,7 +822,7 @@ public class Fixed {
* @param num The 26.6 fixed number in question
* @return The resulting square root
*/
- public static int squareRoot(int num) {
+ public static int squareRoot(final int num) {
int n = num;
int divisor = num;
int nSquared;
@@ -841,12 +841,12 @@ public class Fixed {
return n;
}
- public static float floatValue(long fixed) {
+ public static float floatValue(final long fixed) {
return (fixed >> 16) + (float)(fixed & 0xffff) / 0x10000;
}
- public static float roundedFloatValue(long fixed, int decimalPlaces) {
- int factor = 10 * decimalPlaces;
+ public static float roundedFloatValue(final long fixed, final int decimalPlaces) {
+ final int factor = 10 * decimalPlaces;
return (float)((int)(floatValue(fixed) * factor)) / factor;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
index d6c9da268..6df892d4d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
@@ -143,7 +143,7 @@ public class Mnemonic {
* @param opcode The opcode for which the mnemonic is required
* @return The mnemonic, with a description
*/
- public static String getMnemonic(short opcode) {
+ public static String getMnemonic(final short opcode) {
if (opcode >= MIRP) return "MIRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]";
else if (opcode >= MDRP) return "MDRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]";
else if (opcode >= PUSHW) return "PUSHW["+((opcode&7)+1)+"]";
@@ -269,7 +269,7 @@ public class Mnemonic {
else return "????";
}
- public static String getComment(short opcode) {
+ public static String getComment(final short opcode) {
if (opcode >= MIRP) return "MIRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]\t\tMove Indirect Relative Point";
else if (opcode >= MDRP) return "MDRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]\t\tMove Direct Relative Point";
else if (opcode >= PUSHW) return "PUSHW["+((opcode&7)+1)+"]";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
index 7c3b32e2c..e83a428ed 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
@@ -79,7 +79,7 @@ import jogamp.graph.font.typecast.ot.table.VheaTable;
*/
public class OTFont {
- private OTFontCollection _fc;
+ private final OTFontCollection _fc;
private TableDirectory _tableDirectory = null;
private Table[] _tables;
private Os2Table _os2;
@@ -98,17 +98,17 @@ public class OTFont {
/**
* Constructor
*/
- public OTFont(OTFontCollection fc) {
+ public OTFont(final OTFontCollection fc) {
_fc = fc;
}
- public StringBuilder getName(int nameIndex, StringBuilder sb) {
+ public StringBuilder getName(final int nameIndex, StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
}
return _name.getRecordsRecordString(sb, nameIndex);
}
- public StringBuilder getAllNames(StringBuilder sb, String separator) {
+ public StringBuilder getAllNames(StringBuilder sb, final String separator) {
if(null != _name) {
if(null == sb) {
sb = new StringBuilder();
@@ -120,7 +120,7 @@ public class OTFont {
return sb;
}
- public Table getTable(int tableType) {
+ public Table getTable(final int tableType) {
for (int i = 0; i < _tables.length; i++) {
if ((_tables[i] != null) && (_tables[i].getType() == tableType)) {
return _tables[i];
@@ -185,7 +185,7 @@ public class OTFont {
return _maxp.getNumGlyphs();
}
- public OTGlyph getGlyph(int i) {
+ public OTGlyph getGlyph(final int i) {
final GlyfDescript _glyfDescr = _glyf.getDescription(i);
return (null != _glyfDescr)
@@ -201,11 +201,11 @@ public class OTFont {
}
private Table readTable(
- DataInputStream dis,
- int tablesOrigin,
- int tag) throws IOException {
+ final DataInputStream dis,
+ final int tablesOrigin,
+ final int tag) throws IOException {
dis.reset();
- DirectoryEntry entry = _tableDirectory.getEntryByTag(tag);
+ final DirectoryEntry entry = _tableDirectory.getEntryByTag(tag);
if (entry == null) {
return null;
}
@@ -225,9 +225,9 @@ public class OTFont {
* individual font resource data.
*/
protected void read(
- DataInputStream dis,
- int directoryOffset,
- int tablesOrigin) throws IOException {
+ final DataInputStream dis,
+ final int directoryOffset,
+ final int tablesOrigin) throws IOException {
// Load the table directory
dis.reset();
@@ -255,7 +255,7 @@ public class OTFont {
// Load all other tables
for (int i = 0; i < _tableDirectory.getNumTables(); i++) {
- DirectoryEntry entry = _tableDirectory.getEntry(i);
+ final DirectoryEntry entry = _tableDirectory.getEntry(i);
if (entry.getTag() == Table.head
|| entry.getTag() == Table.hhea
|| entry.getTag() == Table.maxp
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
index c79380f16..e5ad2900a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
@@ -48,7 +48,7 @@ public class OTFontCollection {
private String _fileName;
private TTCHeader _ttcHeader;
private OTFont[] _fonts;
- private ArrayList<Table> _tables = new ArrayList<Table>();
+ private final ArrayList<Table> _tables = new ArrayList<Table>();
private boolean _resourceFork = false;
/** Creates new FontCollection */
@@ -58,8 +58,8 @@ public class OTFontCollection {
/**
* @param file The OpenType font file
*/
- public static OTFontCollection create(File file) throws IOException {
- OTFontCollection fc = new OTFontCollection();
+ public static OTFontCollection create(final File file) throws IOException {
+ final OTFontCollection fc = new OTFontCollection();
fc.read(file);
return fc;
}
@@ -72,7 +72,7 @@ public class OTFontCollection {
return _fileName;
}
- public OTFont getFont(int i) {
+ public OTFont getFont(final int i) {
return _fonts[i];
}
@@ -84,9 +84,9 @@ public class OTFontCollection {
return _ttcHeader;
}
- public Table getTable(DirectoryEntry de) {
+ public Table getTable(final DirectoryEntry de) {
for (int i = 0; i < _tables.size(); i++) {
- Table table = _tables.get(i);
+ final Table table = _tables.get(i);
if ((table.getDirectoryEntry().getTag() == de.getTag()) &&
(table.getDirectoryEntry().getOffset() == de.getOffset())) {
return table;
@@ -95,7 +95,7 @@ public class OTFontCollection {
return null;
}
- public void addTable(Table table) {
+ public void addTable(final Table table) {
_tables.add(table);
}
@@ -120,7 +120,7 @@ public class OTFontCollection {
_resourceFork = true;
}
- DataInputStream dis = new DataInputStream(
+ final DataInputStream dis = new DataInputStream(
new BufferedInputStream(
new FileInputStream(file), (int) file.length()));
dis.mark((int) file.length());
@@ -128,22 +128,22 @@ public class OTFontCollection {
if (_resourceFork || _pathName.endsWith(".dfont")) {
// This is a Macintosh font suitcase resource
- ResourceHeader resourceHeader = new ResourceHeader(dis);
+ final ResourceHeader resourceHeader = new ResourceHeader(dis);
// Seek to the map offset and read the map
dis.reset();
dis.skip(resourceHeader.getMapOffset());
- ResourceMap map = new ResourceMap(dis);
+ final ResourceMap map = new ResourceMap(dis);
// Get the 'sfnt' resources
- ResourceType resourceType = map.getResourceType("sfnt");
+ final ResourceType resourceType = map.getResourceType("sfnt");
// Load the font data
_fonts = new OTFont[resourceType.getCount()];
for (int i = 0; i < resourceType.getCount(); i++) {
- ResourceReference resourceReference = resourceType.getReference(i);
+ final ResourceReference resourceReference = resourceType.getReference(i);
_fonts[i] = new OTFont(this);
- int offset = resourceHeader.getDataOffset() +
+ final int offset = resourceHeader.getDataOffset() +
resourceReference.getDataOffset() + 4;
_fonts[i].read(dis, offset, offset);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
index 270507fec..7bfffd58c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
@@ -79,7 +79,7 @@ public class OTGlyph {
* @param lsb The Left Side Bearing.
* @param advance The advance width.
*/
- public OTGlyph(GlyphDescription gd, short lsb, int advance) {
+ public OTGlyph(final GlyphDescription gd, final short lsb, final int advance) {
_leftSideBearing = lsb;
_advanceWidth = advance;
describe(gd);
@@ -91,11 +91,11 @@ public class OTGlyph {
* @param lsb The Left Side Bearing.
* @param advance The advance width.
*/
- public OTGlyph(Charstring cs, short lsb, int advance) {
+ public OTGlyph(final Charstring cs, final short lsb, final int advance) {
_leftSideBearing = lsb;
_advanceWidth = advance;
if (cs instanceof CharstringType2) {
- T2Interpreter t2i = new T2Interpreter();
+ final T2Interpreter t2i = new T2Interpreter();
_points = t2i.execute((CharstringType2) cs);
} else {
//throw unsupported charstring type
@@ -118,7 +118,7 @@ public class OTGlyph {
return _leftSideBearing;
}
- public Point getPoint(int i) {
+ public Point getPoint(final int i) {
return _points[i];
}
@@ -129,7 +129,7 @@ public class OTGlyph {
/**
* @param factor a 16.16 fixed value
*/
- public void scale(int factor) {
+ public void scale(final int factor) {
for (int i = 0; i < _points.length; i++) {
//points[i].x = ( points[i].x * factor ) >> 6;
//points[i].y = ( points[i].y * factor ) >> 6;
@@ -143,11 +143,11 @@ public class OTGlyph {
/**
* Set the points of a glyph from the GlyphDescription
*/
- private void describe(GlyphDescription gd) {
+ private void describe(final GlyphDescription gd) {
int endPtIndex = 0;
_points = new Point[gd.getPointCount() /* + 2 */ ];
for (int i = 0; i < gd.getPointCount(); i++) {
- boolean endPt = gd.getEndPtOfContours(endPtIndex) == i;
+ final boolean endPt = gd.getEndPtOfContours(endPtIndex) == i;
if (endPt) {
endPtIndex++;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
index 0cac8ab44..76b0f90f3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
@@ -19,7 +19,7 @@ public class Point {
public boolean onCurve = true;
public boolean endOfContour = false;
- public Point(int x, int y, boolean onCurve, boolean endOfContour) {
+ public Point(final int x, final int y, final boolean onCurve, final boolean endOfContour) {
this.x = x;
this.y = y;
this.onCurve = onCurve;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
index 7a5b0c4d2..709ff9e91 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
@@ -30,11 +30,11 @@ import java.io.IOException;
*/
public class ResourceData {
- private byte[] data;
+ private final byte[] data;
/** Creates new ResourceData */
- public ResourceData(DataInput di) throws IOException {
- int dataLen = di.readInt();
+ public ResourceData(final DataInput di) throws IOException {
+ final int dataLen = di.readInt();
data = new byte[dataLen];
di.readFully(data);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
index 468ab2e1c..767eafb6b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
@@ -31,11 +31,11 @@ import java.io.RandomAccessFile;
*/
public class ResourceFile {
- private ResourceHeader header;
- private ResourceMap map;
+ private final ResourceHeader header;
+ private final ResourceMap map;
/** Creates new Resource */
- public ResourceFile(RandomAccessFile raf) throws IOException {
+ public ResourceFile(final RandomAccessFile raf) throws IOException {
// Read header at the beginning of the file
raf.seek(0);
@@ -50,13 +50,13 @@ public class ResourceFile {
return map;
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
try {
//RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/GillSans.dfont", "r");
// Tests loading a font from a resource fork on Mac OS X
- RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/Georgia/..namedfork/rsrc", "r");
- ResourceFile resource = new ResourceFile(raf);
+ final RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/Georgia/..namedfork/rsrc", "r");
+ final ResourceFile resource = new ResourceFile(raf);
for (int i = 0; i < resource.getResourceMap().getResourceTypeCount(); i++) {
System.out.println(resource.getResourceMap().getResourceType(i).getTypeAsString());
}
@@ -70,7 +70,7 @@ public class ResourceFile {
reference = type.getReference(i);
System.out.println(reference.getName());
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
index de13b116f..dea0b9843 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
@@ -30,13 +30,13 @@ import java.io.IOException;
*/
public class ResourceHeader {
- private int dataOffset;
- private int mapOffset;
- private int dataLen;
- private int mapLen;
+ private final int dataOffset;
+ private final int mapOffset;
+ private final int dataLen;
+ private final int mapLen;
/** Creates new ResourceHeader */
- public ResourceHeader(DataInput di) throws IOException {
+ public ResourceHeader(final DataInput di) throws IOException {
dataOffset = di.readInt();
mapOffset = di.readInt();
dataLen = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
index d348c645e..b22a06325 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
@@ -30,21 +30,21 @@ import java.io.IOException;
*/
public class ResourceMap {
- private byte[] headerCopy = new byte[16];
- private int nextResourceMap;
- private int fileReferenceNumber;
- private int attributes;
- private ResourceType[] types;
+ private final byte[] headerCopy = new byte[16];
+ private final int nextResourceMap;
+ private final int fileReferenceNumber;
+ private final int attributes;
+ private final ResourceType[] types;
/** Creates new ResourceMap */
- public ResourceMap(DataInput di) throws IOException {
+ public ResourceMap(final DataInput di) throws IOException {
di.readFully(headerCopy);
nextResourceMap = di.readInt();
fileReferenceNumber = di.readUnsignedShort();
attributes = di.readUnsignedShort();
- int typeOffset = di.readUnsignedShort();
- int nameOffset = di.readUnsignedShort();
- int typeCount = di.readUnsignedShort() + 1;
+ final int typeOffset = di.readUnsignedShort();
+ final int nameOffset = di.readUnsignedShort();
+ final int typeCount = di.readUnsignedShort() + 1;
// Read types
types = new ResourceType[typeCount];
@@ -63,9 +63,9 @@ public class ResourceMap {
}
}
- public ResourceType getResourceType(String typeName) {
+ public ResourceType getResourceType(final String typeName) {
for (int i = 0; i < types.length; i++) {
- String s = types[i].getTypeAsString();
+ final String s = types[i].getTypeAsString();
if (types[i].getTypeAsString().equals(typeName)) {
return types[i];
}
@@ -73,7 +73,7 @@ public class ResourceMap {
return null;
}
- public ResourceType getResourceType(int i) {
+ public ResourceType getResourceType(final int i) {
return types[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
index 9d1534821..f76b85cf4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
@@ -30,15 +30,15 @@ import java.io.IOException;
*/
public class ResourceReference {
- private int id;
- private short nameOffset;
- private short attributes;
- private int dataOffset;
- private int handle;
+ private final int id;
+ private final short nameOffset;
+ private final short attributes;
+ private final int dataOffset;
+ private final int handle;
private String name;
/** Creates new ResourceReference */
- protected ResourceReference(DataInput di) throws IOException {
+ protected ResourceReference(final DataInput di) throws IOException {
id = di.readUnsignedShort();
nameOffset = di.readShort();
attributes = (short) di.readUnsignedByte();
@@ -46,10 +46,10 @@ public class ResourceReference {
handle = di.readInt();
}
- protected void readName(DataInput di) throws IOException {
+ protected void readName(final DataInput di) throws IOException {
if (nameOffset > -1) {
- int len = di.readUnsignedByte();
- byte[] buf = new byte[len];
+ final int len = di.readUnsignedByte();
+ final byte[] buf = new byte[len];
di.readFully(buf);
name = new String(buf);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
index 2ad002e6a..903fe1a48 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
@@ -30,26 +30,26 @@ import java.io.IOException;
*/
public class ResourceType {
- private int type;
- private int count;
- private int offset;
- private ResourceReference[] references;
+ private final int type;
+ private final int count;
+ private final int offset;
+ private final ResourceReference[] references;
/** Creates new ResourceType */
- protected ResourceType(DataInput di) throws IOException {
+ protected ResourceType(final DataInput di) throws IOException {
type = di.readInt();
count = di.readUnsignedShort() + 1;
offset = di.readUnsignedShort();
references = new ResourceReference[count];
}
- protected void readRefs(DataInput di) throws IOException {
+ protected void readRefs(final DataInput di) throws IOException {
for (int i = 0; i < count; i++) {
references[i] = new ResourceReference(di);
}
}
- protected void readNames(DataInput di) throws IOException {
+ protected void readNames(final DataInput di) throws IOException {
for (int i = 0; i < count; i++) {
references[i].readName(di);
}
@@ -76,7 +76,7 @@ public class ResourceType {
return offset;
}
- public ResourceReference getReference(int i) {
+ public ResourceReference getReference(final int i) {
return references[i];
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
index 60975dd52..49ab1d474 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
@@ -41,9 +41,9 @@ public class BaseTable implements Table {
private class BaseCoordFormat1 extends BaseCoord {
- private short _coordinate;
+ private final short _coordinate;
- protected BaseCoordFormat1(DataInput di) throws IOException {
+ protected BaseCoordFormat1(final DataInput di) throws IOException {
_coordinate = di.readShort();
}
@@ -61,11 +61,11 @@ public class BaseTable implements Table {
private class BaseCoordFormat2 extends BaseCoord {
- private short _coordinate;
- private int _referenceGlyph;
- private int _baseCoordPoint;
+ private final short _coordinate;
+ private final int _referenceGlyph;
+ private final int _baseCoordPoint;
- protected BaseCoordFormat2(DataInput di) throws IOException {
+ protected BaseCoordFormat2(final DataInput di) throws IOException {
_coordinate = di.readShort();
_referenceGlyph = di.readUnsignedShort();
_baseCoordPoint = di.readUnsignedShort();
@@ -85,10 +85,10 @@ public class BaseTable implements Table {
private class BaseCoordFormat3 extends BaseCoord {
- private short _coordinate;
- private int _deviceTableOffset;
+ private final short _coordinate;
+ private final int _deviceTableOffset;
- protected BaseCoordFormat3(DataInput di) throws IOException {
+ protected BaseCoordFormat3(final DataInput di) throws IOException {
_coordinate = di.readShort();
_deviceTableOffset = di.readUnsignedShort();
}
@@ -107,11 +107,11 @@ public class BaseTable implements Table {
private class FeatMinMaxRecord {
- private int _tag;
- private int _minCoordOffset;
- private int _maxCoordOffset;
+ private final int _tag;
+ private final int _minCoordOffset;
+ private final int _maxCoordOffset;
- protected FeatMinMaxRecord(DataInput di) throws IOException {
+ protected FeatMinMaxRecord(final DataInput di) throws IOException {
_tag = di.readInt();
_minCoordOffset = di.readUnsignedShort();
_maxCoordOffset = di.readUnsignedShort();
@@ -120,13 +120,13 @@ public class BaseTable implements Table {
private class MinMax {
- private int _minCoordOffset;
- private int _maxCoordOffset;
- private int _featMinMaxCount;
- private FeatMinMaxRecord[] _featMinMaxRecord;
+ private final int _minCoordOffset;
+ private final int _maxCoordOffset;
+ private final int _featMinMaxCount;
+ private final FeatMinMaxRecord[] _featMinMaxRecord;
- protected MinMax(int minMaxOffset) throws IOException {
- DataInput di = getDataInputForOffset(minMaxOffset);
+ protected MinMax(final int minMaxOffset) throws IOException {
+ final DataInput di = getDataInputForOffset(minMaxOffset);
_minCoordOffset = di.readUnsignedShort();
_maxCoordOffset = di.readUnsignedShort();
_featMinMaxCount = di.readUnsignedShort();
@@ -139,13 +139,13 @@ public class BaseTable implements Table {
private class BaseValues {
- private int _defaultIndex;
- private int _baseCoordCount;
- private int[] _baseCoordOffset;
- private BaseCoord[] _baseCoords;
+ private final int _defaultIndex;
+ private final int _baseCoordCount;
+ private final int[] _baseCoordOffset;
+ private final BaseCoord[] _baseCoords;
- protected BaseValues(int baseValuesOffset) throws IOException {
- DataInput di = getDataInputForOffset(baseValuesOffset);
+ protected BaseValues(final int baseValuesOffset) throws IOException {
+ final DataInput di = getDataInputForOffset(baseValuesOffset);
_defaultIndex = di.readUnsignedShort();
_baseCoordCount = di.readUnsignedShort();
_baseCoordOffset = new int[_baseCoordCount];
@@ -154,7 +154,7 @@ public class BaseTable implements Table {
}
_baseCoords = new BaseCoord[_baseCoordCount];
for (int i = 0; i < _baseCoordCount; ++i) {
- int format = di.readUnsignedShort();
+ final int format = di.readUnsignedShort();
switch (format) {
case 1:
_baseCoords[i] = new BaseCoordFormat1(di);
@@ -172,10 +172,10 @@ public class BaseTable implements Table {
private class BaseLangSysRecord {
- private int _baseLangSysTag;
- private int _minMaxOffset;
+ private final int _baseLangSysTag;
+ private final int _minMaxOffset;
- protected BaseLangSysRecord(DataInput di) throws IOException {
+ protected BaseLangSysRecord(final DataInput di) throws IOException {
_baseLangSysTag = di.readInt();
_minMaxOffset = di.readUnsignedShort();
}
@@ -191,17 +191,17 @@ public class BaseTable implements Table {
private class BaseScript {
- private int _thisOffset;
- private int _baseValuesOffset;
- private int _defaultMinMaxOffset;
- private int _baseLangSysCount;
- private BaseLangSysRecord[] _baseLangSysRecord;
+ private final int _thisOffset;
+ private final int _baseValuesOffset;
+ private final int _defaultMinMaxOffset;
+ private final int _baseLangSysCount;
+ private final BaseLangSysRecord[] _baseLangSysRecord;
private BaseValues _baseValues;
private MinMax[] _minMax;
- protected BaseScript(int baseScriptOffset) throws IOException {
+ protected BaseScript(final int baseScriptOffset) throws IOException {
_thisOffset = baseScriptOffset;
- DataInput di = getDataInputForOffset(baseScriptOffset);
+ final DataInput di = getDataInputForOffset(baseScriptOffset);
_baseValuesOffset = di.readUnsignedShort();
_defaultMinMaxOffset = di.readUnsignedShort();
_baseLangSysCount = di.readUnsignedShort();
@@ -219,7 +219,7 @@ public class BaseTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("\nBaseScript BaseScriptT").append(Integer.toHexString(_thisOffset))
.append("\nBaseValuesT").append(Integer.toHexString(_thisOffset + _baseValuesOffset))
.append("\nMinMaxT").append(Integer.toHexString(_thisOffset + _defaultMinMaxOffset))
@@ -241,10 +241,10 @@ public class BaseTable implements Table {
private class BaseScriptRecord {
- private int _baseScriptTag;
- private int _baseScriptOffset;
+ private final int _baseScriptTag;
+ private final int _baseScriptOffset;
- protected BaseScriptRecord(DataInput di) throws IOException {
+ protected BaseScriptRecord(final DataInput di) throws IOException {
_baseScriptTag = di.readInt();
_baseScriptOffset = di.readUnsignedShort();
}
@@ -260,14 +260,14 @@ public class BaseTable implements Table {
private class BaseScriptList {
- private int _thisOffset;
- private int _baseScriptCount;
- private BaseScriptRecord[] _baseScriptRecord;
- private BaseScript[] _baseScripts;
+ private final int _thisOffset;
+ private final int _baseScriptCount;
+ private final BaseScriptRecord[] _baseScriptRecord;
+ private final BaseScript[] _baseScripts;
- protected BaseScriptList(int baseScriptListOffset) throws IOException {
+ protected BaseScriptList(final int baseScriptListOffset) throws IOException {
_thisOffset = baseScriptListOffset;
- DataInput di = getDataInputForOffset(baseScriptListOffset);
+ final DataInput di = getDataInputForOffset(baseScriptListOffset);
_baseScriptCount = di.readUnsignedShort();
_baseScriptRecord = new BaseScriptRecord[_baseScriptCount];
for (int i = 0; i < _baseScriptCount; ++i) {
@@ -282,7 +282,7 @@ public class BaseTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("\nBaseScriptList BaseScriptListT").append(Integer.toHexString(_thisOffset))
.append("\n").append(Integer.toHexString(_baseScriptCount));
for (int i = 0; i < _baseScriptCount; ++i) {
@@ -299,13 +299,13 @@ public class BaseTable implements Table {
private class BaseTagList {
- private int _thisOffset;
- private int _baseTagCount;
- private int[] _baselineTag;
+ private final int _thisOffset;
+ private final int _baseTagCount;
+ private final int[] _baselineTag;
- protected BaseTagList(int baseTagListOffset) throws IOException {
+ protected BaseTagList(final int baseTagListOffset) throws IOException {
_thisOffset = baseTagListOffset;
- DataInput di = getDataInputForOffset(baseTagListOffset);
+ final DataInput di = getDataInputForOffset(baseTagListOffset);
_baseTagCount = di.readUnsignedShort();
_baselineTag = new int[_baseTagCount];
for (int i = 0; i < _baseTagCount; ++i) {
@@ -315,7 +315,7 @@ public class BaseTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("\nBaseTagList BaseTagListT").append(Integer.toHexString(_thisOffset))
.append("\n").append(Integer.toHexString(_baseTagCount));
for (int i = 0; i < _baseTagCount; ++i) {
@@ -327,15 +327,15 @@ public class BaseTable implements Table {
private class Axis {
- private int _thisOffset;
- private int _baseTagListOffset;
- private int _baseScriptListOffset;
+ private final int _thisOffset;
+ private final int _baseTagListOffset;
+ private final int _baseScriptListOffset;
private BaseTagList _baseTagList;
private BaseScriptList _baseScriptList;
- protected Axis(int axisOffset) throws IOException {
+ protected Axis(final int axisOffset) throws IOException {
_thisOffset = axisOffset;
- DataInput di = getDataInputForOffset(axisOffset);
+ final DataInput di = getDataInputForOffset(axisOffset);
_baseTagListOffset = di.readUnsignedShort();
_baseScriptListOffset = di.readUnsignedShort();
if (_baseTagListOffset != 0) {
@@ -359,22 +359,22 @@ public class BaseTable implements Table {
}
}
- private DirectoryEntry _de;
- private int _version;
- private int _horizAxisOffset;
- private int _vertAxisOffset;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final int _horizAxisOffset;
+ private final int _vertAxisOffset;
private Axis _horizAxis;
private Axis _vertAxis;
private byte[] _buf;
/** Creates a new instance of BaseTable */
- protected BaseTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected BaseTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
// Load entire table into a buffer, and create another input stream
_buf = new byte[de.getLength()];
di.readFully(_buf);
- DataInput di2 = getDataInputForOffset(0);
+ final DataInput di2 = getDataInputForOffset(0);
_version = di2.readInt();
_horizAxisOffset = di2.readUnsignedShort();
@@ -390,7 +390,7 @@ public class BaseTable implements Table {
_buf = null;
}
- private DataInput getDataInputForOffset(int offset) {
+ private DataInput getDataInputForOffset(final int offset) {
return new DataInputStream(new ByteArrayInputStream(
_buf, offset,
_de.getLength() - offset));
@@ -404,8 +404,8 @@ public class BaseTable implements Table {
// return String.format("%1$8x", value);
// }
- static protected String tagAsString(int tag) {
- char[] c = new char[4];
+ static protected String tagAsString(final int tag) {
+ final char[] c = new char[4];
c[0] = (char)((tag >> 24) & 0xff);
c[1] = (char)((tag >> 16) & 0xff);
c[2] = (char)((tag >> 8) & 0xff);
@@ -420,7 +420,7 @@ public class BaseTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("; 'BASE' Table - Baseline\n;-------------------------------------\n\n")
.append("BASEHeader BASEHeaderT").append(Integer.toHexString(0))
.append("\n").append(Integer.toHexString(_version))
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
index a36a49923..b0acff575 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
@@ -39,11 +39,11 @@ public class CffTable implements Table {
public class Dict {
- private Dictionary<Integer, Object> _entries = new Hashtable<Integer, Object>();
- private int[] _data;
+ private final Dictionary<Integer, Object> _entries = new Hashtable<Integer, Object>();
+ private final int[] _data;
private int _index;
- protected Dict(int[] data, int offset, int length) {
+ protected Dict(final int[] data, final int offset, final int length) {
_data = data;
_index = offset;
while (_index < offset + length) {
@@ -51,12 +51,12 @@ public class CffTable implements Table {
}
}
- public Object getValue(int key) {
+ public Object getValue(final int key) {
return _entries.get(key);
}
private boolean addKeyAndValueEntry() {
- ArrayList<Object> operands = new ArrayList<Object>();
+ final ArrayList<Object> operands = new ArrayList<Object>();
Object operand = null;
while (isOperandAtIndex()) {
operand = nextOperand();
@@ -76,7 +76,7 @@ public class CffTable implements Table {
}
private boolean isOperandAtIndex() {
- int b0 = _data[_index];
+ final int b0 = _data[_index];
if ((32 <= b0 && b0 <= 254)
|| b0 == 28
|| b0 == 29
@@ -87,7 +87,7 @@ public class CffTable implements Table {
}
private boolean isOperatorAtIndex() {
- int b0 = _data[_index];
+ final int b0 = _data[_index];
if (0 <= b0 && b0 <= 21) {
return true;
}
@@ -95,7 +95,7 @@ public class CffTable implements Table {
}
private Object nextOperand() {
- int b0 = _data[_index];
+ final int b0 = _data[_index];
if (32 <= b0 && b0 <= 246) {
// 1 byte integer
@@ -104,35 +104,35 @@ public class CffTable implements Table {
} else if (247 <= b0 && b0 <= 250) {
// 2 byte integer
- int b1 = _data[_index + 1];
+ final int b1 = _data[_index + 1];
_index += 2;
return new Integer((b0 - 247) * 256 + b1 + 108);
} else if (251 <= b0 && b0 <= 254) {
// 2 byte integer
- int b1 = _data[_index + 1];
+ final int b1 = _data[_index + 1];
_index += 2;
return new Integer(-(b0 - 251) * 256 - b1 - 108);
} else if (b0 == 28) {
// 3 byte integer
- int b1 = _data[_index + 1];
- int b2 = _data[_index + 2];
+ final int b1 = _data[_index + 1];
+ final int b2 = _data[_index + 2];
_index += 3;
return new Integer(b1 << 8 | b2);
} else if (b0 == 29) {
// 5 byte integer
- int b1 = _data[_index + 1];
- int b2 = _data[_index + 2];
- int b3 = _data[_index + 3];
- int b4 = _data[_index + 4];
+ final int b1 = _data[_index + 1];
+ final int b2 = _data[_index + 2];
+ final int b3 = _data[_index + 3];
+ final int b4 = _data[_index + 4];
_index += 5;
return new Integer(b1 << 24 | b2 << 16 | b3 << 8 | b4);
} else if (b0 == 30) {
// Real number
- StringBuilder fString = new StringBuilder();
+ final StringBuilder fString = new StringBuilder();
int nibble1 = 0;
int nibble2 = 0;
++_index;
@@ -149,7 +149,7 @@ public class CffTable implements Table {
}
}
- private String decodeRealNibble(int nibble) {
+ private String decodeRealNibble(final int nibble) {
if (nibble < 0xa) {
return Integer.toString(nibble);
} else if (nibble == 0xa) {
@@ -166,10 +166,10 @@ public class CffTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
- Enumeration<Integer> keys = _entries.keys();
+ final StringBuilder sb = new StringBuilder();
+ final Enumeration<Integer> keys = _entries.keys();
while (keys.hasMoreElements()) {
- Integer key = keys.nextElement();
+ final Integer key = keys.nextElement();
if ((key.intValue() & 0xc00) == 0xc00) {
sb.append("12 ").append(key.intValue() & 0xff).append(": ");
} else {
@@ -183,12 +183,12 @@ public class CffTable implements Table {
public class Index {
- private int _count;
- private int _offSize;
- private int[] _offset;
- private int[] _data;
+ private final int _count;
+ private final int _offSize;
+ private final int[] _offset;
+ private final int[] _data;
- protected Index(DataInput di) throws IOException {
+ protected Index(final DataInput di) throws IOException {
_count = di.readUnsignedShort();
_offset = new int[_count + 1];
_offSize = di.readUnsignedByte();
@@ -209,7 +209,7 @@ public class CffTable implements Table {
return _count;
}
- public int getOffset(int index) {
+ public int getOffset(final int index) {
return _offset[index];
}
@@ -223,7 +223,7 @@ public class CffTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("DICT\n");
sb.append("count: ").append(_count).append("\n");
sb.append("offSize: ").append(_offSize).append("\n");
@@ -246,19 +246,19 @@ public class CffTable implements Table {
public class TopDictIndex extends Index {
- protected TopDictIndex(DataInput di) throws IOException {
+ protected TopDictIndex(final DataInput di) throws IOException {
super(di);
}
- public Dict getTopDict(int index) {
- int offset = getOffset(index) - 1;
- int len = getOffset(index + 1) - offset - 1;
+ public Dict getTopDict(final int index) {
+ final int offset = getOffset(index) - 1;
+ final int len = getOffset(index + 1) - offset - 1;
return new Dict(getData(), offset, len);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < getCount(); ++i) {
sb.append(getTopDict(i).toString()).append("\n");
}
@@ -268,18 +268,18 @@ public class CffTable implements Table {
public class NameIndex extends Index {
- protected NameIndex(DataInput di) throws IOException {
+ protected NameIndex(final DataInput di) throws IOException {
super(di);
}
- public String getName(int index) {
+ public String getName(final int index) {
String name = null;
- int offset = getOffset(index) - 1;
- int len = getOffset(index + 1) - offset - 1;
+ final int offset = getOffset(index) - 1;
+ final int len = getOffset(index + 1) - offset - 1;
// Ensure the name hasn't been deleted
if (getData()[offset] != 0) {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = offset; i < offset + len; ++i) {
sb.append((char) getData()[i]);
}
@@ -292,7 +292,7 @@ public class CffTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < getCount(); ++i) {
sb.append(getName(i)).append("\n");
}
@@ -302,7 +302,7 @@ public class CffTable implements Table {
public class StringIndex extends Index {
- protected StringIndex(DataInput di) throws IOException {
+ protected StringIndex(final DataInput di) throws IOException {
super(di);
}
@@ -314,10 +314,10 @@ public class CffTable implements Table {
if (index >= getCount()) {
return null;
}
- int offset = getOffset(index) - 1;
- int len = getOffset(index + 1) - offset - 1;
+ final int offset = getOffset(index) - 1;
+ final int len = getOffset(index + 1) - offset - 1;
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = offset; i < offset + len; ++i) {
sb.append((char) getData()[i]);
}
@@ -327,8 +327,8 @@ public class CffTable implements Table {
@Override
public String toString() {
- int nonStandardBase = CffStandardStrings.standardStrings.length;
- StringBuilder sb = new StringBuilder();
+ final int nonStandardBase = CffStandardStrings.standardStrings.length;
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < getCount(); ++i) {
sb.append(nonStandardBase + i).append(": ");
sb.append(getString(nonStandardBase + i)).append("\n");
@@ -346,7 +346,7 @@ public class CffTable implements Table {
return _first;
}
- protected void setFirst(int first) {
+ protected void setFirst(final int first) {
_first = first;
}
@@ -354,14 +354,14 @@ public class CffTable implements Table {
return _left;
}
- protected void setLeft(int left) {
+ protected void setLeft(final int left) {
_left = left;
}
}
private class CharsetRange1 extends CharsetRange {
- protected CharsetRange1(DataInput di) throws IOException {
+ protected CharsetRange1(final DataInput di) throws IOException {
setFirst(di.readUnsignedShort());
setLeft(di.readUnsignedByte());
}
@@ -369,7 +369,7 @@ public class CffTable implements Table {
private class CharsetRange2 extends CharsetRange {
- protected CharsetRange2(DataInput di) throws IOException {
+ protected CharsetRange2(final DataInput di) throws IOException {
setFirst(di.readUnsignedShort());
setLeft(di.readUnsignedShort());
}
@@ -384,9 +384,9 @@ public class CffTable implements Table {
private class CharsetFormat0 extends Charset {
- private int[] _glyph;
+ private final int[] _glyph;
- protected CharsetFormat0(DataInput di, int glyphCount) throws IOException {
+ protected CharsetFormat0(final DataInput di, final int glyphCount) throws IOException {
_glyph = new int[glyphCount - 1]; // minus 1 because .notdef is omitted
for (int i = 0; i < glyphCount - 1; ++i) {
_glyph[i] = di.readUnsignedShort();
@@ -399,7 +399,7 @@ public class CffTable implements Table {
}
@Override
- public int getSID(int gid) {
+ public int getSID(final int gid) {
if (gid == 0) {
return 0;
}
@@ -409,12 +409,12 @@ public class CffTable implements Table {
private class CharsetFormat1 extends Charset {
- private ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
+ private final ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
- protected CharsetFormat1(DataInput di, int glyphCount) throws IOException {
+ protected CharsetFormat1(final DataInput di, final int glyphCount) throws IOException {
int glyphsCovered = glyphCount - 1; // minus 1 because .notdef is omitted
while (glyphsCovered > 0) {
- CharsetRange range = new CharsetRange1(di);
+ final CharsetRange range = new CharsetRange1(di);
_charsetRanges.add(range);
glyphsCovered -= range.getLeft() + 1;
}
@@ -426,17 +426,17 @@ public class CffTable implements Table {
}
@Override
- public int getSID(int gid) {
+ public int getSID(final int gid) {
if (gid == 0) {
return 0;
}
// Count through the ranges to find the one of interest
int count = 0;
- for (CharsetRange range : _charsetRanges) {
+ for (final CharsetRange range : _charsetRanges) {
count += range.getLeft();
if (gid < count) {
- int sid = gid - count + range.getFirst();
+ final int sid = gid - count + range.getFirst();
return sid;
}
}
@@ -446,12 +446,12 @@ public class CffTable implements Table {
private class CharsetFormat2 extends Charset {
- private ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
+ private final ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
- protected CharsetFormat2(DataInput di, int glyphCount) throws IOException {
+ protected CharsetFormat2(final DataInput di, final int glyphCount) throws IOException {
int glyphsCovered = glyphCount - 1; // minus 1 because .notdef is omitted
while (glyphsCovered > 0) {
- CharsetRange range = new CharsetRange2(di);
+ final CharsetRange range = new CharsetRange2(di);
_charsetRanges.add(range);
glyphsCovered -= range.getLeft() + 1;
}
@@ -463,16 +463,16 @@ public class CffTable implements Table {
}
@Override
- public int getSID(int gid) {
+ public int getSID(final int gid) {
if (gid == 0) {
return 0;
}
// Count through the ranges to find the one of interest
int count = 0;
- for (CharsetRange range : _charsetRanges) {
+ for (final CharsetRange range : _charsetRanges) {
if (gid < range.getLeft() + count) {
- int sid = gid - count + range.getFirst() - 1;
+ final int sid = gid - count + range.getFirst() - 1;
return sid;
}
count += range.getLeft();
@@ -481,23 +481,23 @@ public class CffTable implements Table {
}
}
- private DirectoryEntry _de;
- private int _major;
- private int _minor;
- private int _hdrSize;
- private int _offSize;
- private NameIndex _nameIndex;
- private TopDictIndex _topDictIndex;
- private StringIndex _stringIndex;
- private Index _globalSubrIndex;
- private Index _charStringsIndexArray[];
- private Charset[] _charsets;
- private Charstring[][] _charstringsArray;
-
- private byte[] _buf;
+ private final DirectoryEntry _de;
+ private final int _major;
+ private final int _minor;
+ private final int _hdrSize;
+ private final int _offSize;
+ private final NameIndex _nameIndex;
+ private final TopDictIndex _topDictIndex;
+ private final StringIndex _stringIndex;
+ private final Index _globalSubrIndex;
+ private final Index _charStringsIndexArray[];
+ private final Charset[] _charsets;
+ private final Charstring[][] _charstringsArray;
+
+ private final byte[] _buf;
/** Creates a new instance of CffTable */
- protected CffTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected CffTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
// Load entire table into a buffer, and create another input stream
@@ -537,15 +537,15 @@ public class CffTable implements Table {
// Charstrings INDEX
// We load this before Charsets because we may need to know the number
// of glyphs
- Integer charStringsOffset = (Integer) _topDictIndex.getTopDict(i).getValue(17);
+ final Integer charStringsOffset = (Integer) _topDictIndex.getTopDict(i).getValue(17);
di2 = getDataInputForOffset(charStringsOffset);
_charStringsIndexArray[i] = new Index(di2);
- int glyphCount = _charStringsIndexArray[i].getCount();
+ final int glyphCount = _charStringsIndexArray[i].getCount();
// Charsets
- Integer charsetOffset = (Integer) _topDictIndex.getTopDict(i).getValue(15);
+ final Integer charsetOffset = (Integer) _topDictIndex.getTopDict(i).getValue(15);
di2 = getDataInputForOffset(charsetOffset);
- int format = di2.readUnsignedByte();
+ final int format = di2.readUnsignedByte();
switch (format) {
case 0:
_charsets[i] = new CharsetFormat0(di2, glyphCount);
@@ -561,8 +561,8 @@ public class CffTable implements Table {
// Create the charstrings
_charstringsArray[i] = new Charstring[glyphCount];
for (int j = 0; j < glyphCount; ++j) {
- int offset = _charStringsIndexArray[i].getOffset(j) - 1;
- int len = _charStringsIndexArray[i].getOffset(j + 1) - offset - 1;
+ final int offset = _charStringsIndexArray[i].getOffset(j) - 1;
+ final int len = _charStringsIndexArray[i].getOffset(j + 1) - offset - 1;
_charstringsArray[i][j] = new CharstringType2(
i,
_stringIndex.getString(_charsets[i].getSID(j)),
@@ -575,7 +575,7 @@ public class CffTable implements Table {
}
}
- private DataInput getDataInputForOffset(int offset) {
+ private DataInput getDataInputForOffset(final int offset) {
return new DataInputStream(new ByteArrayInputStream(
_buf, offset,
_de.getLength() - offset));
@@ -585,15 +585,15 @@ public class CffTable implements Table {
return _nameIndex;
}
- public Charset getCharset(int fontIndex) {
+ public Charset getCharset(final int fontIndex) {
return _charsets[fontIndex];
}
- public Charstring getCharstring(int fontIndex, int gid) {
+ public Charstring getCharstring(final int fontIndex, final int gid) {
return _charstringsArray[fontIndex][gid];
}
- public int getCharstringCount(int fontIndex) {
+ public int getCharstringCount(final int fontIndex) {
return _charstringsArray[fontIndex].length;
}
@@ -604,7 +604,7 @@ public class CffTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'CFF' Table - Compact Font Format\n---------------------------------\n");
sb.append("\nName INDEX\n");
sb.append(_nameIndex.toString());
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
index 7a7b51890..211499357 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
@@ -106,24 +106,24 @@ public class CharstringType2 extends Charstring {
"-Reserved-"
};
- private int _index;
- private String _name;
- private int[] _data;
- private int _offset;
- private int _length;
- private CffTable.Index _localSubrIndex;
- private CffTable.Index _globalSubrIndex;
+ private final int _index;
+ private final String _name;
+ private final int[] _data;
+ private final int _offset;
+ private final int _length;
+ private final CffTable.Index _localSubrIndex;
+ private final CffTable.Index _globalSubrIndex;
private int _ip;
/** Creates a new instance of CharstringType2 */
protected CharstringType2(
- int index,
- String name,
- int[] data,
- int offset,
- int length,
- CffTable.Index localSubrIndex,
- CffTable.Index globalSubrIndex) {
+ final int index,
+ final String name,
+ final int[] data,
+ final int offset,
+ final int length,
+ final CffTable.Index localSubrIndex,
+ final CffTable.Index globalSubrIndex) {
_index = index;
_name = name;
_data = data;
@@ -143,7 +143,7 @@ public class CharstringType2 extends Charstring {
return _name;
}
- private void disassemble(StringBuilder sb) {
+ private void disassemble(final StringBuilder sb) {
Number operand = null;
while (isOperandAtIndex()) {
operand = nextOperand();
@@ -170,7 +170,7 @@ public class CharstringType2 extends Charstring {
}
public boolean isOperandAtIndex() {
- int b0 = _data[_ip];
+ final int b0 = _data[_ip];
if ((32 <= b0 && b0 <= 255) || b0 == 28) {
return true;
}
@@ -178,7 +178,7 @@ public class CharstringType2 extends Charstring {
}
public Number nextOperand() {
- int b0 = _data[_ip];
+ final int b0 = _data[_ip];
if (32 <= b0 && b0 <= 246) {
// 1 byte integer
@@ -187,29 +187,29 @@ public class CharstringType2 extends Charstring {
} else if (247 <= b0 && b0 <= 250) {
// 2 byte integer
- int b1 = _data[_ip + 1];
+ final int b1 = _data[_ip + 1];
_ip += 2;
return new Integer((b0 - 247) * 256 + b1 + 108);
} else if (251 <= b0 && b0 <= 254) {
// 2 byte integer
- int b1 = _data[_ip + 1];
+ final int b1 = _data[_ip + 1];
_ip += 2;
return new Integer(-(b0 - 251) * 256 - b1 - 108);
} else if (b0 == 28) {
// 3 byte integer
- int b1 = _data[_ip + 1];
- int b2 = _data[_ip + 2];
+ final int b1 = _data[_ip + 1];
+ final int b2 = _data[_ip + 2];
_ip += 3;
return new Integer(b1 << 8 | b2);
} else if (b0 == 255) {
// 16-bit signed integer with 16 bits of fraction
- int b1 = (byte) _data[_ip + 1];
- int b2 = _data[_ip + 2];
- int b3 = _data[_ip + 3];
- int b4 = _data[_ip + 4];
+ final int b1 = (byte) _data[_ip + 1];
+ final int b2 = _data[_ip + 2];
+ final int b3 = _data[_ip + 3];
+ final int b4 = _data[_ip + 4];
_ip += 5;
return new Float((b1 << 8 | b2) + ((b3 << 8 | b4) / 65536.0));
} else {
@@ -227,7 +227,7 @@ public class CharstringType2 extends Charstring {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
resetIP();
while (moreBytes()) {
disassemble(sb);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
index 21698c76b..a65bcd525 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
@@ -20,9 +20,9 @@ public abstract class ClassDef {
public abstract int getFormat();
- protected static ClassDef read(RandomAccessFile raf) throws IOException {
+ protected static ClassDef read(final RandomAccessFile raf) throws IOException {
ClassDef c = null;
- int format = raf.readUnsignedShort();
+ final int format = raf.readUnsignedShort();
if (format == 1) {
c = new ClassDefFormat1(raf);
} else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
index 94910e4f6..cbc05393f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
@@ -18,12 +18,12 @@ import java.io.RandomAccessFile;
*/
public class ClassDefFormat1 extends ClassDef {
- private int startGlyph;
- private int glyphCount;
- private int[] classValues;
+ private final int startGlyph;
+ private final int glyphCount;
+ private final int[] classValues;
/** Creates new ClassDefFormat1 */
- public ClassDefFormat1(RandomAccessFile raf) throws IOException {
+ public ClassDefFormat1(final RandomAccessFile raf) throws IOException {
startGlyph = raf.readUnsignedShort();
glyphCount = raf.readUnsignedShort();
classValues = new int[glyphCount];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
index 9906ecfb1..99283f026 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
@@ -18,11 +18,11 @@ import java.io.RandomAccessFile;
*/
public class ClassDefFormat2 extends ClassDef {
- private int classRangeCount;
- private RangeRecord[] classRangeRecords;
+ private final int classRangeCount;
+ private final RangeRecord[] classRangeRecords;
/** Creates new ClassDefFormat2 */
- public ClassDefFormat2(RandomAccessFile raf) throws IOException {
+ public ClassDefFormat2(final RandomAccessFile raf) throws IOException {
classRangeCount = raf.readUnsignedShort();
classRangeRecords = new RangeRecord[classRangeCount];
for (int i = 0; i < classRangeCount; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
index f7054852a..f29583ec4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
@@ -61,10 +61,10 @@ public abstract class CmapFormat {
public class Range {
- private int _startCode;
- private int _endCode;
+ private final int _startCode;
+ private final int _endCode;
- protected Range(int startCode, int endCode) {
+ protected Range(final int startCode, final int endCode) {
_startCode = startCode;
_endCode = endCode;
}
@@ -82,12 +82,12 @@ public abstract class CmapFormat {
protected int _length;
protected int _language;
- protected CmapFormat(DataInput di) throws IOException {
+ protected CmapFormat(final DataInput di) throws IOException {
_length = di.readUnsignedShort();
_language = di.readUnsignedShort();
}
- protected static CmapFormat create(int format, DataInput di)
+ protected static CmapFormat create(final int format, final DataInput di)
throws IOException {
switch(format) {
case 0:
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
index dd1ede232..505e8c942 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
@@ -61,9 +61,9 @@ import java.io.IOException;
*/
public class CmapFormat0 extends CmapFormat {
- private int[] _glyphIdArray = new int[256];
+ private final int[] _glyphIdArray = new int[256];
- protected CmapFormat0(DataInput di) throws IOException {
+ protected CmapFormat0(final DataInput di) throws IOException {
super(di);
_format = 0;
for (int i = 0; i < 256; i++) {
@@ -77,7 +77,7 @@ public class CmapFormat0 extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
if (index != 0) {
throw new ArrayIndexOutOfBoundsException();
}
@@ -85,7 +85,7 @@ public class CmapFormat0 extends CmapFormat {
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
if (0 <= charCode && charCode < 256) {
return _glyphIdArray[charCode];
} else {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
index d071e9421..e57e509b4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
@@ -68,11 +68,11 @@ public class CmapFormat2 extends CmapFormat {
int _arrayIndex;
}
- private int[] _subHeaderKeys = new int[256];
- private SubHeader[] _subHeaders;
- private int[] _glyphIndexArray;
+ private final int[] _subHeaderKeys = new int[256];
+ private final SubHeader[] _subHeaders;
+ private final int[] _glyphIndexArray;
- protected CmapFormat2(DataInput di) throws IOException {
+ protected CmapFormat2(final DataInput di) throws IOException {
super(di);
_format = 2;
@@ -86,15 +86,15 @@ public class CmapFormat2 extends CmapFormat {
highest = Math.max(highest, _subHeaderKeys[i]);
pos += 2;
}
- int subHeaderCount = highest / 8 + 1;
+ final int subHeaderCount = highest / 8 + 1;
_subHeaders = new SubHeader[subHeaderCount];
// Read the subheaders, once again noting the highest glyphIndexArray
// index range.
- int indexArrayOffset = 8 * subHeaderCount + 518;
+ final int indexArrayOffset = 8 * subHeaderCount + 518;
highest = 0;
for (int i = 0; i < _subHeaders.length; ++i) {
- SubHeader sh = new SubHeader();
+ final SubHeader sh = new SubHeader();
sh._firstCode = di.readUnsignedShort();
sh._entryCount = di.readUnsignedShort();
sh._idDelta = di.readShort();
@@ -124,7 +124,7 @@ public class CmapFormat2 extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
if (index < 0 || index >= _subHeaders.length) {
throw new ArrayIndexOutOfBoundsException();
}
@@ -147,18 +147,18 @@ public class CmapFormat2 extends CmapFormat {
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
// Get the appropriate subheader
int index = 0;
- int highByte = charCode >> 8;
+ final int highByte = charCode >> 8;
if (highByte != 0) {
index = _subHeaderKeys[highByte] / 8;
}
- SubHeader sh = _subHeaders[index];
+ final SubHeader sh = _subHeaders[index];
// Is the charCode out-of-range?
- int lowByte = charCode & 0xff;
+ final int lowByte = charCode & 0xff;
if (lowByte < sh._firstCode ||
lowByte >= (sh._firstCode + sh._entryCount)) {
return 0;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
index 2ae23d031..f84a4eab3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
@@ -59,18 +59,18 @@ import java.io.IOException;
*/
public class CmapFormat4 extends CmapFormat {
- private int _segCountX2;
- private int _searchRange;
- private int _entrySelector;
- private int _rangeShift;
- private int[] _endCode;
- private int[] _startCode;
- private int[] _idDelta;
- private int[] _idRangeOffset;
- private int[] _glyphIdArray;
- private int _segCount;
-
- protected CmapFormat4(DataInput di) throws IOException {
+ private final int _segCountX2;
+ private final int _searchRange;
+ private final int _entrySelector;
+ private final int _rangeShift;
+ private final int[] _endCode;
+ private final int[] _startCode;
+ private final int[] _idDelta;
+ private final int[] _idRangeOffset;
+ private final int[] _glyphIdArray;
+ private final int _segCount;
+
+ protected CmapFormat4(final DataInput di) throws IOException {
super(di); // 6
_format = 4;
_segCountX2 = di.readUnsignedShort(); // +2 (8)
@@ -97,7 +97,7 @@ public class CmapFormat4 extends CmapFormat {
} // + 2*segCount (8*segCount + 16)
// Whatever remains of this header belongs in glyphIdArray
- int count = (_length - (8*_segCount + 16)) / 2;
+ final int count = (_length - (8*_segCount + 16)) / 2;
_glyphIdArray = new int[count];
for (int i = 0; i < count; i++) {
_glyphIdArray[i] = di.readUnsignedShort();
@@ -116,7 +116,7 @@ public class CmapFormat4 extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
if (index < 0 || index >= _segCount) {
throw new ArrayIndexOutOfBoundsException();
}
@@ -124,7 +124,7 @@ public class CmapFormat4 extends CmapFormat {
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
try {
for (int i = 0; i < _segCount; i++) {
if (_endCode[i] >= charCode) {
@@ -139,7 +139,7 @@ public class CmapFormat4 extends CmapFormat {
}
}
}
- } catch (ArrayIndexOutOfBoundsException e) {
+ } catch (final ArrayIndexOutOfBoundsException e) {
System.err.println("error: Array out of bounds - " + e.getMessage());
}
return 0;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
index 2a33d8d40..eff3d2fb1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
@@ -64,7 +64,7 @@ public class CmapFormat6 extends CmapFormat {
private short _entryCount;
private short[] _glyphIdArray;
- protected CmapFormat6(DataInput di) throws IOException {
+ protected CmapFormat6(final DataInput di) throws IOException {
super(di);
_format = 6;
@@ -79,12 +79,12 @@ public class CmapFormat6 extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
throw new ArrayIndexOutOfBoundsException();
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
return 0;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
index 392683bcd..e9aa1d4e0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
@@ -32,7 +32,7 @@ import java.io.IOException;
public class CmapFormatUnknown extends CmapFormat {
/** Creates a new instance of CmapFormatUnknown */
- protected CmapFormatUnknown(int format, DataInput di) throws IOException {
+ protected CmapFormatUnknown(final int format, final DataInput di) throws IOException {
super(di);
_format = format;
@@ -46,12 +46,12 @@ public class CmapFormatUnknown extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
throw new ArrayIndexOutOfBoundsException();
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
return 0;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
index 4833318d5..1f2c80286 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
@@ -59,12 +59,12 @@ import java.io.IOException;
*/
public class CmapIndexEntry implements Comparable {
- private int _platformId;
- private int _encodingId;
- private int _offset;
+ private final int _platformId;
+ private final int _encodingId;
+ private final int _offset;
private CmapFormat _format;
- protected CmapIndexEntry(DataInput di) throws IOException {
+ protected CmapIndexEntry(final DataInput di) throws IOException {
_platformId = di.readUnsignedShort();
_encodingId = di.readUnsignedShort();
_offset = di.readInt();
@@ -86,7 +86,7 @@ public class CmapIndexEntry implements Comparable {
return _format;
}
- public void setFormat(CmapFormat format) {
+ public void setFormat(final CmapFormat format) {
_format = format;
}
@@ -106,8 +106,8 @@ public class CmapIndexEntry implements Comparable {
}
@Override
- public int compareTo(java.lang.Object obj) {
- CmapIndexEntry entry = (CmapIndexEntry) obj;
+ public int compareTo(final java.lang.Object obj) {
+ final CmapIndexEntry entry = (CmapIndexEntry) obj;
if (getOffset() < entry.getOffset()) {
return -1;
} else if (getOffset() > entry.getOffset()) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
index 2cdddb3ef..4623eb5cf 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
@@ -61,12 +61,12 @@ import java.util.Arrays;
*/
public class CmapTable implements Table {
- private DirectoryEntry _de;
- private int _version;
- private int _numTables;
- private CmapIndexEntry[] _entries;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final int _numTables;
+ private final CmapIndexEntry[] _entries;
- protected CmapTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected CmapTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_version = di.readUnsignedShort();
_numTables = di.readUnsignedShort();
@@ -98,7 +98,7 @@ public class CmapTable implements Table {
// Something is amiss
throw new IOException();
}
- int formatType = di.readUnsignedShort();
+ final int formatType = di.readUnsignedShort();
lastFormat = CmapFormat.create(formatType, di);
lastOffset = _entries[i].getOffset();
_entries[i].setFormat(lastFormat);
@@ -114,11 +114,11 @@ public class CmapTable implements Table {
return _numTables;
}
- public CmapIndexEntry getCmapIndexEntry(int i) {
+ public CmapIndexEntry getCmapIndexEntry(final int i) {
return _entries[i];
}
- public CmapFormat getCmapFormat(short platformId, short encodingId) {
+ public CmapFormat getCmapFormat(final short platformId, final short encodingId) {
// Find the requested format
for (int i = 0; i < _numTables; i++) {
@@ -137,7 +137,7 @@ public class CmapTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder().append("cmap\n");
+ final StringBuilder sb = new StringBuilder().append("cmap\n");
// Get each of the index entries
for (int i = 0; i < _numTables; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
index 4f526f51d..a6f994f95 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
@@ -69,9 +69,9 @@ public abstract class Coverage {
*/
public abstract int findGlyph(int glyphId);
- protected static Coverage read(DataInput di) throws IOException {
+ protected static Coverage read(final DataInput di) throws IOException {
Coverage c = null;
- int format = di.readUnsignedShort();
+ final int format = di.readUnsignedShort();
if (format == 1) {
c = new CoverageFormat1(di);
} else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
index 715bf11ec..3deb60202 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class CoverageFormat1 extends Coverage {
- private int _glyphCount;
- private int[] _glyphIds;
+ private final int _glyphCount;
+ private final int[] _glyphIds;
/** Creates new CoverageFormat1 */
- protected CoverageFormat1(DataInput di) throws IOException {
+ protected CoverageFormat1(final DataInput di) throws IOException {
_glyphCount = di.readUnsignedShort();
_glyphIds = new int[_glyphCount];
for (int i = 0; i < _glyphCount; i++) {
@@ -78,7 +78,7 @@ public class CoverageFormat1 extends Coverage {
}
@Override
- public int findGlyph(int glyphId) {
+ public int findGlyph(final int glyphId) {
for (int i = 0; i < _glyphCount; i++) {
if (_glyphIds[i] == glyphId) {
return i;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
index bd2a28f79..9397f376d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class CoverageFormat2 extends Coverage {
- private int _rangeCount;
- private RangeRecord[] _rangeRecords;
+ private final int _rangeCount;
+ private final RangeRecord[] _rangeRecords;
/** Creates new CoverageFormat2 */
- protected CoverageFormat2(DataInput di) throws IOException {
+ protected CoverageFormat2(final DataInput di) throws IOException {
_rangeCount = di.readUnsignedShort();
_rangeRecords = new RangeRecord[_rangeCount];
for (int i = 0; i < _rangeCount; i++) {
@@ -78,9 +78,9 @@ public class CoverageFormat2 extends Coverage {
}
@Override
- public int findGlyph(int glyphId) {
+ public int findGlyph(final int glyphId) {
for (int i = 0; i < _rangeCount; i++) {
- int n = _rangeRecords[i].getCoverageIndex(glyphId);
+ final int n = _rangeRecords[i].getCoverageIndex(glyphId);
if (n > -1) {
return n;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
index 9e1c47de9..7f62d26ab 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
@@ -17,12 +17,12 @@ import java.io.IOException;
*/
public class CvtTable implements Table {
- private DirectoryEntry de;
- private short[] values;
+ private final DirectoryEntry de;
+ private final short[] values;
- protected CvtTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected CvtTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
- int len = de.getLength() / 2;
+ final int len = de.getLength() / 2;
values = new short[len];
for (int i = 0; i < len; i++) {
values[i] = di.readShort();
@@ -40,7 +40,7 @@ public class CvtTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'cvt ' Table - Control Value Table\n----------------------------------\n");
sb.append("Size = ").append(0).append(" bytes, ").append(values.length).append(" entries\n");
sb.append(" Values\n ------\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
index 5451f4502..a0b10e187 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
@@ -18,13 +18,13 @@ import java.io.RandomAccessFile;
*/
public class Device extends Object {
- private int startSize;
- private int endSize;
- private int deltaFormat;
- private int[] deltaValues;
+ private final int startSize;
+ private final int endSize;
+ private final int deltaFormat;
+ private final int[] deltaValues;
/** Creates new Device */
- public Device(RandomAccessFile raf) throws IOException {
+ public Device(final RandomAccessFile raf) throws IOException {
startSize = raf.readUnsignedShort();
endSize = raf.readUnsignedShort();
deltaFormat = raf.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
index e34fa32e8..54684b8e9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
@@ -59,12 +59,12 @@ import java.io.IOException;
*/
public class DirectoryEntry implements Cloneable {
- private int _tag;
- private int _checksum;
- private int _offset;
- private int _length;
+ private final int _tag;
+ private final int _checksum;
+ private final int _offset;
+ private final int _length;
- protected DirectoryEntry(DataInput di) throws IOException {
+ protected DirectoryEntry(final DataInput di) throws IOException {
_tag = di.readInt();
_checksum = di.readInt();
_offset = di.readInt();
@@ -75,7 +75,7 @@ public class DirectoryEntry implements Cloneable {
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
return null;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
index 4a09a4c34..ec7b503f1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
@@ -18,12 +18,12 @@ import java.io.DataInput;
*/
public class DsigEntry {
- private int format;
- private int length;
- private int offset;
+ private final int format;
+ private final int length;
+ private final int offset;
/** Creates new DsigEntry */
- protected DsigEntry(DataInput di) throws IOException {
+ protected DsigEntry(final DataInput di) throws IOException {
format = di.readInt();
length = di.readInt();
offset = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
index 2b85f52d8..f2b1322c0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
@@ -18,15 +18,15 @@ import java.io.DataInput;
*/
public class DsigTable implements Table {
- private DirectoryEntry de;
- private int version;
- private int numSigs;
- private int flag;
- private DsigEntry[] dsigEntry;
- private SignatureBlock[] sigBlocks;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int numSigs;
+ private final int flag;
+ private final DsigEntry[] dsigEntry;
+ private final SignatureBlock[] sigBlocks;
/** Creates new DsigTable */
- protected DsigTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected DsigTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readInt();
numSigs = di.readUnsignedShort();
@@ -63,7 +63,7 @@ public class DsigTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder().append("DSIG\n");
+ final StringBuilder sb = new StringBuilder().append("DSIG\n");
for (int i = 0; i < numSigs; i++) {
sb.append(sigBlocks[i].toString());
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
index ee27896a4..c6f912569 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class Feature {
- private int _featureParams;
- private int _lookupCount;
- private int[] _lookupListIndex;
+ private final int _featureParams;
+ private final int _lookupCount;
+ private final int[] _lookupListIndex;
/** Creates new Feature */
- protected Feature(DataInput di) throws IOException {
+ protected Feature(final DataInput di) throws IOException {
_featureParams = di.readUnsignedShort();
_lookupCount = di.readUnsignedShort();
_lookupListIndex = new int[_lookupCount];
@@ -78,7 +78,7 @@ public class Feature {
return _lookupCount;
}
- public int getLookupListIndex(int i) {
+ public int getLookupListIndex(final int i) {
return _lookupListIndex[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
index fdedca94a..933378068 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class FeatureList {
- private int _featureCount;
- private FeatureRecord[] _featureRecords;
- private Feature[] _features;
+ private final int _featureCount;
+ private final FeatureRecord[] _featureRecords;
+ private final Feature[] _features;
/** Creates new FeatureList */
- public FeatureList(DataInputStream dis, int offset) throws IOException {
+ public FeatureList(final DataInputStream dis, final int offset) throws IOException {
// Ensure we're in the right place
dis.reset();
@@ -89,19 +89,19 @@ public class FeatureList {
return _featureCount;
}
- public FeatureRecord getFeatureRecord(int i) {
+ public FeatureRecord getFeatureRecord(final int i) {
return _featureRecords[i];
}
- public Feature getFeature(int i) {
+ public Feature getFeature(final int i) {
return _features[i];
}
- public Feature findFeature(LangSys langSys, String tag) {
+ public Feature findFeature(final LangSys langSys, final String tag) {
if (tag.length() != 4) {
return null;
}
- int tagVal = ((tag.charAt(0)<<24)
+ final int tagVal = ((tag.charAt(0)<<24)
| (tag.charAt(1)<<16)
| (tag.charAt(2)<<8)
| tag.charAt(3));
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
index 1da74f4d5..06506904f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class FeatureRecord {
- private int _tag;
- private int _offset;
+ private final int _tag;
+ private final int _offset;
/** Creates new FeatureRecord */
- protected FeatureRecord(DataInput di) throws IOException {
+ protected FeatureRecord(final DataInput di) throws IOException {
_tag = di.readInt();
_offset = di.readUnsignedShort();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
index 467a4f360..e44acfa02 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
@@ -19,9 +19,9 @@ import jogamp.graph.font.typecast.ot.Disassembler;
*/
public class FpgmTable extends Program implements Table {
- private DirectoryEntry de;
+ private final DirectoryEntry de;
- protected FpgmTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected FpgmTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
readInstructions(di, de.getLength());
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
index cc87b19a4..cebc51646 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
@@ -21,18 +21,18 @@ public class GaspRange {
public static final int GASP_GRIDFIT = 1;
public static final int GASP_DOGRAY = 2;
- private int rangeMaxPPEM;
- private int rangeGaspBehavior;
+ private final int rangeMaxPPEM;
+ private final int rangeGaspBehavior;
/** Creates new GaspRange */
- protected GaspRange(DataInput di) throws IOException {
+ protected GaspRange(final DataInput di) throws IOException {
rangeMaxPPEM = di.readUnsignedShort();
rangeGaspBehavior = di.readUnsignedShort();
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(" rangeMaxPPEM: ").append(rangeMaxPPEM)
.append("\n rangeGaspBehavior: 0x").append(rangeGaspBehavior);
if ((rangeGaspBehavior & GASP_GRIDFIT) != 0) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
index 8f91e6d00..7bf7f96cc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
*/
public class GaspTable implements Table {
- private DirectoryEntry de;
- private int version;
- private int numRanges;
- private GaspRange[] gaspRange;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int numRanges;
+ private final GaspRange[] gaspRange;
/** Creates new GaspTable */
- protected GaspTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected GaspTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readUnsignedShort();
numRanges = di.readUnsignedShort();
@@ -41,7 +41,7 @@ public class GaspTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'gasp' Table - Grid-fitting And Scan-conversion Procedure\n---------------------------------------------------------");
sb.append("\n 'gasp' version: ").append(version);
sb.append("\n numRanges: ").append(numRanges);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
index e5c86873e..4db4ddcc2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
@@ -69,12 +69,12 @@ public class GlyfCompositeComp {
public static final short WE_HAVE_INSTRUCTIONS = 0x0100;
public static final short USE_MY_METRICS = 0x0200;
- private int _firstIndex;
- private int _firstContour;
+ private final int _firstIndex;
+ private final int _firstContour;
private short _argument1;
private short _argument2;
- private int _flags;
- private int _glyphIndex;
+ private final int _flags;
+ private final int _glyphIndex;
private double _xscale = 1.0;
private double _yscale = 1.0;
private double _scale01 = 0.0;
@@ -84,7 +84,7 @@ public class GlyfCompositeComp {
private int _point1 = 0;
private int _point2 = 0;
- protected GlyfCompositeComp(int firstIndex, int firstContour, DataInput di)
+ protected GlyfCompositeComp(final int firstIndex, final int firstContour, final DataInput di)
throws IOException {
_firstIndex = firstIndex;
_firstContour = firstContour;
@@ -96,8 +96,8 @@ public class GlyfCompositeComp {
_argument1 = di.readShort();
_argument2 = di.readShort();
} else {
- _argument1 = (short) di.readByte();
- _argument2 = (short) di.readByte();
+ _argument1 = di.readByte();
+ _argument2 = di.readByte();
}
// Assign the arguments according to the flags
@@ -111,7 +111,7 @@ public class GlyfCompositeComp {
// Get the scale values (if any)
if ((_flags & WE_HAVE_A_SCALE) != 0) {
- int i = di.readShort();
+ final int i = di.readShort();
_xscale = _yscale = (double) i / (double) 0x4000;
} else if ((_flags & WE_HAVE_AN_X_AND_Y_SCALE) != 0) {
short i = di.readShort();
@@ -184,8 +184,8 @@ public class GlyfCompositeComp {
* @param y The y-coordinate of the point to transform
* @return The transformed x-coordinate
*/
- public int scaleX(int x, int y) {
- return (int)((double) x * _xscale + (double) y * _scale10);
+ public int scaleX(final int x, final int y) {
+ return (int)(x * _xscale + y * _scale10);
}
/**
@@ -194,7 +194,7 @@ public class GlyfCompositeComp {
* @param y The y-coordinate of the point to transform
* @return The transformed y-coordinate
*/
- public int scaleY(int x, int y) {
- return (int)((double) x * _scale01 + (double) y * _yscale);
+ public int scaleY(final int x, final int y) {
+ return (int)(x * _scale01 + y * _yscale);
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
index fabc71a77..3879da02a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
@@ -69,9 +69,9 @@ public class GlyfCompositeDescript extends GlyfDescript {
new ArrayList<GlyfCompositeComp>();
public GlyfCompositeDescript(
- GlyfTable parentTable,
- int glyphIndex,
- DataInput di) throws IOException {
+ final GlyfTable parentTable,
+ final int glyphIndex,
+ final DataInput di) throws IOException {
super(parentTable, glyphIndex, (short) -1, di);
// Get all of the composite components
@@ -81,7 +81,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
try {
do {
_components.add(comp = new GlyfCompositeComp(firstIndex, firstContour, di));
- GlyfDescript desc = parentTable.getDescription(comp.getGlyphIndex());
+ final GlyfDescript desc = parentTable.getDescription(comp.getGlyphIndex());
if (desc != null) {
firstIndex += desc.getPointCount();
firstContour += desc.getContourCount();
@@ -92,7 +92,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
if ((comp.getFlags() & GlyfCompositeComp.WE_HAVE_INSTRUCTIONS) != 0) {
readInstructions(di, di.readShort());
}
- } catch (IOException e) {
+ } catch (final IOException e) {
throw e;
// } catch (Exception e) {
// int foo = 0;
@@ -100,33 +100,33 @@ public class GlyfCompositeDescript extends GlyfDescript {
}
@Override
- public int getEndPtOfContours(int i) {
- GlyfCompositeComp c = getCompositeCompEndPt(i);
+ public int getEndPtOfContours(final int i) {
+ final GlyfCompositeComp c = getCompositeCompEndPt(i);
if (c != null) {
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
return gd.getEndPtOfContours(i - c.getFirstContour()) + c.getFirstIndex();
}
return 0;
}
@Override
- public byte getFlags(int i) {
- GlyfCompositeComp c = getCompositeComp(i);
+ public byte getFlags(final int i) {
+ final GlyfCompositeComp c = getCompositeComp(i);
if (c != null) {
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
return gd.getFlags(i - c.getFirstIndex());
}
return 0;
}
@Override
- public short getXCoordinate(int i) {
- GlyfCompositeComp c = getCompositeComp(i);
+ public short getXCoordinate(final int i) {
+ final GlyfCompositeComp c = getCompositeComp(i);
if (c != null) {
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
- int n = i - c.getFirstIndex();
- int x = gd.getXCoordinate(n);
- int y = gd.getYCoordinate(n);
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final int n = i - c.getFirstIndex();
+ final int x = gd.getXCoordinate(n);
+ final int y = gd.getYCoordinate(n);
short x1 = (short) c.scaleX(x, y);
x1 += c.getXTranslate();
return x1;
@@ -135,13 +135,13 @@ public class GlyfCompositeDescript extends GlyfDescript {
}
@Override
- public short getYCoordinate(int i) {
- GlyfCompositeComp c = getCompositeComp(i);
+ public short getYCoordinate(final int i) {
+ final GlyfCompositeComp c = getCompositeComp(i);
if (c != null) {
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
- int n = i - c.getFirstIndex();
- int x = gd.getXCoordinate(n);
- int y = gd.getYCoordinate(n);
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final int n = i - c.getFirstIndex();
+ final int x = gd.getXCoordinate(n);
+ final int y = gd.getYCoordinate(n);
short y1 = (short) c.scaleY(x, y);
y1 += c.getYTranslate();
return y1;
@@ -156,8 +156,8 @@ public class GlyfCompositeDescript extends GlyfDescript {
@Override
public int getPointCount() {
- GlyfCompositeComp c = _components.get(_components.size()-1);
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyfCompositeComp c = _components.get(_components.size()-1);
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
if (gd != null) {
return c.getFirstIndex() + gd.getPointCount();
} else {
@@ -172,7 +172,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
return c.getFirstContour() + ( null != d ? d.getContourCount() : 0 );
}
- public int getComponentIndex(int i) {
+ public int getComponentIndex(final int i) {
return _components.get(i).getFirstIndex();
}
@@ -180,15 +180,15 @@ public class GlyfCompositeDescript extends GlyfDescript {
return _components.size();
}
- public GlyfCompositeComp getComponent(int i) {
+ public GlyfCompositeComp getComponent(final int i) {
return _components.get(i);
}
- protected GlyfCompositeComp getCompositeComp(int i) {
+ protected GlyfCompositeComp getCompositeComp(final int i) {
GlyfCompositeComp c;
for (int n = 0; n < _components.size(); n++) {
c = _components.get(n);
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
if (c.getFirstIndex() <= i && i < (c.getFirstIndex() + gd.getPointCount())) {
return c;
}
@@ -196,11 +196,11 @@ public class GlyfCompositeDescript extends GlyfDescript {
return null;
}
- protected GlyfCompositeComp getCompositeCompEndPt(int i) {
+ protected GlyfCompositeComp getCompositeCompEndPt(final int i) {
GlyfCompositeComp c;
for (int j = 0; j < _components.size(); j++) {
c = _components.get(j);
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
if (c.getFirstContour() <= i && i < (c.getFirstContour() + gd.getContourCount())) {
return c;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
index 6b06eb3de..3d2154d5a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
@@ -69,17 +69,17 @@ public abstract class GlyfDescript extends Program implements GlyphDescription {
protected GlyfTable _parentTable;
private int _glyphIndex;
- private int _numberOfContours;
- private short _xMin;
- private short _yMin;
- private short _xMax;
- private short _yMax;
+ private final int _numberOfContours;
+ private final short _xMin;
+ private final short _yMin;
+ private final short _xMax;
+ private final short _yMax;
protected GlyfDescript(
- GlyfTable parentTable,
- int glyphIndex,
- short numberOfContours,
- DataInput di) throws IOException {
+ final GlyfTable parentTable,
+ final int glyphIndex,
+ final short numberOfContours,
+ final DataInput di) throws IOException {
_parentTable = parentTable;
_numberOfContours = numberOfContours;
_xMin = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
index c06ceaa13..041c0f04c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
@@ -61,17 +61,17 @@ import jogamp.graph.font.typecast.ot.Disassembler;
*/
public class GlyfSimpleDescript extends GlyfDescript {
- private int[] _endPtsOfContours;
- private byte[] _flags;
- private short[] _xCoordinates;
- private short[] _yCoordinates;
- private int _count;
+ private final int[] _endPtsOfContours;
+ private final byte[] _flags;
+ private final short[] _xCoordinates;
+ private final short[] _yCoordinates;
+ private final int _count;
public GlyfSimpleDescript(
- GlyfTable parentTable,
- int glyphIndex,
- short numberOfContours,
- DataInput di) throws IOException {
+ final GlyfTable parentTable,
+ final int glyphIndex,
+ final short numberOfContours,
+ final DataInput di) throws IOException {
super(parentTable, glyphIndex, numberOfContours, di);
// Simple glyph description
@@ -86,29 +86,29 @@ public class GlyfSimpleDescript extends GlyfDescript {
_xCoordinates = new short[_count];
_yCoordinates = new short[_count];
- int instructionCount = di.readShort();
+ final int instructionCount = di.readShort();
readInstructions(di, instructionCount);
readFlags(_count, di);
readCoords(_count, di);
}
@Override
- public int getEndPtOfContours(int i) {
+ public int getEndPtOfContours(final int i) {
return _endPtsOfContours[i];
}
@Override
- public byte getFlags(int i) {
+ public byte getFlags(final int i) {
return _flags[i];
}
@Override
- public short getXCoordinate(int i) {
+ public short getXCoordinate(final int i) {
return _xCoordinates[i];
}
@Override
- public short getYCoordinate(int i) {
+ public short getYCoordinate(final int i) {
return _yCoordinates[i];
}
@@ -138,7 +138,7 @@ public class GlyfSimpleDescript extends GlyfDescript {
/**
* The table is stored as relative values, but we'll store them as absolutes
*/
- private void readCoords(int count, DataInput di) throws IOException {
+ private void readCoords(final int count, final DataInput di) throws IOException {
short x = 0;
short y = 0;
for (int i = 0; i < count; i++) {
@@ -175,26 +175,26 @@ public class GlyfSimpleDescript extends GlyfDescript {
/**
* The flags are run-length encoded
*/
- private void readFlags(int flagCount, DataInput di) throws IOException {
+ private void readFlags(final int flagCount, final DataInput di) throws IOException {
try {
for (int index = 0; index < flagCount; index++) {
_flags[index] = di.readByte();
if ((_flags[index] & repeat) != 0) {
- int repeats = di.readByte();
+ final int repeats = di.readByte();
for (int i = 1; i <= repeats; i++) {
_flags[index + i] = _flags[index];
}
index += repeats;
}
}
- } catch (ArrayIndexOutOfBoundsException e) {
+ } catch (final ArrayIndexOutOfBoundsException e) {
System.out.println("error: array index out of bounds");
}
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(super.toString());
sb.append("\n\n EndPoints\n ---------");
for (int i = 0; i < _endPtsOfContours.length; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
index 4b196c9e2..6750e9394 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
@@ -61,30 +61,30 @@ import java.io.IOException;
*/
public class GlyfTable implements Table {
- private DirectoryEntry _de;
- private GlyfDescript[] _descript;
+ private final DirectoryEntry _de;
+ private final GlyfDescript[] _descript;
protected GlyfTable(
- DirectoryEntry de,
- DataInput di,
- MaxpTable maxp,
- LocaTable loca) throws IOException {
+ final DirectoryEntry de,
+ final DataInput di,
+ final MaxpTable maxp,
+ final LocaTable loca) throws IOException {
_de = (DirectoryEntry) de.clone();
_descript = new GlyfDescript[maxp.getNumGlyphs()];
// Buffer the whole table so we can randomly access it
- byte[] buf = new byte[de.getLength()];
+ final byte[] buf = new byte[de.getLength()];
di.readFully(buf);
- ByteArrayInputStream bais = new ByteArrayInputStream(buf);
+ final ByteArrayInputStream bais = new ByteArrayInputStream(buf);
// Process all the simple glyphs
for (int i = 0; i < maxp.getNumGlyphs(); i++) {
- int len = loca.getOffset(i + 1) - loca.getOffset(i);
+ final int len = loca.getOffset(i + 1) - loca.getOffset(i);
if (len > 0) {
bais.reset();
bais.skip(loca.getOffset(i));
- DataInputStream dis = new DataInputStream(bais);
- short numberOfContours = dis.readShort();
+ final DataInputStream dis = new DataInputStream(bais);
+ final short numberOfContours = dis.readShort();
if (numberOfContours >= 0) {
_descript[i] = new GlyfSimpleDescript(this, i, numberOfContours, dis);
}
@@ -95,12 +95,12 @@ public class GlyfTable implements Table {
// Now do all the composite glyphs
for (int i = 0; i < maxp.getNumGlyphs(); i++) {
- int len = loca.getOffset(i + 1) - loca.getOffset(i);
+ final int len = loca.getOffset(i + 1) - loca.getOffset(i);
if (len > 0) {
bais.reset();
bais.skip(loca.getOffset(i));
- DataInputStream dis = new DataInputStream(bais);
- short numberOfContours = dis.readShort();
+ final DataInputStream dis = new DataInputStream(bais);
+ final short numberOfContours = dis.readShort();
if (numberOfContours < 0) {
_descript[i] = new GlyfCompositeDescript(this, i, dis);
}
@@ -108,7 +108,7 @@ public class GlyfTable implements Table {
}
}
- public GlyfDescript getDescription(int i) {
+ public GlyfDescript getDescription(final int i) {
if (i < _descript.length) {
return _descript[i];
} else {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
index 30ecdd051..f10d4e299 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
@@ -30,16 +30,16 @@ import java.io.IOException;
*/
public class GposTable implements Table {
- private DirectoryEntry _de;
+ private final DirectoryEntry _de;
- protected GposTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected GposTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
// GPOS Header
- int version = di.readInt();
- int scriptList = di.readInt();
- int featureList = di.readInt();
- int lookupList = di.readInt();
+ final int version = di.readInt();
+ final int scriptList = di.readInt();
+ final int featureList = di.readInt();
+ final int lookupList = di.readInt();
}
/** Get the table type, as a table directory value.
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
index c23d420a8..f09973f99 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
@@ -62,24 +62,24 @@ import java.io.IOException;
*/
public class GsubTable implements Table, LookupSubtableFactory {
- private DirectoryEntry _de;
- private ScriptList _scriptList;
- private FeatureList _featureList;
- private LookupList _lookupList;
+ private final DirectoryEntry _de;
+ private final ScriptList _scriptList;
+ private final FeatureList _featureList;
+ private final LookupList _lookupList;
- protected GsubTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected GsubTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
// Load into a temporary buffer, and create another input stream
- byte[] buf = new byte[de.getLength()];
+ final byte[] buf = new byte[de.getLength()];
di.readFully(buf);
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream(buf));
+ final DataInputStream dis = new DataInputStream(new ByteArrayInputStream(buf));
// GSUB Header
- int version = dis.readInt();
- int scriptListOffset = dis.readUnsignedShort();
- int featureListOffset = dis.readUnsignedShort();
- int lookupListOffset = dis.readUnsignedShort();
+ final int version = dis.readInt();
+ final int scriptListOffset = dis.readUnsignedShort();
+ final int featureListOffset = dis.readUnsignedShort();
+ final int lookupListOffset = dis.readUnsignedShort();
// Script List
_scriptList = new ScriptList(dis, scriptListOffset);
@@ -101,9 +101,9 @@ public class GsubTable implements Table, LookupSubtableFactory {
*/
@Override
public LookupSubtable read(
- int type,
- DataInputStream dis,
- int offset) throws IOException {
+ final int type,
+ final DataInputStream dis,
+ final int offset) throws IOException {
LookupSubtable s = null;
switch (type) {
case 1:
@@ -153,7 +153,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
return "GSUB";
}
- public static String lookupTypeAsString(int type) {
+ public static String lookupTypeAsString(final int type) {
switch (type) {
case 1:
return "Single";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
index 64f5e6415..c3b875a2c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
@@ -33,11 +33,11 @@ public class HdmxTable implements Table {
public class DeviceRecord {
- private short _pixelSize;
- private short _maxWidth;
- private short[] _widths;
+ private final short _pixelSize;
+ private final short _maxWidth;
+ private final short[] _widths;
- protected DeviceRecord(int numGlyphs, DataInput di) throws IOException {
+ protected DeviceRecord(final int numGlyphs, final DataInput di) throws IOException {
_pixelSize = di.readByte();
_maxWidth = di.readByte();
_widths = new short[numGlyphs];
@@ -58,20 +58,20 @@ public class HdmxTable implements Table {
return _widths;
}
- public short getWidth(int glyphidx) {
+ public short getWidth(final int glyphidx) {
return _widths[glyphidx];
}
}
- private DirectoryEntry _de;
- private int _version;
- private short _numRecords;
- private int _sizeDeviceRecords;
- private DeviceRecord[] _records;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final short _numRecords;
+ private final int _sizeDeviceRecords;
+ private final DeviceRecord[] _records;
/** Creates a new instance of HdmxTable */
- protected HdmxTable(DirectoryEntry de, DataInput di, MaxpTable maxp)
+ protected HdmxTable(final DirectoryEntry de, final DataInput di, final MaxpTable maxp)
throws IOException {
_de = (DirectoryEntry) de.clone();
_version = di.readUnsignedShort();
@@ -89,7 +89,7 @@ public class HdmxTable implements Table {
return _numRecords;
}
- public DeviceRecord getRecord(int i) {
+ public DeviceRecord getRecord(final int i) {
return _records[i];
}
@@ -100,7 +100,7 @@ public class HdmxTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'hdmx' Table - Horizontal Device Metrics\n----------------------------------------\n");
sb.append("Size = ").append(_de.getLength()).append(" bytes\n")
.append("\t'hdmx' version: ").append(_version).append("\n")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
index 47e60f900..85158ea3e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
@@ -62,26 +62,26 @@ import jogamp.graph.font.typecast.ot.Fixed;
*/
public class HeadTable implements Table {
- private DirectoryEntry _de;
- private int _versionNumber;
- private int _fontRevision;
- private int _checkSumAdjustment;
- private int _magicNumber;
- private short _flags;
- private short _unitsPerEm;
- private long _created;
- private long _modified;
- private short _xMin;
- private short _yMin;
- private short _xMax;
- private short _yMax;
- private short _macStyle;
- private short _lowestRecPPEM;
- private short _fontDirectionHint;
- private short _indexToLocFormat;
- private short _glyphDataFormat;
-
- protected HeadTable(DirectoryEntry de, DataInput di) throws IOException {
+ private final DirectoryEntry _de;
+ private final int _versionNumber;
+ private final int _fontRevision;
+ private final int _checkSumAdjustment;
+ private final int _magicNumber;
+ private final short _flags;
+ private final short _unitsPerEm;
+ private final long _created;
+ private final long _modified;
+ private final short _xMin;
+ private final short _yMin;
+ private final short _xMax;
+ private final short _yMax;
+ private final short _macStyle;
+ private final short _lowestRecPPEM;
+ private final short _fontDirectionHint;
+ private final short _indexToLocFormat;
+ private final short _glyphDataFormat;
+
+ protected HeadTable(final DirectoryEntry de, final DataInput di) throws IOException {
this._de = (DirectoryEntry) de.clone();
_versionNumber = di.readInt();
_fontRevision = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
index 242c9b139..e67a03777 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
@@ -19,21 +19,21 @@ import jogamp.graph.font.typecast.ot.Fixed;
*/
public class HheaTable implements Table {
- private DirectoryEntry de;
- private int version;
- private short ascender;
- private short descender;
- private short lineGap;
- private short advanceWidthMax;
- private short minLeftSideBearing;
- private short minRightSideBearing;
- private short xMaxExtent;
- private short caretSlopeRise;
- private short caretSlopeRun;
- private short metricDataFormat;
- private int numberOfHMetrics;
-
- protected HheaTable(DirectoryEntry de, DataInput di) throws IOException {
+ private final DirectoryEntry de;
+ private final int version;
+ private final short ascender;
+ private final short descender;
+ private final short lineGap;
+ private final short advanceWidthMax;
+ private final short minLeftSideBearing;
+ private final short minRightSideBearing;
+ private final short xMaxExtent;
+ private final short caretSlopeRise;
+ private final short caretSlopeRun;
+ private final short metricDataFormat;
+ private final int numberOfHMetrics;
+
+ protected HheaTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readInt();
ascender = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
index 122a0a826..3a9672a92 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
@@ -59,15 +59,15 @@ import java.io.IOException;
*/
public class HmtxTable implements Table {
- private DirectoryEntry _de;
+ private final DirectoryEntry _de;
private int[] _hMetrics = null;
private short[] _leftSideBearing = null;
protected HmtxTable(
- DirectoryEntry de,
- DataInput di,
- HheaTable hhea,
- MaxpTable maxp) throws IOException {
+ final DirectoryEntry de,
+ final DataInput di,
+ final HheaTable hhea,
+ final MaxpTable maxp) throws IOException {
_de = (DirectoryEntry) de.clone();
_hMetrics = new int[hhea.getNumberOfHMetrics()];
for (int i = 0; i < hhea.getNumberOfHMetrics(); ++i) {
@@ -77,14 +77,14 @@ public class HmtxTable implements Table {
| di.readUnsignedByte()<<8
| di.readUnsignedByte();
}
- int lsbCount = maxp.getNumGlyphs() - hhea.getNumberOfHMetrics();
+ final int lsbCount = maxp.getNumGlyphs() - hhea.getNumberOfHMetrics();
_leftSideBearing = new short[lsbCount];
for (int i = 0; i < lsbCount; ++i) {
_leftSideBearing[i] = di.readShort();
}
}
- public int getAdvanceWidth(int i) {
+ public int getAdvanceWidth(final int i) {
if (_hMetrics == null) {
return 0;
}
@@ -95,7 +95,7 @@ public class HmtxTable implements Table {
}
}
- public short getLeftSideBearing(int i) {
+ public short getLeftSideBearing(final int i) {
if (_hMetrics == null) {
return 0;
}
@@ -113,7 +113,7 @@ public class HmtxTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'hmtx' Table - Horizontal Metrics\n---------------------------------\n");
sb.append("Size = ").append(_de.getLength()).append(" bytes, ")
.append(_hMetrics.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
index eed8c1841..ad7e4e376 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
@@ -190,7 +190,7 @@ public abstract class ID {
public static final short nameSampleText = 19;
public static final short namePostScriptCIDFindfontName = 20;
- public static String getPlatformName(short platformId) {
+ public static String getPlatformName(final short platformId) {
switch (platformId) {
case platformUnicode: return "Unicode";
case platformMacintosh: return "Macintosh";
@@ -200,7 +200,7 @@ public abstract class ID {
}
}
- public static String getEncodingName(short platformId, short encodingId) {
+ public static String getEncodingName(final short platformId, final short encodingId) {
if (platformId == platformUnicode) {
@@ -284,7 +284,7 @@ public abstract class ID {
return "";
}
- public static String getLanguageName(short platformId, short languageId) {
+ public static String getLanguageName(final short platformId, final short languageId) {
if (platformId == platformMacintosh) {
switch (languageId) {
@@ -371,7 +371,7 @@ public abstract class ID {
return "";
}
- public static String getNameName(short nameId) {
+ public static String getNameName(final short nameId) {
switch (nameId) {
case nameCopyrightNotice: return "Copyright notice";
case nameFontFamilyName: return "Font Family name";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
index 04fd646a7..df5d0394f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
@@ -26,12 +26,12 @@ public abstract class KernSubtable {
public abstract KerningPair getKerningPair(int i);
- public static KernSubtable read(DataInput di) throws IOException {
+ public static KernSubtable read(final DataInput di) throws IOException {
KernSubtable table = null;
- int version = di.readUnsignedShort();
- int length = di.readUnsignedShort();
- int coverage = di.readUnsignedShort();
- int format = coverage >> 8;
+ final int version = di.readUnsignedShort();
+ final int length = di.readUnsignedShort();
+ final int coverage = di.readUnsignedShort();
+ final int format = coverage >> 8;
switch (format) {
case 0:
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
index 1e7ff8c2d..2d1acddd5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
@@ -18,14 +18,14 @@ import java.io.IOException;
*/
public class KernSubtableFormat0 extends KernSubtable {
- private int nPairs;
- private int searchRange;
- private int entrySelector;
- private int rangeShift;
- private KerningPair[] kerningPairs;
+ private final int nPairs;
+ private final int searchRange;
+ private final int entrySelector;
+ private final int rangeShift;
+ private final KerningPair[] kerningPairs;
/** Creates new KernSubtableFormat0 */
- protected KernSubtableFormat0(DataInput di) throws IOException {
+ protected KernSubtableFormat0(final DataInput di) throws IOException {
nPairs = di.readUnsignedShort();
searchRange = di.readUnsignedShort();
entrySelector = di.readUnsignedShort();
@@ -42,7 +42,7 @@ public class KernSubtableFormat0 extends KernSubtable {
}
@Override
- public KerningPair getKerningPair(int i) {
+ public KerningPair getKerningPair(final int i) {
return kerningPairs[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
index 9c7fc81f9..deb56c96d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
@@ -18,13 +18,13 @@ import java.io.IOException;
*/
public class KernSubtableFormat2 extends KernSubtable {
- private int rowWidth;
- private int leftClassTable;
- private int rightClassTable;
- private int array;
+ private final int rowWidth;
+ private final int leftClassTable;
+ private final int rightClassTable;
+ private final int array;
/** Creates new KernSubtableFormat2 */
- protected KernSubtableFormat2(DataInput di) throws IOException {
+ protected KernSubtableFormat2(final DataInput di) throws IOException {
rowWidth = di.readUnsignedShort();
leftClassTable = di.readUnsignedShort();
rightClassTable = di.readUnsignedShort();
@@ -37,7 +37,7 @@ public class KernSubtableFormat2 extends KernSubtable {
}
@Override
- public KerningPair getKerningPair(int i) {
+ public KerningPair getKerningPair(final int i) {
return null;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
index 006a86895..6f1d682e1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
*/
public class KernTable implements Table {
- private DirectoryEntry de;
- private int version;
- private int nTables;
- private KernSubtable[] tables;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int nTables;
+ private final KernSubtable[] tables;
/** Creates new KernTable */
- protected KernTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected KernTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readUnsignedShort();
nTables = di.readUnsignedShort();
@@ -38,7 +38,7 @@ public class KernTable implements Table {
return nTables;
}
- public KernSubtable getSubtable(int i) {
+ public KernSubtable getSubtable(final int i) {
return tables[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
index 52f82cc85..dd5d0ba06 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
@@ -18,12 +18,12 @@ import java.io.IOException;
*/
public class KerningPair {
- private int left;
- private int right;
- private short value;
+ private final int left;
+ private final int right;
+ private final short value;
/** Creates new KerningPair */
- protected KerningPair(DataInput di) throws IOException {
+ protected KerningPair(final DataInput di) throws IOException {
left = di.readUnsignedShort();
right = di.readUnsignedShort();
value = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
index 1ab112a78..e12d2e2e7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
@@ -60,13 +60,13 @@ import java.io.IOException;
*/
public class LangSys {
- private int _lookupOrder;
- private int _reqFeatureIndex;
- private int _featureCount;
- private int[] _featureIndex;
+ private final int _lookupOrder;
+ private final int _reqFeatureIndex;
+ private final int _featureCount;
+ private final int[] _featureIndex;
/** Creates new LangSys */
- protected LangSys(DataInput di) throws IOException {
+ protected LangSys(final DataInput di) throws IOException {
_lookupOrder = di.readUnsignedShort();
_reqFeatureIndex = di.readUnsignedShort();
_featureCount = di.readUnsignedShort();
@@ -88,11 +88,11 @@ public class LangSys {
return _featureCount;
}
- public int getFeatureIndex(int i) {
+ public int getFeatureIndex(final int i) {
return _featureIndex[i];
}
- protected boolean isFeatureIndexed(int n) {
+ protected boolean isFeatureIndexed(final int n) {
for (int i = 0; i < _featureCount; i++) {
if (_featureIndex[i] == n) {
return true;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
index f3befe3b6..08ea719f3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class LangSysRecord {
- private int _tag;
- private int _offset;
+ private final int _tag;
+ private final int _offset;
/** Creates new LangSysRecord */
- public LangSysRecord(DataInput di) throws IOException {
+ public LangSysRecord(final DataInput di) throws IOException {
_tag = di.readInt();
_offset = di.readUnsignedShort();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
index de862a983..dfd19e7ac 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class Ligature {
- private int _ligGlyph;
- private int _compCount;
- private int[] _components;
+ private final int _ligGlyph;
+ private final int _compCount;
+ private final int[] _components;
/** Creates new Ligature */
- public Ligature(DataInput di) throws IOException {
+ public Ligature(final DataInput di) throws IOException {
_ligGlyph = di.readUnsignedShort();
_compCount = di.readUnsignedShort();
_components = new int[_compCount - 1];
@@ -78,7 +78,7 @@ public class Ligature {
return _compCount;
}
- public int getGlyphId(int i) {
+ public int getGlyphId(final int i) {
return (i == 0) ? _ligGlyph : _components[i-1];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
index e261f3a88..8b7738992 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class LigatureSet {
- private int _ligatureCount;
- private int[] _ligatureOffsets;
- private Ligature[] _ligatures;
+ private final int _ligatureCount;
+ private final int[] _ligatureOffsets;
+ private final Ligature[] _ligatures;
/** Creates new LigatureSet */
- public LigatureSet(DataInputStream dis, int offset) throws IOException {
+ public LigatureSet(final DataInputStream dis, final int offset) throws IOException {
dis.reset();
dis.skipBytes(offset);
_ligatureCount = dis.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
index c0570cde9..36a44a11e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
@@ -60,10 +60,10 @@ import java.io.IOException;
*/
public abstract class LigatureSubst extends LookupSubtable {
- public static LigatureSubst read(DataInputStream dis, int offset) throws IOException {
+ public static LigatureSubst read(final DataInputStream dis, final int offset) throws IOException {
dis.reset();
dis.skipBytes(offset);
- int format = dis.readUnsignedShort();
+ final int format = dis.readUnsignedShort();
if (format == 1) {
return new LigatureSubstFormat1(dis, offset);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
index 1979ea586..02d4479b3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
@@ -60,16 +60,16 @@ import java.io.IOException;
*/
public class LigatureSubstFormat1 extends LigatureSubst {
- private int _coverageOffset;
- private int _ligSetCount;
- private int[] _ligatureSetOffsets;
- private Coverage _coverage;
- private LigatureSet[] _ligatureSets;
+ private final int _coverageOffset;
+ private final int _ligSetCount;
+ private final int[] _ligatureSetOffsets;
+ private final Coverage _coverage;
+ private final LigatureSet[] _ligatureSets;
/** Creates new LigatureSubstFormat1 */
protected LigatureSubstFormat1(
- DataInputStream dis,
- int offset) throws IOException {
+ final DataInputStream dis,
+ final int offset) throws IOException {
_coverageOffset = dis.readUnsignedShort();
_ligSetCount = dis.readUnsignedShort();
_ligatureSetOffsets = new int[_ligSetCount];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
index 2c7079fec..a955ad3e5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
@@ -17,18 +17,18 @@ import java.io.IOException;
*/
public class LocaTable implements Table {
- private DirectoryEntry _de;
+ private final DirectoryEntry _de;
private int[] _offsets = null;
private short _factor = 0;
protected LocaTable(
- DirectoryEntry de,
- DataInput di,
- HeadTable head,
- MaxpTable maxp) throws IOException {
+ final DirectoryEntry de,
+ final DataInput di,
+ final HeadTable head,
+ final MaxpTable maxp) throws IOException {
_de = (DirectoryEntry) de.clone();
_offsets = new int[maxp.getNumGlyphs() + 1];
- boolean shortEntries = head.getIndexToLocFormat() == 0;
+ final boolean shortEntries = head.getIndexToLocFormat() == 0;
if (shortEntries) {
_factor = 2;
for (int i = 0; i <= maxp.getNumGlyphs(); i++) {
@@ -42,7 +42,7 @@ public class LocaTable implements Table {
}
}
- public int getOffset(int i) {
+ public int getOffset(final int i) {
if (_offsets == null) {
return 0;
}
@@ -56,7 +56,7 @@ public class LocaTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'loca' Table - Index To Location Table\n--------------------------------------\n")
.append("Size = ").append(_de.getLength()).append(" bytes, ")
.append(_offsets.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
index 6496c3791..b80ebbee4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
@@ -66,14 +66,14 @@ public class Lookup {
public static final int IGNORE_BASE_MARKS = 0x0008;
public static final int MARK_ATTACHMENT_TYPE = 0xFF00;
- private int _type;
- private int _flag;
- private int _subTableCount;
- private int[] _subTableOffsets;
- private LookupSubtable[] _subTables;
+ private final int _type;
+ private final int _flag;
+ private final int _subTableCount;
+ private final int[] _subTableOffsets;
+ private final LookupSubtable[] _subTables;
/** Creates new Lookup */
- public Lookup(LookupSubtableFactory factory, DataInputStream dis, int offset)
+ public Lookup(final LookupSubtableFactory factory, final DataInputStream dis, final int offset)
throws IOException {
// Ensure we're in the right place
@@ -102,7 +102,7 @@ public class Lookup {
return _subTableCount;
}
- public LookupSubtable getSubtable(int i) {
+ public LookupSubtable getSubtable(final int i) {
return _subTables[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
index e70a932e4..6d8ca2a6c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class LookupList {
- private int _lookupCount;
- private int[] _lookupOffsets;
- private Lookup[] _lookups;
+ private final int _lookupCount;
+ private final int[] _lookupOffsets;
+ private final Lookup[] _lookups;
/** Creates new LookupList */
- public LookupList(DataInputStream dis, int offset, LookupSubtableFactory factory)
+ public LookupList(final DataInputStream dis, final int offset, final LookupSubtableFactory factory)
throws IOException {
// Ensure we're in the right place
@@ -88,17 +88,17 @@ public class LookupList {
return _lookupCount;
}
- public int getLookupOffset(int i) {
+ public int getLookupOffset(final int i) {
return _lookupOffsets[i];
}
- public Lookup getLookup(int i) {
+ public Lookup getLookup(final int i) {
return _lookups[i];
}
- public Lookup getLookup(Feature feature, int index) {
+ public Lookup getLookup(final Feature feature, final int index) {
if (feature.getLookupCount() > index) {
- int i = feature.getLookupListIndex(index);
+ final int i = feature.getLookupListIndex(index);
return _lookups[i];
}
return null;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
index 47874cc56..efafe7bb6 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
*/
public class LtshTable implements Table {
- private DirectoryEntry de;
- private int version;
- private int numGlyphs;
- private int[] yPels;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int numGlyphs;
+ private final int[] yPels;
/** Creates new LtshTable */
- protected LtshTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected LtshTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readUnsignedShort();
numGlyphs = di.readUnsignedShort();
@@ -45,7 +45,7 @@ public class LtshTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'LTSH' Table - Linear Threshold Table\n-------------------------------------")
.append("\n 'LTSH' Version: ").append(version)
.append("\n Number of Glyphs: ").append(numGlyphs)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
index abb6047fc..0e9a6177f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
@@ -19,8 +19,8 @@ import jogamp.graph.font.typecast.ot.Fixed;
*/
public class MaxpTable implements Table {
- private DirectoryEntry de;
- private int versionNumber;
+ private final DirectoryEntry de;
+ private final int versionNumber;
private int numGlyphs;
private int maxPoints;
private int maxContours;
@@ -36,7 +36,7 @@ public class MaxpTable implements Table {
private int maxComponentElements;
private int maxComponentDepth;
- protected MaxpTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected MaxpTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
versionNumber = di.readInt();
@@ -128,7 +128,7 @@ public class MaxpTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'maxp' Table - Maximum Profile\n------------------------------")
.append("\n 'maxp' version: ").append(Fixed.floatValue(versionNumber))
.append("\n numGlyphs: ").append(numGlyphs);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
index a1787e3e7..5ac9ada29 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
@@ -59,15 +59,15 @@ import java.io.IOException;
*/
public class NameRecord {
- private short _platformId;
- private short _encodingId;
- private short _languageId;
- private short _nameId;
- private short _stringLength;
- private short _stringOffset;
+ private final short _platformId;
+ private final short _encodingId;
+ private final short _languageId;
+ private final short _nameId;
+ private final short _stringLength;
+ private final short _stringOffset;
private String _record;
- protected NameRecord(DataInput di) throws IOException {
+ protected NameRecord(final DataInput di) throws IOException {
_platformId = di.readShort();
_encodingId = di.readShort();
_languageId = di.readShort();
@@ -92,13 +92,13 @@ public class NameRecord {
return _platformId;
}
- public StringBuilder getRecordString(StringBuilder sb) {
+ public StringBuilder getRecordString(final StringBuilder sb) {
sb.append(_record);
return sb;
}
- protected void loadString(DataInput di) throws IOException {
- StringBuilder sb = new StringBuilder();
+ protected void loadString(final DataInput di) throws IOException {
+ final StringBuilder sb = new StringBuilder();
di.skipBytes(_stringOffset);
if (_platformId == ID.platformUnicode) {
@@ -132,7 +132,7 @@ public class NameRecord {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(" Platform ID: ").append(_platformId)
.append("\n Specific ID: ").append(_encodingId)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
index ad8198b7f..ba9292a4b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
@@ -63,13 +63,13 @@ import java.io.IOException;
* @author <a href="mailto:[email protected]">David Schweinsberg</a>
*/
public class NameTable implements Table {
- private DirectoryEntry _de;
- private short _formatSelector;
- private short _numberOfNameRecords;
- private short _stringStorageOffset;
- private NameRecord[] _records;
+ private final DirectoryEntry _de;
+ private final short _formatSelector;
+ private final short _numberOfNameRecords;
+ private final short _stringStorageOffset;
+ private final NameRecord[] _records;
- protected NameTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected NameTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_formatSelector = di.readShort();
_numberOfNameRecords = di.readShort();
@@ -84,7 +84,7 @@ public class NameTable implements Table {
// Load the string data into a buffer so the records can copy out the
// bits they are interested in
- byte[] buffer = new byte[_de.getLength() - _stringStorageOffset];
+ final byte[] buffer = new byte[_de.getLength() - _stringStorageOffset];
di.readFully(buffer);
// Now let the records get their hands on them
@@ -99,14 +99,14 @@ public class NameTable implements Table {
}
- public NameRecord getRecord(int i) {
+ public NameRecord getRecord(final int i) {
if(_numberOfNameRecords > i) {
return _records[i];
}
return null;
}
- public StringBuilder getRecordsRecordString(StringBuilder sb, int i) {
+ public StringBuilder getRecordsRecordString(final StringBuilder sb, final int i) {
if(_numberOfNameRecords > i) {
_records[i].getRecordString(sb);
} else {
@@ -115,7 +115,7 @@ public class NameTable implements Table {
return sb;
}
- public StringBuilder getNamedRecordString(StringBuilder sb, short nameId) {
+ public StringBuilder getNamedRecordString(final StringBuilder sb, final short nameId) {
// Search for the first instance of this name ID
boolean done = false;
for (int i = 0; !done && i < _numberOfNameRecords; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
index 5340b297c..c91127303 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
@@ -59,46 +59,46 @@ import java.io.IOException;
*/
public class Os2Table implements Table {
- private DirectoryEntry _de;
- private int _version;
- private short _xAvgCharWidth;
- private int _usWeightClass;
- private int _usWidthClass;
- private short _fsType;
- private short _ySubscriptXSize;
- private short _ySubscriptYSize;
- private short _ySubscriptXOffset;
- private short _ySubscriptYOffset;
- private short _ySuperscriptXSize;
- private short _ySuperscriptYSize;
- private short _ySuperscriptXOffset;
- private short _ySuperscriptYOffset;
- private short _yStrikeoutSize;
- private short _yStrikeoutPosition;
- private short _sFamilyClass;
- private Panose _panose;
- private int _ulUnicodeRange1;
- private int _ulUnicodeRange2;
- private int _ulUnicodeRange3;
- private int _ulUnicodeRange4;
- private int _achVendorID;
- private short _fsSelection;
- private int _usFirstCharIndex;
- private int _usLastCharIndex;
- private short _sTypoAscender;
- private short _sTypoDescender;
- private short _sTypoLineGap;
- private int _usWinAscent;
- private int _usWinDescent;
- private int _ulCodePageRange1;
- private int _ulCodePageRange2;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final short _xAvgCharWidth;
+ private final int _usWeightClass;
+ private final int _usWidthClass;
+ private final short _fsType;
+ private final short _ySubscriptXSize;
+ private final short _ySubscriptYSize;
+ private final short _ySubscriptXOffset;
+ private final short _ySubscriptYOffset;
+ private final short _ySuperscriptXSize;
+ private final short _ySuperscriptYSize;
+ private final short _ySuperscriptXOffset;
+ private final short _ySuperscriptYOffset;
+ private final short _yStrikeoutSize;
+ private final short _yStrikeoutPosition;
+ private final short _sFamilyClass;
+ private final Panose _panose;
+ private final int _ulUnicodeRange1;
+ private final int _ulUnicodeRange2;
+ private final int _ulUnicodeRange3;
+ private final int _ulUnicodeRange4;
+ private final int _achVendorID;
+ private final short _fsSelection;
+ private final int _usFirstCharIndex;
+ private final int _usLastCharIndex;
+ private final short _sTypoAscender;
+ private final short _sTypoDescender;
+ private final short _sTypoLineGap;
+ private final int _usWinAscent;
+ private final int _usWinDescent;
+ private final int _ulCodePageRange1;
+ private final int _ulCodePageRange2;
private short _sxHeight;
private short _sCapHeight;
private int _usDefaultChar;
private int _usBreakChar;
private int _usMaxContext;
- protected Os2Table(DirectoryEntry de, DataInput di) throws IOException {
+ protected Os2Table(final DirectoryEntry de, final DataInput di) throws IOException {
this._de = (DirectoryEntry) de.clone();
_version = di.readUnsignedShort();
_xAvgCharWidth = di.readShort();
@@ -116,7 +116,7 @@ public class Os2Table implements Table {
_yStrikeoutSize = di.readShort();
_yStrikeoutPosition = di.readShort();
_sFamilyClass = di.readShort();
- byte[] buf = new byte[10];
+ final byte[] buf = new byte[10];
di.readFully(buf);
_panose = new Panose(buf);
_ulUnicodeRange1 = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
index 771318108..493f43baa 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
@@ -26,7 +26,7 @@ public class Panose {
byte bXHeight = 0;
/** Creates new Panose */
- public Panose(byte[] panose) {
+ public Panose(final byte[] panose) {
bFamilyType = panose[0];
bSerifStyle = panose[1];
bWeight = panose[2];
@@ -81,7 +81,7 @@ public class Panose {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(String.valueOf(bFamilyType)).append(" ")
.append(String.valueOf(bSerifStyle)).append(" ")
.append(String.valueOf(bWeight)).append(" ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
index a1f603d8f..63399cf0e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
@@ -18,25 +18,25 @@ import java.io.IOException;
*/
public class PcltTable implements Table {
- private DirectoryEntry de;
- private int version;
- private long fontNumber;
- private int pitch;
- private int xHeight;
- private int style;
- private int typeFamily;
- private int capHeight;
- private int symbolSet;
- private char[] typeface = new char[16];
- private short[] characterComplement = new short[8];
- private char[] fileName = new char[6];
- private short strokeWeight;
- private short widthType;
- private byte serifStyle;
- private byte reserved;
+ private final DirectoryEntry de;
+ private final int version;
+ private final long fontNumber;
+ private final int pitch;
+ private final int xHeight;
+ private final int style;
+ private final int typeFamily;
+ private final int capHeight;
+ private final int symbolSet;
+ private final char[] typeface = new char[16];
+ private final short[] characterComplement = new short[8];
+ private final char[] fileName = new char[6];
+ private final short strokeWeight;
+ private final short widthType;
+ private final byte serifStyle;
+ private final byte reserved;
/** Creates new PcltTable */
- protected PcltTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected PcltTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readInt();
fontNumber = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
index 188b441ac..faeecf909 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
@@ -284,16 +284,16 @@ public class PostTable implements Table {
"" // 257
};
- private DirectoryEntry de;
- private int version;
- private int italicAngle;
- private short underlinePosition;
- private short underlineThickness;
- private int isFixedPitch;
- private int minMemType42;
- private int maxMemType42;
- private int minMemType1;
- private int maxMemType1;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int italicAngle;
+ private final short underlinePosition;
+ private final short underlineThickness;
+ private final int isFixedPitch;
+ private final int minMemType42;
+ private final int maxMemType42;
+ private final int minMemType1;
+ private final int maxMemType1;
// v2
private int numGlyphs;
@@ -301,7 +301,7 @@ public class PostTable implements Table {
private String[] psGlyphName;
/** Creates new PostTable */
- protected PostTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected PostTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readInt();
italicAngle = di.readInt();
@@ -324,8 +324,8 @@ public class PostTable implements Table {
h -= 257;
psGlyphName = new String[h];
for (int i = 0; i < h; i++) {
- int len = di.readUnsignedByte();
- byte[] buf = new byte[len];
+ final int len = di.readUnsignedByte();
+ final byte[] buf = new byte[len];
di.readFully(buf);
psGlyphName[i] = new String(buf);
}
@@ -349,7 +349,7 @@ public class PostTable implements Table {
return high;
}
- public String getGlyphName(int i) {
+ public String getGlyphName(final int i) {
if (version == 0x00020000) {
return (glyphNameIndex[i] > 257)
? psGlyphName[glyphNameIndex[i] - 258]
@@ -359,7 +359,7 @@ public class PostTable implements Table {
}
}
- private boolean isMacGlyphName(int i) {
+ private boolean isMacGlyphName(final int i) {
if (version == 0x00020000) {
return glyphNameIndex[i] <= 257;
} else {
@@ -377,7 +377,7 @@ public class PostTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'post' Table - PostScript Metrics\n---------------------------------\n")
.append("\n 'post' version: ").append(Fixed.floatValue(version))
.append("\n italicAngle: ").append(Fixed.floatValue(italicAngle))
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
index 4c64673b7..039789d62 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
@@ -19,9 +19,9 @@ import jogamp.graph.font.typecast.ot.Disassembler;
*/
public class PrepTable extends Program implements Table {
- private DirectoryEntry de;
+ private final DirectoryEntry de;
- public PrepTable(DirectoryEntry de, DataInput di) throws IOException {
+ public PrepTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
readInstructions(di, de.getLength());
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
index e3beabef8..c0d2c1b9d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
@@ -23,7 +23,7 @@ public abstract class Program {
return instructions;
}
- protected void readInstructions(DataInput di, int count) throws IOException {
+ protected void readInstructions(final DataInput di, final int count) throws IOException {
instructions = new short[count];
for (int i = 0; i < count; i++) {
instructions[i] = (short) di.readUnsignedByte();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
index 40ddf4215..417779703 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
@@ -61,22 +61,22 @@ import java.io.IOException;
*/
public class RangeRecord {
- private int _start;
- private int _end;
- private int _startCoverageIndex;
+ private final int _start;
+ private final int _end;
+ private final int _startCoverageIndex;
/** Creates new RangeRecord */
- public RangeRecord(DataInput di) throws IOException {
+ public RangeRecord(final DataInput di) throws IOException {
_start = di.readUnsignedShort();
_end = di.readUnsignedShort();
_startCoverageIndex = di.readUnsignedShort();
}
- public boolean isInRange(int glyphId) {
+ public boolean isInRange(final int glyphId) {
return (_start <= glyphId && glyphId <= _end);
}
- public int getCoverageIndex(int glyphId) {
+ public int getCoverageIndex(final int glyphId) {
if (isInRange(glyphId)) {
return _startCoverageIndex + glyphId - _start;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
index 04781a8f9..8846de5f0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
@@ -60,14 +60,14 @@ import java.io.IOException;
*/
public class Script {
- private int _defaultLangSysOffset;
- private int _langSysCount;
+ private final int _defaultLangSysOffset;
+ private final int _langSysCount;
private LangSysRecord[] _langSysRecords;
private LangSys _defaultLangSys;
private LangSys[] _langSys;
/** Creates new ScriptTable */
- protected Script(DataInputStream dis, int offset) throws IOException {
+ protected Script(final DataInputStream dis, final int offset) throws IOException {
// Ensure we're in the right place
dis.reset();
@@ -103,7 +103,7 @@ public class Script {
return _langSysCount;
}
- public LangSysRecord getLangSysRecord(int i) {
+ public LangSysRecord getLangSysRecord(final int i) {
return _langSysRecords[i];
}
@@ -111,7 +111,7 @@ public class Script {
return _defaultLangSys;
}
- public LangSys getLangSys(int i) {
+ public LangSys getLangSys(final int i) {
return _langSys[i];
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
index 18589b712..1c1be0d2b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
@@ -61,11 +61,11 @@ import java.io.IOException;
public class ScriptList {
private int _scriptCount = 0;
- private ScriptRecord[] _scriptRecords;
- private Script[] _scripts;
+ private final ScriptRecord[] _scriptRecords;
+ private final Script[] _scripts;
/** Creates new ScriptList */
- protected ScriptList(DataInputStream dis, int offset) throws IOException {
+ protected ScriptList(final DataInputStream dis, final int offset) throws IOException {
// Ensure we're in the right place
dis.reset();
@@ -87,19 +87,19 @@ public class ScriptList {
return _scriptCount;
}
- public ScriptRecord getScriptRecord(int i) {
+ public ScriptRecord getScriptRecord(final int i) {
return _scriptRecords[i];
}
- public Script getScript(int i) {
+ public Script getScript(final int i) {
return _scripts[i];
}
- public Script findScript(String tag) {
+ public Script findScript(final String tag) {
if (tag.length() != 4) {
return null;
}
- int tagVal = ((tag.charAt(0)<<24)
+ final int tagVal = ((tag.charAt(0)<<24)
| (tag.charAt(1)<<16)
| (tag.charAt(2)<<8)
| tag.charAt(3));
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
index 183ca2ffd..18eefe5a7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class ScriptRecord {
- private int _tag;
- private int _offset;
+ private final int _tag;
+ private final int _offset;
/** Creates new ScriptRecord */
- protected ScriptRecord(DataInput di) throws IOException {
+ protected ScriptRecord(final DataInput di) throws IOException {
_tag = di.readInt();
_offset = di.readUnsignedShort();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
index 31a2d17c9..e6841b94c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
@@ -18,13 +18,13 @@ import java.io.DataInput;
*/
public class SignatureBlock {
- private int reserved1;
- private int reserved2;
- private int signatureLen;
- private byte[] signature;
+ private final int reserved1;
+ private final int reserved2;
+ private final int signatureLen;
+ private final byte[] signature;
/** Creates new SignatureBlock */
- protected SignatureBlock(DataInput di) throws IOException {
+ protected SignatureBlock(final DataInput di) throws IOException {
reserved1 = di.readUnsignedShort();
reserved2 = di.readUnsignedShort();
signatureLen = di.readInt();
@@ -34,7 +34,7 @@ public class SignatureBlock {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < signatureLen; i += 16) {
if (signatureLen - i >= 16) {
sb.append(new String(signature, i, 16)).append("\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
index e31281f2e..c398b4fbb 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
@@ -64,11 +64,11 @@ public abstract class SingleSubst extends LookupSubtable {
public abstract int substitute(int glyphId);
- public static SingleSubst read(DataInputStream dis, int offset) throws IOException {
+ public static SingleSubst read(final DataInputStream dis, final int offset) throws IOException {
SingleSubst s = null;
dis.reset();
dis.skipBytes(offset);
- int format = dis.readUnsignedShort();
+ final int format = dis.readUnsignedShort();
if (format == 1) {
s = new SingleSubstFormat1(dis, offset);
} else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
index e97e62a58..b2e65dded 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class SingleSubstFormat1 extends SingleSubst {
- private int _coverageOffset;
- private short _deltaGlyphID;
- private Coverage _coverage;
+ private final int _coverageOffset;
+ private final short _deltaGlyphID;
+ private final Coverage _coverage;
/** Creates new SingleSubstFormat1 */
- protected SingleSubstFormat1(DataInputStream dis, int offset) throws IOException {
+ protected SingleSubstFormat1(final DataInputStream dis, final int offset) throws IOException {
_coverageOffset = dis.readUnsignedShort();
_deltaGlyphID = dis.readShort();
dis.reset();
@@ -79,8 +79,8 @@ public class SingleSubstFormat1 extends SingleSubst {
}
@Override
- public int substitute(int glyphId) {
- int i = _coverage.findGlyph(glyphId);
+ public int substitute(final int glyphId) {
+ final int i = _coverage.findGlyph(glyphId);
if (i > -1) {
return glyphId + _deltaGlyphID;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
index 4d46b07b4..449c14c7a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
@@ -60,13 +60,13 @@ import java.io.IOException;
*/
public class SingleSubstFormat2 extends SingleSubst {
- private int _coverageOffset;
- private int _glyphCount;
- private int[] _substitutes;
- private Coverage _coverage;
+ private final int _coverageOffset;
+ private final int _glyphCount;
+ private final int[] _substitutes;
+ private final Coverage _coverage;
/** Creates new SingleSubstFormat2 */
- protected SingleSubstFormat2(DataInputStream dis, int offset) throws IOException {
+ protected SingleSubstFormat2(final DataInputStream dis, final int offset) throws IOException {
_coverageOffset = dis.readUnsignedShort();
_glyphCount = dis.readUnsignedShort();
_substitutes = new int[_glyphCount];
@@ -84,8 +84,8 @@ public class SingleSubstFormat2 extends SingleSubst {
}
@Override
- public int substitute(int glyphId) {
- int i = _coverage.findGlyph(glyphId);
+ public int substitute(final int glyphId) {
+ final int i = _coverage.findGlyph(glyphId);
if (i > -1) {
return _substitutes[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
index f7c7d99b5..a6ec61887 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
@@ -20,16 +20,16 @@ public class TTCHeader {
public static final int ttcf = 0x74746366;
- private int ttcTag;
- private int version;
- private int directoryCount;
- private int[] tableDirectory;
+ private final int ttcTag;
+ private final int version;
+ private final int directoryCount;
+ private final int[] tableDirectory;
private int dsigTag;
- private int dsigLength;
- private int dsigOffset;
+ private final int dsigLength;
+ private final int dsigOffset;
/** Creates new TTCHeader */
- public TTCHeader(DataInput di) throws IOException {
+ public TTCHeader(final DataInput di) throws IOException {
ttcTag = di.readInt();
version = di.readInt();
directoryCount = di.readInt();
@@ -48,12 +48,12 @@ public class TTCHeader {
return directoryCount;
}
- public int getTableDirectory(int i) {
+ public int getTableDirectory(final int i) {
return tableDirectory[i];
}
- public static boolean isTTC(DataInput di) throws IOException {
- int ttcTag = di.readInt();
+ public static boolean isTTC(final DataInput di) throws IOException {
+ final int ttcTag = di.readInt();
return ttcTag == ttcf;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
index 23ecba804..b9448cc72 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
@@ -66,9 +66,9 @@ public class TableDirectory {
private short _searchRange = 0;
private short _entrySelector = 0;
private short _rangeShift = 0;
- private DirectoryEntry[] _entries;
+ private final DirectoryEntry[] _entries;
- public TableDirectory(DataInput di) throws IOException {
+ public TableDirectory(final DataInput di) throws IOException {
_version = di.readInt();
_numTables = di.readShort();
_searchRange = di.readShort();
@@ -80,11 +80,11 @@ public class TableDirectory {
}
}
- public DirectoryEntry getEntry(int index) {
+ public DirectoryEntry getEntry(final int index) {
return _entries[index];
}
- public DirectoryEntry getEntryByTag(int tag) {
+ public DirectoryEntry getEntryByTag(final int tag) {
for (int i = 0; i < _numTables; i++) {
if (_entries[i].getTag() == tag) {
return _entries[i];
@@ -115,7 +115,7 @@ public class TableDirectory {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("Offset Table\n------ -----")
.append("\n sfnt version: ").append(Fixed.floatValue(_version))
.append("\n numTables = ").append(_numTables)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
index 65aa84bff..e0433f098 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
@@ -40,7 +40,7 @@ public class TableException extends java.lang.Exception {
* Constructs an instance of <code>TableException</code> with the specified detail message.
* @param msg the detail message.
*/
- public TableException(String msg) {
+ public TableException(final String msg) {
super(msg);
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
index 956d1aecd..d24f3b3ae 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
@@ -64,10 +64,10 @@ import jogamp.graph.font.typecast.ot.OTFontCollection;
public class TableFactory {
public static Table create(
- OTFontCollection fc,
- OTFont font,
- DirectoryEntry de,
- DataInputStream dis) throws IOException {
+ final OTFontCollection fc,
+ final OTFont font,
+ final DirectoryEntry de,
+ final DataInputStream dis) throws IOException {
Table t = null;
// First, if we have a font collection, look for the table there
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
index bebd7f946..1a390f86d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
@@ -32,12 +32,12 @@ public class VdmxTable implements Table {
private class Ratio {
- private byte _bCharSet;
- private byte _xRatio;
- private byte _yStartRatio;
- private byte _yEndRatio;
+ private final byte _bCharSet;
+ private final byte _xRatio;
+ private final byte _yStartRatio;
+ private final byte _yEndRatio;
- protected Ratio(DataInput di) throws IOException {
+ protected Ratio(final DataInput di) throws IOException {
_bCharSet = di.readByte();
_xRatio = di.readByte();
_yStartRatio = di.readByte();
@@ -63,11 +63,11 @@ public class VdmxTable implements Table {
private class VTableRecord {
- private int _yPelHeight;
- private short _yMax;
- private short _yMin;
+ private final int _yPelHeight;
+ private final short _yMax;
+ private final short _yMin;
- protected VTableRecord(DataInput di) throws IOException {
+ protected VTableRecord(final DataInput di) throws IOException {
_yPelHeight = di.readUnsignedShort();
_yMax = di.readShort();
_yMin = di.readShort();
@@ -88,12 +88,12 @@ public class VdmxTable implements Table {
private class Group {
- private int _recs;
- private int _startsz;
- private int _endsz;
- private VTableRecord[] _entry;
+ private final int _recs;
+ private final int _startsz;
+ private final int _endsz;
+ private final VTableRecord[] _entry;
- protected Group(DataInput di) throws IOException {
+ protected Group(final DataInput di) throws IOException {
_recs = di.readUnsignedShort();
_startsz = di.readUnsignedByte();
_endsz = di.readUnsignedByte();
@@ -120,16 +120,16 @@ public class VdmxTable implements Table {
}
}
- private DirectoryEntry _de;
- private int _version;
- private int _numRecs;
- private int _numRatios;
- private Ratio[] _ratRange;
- private int _offset[];
- private Group[] _groups;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final int _numRecs;
+ private final int _numRatios;
+ private final Ratio[] _ratRange;
+ private final int _offset[];
+ private final Group[] _groups;
/** Creates a new instance of VdmxTable */
- protected VdmxTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected VdmxTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_version = di.readUnsignedShort();
_numRecs = di.readUnsignedShort();
@@ -155,7 +155,7 @@ public class VdmxTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'VDMX' Table - Precomputed Vertical Device Metrics\n")
.append("--------------------------------------------------\n")
.append(" Version: ").append(_version).append("\n")
@@ -172,7 +172,7 @@ public class VdmxTable implements Table {
sb.append("\n VDMX Height Record Groups\n")
.append(" -------------------------\n");
for (int i = 0; i < _numRecs; ++i) {
- Group group = _groups[i];
+ final Group group = _groups[i];
sb.append(" ").append(i + 1)
.append(". Number of Hgt Records ").append(group.getRecs()).append("\n")
.append(" Starting Y Pel Height ").append(group.getStartSZ()).append("\n")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
index 521b87cc8..cef7b5297 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
@@ -32,21 +32,21 @@ import jogamp.graph.font.typecast.ot.Fixed;
*/
public class VheaTable implements Table {
- private DirectoryEntry _de;
- private int _version;
- private short _ascent;
- private short _descent;
- private short _lineGap;
- private short _advanceHeightMax;
- private short _minTopSideBearing;
- private short _minBottomSideBearing;
- private short _yMaxExtent;
- private short _caretSlopeRise;
- private short _caretSlopeRun;
- private short _metricDataFormat;
- private int _numberOfLongVerMetrics;
-
- protected VheaTable(DirectoryEntry de, DataInput di) throws IOException {
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final short _ascent;
+ private final short _descent;
+ private final short _lineGap;
+ private final short _advanceHeightMax;
+ private final short _minTopSideBearing;
+ private final short _minBottomSideBearing;
+ private final short _yMaxExtent;
+ private final short _caretSlopeRise;
+ private final short _caretSlopeRun;
+ private final short _metricDataFormat;
+ private final int _numberOfLongVerMetrics;
+
+ protected VheaTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_version = di.readInt();
_ascent = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
index 1b77a6fdc..b76ed7e15 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
@@ -30,15 +30,15 @@ import java.io.IOException;
*/
public class VmtxTable implements Table {
- private DirectoryEntry _de;
+ private final DirectoryEntry _de;
private int[] _vMetrics = null;
private short[] _topSideBearing = null;
protected VmtxTable(
- DirectoryEntry de,
- DataInput di,
- VheaTable vhea,
- MaxpTable maxp) throws IOException {
+ final DirectoryEntry de,
+ final DataInput di,
+ final VheaTable vhea,
+ final MaxpTable maxp) throws IOException {
_de = (DirectoryEntry) de.clone();
_vMetrics = new int[vhea.getNumberOfLongVerMetrics()];
for (int i = 0; i < vhea.getNumberOfLongVerMetrics(); ++i) {
@@ -48,14 +48,14 @@ public class VmtxTable implements Table {
| di.readUnsignedByte()<<8
| di.readUnsignedByte();
}
- int tsbCount = maxp.getNumGlyphs() - vhea.getNumberOfLongVerMetrics();
+ final int tsbCount = maxp.getNumGlyphs() - vhea.getNumberOfLongVerMetrics();
_topSideBearing = new short[tsbCount];
for (int i = 0; i < tsbCount; ++i) {
_topSideBearing[i] = di.readShort();
}
}
- public int getAdvanceHeight(int i) {
+ public int getAdvanceHeight(final int i) {
if (_vMetrics == null) {
return 0;
}
@@ -66,7 +66,7 @@ public class VmtxTable implements Table {
}
}
- public short getTopSideBearing(int i) {
+ public short getTopSideBearing(final int i) {
if (_vMetrics == null) {
return 0;
}
@@ -84,7 +84,7 @@ public class VmtxTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'vmtx' Table - Vertical Metrics\n-------------------------------\n");
sb.append("Size = ").append(_de.getLength()).append(" bytes, ")
.append(_vMetrics.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
index 73f26b27c..7bfb8cbd5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
@@ -56,10 +56,10 @@ public class T2Interpreter {
* (dx1, dy1).
*/
private void _rmoveto() {
- int dy1 = popArg().intValue();
- int dx1 = popArg().intValue();
+ final int dy1 = popArg().intValue();
+ final int dx1 = popArg().intValue();
clearArg();
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
moveTo(lastPoint.x + dx1, lastPoint.y + dy1);
}
@@ -67,9 +67,9 @@ public class T2Interpreter {
* Moves the current point dx1 units in the horizontal direction.
*/
private void _hmoveto() {
- int dx1 = popArg().intValue();
+ final int dx1 = popArg().intValue();
clearArg();
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
moveTo(lastPoint.x + dx1, lastPoint.y);
}
@@ -77,9 +77,9 @@ public class T2Interpreter {
* Moves the current point dy1 units in the vertical direction.
*/
private void _vmoveto() {
- int dy1 = popArg().intValue();
+ final int dy1 = popArg().intValue();
clearArg();
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
moveTo(lastPoint.x, lastPoint.y + dy1);
}
@@ -90,15 +90,15 @@ public class T2Interpreter {
* lines is determined from the number of arguments on the stack.
*/
private void _rlineto() {
- int count = getArgCount() / 2;
- int[] dx = new int[count];
- int[] dy = new int[count];
+ final int count = getArgCount() / 2;
+ final int[] dx = new int[count];
+ final int[] dy = new int[count];
for (int i = 0; i < count; ++i) {
dy[count - i - 1] = popArg().intValue();
dx[count - i - 1] = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
lineTo(lastPoint.x + dx[i], lastPoint.y + dy[i]);
}
clearArg();
@@ -115,13 +115,13 @@ public class T2Interpreter {
* number of arguments on the stack.
*/
private void _hlineto() {
- int count = getArgCount();
- Number[] nums = new Number[count];
+ final int count = getArgCount();
+ final Number[] nums = new Number[count];
for (int i = 0; i < count; ++i) {
nums[count - i - 1] = popArg();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
if (i % 2 == 0) {
lineTo(lastPoint.x + nums[i].intValue(), lastPoint.y);
} else {
@@ -142,13 +142,13 @@ public class T2Interpreter {
* number of arguments on the stack.
*/
private void _vlineto() {
- int count = getArgCount();
- Number[] nums = new Number[count];
+ final int count = getArgCount();
+ final Number[] nums = new Number[count];
for (int i = 0; i < count; ++i) {
nums[count - i - 1] = popArg();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
if (i % 2 == 0) {
lineTo(lastPoint.x, lastPoint.y + nums[i].intValue());
} else {
@@ -167,13 +167,13 @@ public class T2Interpreter {
* stack.
*/
private void _rrcurveto() {
- int count = getArgCount() / 6;
- int[] dxa = new int[count];
- int[] dya = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
- int[] dyc = new int[count];
+ final int count = getArgCount() / 6;
+ final int[] dxa = new int[count];
+ final int[] dya = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
+ final int[] dyc = new int[count];
for (int i = 0; i < count; ++i) {
dyc[count - i - 1] = popArg().intValue();
dxc[count - i - 1] = popArg().intValue();
@@ -183,13 +183,13 @@ public class T2Interpreter {
dxa[count - i - 1] = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x + dxa[i];
- int ya = lastPoint.y + dya[i];
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb + dxc[i];
- int yc = yb + dyc[i];
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x + dxa[i];
+ final int ya = lastPoint.y + dya[i];
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb + dxc[i];
+ final int yc = yb + dyc[i];
curveTo(xa, ya, xb, yb, xc, yc);
}
clearArg();
@@ -203,12 +203,12 @@ public class T2Interpreter {
* case). Note the argument order for the odd argument case.
*/
private void _hhcurveto() {
- int count = getArgCount() / 4;
+ final int count = getArgCount() / 4;
int dy1 = 0;
- int[] dxa = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
+ final int[] dxa = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
for (int i = 0; i < count; ++i) {
dxc[count - i - 1] = popArg().intValue();
dyb[count - i - 1] = popArg().intValue();
@@ -219,13 +219,13 @@ public class T2Interpreter {
dy1 = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x + dxa[i];
- int ya = lastPoint.y + (i == 0 ? dy1 : 0);
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb + dxc[i];
- int yc = yb;
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x + dxa[i];
+ final int ya = lastPoint.y + (i == 0 ? dy1 : 0);
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb + dxc[i];
+ final int yc = yb;
curveTo(xa, ya, xb, yb, xc, yc);
}
clearArg();
@@ -243,15 +243,15 @@ public class T2Interpreter {
*/
private void _hvcurveto() {
if (getArgCount() % 8 <= 1) {
- int count = getArgCount() / 8;
- int[] dxa = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dyc = new int[count];
- int[] dyd = new int[count];
- int[] dxe = new int[count];
- int[] dye = new int[count];
- int[] dxf = new int[count];
+ final int count = getArgCount() / 8;
+ final int[] dxa = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dyc = new int[count];
+ final int[] dyd = new int[count];
+ final int[] dxe = new int[count];
+ final int[] dye = new int[count];
+ final int[] dxf = new int[count];
int dyf = 0;
if (getArgCount() % 8 == 1) {
dyf = popArg().intValue();
@@ -267,32 +267,32 @@ public class T2Interpreter {
dxa[count - i - 1] = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x + dxa[i];
- int ya = lastPoint.y;
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb;
- int yc = yb + dyc[i];
- int xd = xc;
- int yd = yc + dyd[i];
- int xe = xd + dxe[i];
- int ye = yd + dye[i];
- int xf = xe + dxf[i];
- int yf = ye + dyf;
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x + dxa[i];
+ final int ya = lastPoint.y;
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb;
+ final int yc = yb + dyc[i];
+ final int xd = xc;
+ final int yd = yc + dyd[i];
+ final int xe = xd + dxe[i];
+ final int ye = yd + dye[i];
+ final int xf = xe + dxf[i];
+ final int yf = ye + dyf;
curveTo(xa, ya, xb, yb, xc, yc);
curveTo(xd, yd, xe, ye, xf, yf);
}
} else {
- int count = getArgCount() / 8;
- int[] dya = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
- int[] dxd = new int[count];
- int[] dxe = new int[count];
- int[] dye = new int[count];
- int[] dyf = new int[count];
+ final int count = getArgCount() / 8;
+ final int[] dya = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
+ final int[] dxd = new int[count];
+ final int[] dxe = new int[count];
+ final int[] dye = new int[count];
+ final int[] dyf = new int[count];
int dxf = 0;
if (getArgCount() % 8 == 1) {
dxf = popArg().intValue();
@@ -307,24 +307,24 @@ public class T2Interpreter {
dxb[count - i - 1] = popArg().intValue();
dya[count - i - 1] = popArg().intValue();
}
- int dy3 = popArg().intValue();
- int dy2 = popArg().intValue();
- int dx2 = popArg().intValue();
- int dx1 = popArg().intValue();
+ final int dy3 = popArg().intValue();
+ final int dy2 = popArg().intValue();
+ final int dx2 = popArg().intValue();
+ final int dx1 = popArg().intValue();
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x;
- int ya = lastPoint.y + dya[i];
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb + dxc[i];
- int yc = yb;
- int xd = xc + dxd[i];
- int yd = yc;
- int xe = xd + dxe[i];
- int ye = yd + dye[i];
- int xf = xe + dxf;
- int yf = ye + dyf[i];
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x;
+ final int ya = lastPoint.y + dya[i];
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb + dxc[i];
+ final int yc = yb;
+ final int xd = xc + dxd[i];
+ final int yd = yc;
+ final int xe = xd + dxe[i];
+ final int ye = yd + dye[i];
+ final int xf = xe + dxf;
+ final int yf = ye + dyf[i];
curveTo(xa, ya, xb, yb, xc, yc);
curveTo(xd, yd, xe, ye, xf, yf);
@@ -341,15 +341,15 @@ public class T2Interpreter {
* on the argument stack.
*/
private void _rcurveline() {
- int count = (getArgCount() - 2) / 6;
- int[] dxa = new int[count];
- int[] dya = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
- int[] dyc = new int[count];
- int dyd = popArg().intValue();
- int dxd = popArg().intValue();
+ final int count = (getArgCount() - 2) / 6;
+ final int[] dxa = new int[count];
+ final int[] dya = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
+ final int[] dyc = new int[count];
+ final int dyd = popArg().intValue();
+ final int dxd = popArg().intValue();
for (int i = 0; i < count; ++i) {
dyc[count - i - 1] = popArg().intValue();
dxc[count - i - 1] = popArg().intValue();
@@ -361,11 +361,11 @@ public class T2Interpreter {
int xc = 0;
int yc = 0;
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x + dxa[i];
- int ya = lastPoint.y + dya[i];
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x + dxa[i];
+ final int ya = lastPoint.y + dya[i];
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
xc = xb + dxc[i];
yc = yb + dyc[i];
curveTo(xa, ya, xb, yb, xc, yc);
@@ -381,15 +381,15 @@ public class T2Interpreter {
* items on the argument stack.
*/
private void _rlinecurve() {
- int count = (getArgCount() - 6) / 2;
- int[] dxa = new int[count];
- int[] dya = new int[count];
- int dyd = popArg().intValue();
- int dxd = popArg().intValue();
- int dyc = popArg().intValue();
- int dxc = popArg().intValue();
- int dyb = popArg().intValue();
- int dxb = popArg().intValue();
+ final int count = (getArgCount() - 6) / 2;
+ final int[] dxa = new int[count];
+ final int[] dya = new int[count];
+ final int dyd = popArg().intValue();
+ final int dxd = popArg().intValue();
+ final int dyc = popArg().intValue();
+ final int dxc = popArg().intValue();
+ final int dyb = popArg().intValue();
+ final int dxb = popArg().intValue();
for (int i = 0; i < count; ++i) {
dya[count - i - 1] = popArg().intValue();
dxa[count - i - 1] = popArg().intValue();
@@ -397,17 +397,17 @@ public class T2Interpreter {
int xa = 0;
int ya = 0;
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
xa = lastPoint.x + dxa[i];
ya = lastPoint.y + dya[i];
lineTo(xa, ya);
}
- int xb = xa + dxb;
- int yb = ya + dyb;
- int xc = xb + dxc;
- int yc = yb + dyc;
- int xd = xc + dxd;
- int yd = yc + dyd;
+ final int xb = xa + dxb;
+ final int yb = ya + dyb;
+ final int xc = xb + dxc;
+ final int yc = yb + dyc;
+ final int xd = xc + dxd;
+ final int yd = yc + dyd;
curveTo(xb, yb, xc, yc, xd, yd);
clearArg();
}
@@ -420,15 +420,15 @@ public class T2Interpreter {
*/
private void _vhcurveto() {
if (getArgCount() % 8 <= 1) {
- int count = getArgCount() / 8;
- int[] dya = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
- int[] dxd = new int[count];
- int[] dxe = new int[count];
- int[] dye = new int[count];
- int[] dyf = new int[count];
+ final int count = getArgCount() / 8;
+ final int[] dya = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
+ final int[] dxd = new int[count];
+ final int[] dxe = new int[count];
+ final int[] dye = new int[count];
+ final int[] dyf = new int[count];
int dxf = 0;
if (getArgCount() % 8 == 1) {
dxf = popArg().intValue();
@@ -444,24 +444,24 @@ public class T2Interpreter {
dya[count - i - 1] = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x;
- int ya = lastPoint.y + dya[i];
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb + dxc[i];
- int yc = yb;
- int xd = xc + dxd[i];
- int yd = yc;
- int xe = xd + dxe[i];
- int ye = yd + dye[i];
- int xf = xe + dxf;
- int yf = ye + dyf[i];
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x;
+ final int ya = lastPoint.y + dya[i];
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb + dxc[i];
+ final int yc = yb;
+ final int xd = xc + dxd[i];
+ final int yd = yc;
+ final int xe = xd + dxe[i];
+ final int ye = yd + dye[i];
+ final int xf = xe + dxf;
+ final int yf = ye + dyf[i];
curveTo(xa, ya, xb, yb, xc, yc);
curveTo(xd, yd, xe, ye, xf, yf);
}
} else {
- int foo = 0;
+ final int foo = 0;
}
clearArg();
}
@@ -565,7 +565,7 @@ public class T2Interpreter {
* Returns the absolute value of num.
*/
private void _abs() {
- double num = popArg().doubleValue();
+ final double num = popArg().doubleValue();
pushArg(Math.abs(num));
}
@@ -573,8 +573,8 @@ public class T2Interpreter {
* Returns the sum of the two numbers num1 and num2.
*/
private void _add() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 + num2);
}
@@ -582,8 +582,8 @@ public class T2Interpreter {
* Returns the result of subtracting num2 from num1.
*/
private void _sub() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 - num2);
}
@@ -592,8 +592,8 @@ public class T2Interpreter {
* undefined if overflow occurs and is zero for underflow.
*/
private void _div() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 / num2);
}
@@ -601,7 +601,7 @@ public class T2Interpreter {
* Returns the negative of num.
*/
private void _neg() {
- double num = popArg().doubleValue();
+ final double num = popArg().doubleValue();
pushArg(-num);
}
@@ -618,8 +618,8 @@ public class T2Interpreter {
* result is undefined, and zero is returned for underflow.
*/
private void _mul() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 * num2);
}
@@ -628,7 +628,7 @@ public class T2Interpreter {
* undefined.
*/
private void _sqrt() {
- double num = popArg().doubleValue();
+ final double num = popArg().doubleValue();
pushArg(Math.sqrt(num));
}
@@ -643,8 +643,8 @@ public class T2Interpreter {
* Exchanges the top two elements on the argument stack.
*/
private void _exch() {
- Number num2 = popArg();
- Number num1 = popArg();
+ final Number num2 = popArg();
+ final Number num1 = popArg();
pushArg(num2);
pushArg(num1);
}
@@ -656,8 +656,8 @@ public class T2Interpreter {
* undefined.
*/
private void _index() {
- int i = popArg().intValue();
- Number[] nums = new Number[i];
+ final int i = popArg().intValue();
+ final Number[] nums = new Number[i];
for (int j = 0; j < i; ++j) {
nums[j] = popArg();
}
@@ -675,9 +675,9 @@ public class T2Interpreter {
* operation is undefined.
*/
private void _roll() {
- int j = popArg().intValue();
- int n = popArg().intValue();
- Number[] nums = new Number[n];
+ final int j = popArg().intValue();
+ final int n = popArg().intValue();
+ final Number[] nums = new Number[n];
for (int i = 0; i < n; ++i) {
nums[i] = popArg();
}
@@ -690,7 +690,7 @@ public class T2Interpreter {
* Duplicates the top element on the argument stack.
*/
private void _dup() {
- Number any = popArg();
+ final Number any = popArg();
pushArg(any);
pushArg(any);
}
@@ -699,8 +699,8 @@ public class T2Interpreter {
* Stores val into the transient array at the location given by i.
*/
private void _put() {
- int i = popArg().intValue();
- Number val = popArg();
+ final int i = popArg().intValue();
+ final Number val = popArg();
_transientArray[i] = val;
}
@@ -711,7 +711,7 @@ public class T2Interpreter {
* charstring, the value returned is undefined.
*/
private void _get() {
- int i = popArg().intValue();
+ final int i = popArg().intValue();
pushArg(_transientArray[i]);
}
@@ -720,8 +720,8 @@ public class T2Interpreter {
* puts a 0 on the stack if either argument is zero.
*/
private void _and() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg((num1!=0.0) && (num2!=0.0) ? 1 : 0);
}
@@ -730,8 +730,8 @@ public class T2Interpreter {
* puts a 0 on the stack if both arguments are zero.
*/
private void _or() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg((num1!=0.0) || (num2!=0.0) ? 1 : 0);
}
@@ -739,7 +739,7 @@ public class T2Interpreter {
* Returns a 0 if num1 is non-zero; returns a 1 if num1 is zero.
*/
private void _not() {
- double num1 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg((num1!=0.0) ? 0 : 1);
}
@@ -748,8 +748,8 @@ public class T2Interpreter {
* is put on the stack.
*/
private void _eq() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 == num2 ? 1 : 0);
}
@@ -759,10 +759,10 @@ public class T2Interpreter {
* number of a subroutine.
*/
private void _ifelse() {
- double v2 = popArg().doubleValue();
- double v1 = popArg().doubleValue();
- Number s2 = popArg();
- Number s1 = popArg();
+ final double v2 = popArg().doubleValue();
+ final double v1 = popArg().doubleValue();
+ final Number s2 = popArg();
+ final Number s1 = popArg();
pushArg(v1 <= v2 ? s1 : s2);
}
@@ -796,7 +796,7 @@ public class T2Interpreter {
}
- public Point[] execute(CharstringType2 cs) {
+ public Point[] execute(final CharstringType2 cs) {
_points = new ArrayList<Point>();
cs.resetIP();
while (cs.moreBytes()) {
@@ -964,7 +964,7 @@ public class T2Interpreter {
}
}
}
- Point[] pointArray = new Point[_points.size()];
+ final Point[] pointArray = new Point[_points.size()];
_points.toArray(pointArray);
return pointArray;
}
@@ -986,7 +986,7 @@ public class T2Interpreter {
/**
* Push a value on to the argument stack
*/
- private void pushArg(Number n) {
+ private void pushArg(final Number n) {
_argStack[_argStackIndex++] = n;
}
@@ -1000,7 +1000,7 @@ public class T2Interpreter {
/**
* Push a value on to the subroutine stack
*/
- private void pushSubr(int n) {
+ private void pushSubr(final int n) {
_subrStack[_subrStackIndex++] = n;
}
@@ -1012,7 +1012,7 @@ public class T2Interpreter {
}
private Point getLastPoint() {
- int size = _points.size();
+ final int size = _points.size();
if (size > 0) {
return _points.get(size - 1);
} else {
@@ -1020,23 +1020,23 @@ public class T2Interpreter {
}
}
- private void moveTo(int x, int y) {
+ private void moveTo(final int x, final int y) {
endContour();
_points.add(new Point(x, y, true, false));
}
- private void lineTo(int x, int y) {
+ private void lineTo(final int x, final int y) {
_points.add(new Point(x, y, true, false));
}
- private void curveTo(int cx1, int cy1, int cx2, int cy2, int x, int y) {
+ private void curveTo(final int cx1, final int cy1, final int cx2, final int cy2, final int x, final int y) {
_points.add(new Point(cx1, cy1, false, false));
_points.add(new Point(cx2, cy2, false, false));
_points.add(new Point(x, y, true, false));
}
private void endContour() {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
if (lastPoint != null) {
lastPoint.endOfContour = true;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
index 2bb5cec0c..b296886cc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
@@ -33,16 +33,16 @@ import jogamp.graph.font.typecast.ot.Point;
public class Interpreter {
private Parser parser = null;
- private GraphicsState gs = new GraphicsState();
- private Point[][] zone = new Point[2][];
+ private final GraphicsState gs = new GraphicsState();
+ private final Point[][] zone = new Point[2][];
private int[] stack = null;
private int[] store = null;
- private int[] cvt = new int[256];
+ private final int[] cvt = new int[256];
private int[] functionMap = null;
private int stackIndex = 0;
private boolean inFuncDef = false;
- public Interpreter(int stackMax, int storeMax, int funcMax) {
+ public Interpreter(final int stackMax, final int storeMax, final int funcMax) {
zone[0] = new Point[256];
zone[1] = new Point[256];
stack = new int[stackMax];
@@ -54,7 +54,7 @@ public class Interpreter {
* ABSolute value
*/
private void _abs() {
- int n = pop();
+ final int n = pop();
if (n >= 0) {
push(n);
} else {
@@ -66,8 +66,8 @@ public class Interpreter {
* ADD
*/
private void _add() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push(n2 + n1);
}
@@ -92,8 +92,8 @@ public class Interpreter {
* logical AND
*/
private void _and() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push(((e1 != 0) && (e2 != 0)) ? 1 : 0);
}
@@ -108,7 +108,7 @@ public class Interpreter {
* CEILING
*/
private void _ceiling() {
- int n = pop();
+ final int n = pop();
if (n >= 0) {
push((n & 0xffc0) + (((n & 0x3f) != 0) ? 0x40 : 0));
} else {
@@ -138,7 +138,7 @@ public class Interpreter {
* DELTA exception C1
*/
private void _deltac1() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -149,7 +149,7 @@ public class Interpreter {
* DELTA exception C2
*/
private void _deltac2() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -160,7 +160,7 @@ public class Interpreter {
* DELTA exception C3
*/
private void _deltac3() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -171,7 +171,7 @@ public class Interpreter {
* DELTA exception P1
*/
private void _deltap1() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -182,7 +182,7 @@ public class Interpreter {
* DELTA exception P2
*/
private void _deltap2() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -193,7 +193,7 @@ public class Interpreter {
* DELTA exception P3
*/
private void _deltap3() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -211,8 +211,8 @@ public class Interpreter {
* DIVide
*/
private void _div() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push((n2 / n1) >> 6);
}
@@ -220,7 +220,7 @@ public class Interpreter {
* DUPlicate top stack element
*/
private void _dup() {
- int n = pop();
+ final int n = pop();
push(n);
push(n);
}
@@ -228,7 +228,7 @@ public class Interpreter {
/**
* ELSE
*/
- private int _else(int instructionIndex) {
+ private int _else(final int instructionIndex) {
return parser.handleElse(instructionIndex);
}
@@ -236,8 +236,8 @@ public class Interpreter {
* EQual
*/
private void _eq() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 == e2) ? 1 : 0);
}
@@ -249,7 +249,7 @@ public class Interpreter {
/**
* Function DEFinition
*/
- private void _fdef(int instructionIndex) {
+ private void _fdef(final int instructionIndex) {
functionMap[pop()] = instructionIndex;
inFuncDef = true;
}
@@ -275,7 +275,7 @@ public class Interpreter {
*/
private void _flippt() {
while(gs.loop-- > 0) {
- int index = pop();
+ final int index = pop();
zone[gs.zp0][index].onCurve = !zone[gs.zp0][index].onCurve;
}
gs.loop = 1;
@@ -285,8 +285,8 @@ public class Interpreter {
* FLIP RanGe OFF
*/
private void _fliprgoff() {
- int end = pop();
- int start = pop();
+ final int end = pop();
+ final int start = pop();
for (int i = start; i <= end; i++) {
zone[1][i].onCurve = false;
}
@@ -296,8 +296,8 @@ public class Interpreter {
* FLIP RanGe ON
*/
private void _fliprgon() {
- int end = pop();
- int start = pop();
+ final int end = pop();
+ final int start = pop();
for (int i = start; i <= end; i++) {
zone[1][i].onCurve = true;
}
@@ -307,7 +307,7 @@ public class Interpreter {
* FLOOR
*/
private void _floor() {
- int n = pop();
+ final int n = pop();
if (n >= 0) {
push(n & 0xffc0);
} else {
@@ -315,7 +315,7 @@ public class Interpreter {
}
}
- private void _gc(short param) {
+ private void _gc(final short param) {
pop();
push(0);
}
@@ -345,8 +345,8 @@ public class Interpreter {
* Greater Than
*/
private void _gt() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 > e2) ? 1 : 0);
}
@@ -354,8 +354,8 @@ public class Interpreter {
* Greater Than or EQual
*/
private void _gteq() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 >= e2) ? 1 : 0);
}
@@ -370,7 +370,7 @@ public class Interpreter {
/**
* IF test
*/
- private int _if(int instructionIndex) {
+ private int _if(final int instructionIndex) {
return parser.handleIf(pop() != 0, instructionIndex);
}
@@ -425,8 +425,8 @@ public class Interpreter {
* will be used in glyph instructions.
*/
private void _instctrl() {
- int s = pop();
- int v = pop();
+ final int s = pop();
+ final int v = pop();
if (s == 1) {
gs.instruction_control |= v;
} else if (s == 2) {
@@ -446,7 +446,7 @@ public class Interpreter {
pop();
}
- private void _iup(short param) {
+ private void _iup(final short param) {
}
/**
@@ -460,8 +460,8 @@ public class Interpreter {
* Jump Relative On False
*/
private int _jrof(int instructionIndex) {
- boolean test = pop() != 0;
- int offset = pop();
+ final boolean test = pop() != 0;
+ final int offset = pop();
if (!test) {
instructionIndex += offset - 1;
}
@@ -472,8 +472,8 @@ public class Interpreter {
* Jump Relative On True
*/
private int _jrot(int instructionIndex) {
- boolean test = pop() != 0;
- int offset = pop();
+ final boolean test = pop() != 0;
+ final int offset = pop();
if (test) {
instructionIndex += offset - 1;
}
@@ -484,8 +484,8 @@ public class Interpreter {
* LOOP and CALL function
*/
private void _loopcall() {
- int index = pop();
- int count = pop();
+ final int index = pop();
+ final int count = pop();
for (int i = 0; i < count; i++) {
execute(functionMap[i]);
}
@@ -495,8 +495,8 @@ public class Interpreter {
* Less Than
*/
private void _lt() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 < e2) ? 1 : 0);
}
@@ -504,8 +504,8 @@ public class Interpreter {
* Less Than or EQual
*/
private void _lteq() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 <= e2) ? 1 : 0);
}
@@ -513,26 +513,26 @@ public class Interpreter {
* MAXimum of top two stack elements
*/
private void _max() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push((n1 > n2) ? n1 : n2);
}
- private void _md(short param) {
+ private void _md(final short param) {
pop();
pop();
push(0);
}
- private void _mdap(short param) {
+ private void _mdap(final short param) {
pop();
}
- private void _mdrp(short param) {
+ private void _mdrp(final short param) {
pop();
}
- private void _miap(short param) {
+ private void _miap(final short param) {
pop();
pop();
}
@@ -540,8 +540,8 @@ public class Interpreter {
* MINimum of top two stack elements
*/
private void _min() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push((n1 < n2) ? n1 : n2);
}
@@ -550,15 +550,15 @@ public class Interpreter {
*/
private void _mindex() {
// Move the indexed element to stackIndex, and shift the others down
- int k = pop();
- int e = stack[stackIndex - k];
+ final int k = pop();
+ final int e = stack[stackIndex - k];
for (int i = stackIndex - k; i < stackIndex - 1; i++) {
stack[i] = stack[i+1];
}
stack[stackIndex - 1] = e;
}
- private void _mirp(short param) {
+ private void _mirp(final short param) {
pop();
pop();
}
@@ -571,7 +571,7 @@ public class Interpreter {
push(0);
}
- private void _msirp(short param) {
+ private void _msirp(final short param) {
pop();
pop();
}
@@ -580,8 +580,8 @@ public class Interpreter {
* MULtiply
*/
private void _mul() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push((n1 * n2) >> 6);
}
@@ -596,8 +596,8 @@ public class Interpreter {
* Not EQual
*/
private void _neq() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 != e2) ? 1 : 0);
}
@@ -608,7 +608,7 @@ public class Interpreter {
push((pop() != 0) ? 0 : 1);
}
- private void _nround(short param) {
+ private void _nround(final short param) {
pop();
push(0);
}
@@ -622,8 +622,8 @@ public class Interpreter {
* logical OR
*/
private void _or() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push(((e1 != 0) || (e2 != 0)) ? 1 : 0);
}
@@ -633,7 +633,7 @@ public class Interpreter {
* PUSH Bytes
* PUSH Words
*/
- private void _push(int[] data) {
+ private void _push(final int[] data) {
for (int j = 0; j < data.length; j++) {
push(data[j]);
}
@@ -664,15 +664,15 @@ public class Interpreter {
* ROLL the top three stack elements
*/
private void _roll() {
- int a = pop();
- int b = pop();
- int c = pop();
+ final int a = pop();
+ final int b = pop();
+ final int c = pop();
push(b);
push(a);
push(c);
}
- private void _round(short param) {
+ private void _round(final short param) {
pop();
push(0);
}
@@ -907,7 +907,7 @@ public class Interpreter {
/**
* Set Dual Projection_Vector To Line
*/
- private void _sdpvtl(short param) {
+ private void _sdpvtl(final short param) {
pop();
pop();
}
@@ -930,7 +930,7 @@ public class Interpreter {
/*
* Set Freedom_Vector to Coordinate Axis
*/
- private void _sfvtca(short param) {
+ private void _sfvtca(final short param) {
if (param == 1) {
gs.freedom_vector[0] = 0x4000;
gs.freedom_vector[1] = 0x0000;
@@ -943,7 +943,7 @@ public class Interpreter {
/*
* Set Freedom_Vector To Line
*/
- private void _sfvtl(short param) {
+ private void _sfvtl(final short param) {
pop();
pop();
if (param == 1) {
@@ -963,7 +963,7 @@ public class Interpreter {
gs.freedom_vector[1] = gs.projection_vector[1];
}
- private void _shc(short param) {
+ private void _shc(final short param) {
pop();
}
@@ -972,7 +972,7 @@ public class Interpreter {
*
* USES: loop
*/
- private void _shp(short param) {
+ private void _shp(final short param) {
while(gs.loop-- > 0) {
pop();
if(param == 0) {
@@ -995,7 +995,7 @@ public class Interpreter {
gs.loop = 1;
}
- private void _shz(short param) {
+ private void _shz(final short param) {
pop();
}
@@ -1024,7 +1024,7 @@ public class Interpreter {
/*
* Set Projection_Vector To Coordinate Axis
*/
- private void _spvtca(short param) {
+ private void _spvtca(final short param) {
if (param == 1) {
gs.projection_vector[0] = 0x4000;
gs.projection_vector[1] = 0x0000;
@@ -1037,14 +1037,14 @@ public class Interpreter {
/**
* Set Projection_Vector To Line
*/
- private void _spvtl(short param) {
+ private void _spvtl(final short param) {
// We'll get a copy of the line and normalize it -
// divide the x- and y-coords by the vector's dot product.
- Point p1 = zone[gs.zp2][pop()];
- Point p2 = zone[gs.zp1][pop()];
- int x = p2.x - p1.x;
- int y = p2.y - p1.y;
+ final Point p1 = zone[gs.zp2][pop()];
+ final Point p2 = zone[gs.zp1][pop()];
+ final int x = p2.x - p1.x;
+ final int y = p2.y - p1.y;
if(param == 1) {
gs.projection_vector[0] = 0x0000;
gs.projection_vector[1] = 0x0000;
@@ -1097,15 +1097,15 @@ public class Interpreter {
* SUBtract
*/
private void _sub() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push(n2 - n1);
}
/**
* Set freedom and projection Vectors To Coordinate Axis
*/
- private void _svtca(short param) {
+ private void _svtca(final short param) {
if (param == 1) {
gs.projection_vector[0] = 0x4000;
gs.projection_vector[1] = 0x0000;
@@ -1123,8 +1123,8 @@ public class Interpreter {
* SWAP the top two elements on the stack
*/
private void _swap() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push(n1);
push(n2);
}
@@ -1165,7 +1165,7 @@ public class Interpreter {
* Write Control Value Table in FUnits
*/
private void _wcvtf() {
- int value = pop();
+ final int value = pop();
// Conversion of value goes here
cvt[pop()] = value;
}
@@ -1174,7 +1174,7 @@ public class Interpreter {
* Write Control Value Table in Pixel units
*/
private void _wcvtp() {
- int value = pop();
+ final int value = pop();
// Conversion of value goes here
cvt[pop()] = value;
}
@@ -1188,7 +1188,7 @@ public class Interpreter {
public void execute(int ip) {
while (ip < ((ip & 0xffff0000) | parser.getISLength(ip >> 16))) {
- short opcode = parser.getOpcode(ip);
+ final short opcode = parser.getOpcode(ip);
if (inFuncDef) {
// We're within a function definition, so don't execute the code
@@ -1332,7 +1332,7 @@ public class Interpreter {
return stack[--stackIndex];
}
- private void push(int i) {
+ private void push(final int i) {
stack[stackIndex++] = i;
}
@@ -1351,7 +1351,7 @@ public class Interpreter {
}
}
- public void setParser(Parser p) {
+ public void setParser(final Parser p) {
parser = p;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
index 1159b2c17..ff1795a28 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
@@ -28,7 +28,7 @@ import jogamp.graph.font.typecast.ot.Mnemonic;
*/
public class Parser {
- private short[][] instructions = new short[3][];
+ private final short[][] instructions = new short[3][];
/**
* Advance the instruction pointer to the next executable opcode.
@@ -41,7 +41,7 @@ public class Parser {
public int advanceIP(int ip) {
// The high word specifies font, cvt, or glyph program
- int prog = ip >> 16;
+ final int prog = ip >> 16;
int i = ip & 0xffff;
int dataCount;
ip++;
@@ -63,16 +63,16 @@ public class Parser {
return ip;
}
- public int getISLength(int prog) {
+ public int getISLength(final int prog) {
return instructions[prog].length;
}
- public short getOpcode(int ip) {
+ public short getOpcode(final int ip) {
return instructions[ip >> 16][ip & 0xffff];
}
- public short getPushCount(int ip) {
- short instr = instructions[ip >> 16][ip & 0xffff];
+ public short getPushCount(final int ip) {
+ final short instr = instructions[ip >> 16][ip & 0xffff];
if ((Mnemonic.NPUSHB == instr) || (Mnemonic.NPUSHW == instr)) {
return instructions[ip >> 16][(ip & 0xffff) + 1];
} else if ((Mnemonic.PUSHB == (instr & 0xf8)) || (Mnemonic.PUSHW == (instr & 0xf8))) {
@@ -81,12 +81,12 @@ public class Parser {
return 0;
}
- public int[] getPushData(int ip) {
- int count = getPushCount(ip);
- int[] data = new int[count];
- int prog = ip >> 16;
- int i = ip & 0xffff;
- short instr = instructions[prog][i];
+ public int[] getPushData(final int ip) {
+ final int count = getPushCount(ip);
+ final int[] data = new int[count];
+ final int prog = ip >> 16;
+ final int i = ip & 0xffff;
+ final short instr = instructions[prog][i];
if (Mnemonic.NPUSHB == instr) {
for (int j = 0; j < count; j++) {
data[j] = instructions[prog][i + j + 2];
@@ -114,7 +114,7 @@ public class Parser {
return ip;
}
- public int handleIf(boolean test, int ip) {
+ public int handleIf(final boolean test, int ip) {
if (test == false) {
// The TrueType spec says that we merely jump to the *next* ELSE or EIF
// instruction in the instruction stream. So therefore no nesting!
@@ -130,32 +130,32 @@ public class Parser {
/**
* This program is run everytime we scale the font
*/
- public void setCvtProgram(short[] program) {
+ public void setCvtProgram(final short[] program) {
instructions[1] = program;
}
/**
* This program is only run once
*/
- public void setFontProgram(short[] program) {
+ public void setFontProgram(final short[] program) {
instructions[0] = program;
}
/**
* This program is run everytime we scale the glyph
*/
- public void setGlyphProgram(short[] program) {
+ public void setGlyphProgram(final short[] program) {
instructions[2] = program;
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
int ip = 0;
while (ip < instructions[0].length) {
sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
if (getPushCount(ip) > 0) {
- int[] data = getPushData(ip);
+ final int[] data = getPushData(ip);
for(int j = 0; j < data.length; j++)
sb.append(" ").append(data[j]);
}
@@ -167,7 +167,7 @@ public class Parser {
while (ip < (0x10000 | instructions[1].length)) {
sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
if(getPushCount(ip) > 0) {
- int[] data = getPushData(ip);
+ final int[] data = getPushData(ip);
for (int j = 0; j < data.length; j++) {
sb.append(" ").append(data[j]);
}
@@ -180,7 +180,7 @@ public class Parser {
while (ip < (0x20000 | instructions[2].length)) {
sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
if (getPushCount(ip) > 0) {
- int[] data = getPushData(ip);
+ final int[] data = getPushData(ip);
for (int j = 0; j < data.length; j++) {
sb.append(" ").append(data[j]);
}
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
index 2a30fa6ec..909240c76 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
@@ -69,7 +69,7 @@ public class AffineTransform implements Cloneable {
setToIdentity();
}
- public AffineTransform(AffineTransform t) {
+ public AffineTransform(final AffineTransform t) {
this.type = t.type;
this.m00 = t.m00;
this.m10 = t.m10;
@@ -79,7 +79,7 @@ public class AffineTransform implements Cloneable {
this.m12 = t.m12;
}
- public AffineTransform(float m00, float m10, float m01, float m11, float m02, float m12) {
+ public AffineTransform(final float m00, final float m10, final float m01, final float m11, final float m02, final float m12) {
this.type = TYPE_UNKNOWN;
this.m00 = m00;
this.m10 = m10;
@@ -89,7 +89,7 @@ public class AffineTransform implements Cloneable {
this.m12 = m12;
}
- public AffineTransform(float[] matrix) {
+ public AffineTransform(final float[] matrix) {
this.type = TYPE_UNKNOWN;
m00 = matrix[0];
m10 = matrix[1];
@@ -144,8 +144,8 @@ public class AffineTransform implements Cloneable {
type |= TYPE_FLIP;
}
- float dx = m00 * m00 + m10 * m10;
- float dy = m01 * m01 + m11 * m11;
+ final float dx = m00 * m00 + m10 * m10;
+ final float dy = m01 * m01 + m11 * m11;
if (dx != dy) {
type |= TYPE_GENERAL_SCALE;
} else
@@ -193,7 +193,7 @@ public class AffineTransform implements Cloneable {
return getType() == TYPE_IDENTITY;
}
- public final void getMatrix(float[] matrix) {
+ public final void getMatrix(final float[] matrix) {
matrix[0] = m00;
matrix[1] = m10;
matrix[2] = m01;
@@ -208,7 +208,7 @@ public class AffineTransform implements Cloneable {
return m00 * m11 - m01 * m10;
}
- public final AffineTransform setTransform(float m00, float m10, float m01, float m11, float m02, float m12) {
+ public final AffineTransform setTransform(final float m00, final float m10, final float m01, final float m11, final float m02, final float m12) {
this.type = TYPE_UNKNOWN;
this.m00 = m00;
this.m10 = m10;
@@ -219,7 +219,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setTransform(AffineTransform t) {
+ public final AffineTransform setTransform(final AffineTransform t) {
type = t.type;
setTransform(t.m00, t.m10, t.m01, t.m11, t.m02, t.m12);
return this;
@@ -232,7 +232,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToTranslation(float mx, float my) {
+ public final AffineTransform setToTranslation(final float mx, final float my) {
m00 = m11 = 1.0f;
m01 = m10 = 0.0f;
m02 = mx;
@@ -245,7 +245,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToScale(float scx, float scy) {
+ public final AffineTransform setToScale(final float scx, final float scy) {
m00 = scx;
m11 = scy;
m10 = m01 = m02 = m12 = 0.0f;
@@ -257,7 +257,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToShear(float shx, float shy) {
+ public final AffineTransform setToShear(final float shx, final float shy) {
m00 = m11 = 1.0f;
m02 = m12 = 0.0f;
m01 = shx;
@@ -270,7 +270,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToRotation(float angle) {
+ public final AffineTransform setToRotation(final float angle) {
float sin = FloatUtil.sin(angle);
float cos = FloatUtil.cos(angle);
if (FloatUtil.abs(cos) < ZERO) {
@@ -289,7 +289,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToRotation(float angle, float px, float py) {
+ public final AffineTransform setToRotation(final float angle, final float px, final float py) {
setToRotation(angle);
m02 = px * (1.0f - m00) + py * m10;
m12 = py * (1.0f - m00) - px * m10;
@@ -297,23 +297,23 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform translate(float mx, float my, AffineTransform tmp) {
+ public final AffineTransform translate(final float mx, final float my, final AffineTransform tmp) {
return concatenate(tmp.setToTranslation(mx, my));
}
- public final AffineTransform scale(float scx, float scy, AffineTransform tmp) {
+ public final AffineTransform scale(final float scx, final float scy, final AffineTransform tmp) {
return concatenate(tmp.setToScale(scx, scy));
}
- public final AffineTransform shear(float shx, float shy, AffineTransform tmp) {
+ public final AffineTransform shear(final float shx, final float shy, final AffineTransform tmp) {
return concatenate(tmp.setToShear(shx, shy));
}
- public final AffineTransform rotate(float angle, AffineTransform tmp) {
+ public final AffineTransform rotate(final float angle, final AffineTransform tmp) {
return concatenate(tmp.setToRotation(angle));
}
- public final AffineTransform rotate(float angle, float px, float py, AffineTransform tmp) {
+ public final AffineTransform rotate(final float angle, final float px, final float py, final AffineTransform tmp) {
return concatenate(tmp.setToRotation(angle, px, py));
}
@@ -345,7 +345,7 @@ public class AffineTransform implements Cloneable {
* @param tR the right-argument of the matrix multiplication
* @return this transform for chaining
*/
- public final AffineTransform concatenate(AffineTransform tR) {
+ public final AffineTransform concatenate(final AffineTransform tR) {
// setTransform(multiply(this, tR));
type = TYPE_UNKNOWN;
setTransform(
@@ -369,7 +369,7 @@ public class AffineTransform implements Cloneable {
* @param tL the left-argument of the matrix multiplication
* @return this transform for chaining
*/
- public final AffineTransform preConcatenate(AffineTransform tL) {
+ public final AffineTransform preConcatenate(final AffineTransform tL) {
// setTransform(multiply(tL, this));
type = TYPE_UNKNOWN;
setTransform(
@@ -383,7 +383,7 @@ public class AffineTransform implements Cloneable {
}
public final AffineTransform createInverse() throws NoninvertibleTransformException {
- float det = getDeterminant();
+ final float det = getDeterminant();
if (FloatUtil.abs(det) < ZERO) {
throw new NoninvertibleTransformException(determinantIsZero);
}
@@ -425,8 +425,8 @@ public class AffineTransform implements Cloneable {
public final void transform(final Vertex[] src, int srcOff, final Vertex[] dst, int dstOff, int length) {
while (--length >= 0) {
- Vertex srcPoint = src[srcOff++];
- Vertex dstPoint = dst[dstOff];
+ final Vertex srcPoint = src[srcOff++];
+ final Vertex dstPoint = dst[dstOff];
if (dstPoint == null) {
throw new IllegalArgumentException("dst["+dstOff+"] is null");
}
@@ -489,8 +489,8 @@ public class AffineTransform implements Cloneable {
public final void deltaTransform(final float[] src, int srcOff, final float[] dst, int dstOff, int length) {
while (--length >= 0) {
- float x = src[srcOff++];
- float y = src[srcOff++];
+ final float x = src[srcOff++];
+ final float y = src[srcOff++];
dst[dstOff++] = x * m00 + y * m01;
dst[dstOff++] = x * m10 + y * m11;
}
@@ -504,7 +504,7 @@ public class AffineTransform implements Cloneable {
* @throws NoninvertibleTransformException
*/
public final Vertex inverseTransform(final Vertex src, final Vertex dst) throws NoninvertibleTransformException {
- float det = getDeterminant();
+ final float det = getDeterminant();
if (FloatUtil.abs(det) < ZERO) {
throw new NoninvertibleTransformException(determinantIsZero);
}
@@ -517,28 +517,28 @@ public class AffineTransform implements Cloneable {
public final void inverseTransform(final float[] src, int srcOff, final float[] dst, int dstOff, int length)
throws NoninvertibleTransformException
{
- float det = getDeterminant();
+ final float det = getDeterminant();
if (FloatUtil.abs(det) < ZERO) {
throw new NoninvertibleTransformException(determinantIsZero);
}
while (--length >= 0) {
- float x = src[srcOff++] - m02;
- float y = src[srcOff++] - m12;
+ final float x = src[srcOff++] - m02;
+ final float y = src[srcOff++] - m12;
dst[dstOff++] = (x * m11 - y * m01) / det;
dst[dstOff++] = (y * m00 - x * m10) / det;
}
}
- public final Path2D createTransformedShape(Path2D src) {
+ public final Path2D createTransformedShape(final Path2D src) {
if (src == null) {
return null;
}
if (src instanceof Path2D) {
return src.createTransformedShape(this);
}
- PathIterator path = src.iterator(this);
- Path2D dst = new Path2D(path.getWindingRule());
+ final PathIterator path = src.iterator(this);
+ final Path2D dst = new Path2D(path.getWindingRule());
dst.append(path, false);
return dst;
}
@@ -555,7 +555,7 @@ public class AffineTransform implements Cloneable {
public final AffineTransform clone() {
try {
return (AffineTransform) super.clone();
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
throw new InternalError();
}
}
@@ -573,12 +573,12 @@ public class AffineTransform implements Cloneable {
} */
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof AffineTransform) {
- AffineTransform t = (AffineTransform)obj;
+ final AffineTransform t = (AffineTransform)obj;
return
m00 == t.m00 && m01 == t.m01 &&
m02 == t.m02 && m10 == t.m10 &&
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
index 982575b53..f46dd3c94 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
@@ -51,10 +51,10 @@ public class Crossing {
* @param res - the roots of the equation
* @return a number of roots
*/
- public static int solveQuad(float eqn[], float res[]) {
- float a = eqn[2];
- float b = eqn[1];
- float c = eqn[0];
+ public static int solveQuad(final float eqn[], final float res[]) {
+ final float a = eqn[2];
+ final float b = eqn[1];
+ final float c = eqn[0];
int rc = 0;
if (a == 0.0) {
if (b == 0.0) {
@@ -83,26 +83,26 @@ public class Crossing {
* @param res - the roots of the equation
* @return a number of roots
*/
- public static int solveCubic(float eqn[], float res[]) {
- float d = eqn[3];
+ public static int solveCubic(final float eqn[], final float res[]) {
+ final float d = eqn[3];
if (d == 0) {
return solveQuad(eqn, res);
}
- float a = eqn[2] / d;
- float b = eqn[1] / d;
- float c = eqn[0] / d;
+ final float a = eqn[2] / d;
+ final float b = eqn[1] / d;
+ final float c = eqn[0] / d;
int rc = 0;
- float Q = (a * a - 3.0f * b) / 9.0f;
- float R = (2.0f * a * a * a - 9.0f * a * b + 27.0f * c) / 54.0f;
- float Q3 = Q * Q * Q;
- float R2 = R * R;
- float n = - a / 3.0f;
+ final float Q = (a * a - 3.0f * b) / 9.0f;
+ final float R = (2.0f * a * a * a - 9.0f * a * b + 27.0f * c) / 54.0f;
+ final float Q3 = Q * Q * Q;
+ final float R2 = R * R;
+ final float n = - a / 3.0f;
if (R2 < Q3) {
- float t = FloatUtil.acos(R / FloatUtil.sqrt(Q3)) / 3.0f;
- float p = 2.0f * FloatUtil.PI / 3.0f;
- float m = -2.0f * FloatUtil.sqrt(Q);
+ final float t = FloatUtil.acos(R / FloatUtil.sqrt(Q3)) / 3.0f;
+ final float p = 2.0f * FloatUtil.PI / 3.0f;
+ final float m = -2.0f * FloatUtil.sqrt(Q);
res[rc++] = m * FloatUtil.cos(t) + n;
res[rc++] = m * FloatUtil.cos(t + p) + n;
res[rc++] = m * FloatUtil.cos(t - p) + n;
@@ -116,10 +116,10 @@ public class Crossing {
if (-ROOT_DELTA < A && A < ROOT_DELTA) {
res[rc++] = n;
} else {
- float B = Q / A;
+ final float B = Q / A;
res[rc++] = A + B + n;
// if (R2 == Q3) {
- float delta = R2 - Q3;
+ final float delta = R2 - Q3;
if (-ROOT_DELTA < delta && delta < ROOT_DELTA) {
res[rc++] = - (A + B) / 2.0f + n;
}
@@ -135,7 +135,7 @@ public class Crossing {
* @param rc - the roots count
* @return new roots count
*/
- static int fixRoots(float res[], int rc) {
+ static int fixRoots(final float res[], final int rc) {
int tc = 0;
for(int i = 0; i < rc; i++) {
out: {
@@ -158,7 +158,7 @@ public class Crossing {
float ax, ay, bx, by;
float Ax, Ay, Bx, By;
- public QuadCurve(float x1, float y1, float cx, float cy, float x2, float y2) {
+ public QuadCurve(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2) {
ax = x2 - x1;
ay = y2 - y1;
bx = cx - x1;
@@ -171,11 +171,11 @@ public class Crossing {
Ay = ay - By; // Ay = ay - 2.0 * by
}
- int cross(float res[], int rc, float py1, float py2) {
+ int cross(final float res[], final int rc, final float py1, final float py2) {
int cross = 0;
for (int i = 0; i < rc; i++) {
- float t = res[i];
+ final float t = res[i];
// CURVE-OUTSIDE
if (t < -DELTA || t > 1 + DELTA) {
@@ -196,10 +196,10 @@ public class Crossing {
continue;
}
// CURVE-INSIDE
- float ry = t * (t * Ay + By);
+ final float ry = t * (t * Ay + By);
// ry = t * t * Ay + t * By
if (ry > py2) {
- float rxt = t * Ax + bx;
+ final float rxt = t * Ax + bx;
// rxt = 2.0 * t * Ax + Bx = 2.0 * t * Ax + 2.0 * bx
if (rxt > -DELTA && rxt < DELTA) {
continue;
@@ -211,12 +211,12 @@ public class Crossing {
return cross;
}
- int solvePoint(float res[], float px) {
- float eqn[] = {-px, Bx, Ax};
+ int solvePoint(final float res[], final float px) {
+ final float eqn[] = {-px, Bx, Ax};
return solveQuad(eqn, res);
}
- int solveExtrem(float res[]) {
+ int solveExtrem(final float res[]) {
int rc = 0;
if (Ax != 0.0) {
res[rc++] = - Bx / (Ax + Ax);
@@ -227,11 +227,11 @@ public class Crossing {
return rc;
}
- int addBound(float bound[], int bc, float res[], int rc, float minX, float maxX, boolean changeId, int id) {
+ int addBound(final float bound[], int bc, final float res[], final int rc, final float minX, final float maxX, final boolean changeId, int id) {
for(int i = 0; i < rc; i++) {
- float t = res[i];
+ final float t = res[i];
if (t > -DELTA && t < 1 + DELTA) {
- float rx = t * (t * Ax + Bx);
+ final float rx = t * (t * Ax + Bx);
if (minX <= rx && rx <= maxX) {
bound[bc++] = t;
bound[bc++] = rx;
@@ -257,7 +257,7 @@ public class Crossing {
float Ax, Ay, Bx, By, Cx, Cy;
float Ax3, Bx2;
- public CubicCurve(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2) {
+ public CubicCurve(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2) {
ax = x2 - x1;
ay = y2 - y1;
bx = cx1 - x1;
@@ -277,10 +277,10 @@ public class Crossing {
Bx2 = Bx + Bx;
}
- int cross(float res[], int rc, float py1, float py2) {
+ int cross(final float res[], final int rc, final float py1, final float py2) {
int cross = 0;
for (int i = 0; i < rc; i++) {
- float t = res[i];
+ final float t = res[i];
// CURVE-OUTSIDE
if (t < -DELTA || t > 1 + DELTA) {
@@ -301,7 +301,7 @@ public class Crossing {
continue;
}
// CURVE-INSIDE
- float ry = t * (t * (t * Ay + By) + Cy);
+ final float ry = t * (t * (t * Ay + By) + Cy);
// ry = t * t * t * Ay + t * t * By + t * Cy
if (ry > py2) {
float rxt = t * (t * Ax3 + Bx2) + Cx;
@@ -322,26 +322,26 @@ public class Crossing {
return cross;
}
- int solvePoint(float res[], float px) {
- float eqn[] = {-px, Cx, Bx, Ax};
+ int solvePoint(final float res[], final float px) {
+ final float eqn[] = {-px, Cx, Bx, Ax};
return solveCubic(eqn, res);
}
- int solveExtremX(float res[]) {
- float eqn[] = {Cx, Bx2, Ax3};
+ int solveExtremX(final float res[]) {
+ final float eqn[] = {Cx, Bx2, Ax3};
return solveQuad(eqn, res);
}
- int solveExtremY(float res[]) {
- float eqn[] = {Cy, By + By, Ay + Ay + Ay};
+ int solveExtremY(final float res[]) {
+ final float eqn[] = {Cy, By + By, Ay + Ay + Ay};
return solveQuad(eqn, res);
}
- int addBound(float bound[], int bc, float res[], int rc, float minX, float maxX, boolean changeId, int id) {
+ int addBound(final float bound[], int bc, final float res[], final int rc, final float minX, final float maxX, final boolean changeId, int id) {
for(int i = 0; i < rc; i++) {
- float t = res[i];
+ final float t = res[i];
if (t > -DELTA && t < 1 + DELTA) {
- float rx = t * (t * (t * Ax + Bx) + Cx);
+ final float rx = t * (t * (t * Ax + Bx) + Cx);
if (minX <= rx && rx <= maxX) {
bound[bc++] = t;
bound[bc++] = rx;
@@ -361,7 +361,7 @@ public class Crossing {
/**
* Returns how many times ray from point (x,y) cross line.
*/
- public static int crossLine(float x1, float y1, float x2, float y2, float x, float y) {
+ public static int crossLine(final float x1, final float y1, final float x2, final float y2, final float x, final float y) {
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < x2) ||
@@ -399,7 +399,7 @@ public class Crossing {
/**
* Returns how many times ray from point (x,y) cross quard curve
*/
- public static int crossQuad(float x1, float y1, float cx, float cy, float x2, float y2, float x, float y) {
+ public static int crossQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float x, final float y) {
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < cx && x < x2) ||
@@ -419,11 +419,11 @@ public class Crossing {
}
// INSIDE
- QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
- float px = x - x1;
- float py = y - y1;
- float res[] = new float[3];
- int rc = c.solvePoint(res, px);
+ final QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
+ final float px = x - x1;
+ final float py = y - y1;
+ final float res[] = new float[3];
+ final int rc = c.solvePoint(res, px);
return c.cross(res, rc, py, py);
}
@@ -431,7 +431,7 @@ public class Crossing {
/**
* Returns how many times ray from point (x,y) cross cubic curve
*/
- public static int crossCubic(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, float x, float y) {
+ public static int crossCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float x, final float y) {
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < cx1 && x < cx2 && x < x2) ||
@@ -451,18 +451,18 @@ public class Crossing {
}
// INSIDE
- CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
- float px = x - x1;
- float py = y - y1;
- float res[] = new float[3];
- int rc = c.solvePoint(res, px);
+ final CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
+ final float px = x - x1;
+ final float py = y - y1;
+ final float res[] = new float[3];
+ final int rc = c.solvePoint(res, px);
return c.cross(res, rc, py, py);
}
/**
* Returns how many times ray from point (x,y) cross path
*/
- public static int crossPath(PathIterator p, float x, float y) {
+ public static int crossPath(final PathIterator p, final float x, final float y) {
int cross = 0;
float mx, my, cx, cy;
mx = my = cx = cy = 0.0f;
@@ -513,7 +513,7 @@ public class Crossing {
/**
* Returns how many times ray from point (x,y) cross shape
*/
- public static int crossShape(Path2D s, float x, float y) {
+ public static int crossShape(final Path2D s, final float x, final float y) {
if (!s.getBounds2D().contains(x, y)) {
return 0;
}
@@ -523,14 +523,14 @@ public class Crossing {
/**
* Returns true if value enough small
*/
- public static boolean isZero(float val) {
+ public static boolean isZero(final float val) {
return -DELTA < val && val < DELTA;
}
/**
* Sort bound array
*/
- static void sortBound(float bound[], int bc) {
+ static void sortBound(final float bound[], final int bc) {
for(int i = 0; i < bc - 4; i += 4) {
int k = i;
for(int j = i + 4; j < bc; j += 4) {
@@ -558,7 +558,7 @@ public class Crossing {
/**
* Returns are bounds intersect or not intersect rectangle
*/
- static int crossBound(float bound[], int bc, float py1, float py2) {
+ static int crossBound(final float bound[], final int bc, final float py1, final float py2) {
// LEFT/RIGHT
if (bc == 0) {
@@ -590,7 +590,7 @@ public class Crossing {
sortBound(bound, bc);
boolean sign = bound[2] > py2;
for(int i = 6; i < bc; i += 4) {
- boolean sign2 = bound[i] > py2;
+ final boolean sign2 = bound[i] > py2;
if (sign != sign2 && bound[i + 1] != bound[i - 3]) {
return CROSSING;
}
@@ -603,7 +603,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross line or the are intersect
*/
- public static int intersectLine(float x1, float y1, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+ public static int intersectLine(final float x1, final float y1, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
// LEFT/RIGHT/UP
if ((rx2 < x1 && rx2 < x2) ||
@@ -631,9 +631,9 @@ public class Crossing {
bx1 = x2 < rx1 ? rx1 : x2;
bx2 = x1 < rx2 ? x1 : rx2;
}
- float k = (y2 - y1) / (x2 - x1);
- float by1 = k * (bx1 - x1) + y1;
- float by2 = k * (bx2 - x1) + y1;
+ final float k = (y2 - y1) / (x2 - x1);
+ final float by1 = k * (bx1 - x1) + y1;
+ final float by2 = k * (bx2 - x1) + y1;
// BOUND-UP
if (by1 < ry1 && by2 < ry1) {
@@ -672,7 +672,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross quad curve or the are intersect
*/
- public static int intersectQuad(float x1, float y1, float cx, float cy, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+ public static int intersectQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
// LEFT/RIGHT/UP ------------------------------------------------------
if ((rx2 < x1 && rx2 < cx && rx2 < x2) ||
@@ -691,15 +691,15 @@ public class Crossing {
}
// INSIDE -------------------------------------------------------------
- QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
- float px1 = rx1 - x1;
- float py1 = ry1 - y1;
- float px2 = rx2 - x1;
- float py2 = ry2 - y1;
-
- float res1[] = new float[3];
- float res2[] = new float[3];
- int rc1 = c.solvePoint(res1, px1);
+ final QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
+ final float px1 = rx1 - x1;
+ final float py1 = ry1 - y1;
+ final float px2 = rx2 - x1;
+ final float py2 = ry2 - y1;
+
+ final float res1[] = new float[3];
+ final float res2[] = new float[3];
+ final int rc1 = c.solvePoint(res1, px1);
int rc2 = c.solvePoint(res2, px2);
// INSIDE-LEFT/RIGHT
@@ -708,9 +708,9 @@ public class Crossing {
}
// Build bound --------------------------------------------------------
- float minX = px1 - DELTA;
- float maxX = px2 + DELTA;
- float bound[] = new float[28];
+ final float minX = px1 - DELTA;
+ final float maxX = px2 + DELTA;
+ final float bound[] = new float[28];
int bc = 0;
// Add roots
bc = c.addBound(bound, bc, res1, rc1, minX, maxX, false, 0);
@@ -733,7 +733,7 @@ public class Crossing {
}
// End build bound ----------------------------------------------------
- int cross = crossBound(bound, bc, py1, py2);
+ final int cross = crossBound(bound, bc, py1, py2);
if (cross != UNKNOWN) {
return cross;
}
@@ -743,7 +743,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross cubic curve or the are intersect
*/
- public static int intersectCubic(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+ public static int intersectCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
// LEFT/RIGHT/UP
if ((rx2 < x1 && rx2 < cx1 && rx2 < cx2 && rx2 < x2) ||
@@ -762,15 +762,15 @@ public class Crossing {
}
// INSIDE
- CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
- float px1 = rx1 - x1;
- float py1 = ry1 - y1;
- float px2 = rx2 - x1;
- float py2 = ry2 - y1;
-
- float res1[] = new float[3];
- float res2[] = new float[3];
- int rc1 = c.solvePoint(res1, px1);
+ final CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
+ final float px1 = rx1 - x1;
+ final float py1 = ry1 - y1;
+ final float px2 = rx2 - x1;
+ final float py2 = ry2 - y1;
+
+ final float res1[] = new float[3];
+ final float res2[] = new float[3];
+ final int rc1 = c.solvePoint(res1, px1);
int rc2 = c.solvePoint(res2, px2);
// LEFT/RIGHT
@@ -778,11 +778,11 @@ public class Crossing {
return 0;
}
- float minX = px1 - DELTA;
- float maxX = px2 + DELTA;
+ final float minX = px1 - DELTA;
+ final float maxX = px2 + DELTA;
// Build bound --------------------------------------------------------
- float bound[] = new float[40];
+ final float bound[] = new float[40];
int bc = 0;
// Add roots
bc = c.addBound(bound, bc, res1, rc1, minX, maxX, false, 0);
@@ -807,7 +807,7 @@ public class Crossing {
}
// End build bound ----------------------------------------------------
- int cross = crossBound(bound, bc, py1, py2);
+ final int cross = crossBound(bound, bc, py1, py2);
if (cross != UNKNOWN) {
return cross;
}
@@ -817,7 +817,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross path or the are intersect
*/
- public static int intersectPath(PathIterator p, float x, float y, float w, float h) {
+ public static int intersectPath(final PathIterator p, final float x, final float y, final float w, final float h) {
int cross = 0;
int count;
@@ -825,10 +825,10 @@ public class Crossing {
mx = my = cx = cy = 0.0f;
final float coords[] = new float[6];
- float rx1 = x;
- float ry1 = y;
- float rx2 = x + w;
- float ry2 = y + h;
+ final float rx1 = x;
+ final float ry1 = y;
+ final float rx2 = x + w;
+ final float ry2 = y + h;
while (!p.isDone()) {
count = 0;
@@ -879,7 +879,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross shape or the are intersect
*/
- public static int intersectShape(Path2D s, float x, float y, float w, float h) {
+ public static int intersectShape(final Path2D s, final float x, final float y, final float w, final float h) {
if (!s.getBounds2D().intersects2DRegion(x, y, w, h)) {
return 0;
}
@@ -889,14 +889,14 @@ public class Crossing {
/**
* Returns true if cross count correspond inside location for non zero path rule
*/
- public static boolean isInsideNonZero(int cross) {
+ public static boolean isInsideNonZero(final int cross) {
return cross != 0;
}
/**
* Returns true if cross count correspond inside location for even-odd path rule
*/
- public static boolean isInsideEvenOdd(int cross) {
+ public static boolean isInsideEvenOdd(final int cross) {
return (cross & 1) != 0;
}
}
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java b/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
index 55211b3f9..2c18e0834 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
@@ -26,7 +26,7 @@ public class IllegalPathStateException extends RuntimeException {
public IllegalPathStateException() {
}
- public IllegalPathStateException(String s) {
+ public IllegalPathStateException(final String s) {
super(s);
}
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java b/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
index 398a03fca..6e49607b7 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
@@ -23,7 +23,7 @@ public class NoninvertibleTransformException extends java.lang.Exception {
private static final long serialVersionUID = 6137225240503990466L;
- public NoninvertibleTransformException(String s) {
+ public NoninvertibleTransformException(final String s) {
super(s);
}
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
index a87c0a0a1..3b79c28b6 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
@@ -108,7 +108,7 @@ public final class Path2D implements Cloneable {
* Constructs a new GeneralPath.Iterator for given general path
* @param path - the source GeneralPath object
*/
- Iterator(Path2D path) {
+ Iterator(final Path2D path) {
this(path, null);
}
@@ -117,7 +117,7 @@ public final class Path2D implements Cloneable {
* @param path - the source GeneralPath object
* @param at - the AffineTransform object to apply rectangle path
*/
- Iterator(Path2D path, AffineTransform at) {
+ Iterator(final Path2D path, final AffineTransform at) {
this.p = path;
this.t = at;
}
@@ -138,12 +138,12 @@ public final class Path2D implements Cloneable {
}
@Override
- public int currentSegment(float[] coords) {
+ public int currentSegment(final float[] coords) {
if (isDone()) {
throw new NoSuchElementException(iteratorOutOfBounds);
}
- int type = p.types[typeIndex];
- int count = Path2D.pointShift[type];
+ final int type = p.types[typeIndex];
+ final int count = Path2D.pointShift[type];
System.arraycopy(p.points, pointIndex, coords, 0, count);
if (t != null) {
t.transform(coords, 0, coords, 0, count / 2);
@@ -158,24 +158,24 @@ public final class Path2D implements Cloneable {
this(WIND_NON_ZERO, BUFFER_SIZE);
}
- public Path2D(int rule) {
+ public Path2D(final int rule) {
this(rule, BUFFER_SIZE);
}
- public Path2D(int rule, int initialCapacity) {
+ public Path2D(final int rule, final int initialCapacity) {
setWindingRule(rule);
types = new byte[initialCapacity];
points = new float[initialCapacity * 2];
}
- public Path2D(Path2D path) {
+ public Path2D(final Path2D path) {
this(WIND_NON_ZERO, BUFFER_SIZE);
- PathIterator p = path.iterator(null);
+ final PathIterator p = path.iterator(null);
setWindingRule(p.getWindingRule());
append(p, false);
}
- public void setWindingRule(int rule) {
+ public void setWindingRule(final int rule) {
if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) {
throw new NoSuchElementException(invalidWindingRuleValue);
}
@@ -190,23 +190,23 @@ public final class Path2D implements Cloneable {
* Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.
* @param pointCount - the point count to be added in buffer
*/
- void checkBuf(int pointCount, boolean checkMove) {
+ void checkBuf(final int pointCount, final boolean checkMove) {
if (checkMove && typeSize == 0) {
throw new IllegalPathStateException("First segment should be SEG_MOVETO type");
}
if (typeSize == types.length) {
- byte tmp[] = new byte[typeSize + BUFFER_CAPACITY];
+ final byte tmp[] = new byte[typeSize + BUFFER_CAPACITY];
System.arraycopy(types, 0, tmp, 0, typeSize);
types = tmp;
}
if (pointSize + pointCount > points.length) {
- float tmp[] = new float[pointSize + Math.max(BUFFER_CAPACITY * 2, pointCount)];
+ final float tmp[] = new float[pointSize + Math.max(BUFFER_CAPACITY * 2, pointCount)];
System.arraycopy(points, 0, tmp, 0, pointSize);
points = tmp;
}
}
- public void moveTo(float x, float y) {
+ public void moveTo(final float x, final float y) {
if (typeSize > 0 && types[typeSize - 1] == PathIterator.SEG_MOVETO) {
points[pointSize - 2] = x;
points[pointSize - 1] = y;
@@ -218,14 +218,14 @@ public final class Path2D implements Cloneable {
}
}
- public void lineTo(float x, float y) {
+ public void lineTo(final float x, final float y) {
checkBuf(2, true);
types[typeSize++] = PathIterator.SEG_LINETO;
points[pointSize++] = x;
points[pointSize++] = y;
}
- public void quadTo(float x1, float y1, float x2, float y2) {
+ public void quadTo(final float x1, final float y1, final float x2, final float y2) {
checkBuf(4, true);
types[typeSize++] = PathIterator.SEG_QUADTO;
points[pointSize++] = x1;
@@ -234,7 +234,7 @@ public final class Path2D implements Cloneable {
points[pointSize++] = y2;
}
- public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) {
+ public void curveTo(final float x1, final float y1, final float x2, final float y2, final float x3, final float y3) {
checkBuf(6, true);
types[typeSize++] = PathIterator.SEG_CUBICTO;
points[pointSize++] = x1;
@@ -265,12 +265,12 @@ public final class Path2D implements Cloneable {
return "[size "+size()+", closed "+isClosed()+"]";
}
- public void append(Path2D path, boolean connect) {
- PathIterator p = path.iterator(null);
+ public void append(final Path2D path, final boolean connect) {
+ final PathIterator p = path.iterator(null);
append(p, connect);
}
- public void append(PathIterator path, boolean connect) {
+ public void append(final PathIterator path, boolean connect) {
while (!path.isDone()) {
final float coords[] = new float[6];
final int segmentType = path.currentSegment(coords);
@@ -315,7 +315,7 @@ public final class Path2D implements Cloneable {
if (types[typeSize - 1] == PathIterator.SEG_CLOSE) {
for (int i = typeSize - 2; i > 0; i--) {
- int type = types[i];
+ final int type = types[i];
if (type == PathIterator.SEG_MOVETO) {
break;
}
@@ -330,12 +330,12 @@ public final class Path2D implements Cloneable {
pointSize = 0;
}
- public void transform(AffineTransform t) {
+ public void transform(final AffineTransform t) {
t.transform(points, 0, points, 0, pointSize / 2);
}
- public Path2D createTransformedShape(AffineTransform t) {
- Path2D p = (Path2D)clone();
+ public Path2D createTransformedShape(final AffineTransform t) {
+ final Path2D p = (Path2D)clone();
if (t != null) {
p.transform(t);
}
@@ -351,8 +351,8 @@ public final class Path2D implements Cloneable {
ry1 = ry2 = points[i--];
rx1 = rx2 = points[i--];
while (i > 0) {
- float y = points[i--];
- float x = points[i--];
+ final float y = points[i--];
+ final float x = points[i--];
if (x < rx1) {
rx1 = x;
} else
@@ -375,36 +375,36 @@ public final class Path2D implements Cloneable {
* @param cross - the point cross count
* @return true if point is inside path, or false otherwise
*/
- boolean isInside(int cross) {
+ boolean isInside(final int cross) {
if (rule == WIND_NON_ZERO) {
return Crossing.isInsideNonZero(cross);
}
return Crossing.isInsideEvenOdd(cross);
}
- public boolean contains(float px, float py) {
+ public boolean contains(final float px, final float py) {
return isInside(Crossing.crossShape(this, px, py));
}
- public boolean contains(float rx, float ry, float rw, float rh) {
- int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
+ public boolean contains(final float rx, final float ry, final float rw, final float rh) {
+ final int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
return cross != Crossing.CROSSING && isInside(cross);
}
- public boolean intersects(float rx, float ry, float rw, float rh) {
- int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
+ public boolean intersects(final float rx, final float ry, final float rw, final float rh) {
+ final int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
return cross == Crossing.CROSSING || isInside(cross);
}
- public boolean contains(Vertex p) {
+ public boolean contains(final Vertex p) {
return contains(p.getX(), p.getY());
}
- public boolean contains(AABBox r) {
+ public boolean contains(final AABBox r) {
return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
}
- public boolean intersects(AABBox r) {
+ public boolean intersects(final AABBox r) {
return intersects(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
}
@@ -412,7 +412,7 @@ public final class Path2D implements Cloneable {
return new Iterator(this);
}
- public PathIterator iterator(AffineTransform t) {
+ public PathIterator iterator(final AffineTransform t) {
return new Iterator(this, t);
}
@@ -423,11 +423,11 @@ public final class Path2D implements Cloneable {
@Override
public Object clone() {
try {
- Path2D p = (Path2D) super.clone();
+ final Path2D p = (Path2D) super.clone();
p.types = types.clone();
p.points = points.clone();
return p;
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
throw new InternalError();
}
}