summaryrefslogtreecommitdiffstats
path: root/src/demos/j2d/CustomText.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-06-21 20:58:04 +0200
committerSven Gothel <[email protected]>2012-06-21 20:58:04 +0200
commitbe0ebf39ac48e904803ad35ad280dc6ecde03119 (patch)
tree877e5b6cb721d182cf6f5b6c7bb2d6d34dcef0fd /src/demos/j2d/CustomText.java
parent9c2d74736fdd723267aaf6f7a5018dd1bc882775 (diff)
Remove GLProfile.initSingleton(..) calls and JNLP argument 'NotFirstUIActionOnProcess'; Adapt to CapabilitiesChooser API/generics change; Misc
- Remove GLProfile.initSingleton(..) calls and JNLP argument 'NotFirstUIActionOnProcess' - Adapt to CapabilitiesChooser API/generics change - Cleanup some generics use .. etc
Diffstat (limited to 'src/demos/j2d/CustomText.java')
-rwxr-xr-xsrc/demos/j2d/CustomText.java21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/demos/j2d/CustomText.java b/src/demos/j2d/CustomText.java
index 3a68761..8405b6e 100755
--- a/src/demos/j2d/CustomText.java
+++ b/src/demos/j2d/CustomText.java
@@ -42,7 +42,6 @@ package demos.j2d;
import com.jogamp.opengl.util.awt.TextRenderer;
import com.jogamp.opengl.util.texture.Texture;
import com.jogamp.opengl.util.texture.TextureCoords;
-import com.jogamp.opengl.util.texture.TextureIO;
import com.jogamp.opengl.util.texture.awt.AWTTextureIO;
import demos.common.Demo;
import demos.util.FPSCounter;
@@ -69,7 +68,6 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
-import javax.media.opengl.GLProfile;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES1;
import javax.media.opengl.GL2;
@@ -87,13 +85,6 @@ import javax.swing.JPanel;
public class CustomText extends Demo {
public static void main(String[] args) {
- // set argument 'NotFirstUIActionOnProcess' in the JNLP's application-desc tag for example
- // <application-desc main-class="demos.j2d.TextCube"/>
- // <argument>NotFirstUIActionOnProcess</argument>
- // </application-desc>
- boolean firstUIActionOnProcess = 0==args.length || !args[0].equals("NotFirstUIActionOnProcess") ;
- GLProfile.initSingleton(firstUIActionOnProcess);
-
JFrame frame = new JFrame("Custom Text");
frame.getContentPane().setLayout(new BorderLayout());
@@ -131,7 +122,7 @@ public class CustomText extends Demo {
// Put a little physics on the text to make it look nicer
private static final float INIT_ANG_VEL_MAG = 0.3f;
private static final float INIT_VEL_MAG = 400.0f;
- private static final int DEFAULT_DROP_SHADOW_DIST = 20;
+ // private static final int DEFAULT_DROP_SHADOW_DIST = 20;
// Information about each piece of text
private static class TextInfo {
@@ -144,7 +135,7 @@ public class CustomText extends Demo {
String text;
}
- private List/*<TextInfo>*/ textInfo = new ArrayList/*<TextInfo>*/();
+ private List<TextInfo> textInfo = new ArrayList<TextInfo>();
private Time time;
private Texture backgroundTexture;
private TextRenderer renderer;
@@ -255,8 +246,8 @@ public class CustomText extends Demo {
// Update velocities and positions of all text
float deltaT = (float) time.deltaT();
Vec2f tmp = new Vec2f();
- for (Iterator iter = textInfo.iterator(); iter.hasNext(); ) {
- TextInfo info = (TextInfo) iter.next();
+ for (Iterator<TextInfo> iter = textInfo.iterator(); iter.hasNext(); ) {
+ TextInfo info = iter.next();
// Randomize things a little bit at run time
if (random.nextInt(1000) == 0) {
@@ -328,8 +319,8 @@ public class CustomText extends Demo {
gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
- for (Iterator iter = textInfo.iterator(); iter.hasNext(); ) {
- TextInfo info = (TextInfo) iter.next();
+ for (Iterator<TextInfo> iter = textInfo.iterator(); iter.hasNext(); ) {
+ TextInfo info = iter.next();
gl.glLoadIdentity();
gl.glTranslatef(info.position.x(),
info.position.y(),