aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
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/opengl/awt/AWTTilePainter.java
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/opengl/awt/AWTTilePainter.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 1c1d2350a..a5f5b4702 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -83,11 +83,11 @@ public class AWTTilePainter {
private Graphics2D g2d = null;
private AffineTransform saveAT = null;
- public static void dumpHintsAndScale(Graphics2D g2d) {
+ public static void dumpHintsAndScale(final Graphics2D g2d) {
final RenderingHints rHints = g2d.getRenderingHints();
final Set<Entry<Object, Object>> rEntries = rHints.entrySet();
int count = 0;
- for(Iterator<Entry<Object, Object>> rEntryIter = rEntries.iterator(); rEntryIter.hasNext(); count++) {
+ for(final Iterator<Entry<Object, Object>> rEntryIter = rEntries.iterator(); rEntryIter.hasNext(); count++) {
final Entry<Object, Object> rEntry = rEntryIter.next();
System.err.println("Hint["+count+"]: "+rEntry.getKey()+" -> "+rEntry.getValue());
}
@@ -105,7 +105,7 @@ public class AWTTilePainter {
/**
* @return resulting number of samples by comparing w/ {@link #customNumSamples} and the caps-config, 0 if disabled
*/
- public int getNumSamples(GLCapabilitiesImmutable caps) {
+ public int getNumSamples(final GLCapabilitiesImmutable caps) {
if( 0 > customNumSamples ) {
return 0;
} else if( 0 < customNumSamples ) {
@@ -137,7 +137,7 @@ public class AWTTilePainter {
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param verbose
*/
- public AWTTilePainter(TileRenderer renderer, int componentCount, double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight, boolean verbose) {
+ public AWTTilePainter(final TileRenderer renderer, final int componentCount, final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight, final boolean verbose) {
this.renderer = renderer;
this.renderer.setGLEventListener(preTileGLEL, postTileGLEL);
this.componentCount = componentCount;
@@ -160,16 +160,16 @@ public class AWTTilePainter {
* @param flipVertical if <code>true</code>, the image will be flipped vertically (Default for OpenGL).
* @param originBottomLeft if <code>true</code>, the image's origin is on the bottom left (Default for OpenGL).
*/
- public void setGLOrientation(boolean flipVertical, boolean originBottomLeft) {
+ public void setGLOrientation(final boolean flipVertical, final boolean originBottomLeft) {
this.flipVertical = flipVertical;
this.originBottomLeft = originBottomLeft;
}
- private static Rectangle2D getClipBounds2D(Graphics2D g) {
+ private static Rectangle2D getClipBounds2D(final Graphics2D g) {
final Shape shape = g.getClip();
return null != shape ? shape.getBounds2D() : null;
}
- private static Rectangle2D clipNegative(Rectangle2D in) {
+ private static Rectangle2D clipNegative(final Rectangle2D in) {
if( null == in ) { return null; }
double x=in.getX(), y=in.getY(), width=in.getWidth(), height=in.getHeight();
if( 0 > x ) {
@@ -201,7 +201,7 @@ public class AWTTilePainter {
* @throws NoninvertibleTransformException if the {@link Graphics2D}'s {@link AffineTransform} {@link AffineTransform#invert() inversion} fails.
* Since inversion is tested before scaling the given {@link Graphics2D}, caller shall ignore the whole <i>term</i>.
*/
- public void setupGraphics2DAndClipBounds(Graphics2D g2d, int width, int height) throws NoninvertibleTransformException {
+ public void setupGraphics2DAndClipBounds(final Graphics2D g2d, final int width, final int height) throws NoninvertibleTransformException {
this.g2d = g2d;
saveAT = g2d.getTransform();
if( null == saveAT ) {
@@ -278,11 +278,11 @@ public class AWTTilePainter {
final GLEventListener preTileGLEL = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {}
+ public void init(final GLAutoDrawable drawable) {}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
if( null == tBuffer ) {
final int tWidth = renderer.getParam(TileRenderer.TR_TILE_WIDTH);
@@ -302,17 +302,17 @@ public class AWTTilePainter {
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
};
static int _counter = 0;
final GLEventListener postTileGLEL = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final DimensionImmutable cis = renderer.getClippedImageSize();
final int tWidth = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_WIDTH);
final int tHeight = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_HEIGHT);
@@ -337,7 +337,7 @@ public class AWTTilePainter {
final File fout = new File(fname);
try {
ImageIO.write(tBuffer.image, "png", fout);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
@@ -368,7 +368,7 @@ public class AWTTilePainter {
final File fout = new File(fname);
try {
ImageIO.write(dstImage, "png", fout);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
_counter++;
@@ -395,6 +395,6 @@ public class AWTTilePainter {
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
};
}