aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/awt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-08 19:16:09 +0200
committerSven Gothel <[email protected]>2013-09-08 19:16:09 +0200
commitc9935d087350630f25046b5b757941fbef3a6044 (patch)
tree2658995f08c0fc6be3bc0640adbec65162765bf8 /src/jogl/classes/jogamp/opengl/awt
parentd0e0b963da223e00359cad194061f5a967b2caae (diff)
Add AWTTilePainter.dumpHintsAndScale(..), removing more duplicated code from GLCanvas/GLJPanel
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/awt')
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 8d07bdb8e..9aa6f3395 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -30,10 +30,14 @@ package jogamp.opengl.awt;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;
+import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.Map.Entry;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
@@ -62,6 +66,19 @@ public class AWTTilePainter {
private Graphics2D g2d = null;
private AffineTransform saveAT = null;
+ public static void dumpHintsAndScale(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++) {
+ final Entry<Object, Object> rEntry = rEntryIter.next();
+ System.err.println("Hint["+count+"]: "+rEntry.getKey()+" -> "+rEntry.getValue());
+ }
+ final AffineTransform aTrans = g2d.getTransform();
+ System.err.println(" scale "+aTrans.getScaleX()+" x "+aTrans.getScaleY());
+ System.err.println(" move "+aTrans.getTranslateX()+" x "+aTrans.getTranslateY());
+ }
+
/**
* Assumes a configured {@link TileRenderer}, i.e.
* an {@link TileRenderer#attachToAutoDrawable(GLAutoDrawable) attached}