From 3e1cb65022714a5f3e07a49cf151281e23f7b196 Mon Sep 17 00:00:00 2001 From: eteq Date: Thu, 18 Jan 2007 07:12:41 +0000 Subject: re-organized and built demos git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@37 83d24430-9974-4f80-8418-2cc3294053b9 --- .../classes/jgudemos/BasicGLJFrameDemo$1.class | Bin 0 -> 1470 bytes .../build/classes/jgudemos/BasicGLJFrameDemo.class | Bin 0 -> 732 bytes .../build/classes/jgudemos/FontDrawerDemo$1.class | Bin 0 -> 4118 bytes .../build/classes/jgudemos/FontDrawerDemo$2.class | Bin 0 -> 4087 bytes demos/build/classes/jgudemos/FontDrawerDemo.class | Bin 0 -> 2382 bytes demos/docs/allclasses-frame.html | 32 +++ demos/docs/allclasses-noframe.html | 32 +++ demos/docs/constant-values.html | 140 +++++++++++ demos/docs/deprecated-list.html | 140 +++++++++++ demos/docs/help-doc.html | 211 ++++++++++++++++ demos/docs/index-files/index-1.html | 139 +++++++++++ demos/docs/index-files/index-2.html | 139 +++++++++++ demos/docs/index-files/index-3.html | 136 +++++++++++ demos/docs/index-files/index-4.html | 143 +++++++++++ demos/docs/index.html | 34 +++ demos/docs/jgudemos/BasicGLJFrameDemo.html | 247 +++++++++++++++++++ demos/docs/jgudemos/FontDrawerDemo.html | 256 ++++++++++++++++++++ .../docs/jgudemos/class-use/BasicGLJFrameDemo.html | 138 +++++++++++ demos/docs/jgudemos/class-use/FontDrawerDemo.html | 138 +++++++++++ demos/docs/jgudemos/package-frame.html | 34 +++ demos/docs/jgudemos/package-summary.html | 156 ++++++++++++ demos/docs/jgudemos/package-tree.html | 144 +++++++++++ demos/docs/jgudemos/package-use.html | 138 +++++++++++ demos/docs/overview-tree.html | 146 ++++++++++++ demos/docs/package-list | 1 + demos/docs/resources/inherit.gif | Bin 0 -> 57 bytes demos/docs/stylesheet.css | 29 +++ demos/jgudemos/BasicGLJFrameDemo.java | 75 ------ demos/jgudemos/FontDrawerDemo.java | 264 --------------------- demos/src/jgudemos/BasicGLJFrameDemo.java | 75 ++++++ demos/src/jgudemos/FontDrawerDemo.java | 264 +++++++++++++++++++++ 31 files changed, 2912 insertions(+), 339 deletions(-) create mode 100644 demos/build/classes/jgudemos/BasicGLJFrameDemo$1.class create mode 100644 demos/build/classes/jgudemos/BasicGLJFrameDemo.class create mode 100644 demos/build/classes/jgudemos/FontDrawerDemo$1.class create mode 100644 demos/build/classes/jgudemos/FontDrawerDemo$2.class create mode 100644 demos/build/classes/jgudemos/FontDrawerDemo.class create mode 100644 demos/docs/allclasses-frame.html create mode 100644 demos/docs/allclasses-noframe.html create mode 100644 demos/docs/constant-values.html create mode 100644 demos/docs/deprecated-list.html create mode 100644 demos/docs/help-doc.html create mode 100644 demos/docs/index-files/index-1.html create mode 100644 demos/docs/index-files/index-2.html create mode 100644 demos/docs/index-files/index-3.html create mode 100644 demos/docs/index-files/index-4.html create mode 100644 demos/docs/index.html create mode 100644 demos/docs/jgudemos/BasicGLJFrameDemo.html create mode 100644 demos/docs/jgudemos/FontDrawerDemo.html create mode 100644 demos/docs/jgudemos/class-use/BasicGLJFrameDemo.html create mode 100644 demos/docs/jgudemos/class-use/FontDrawerDemo.html create mode 100644 demos/docs/jgudemos/package-frame.html create mode 100644 demos/docs/jgudemos/package-summary.html create mode 100644 demos/docs/jgudemos/package-tree.html create mode 100644 demos/docs/jgudemos/package-use.html create mode 100644 demos/docs/overview-tree.html create mode 100644 demos/docs/package-list create mode 100644 demos/docs/resources/inherit.gif create mode 100644 demos/docs/stylesheet.css delete mode 100644 demos/jgudemos/BasicGLJFrameDemo.java delete mode 100644 demos/jgudemos/FontDrawerDemo.java create mode 100644 demos/src/jgudemos/BasicGLJFrameDemo.java create mode 100644 demos/src/jgudemos/FontDrawerDemo.java (limited to 'demos') diff --git a/demos/build/classes/jgudemos/BasicGLJFrameDemo$1.class b/demos/build/classes/jgudemos/BasicGLJFrameDemo$1.class new file mode 100644 index 0000000..953bfb5 Binary files /dev/null and b/demos/build/classes/jgudemos/BasicGLJFrameDemo$1.class differ diff --git a/demos/build/classes/jgudemos/BasicGLJFrameDemo.class b/demos/build/classes/jgudemos/BasicGLJFrameDemo.class new file mode 100644 index 0000000..e7084ba Binary files /dev/null and b/demos/build/classes/jgudemos/BasicGLJFrameDemo.class differ diff --git a/demos/build/classes/jgudemos/FontDrawerDemo$1.class b/demos/build/classes/jgudemos/FontDrawerDemo$1.class new file mode 100644 index 0000000..537eae7 Binary files /dev/null and b/demos/build/classes/jgudemos/FontDrawerDemo$1.class differ diff --git a/demos/build/classes/jgudemos/FontDrawerDemo$2.class b/demos/build/classes/jgudemos/FontDrawerDemo$2.class new file mode 100644 index 0000000..1d80f7e Binary files /dev/null and b/demos/build/classes/jgudemos/FontDrawerDemo$2.class differ diff --git a/demos/build/classes/jgudemos/FontDrawerDemo.class b/demos/build/classes/jgudemos/FontDrawerDemo.class new file mode 100644 index 0000000..4b9b8f0 Binary files /dev/null and b/demos/build/classes/jgudemos/FontDrawerDemo.class differ diff --git a/demos/docs/allclasses-frame.html b/demos/docs/allclasses-frame.html new file mode 100644 index 0000000..971848c --- /dev/null +++ b/demos/docs/allclasses-frame.html @@ -0,0 +1,32 @@ + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
BasicGLJFrameDemo +
+FontDrawerDemo +
+
+ + + diff --git a/demos/docs/allclasses-noframe.html b/demos/docs/allclasses-noframe.html new file mode 100644 index 0000000..5498c6a --- /dev/null +++ b/demos/docs/allclasses-noframe.html @@ -0,0 +1,32 @@ + + + + + + +All Classes + + + + + + + + + + +All Classes +
+ + + + + +
BasicGLJFrameDemo +
+FontDrawerDemo +
+
+ + + diff --git a/demos/docs/constant-values.html b/demos/docs/constant-values.html new file mode 100644 index 0000000..be719b4 --- /dev/null +++ b/demos/docs/constant-values.html @@ -0,0 +1,140 @@ + + + + + + +Constant Field Values + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/deprecated-list.html b/demos/docs/deprecated-list.html new file mode 100644 index 0000000..d0f9c2e --- /dev/null +++ b/demos/docs/deprecated-list.html @@ -0,0 +1,140 @@ + + + + + + +Deprecated List + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+Contents + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/help-doc.html b/demos/docs/help-doc.html new file mode 100644 index 0000000..3e84278 --- /dev/null +++ b/demos/docs/help-doc.html @@ -0,0 +1,211 @@ + + + + + + +API Help + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+ +

+Annotation Type

+
+ +

+Each annotation type has its own separate page with the following sections:

+
+ +

+Enum

+
+ +

+Each enum has its own separate page with the following sections:

+
+

+Use

+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object. +
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+

+Constant Field Values

+The Constant Field Values page lists the static final fields and their values. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/index-files/index-1.html b/demos/docs/index-files/index-1.html new file mode 100644 index 0000000..949b6f7 --- /dev/null +++ b/demos/docs/index-files/index-1.html @@ -0,0 +1,139 @@ + + + + + + +B-Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +B F J M
+

+B

+
+
BasicGLJFrameDemo - Class in jgudemos
 
BasicGLJFrameDemo() - +Constructor for class jgudemos.BasicGLJFrameDemo +
  +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +B F J M
+ + + diff --git a/demos/docs/index-files/index-2.html b/demos/docs/index-files/index-2.html new file mode 100644 index 0000000..58ea474 --- /dev/null +++ b/demos/docs/index-files/index-2.html @@ -0,0 +1,139 @@ + + + + + + +F-Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +B F J M
+

+F

+
+
FontDrawerDemo - Class in jgudemos
This Demo application uses the Lighting class and the FontDrawer class to render 3D text into a GLJFrame.
FontDrawerDemo() - +Constructor for class jgudemos.FontDrawerDemo +
  +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +B F J M
+ + + diff --git a/demos/docs/index-files/index-3.html b/demos/docs/index-files/index-3.html new file mode 100644 index 0000000..8967bca --- /dev/null +++ b/demos/docs/index-files/index-3.html @@ -0,0 +1,136 @@ + + + + + + +J-Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +B F J M
+

+J

+
+
jgudemos - package jgudemos
 
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +B F J M
+ + + diff --git a/demos/docs/index-files/index-4.html b/demos/docs/index-files/index-4.html new file mode 100644 index 0000000..05c54f2 --- /dev/null +++ b/demos/docs/index-files/index-4.html @@ -0,0 +1,143 @@ + + + + + + +M-Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +B F J M
+

+M

+
+
main(String[]) - +Static method in class jgudemos.BasicGLJFrameDemo +
  +
main(String[]) - +Static method in class jgudemos.FontDrawerDemo +
Generates GLJFrame + Generates a GLJFrame with a FontDrawer demo. +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +B F J M
+ + + diff --git a/demos/docs/index.html b/demos/docs/index.html new file mode 100644 index 0000000..260b2d4 --- /dev/null +++ b/demos/docs/index.html @@ -0,0 +1,34 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="jgudemos/package-summary.html">Non-frame version.</A> + + + diff --git a/demos/docs/jgudemos/BasicGLJFrameDemo.html b/demos/docs/jgudemos/BasicGLJFrameDemo.html new file mode 100644 index 0000000..d4b3635 --- /dev/null +++ b/demos/docs/jgudemos/BasicGLJFrameDemo.html @@ -0,0 +1,247 @@ + + + + + + +BasicGLJFrameDemo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +jgudemos +
+Class BasicGLJFrameDemo

+
+java.lang.Object
+  extended by jgudemos.BasicGLJFrameDemo
+
+
+
+
public class BasicGLJFrameDemo
extends java.lang.Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
BasicGLJFrameDemo() + +
+           
+  + + + + + + + + + + + +
+Method Summary
+static voidmain(java.lang.String[] args) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+BasicGLJFrameDemo

+
+public BasicGLJFrameDemo()
+
+
+ + + + + + + + +
+Method Detail
+ +

+main

+
+public static void main(java.lang.String[] args)
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/jgudemos/FontDrawerDemo.html b/demos/docs/jgudemos/FontDrawerDemo.html new file mode 100644 index 0000000..2b317d5 --- /dev/null +++ b/demos/docs/jgudemos/FontDrawerDemo.html @@ -0,0 +1,256 @@ + + + + + + +FontDrawerDemo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +jgudemos +
+Class FontDrawerDemo

+
+java.lang.Object
+  extended by jgudemos.FontDrawerDemo
+
+
+
+
public class FontDrawerDemo
extends java.lang.Object
+ + +

+This Demo application uses the Lighting class and the FontDrawer class to render 3D text into a GLJFrame. + See the console for keyboard commands and command line option instructions. +

+ +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
FontDrawerDemo() + +
+           
+  + + + + + + + + + + + +
+Method Summary
+static voidmain(java.lang.String[] args) + +
+          Generates GLJFrame + Generates a GLJFrame with a FontDrawer demo.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+FontDrawerDemo

+
+public FontDrawerDemo()
+
+
+ + + + + + + + +
+Method Detail
+ +

+main

+
+public static void main(java.lang.String[] args)
+
+
Generates GLJFrame + Generates a GLJFrame with a FontDrawer demo. Console output describes input. +

+

+
Parameters:
args - Command Line argument order: textDepth xRotspeed yRotspeed zRotspeed filled flatnormal
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/jgudemos/class-use/BasicGLJFrameDemo.html b/demos/docs/jgudemos/class-use/BasicGLJFrameDemo.html new file mode 100644 index 0000000..6bf4dc5 --- /dev/null +++ b/demos/docs/jgudemos/class-use/BasicGLJFrameDemo.html @@ -0,0 +1,138 @@ + + + + + + +Uses of Class jgudemos.BasicGLJFrameDemo + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
jgudemos.BasicGLJFrameDemo

+
+No usage of jgudemos.BasicGLJFrameDemo +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/jgudemos/class-use/FontDrawerDemo.html b/demos/docs/jgudemos/class-use/FontDrawerDemo.html new file mode 100644 index 0000000..e053733 --- /dev/null +++ b/demos/docs/jgudemos/class-use/FontDrawerDemo.html @@ -0,0 +1,138 @@ + + + + + + +Uses of Class jgudemos.FontDrawerDemo + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
jgudemos.FontDrawerDemo

+
+No usage of jgudemos.FontDrawerDemo +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/jgudemos/package-frame.html b/demos/docs/jgudemos/package-frame.html new file mode 100644 index 0000000..856c636 --- /dev/null +++ b/demos/docs/jgudemos/package-frame.html @@ -0,0 +1,34 @@ + + + + + + +jgudemos + + + + + + + + + + + +jgudemos + + + + +
+Classes  + +
+BasicGLJFrameDemo +
+FontDrawerDemo
+ + + + diff --git a/demos/docs/jgudemos/package-summary.html b/demos/docs/jgudemos/package-summary.html new file mode 100644 index 0000000..3ee0939 --- /dev/null +++ b/demos/docs/jgudemos/package-summary.html @@ -0,0 +1,156 @@ + + + + + + +jgudemos + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package jgudemos +

+ + + + + + + + + + + + + +
+Class Summary
BasicGLJFrameDemo 
FontDrawerDemoThis Demo application uses the Lighting class and the FontDrawer class to render 3D text into a GLJFrame.
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/jgudemos/package-tree.html b/demos/docs/jgudemos/package-tree.html new file mode 100644 index 0000000..d5d6f85 --- /dev/null +++ b/demos/docs/jgudemos/package-tree.html @@ -0,0 +1,144 @@ + + + + + + +jgudemos Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package jgudemos +

+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/jgudemos/package-use.html b/demos/docs/jgudemos/package-use.html new file mode 100644 index 0000000..2e2e3d0 --- /dev/null +++ b/demos/docs/jgudemos/package-use.html @@ -0,0 +1,138 @@ + + + + + + +Uses of Package jgudemos + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
jgudemos

+
+No usage of jgudemos +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/overview-tree.html b/demos/docs/overview-tree.html new file mode 100644 index 0000000..eb16ee6 --- /dev/null +++ b/demos/docs/overview-tree.html @@ -0,0 +1,146 @@ + + + + + + +Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
jgudemos
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/demos/docs/package-list b/demos/docs/package-list new file mode 100644 index 0000000..516b214 --- /dev/null +++ b/demos/docs/package-list @@ -0,0 +1 @@ +jgudemos diff --git a/demos/docs/resources/inherit.gif b/demos/docs/resources/inherit.gif new file mode 100644 index 0000000..c814867 Binary files /dev/null and b/demos/docs/resources/inherit.gif differ diff --git a/demos/docs/stylesheet.css b/demos/docs/stylesheet.css new file mode 100644 index 0000000..14c3737 --- /dev/null +++ b/demos/docs/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff --git a/demos/jgudemos/BasicGLJFrameDemo.java b/demos/jgudemos/BasicGLJFrameDemo.java deleted file mode 100644 index e7d1858..0000000 --- a/demos/jgudemos/BasicGLJFrameDemo.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2007 Erik Tollerud (erik.tollerud@gmail.com) All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * The names of Erik Tollerud, Sun Microsystems, Inc. or the names of - * contributors may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * This software is provided "AS IS," without a warranty of any kind. ALL - * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, - * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ERIK TOLLERUD, - * SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR - * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR - * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL ERIK - * TOLLERUD, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT - * OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR - * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, - * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF ERIK - * TOLLERUD OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed or intended for use - * in the design, construction, operation or maintenance of any nuclear - * facility. - */ - -package jgudemos; - -import net.java.joglutils.*; -import javax.media.opengl.*; - -/** - * - * @author Erik J. Tollerud - * @created January 12, 2007 - */ -public class BasicGLJFrameDemo { - - public static void main(String[] args) { - GLJFrame gljf = new GLJFrame(new GLEventListener() { - public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { - } - - public void init(GLAutoDrawable drawable) { - } - - public void display(GLAutoDrawable drawable) { - GL gl = drawable.getGL(); - gl.glColor3f(1.0f,0.323f,0.8f); - gl.glBegin(GL.GL_TRIANGLE_STRIP); - gl.glVertex2d(0,0); - gl.glVertex2d(0.5,1.0); - gl.glVertex2d(-0.3,-0.9); - gl.glEnd(); - } - - public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { - } - - }); - gljf.setDefaultCloseOperation(gljf.EXIT_ON_CLOSE); - gljf.setVisible(true); - } - -} diff --git a/demos/jgudemos/FontDrawerDemo.java b/demos/jgudemos/FontDrawerDemo.java deleted file mode 100644 index 301c8c9..0000000 --- a/demos/jgudemos/FontDrawerDemo.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2007 Erik Tollerud (erik.tollerud@gmail.com) All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * - Redistribution of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistribution in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * The names of Erik Tollerud, Sun Microsystems, Inc. or the names of - * contributors may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * This software is provided "AS IS," without a warranty of any kind. ALL - * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, - * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ERIK TOLLERUD, - * SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR - * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR - * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL ERIK - * TOLLERUD, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT - * OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR - * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, - * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF ERIK - * TOLLERUD OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed or intended for use - * in the design, construction, operation or maintenance of any nuclear - * facility. - */ - -package jgudemos; - -import net.java.joglutils.jogltext.*; -import java.awt.geom.*; -import java.awt.font.*; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.media.opengl.*; -import javax.media.opengl.glu.*; -import com.sun.opengl.util.Animator; - -/** - * This Demo application uses the Lighting class and the FontDrawer class to render 3D text into a GLJFrame. - * See the console for keyboard commands and command line option instructions. - * @author Erik J. Tollerud - * @created January 12, 2007 - */ -public class FontDrawerDemo { - - /** - * Generates {@link net.java.joglutils.GLJFrame} - * Generates a GLJFrame with a FontDrawer demo. Console output describes input. - * @param args Command Line argument order: textDepth xRotspeed yRotspeed zRotspeed filled flatnormal - * - */ - - - - public static void main(String[] args) { - final float[] rotSteps = {0.0f, 0.3f, 0.0f}; - - System.out.println("Option Command line argument order (first 4 numerical, last 2 boolean)\ntextDepth xRotspeed yRotspeed zRotspeed filled flatnormal"); - System.out.println("Keyboard Inputs (case sensitive)\n" + - "r: toggle rotation\n" + - "R: change rotation speeds\n" + - "n: toggle flat normals\n" + - "f: toggle filled text\n" + - "t: edit text\n" + - ": decrease/increase text depth\n" + - "F: change font\n" + - "s: resize font"); - final String[] argsFin = args; - Font font = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts()[5]; - final FontDrawer dttf = new FontDrawer(font); - final StringBuffer upperStr = new StringBuffer("0,0"); - final StringBuffer lowerStr = new StringBuffer("-1,-1"); - - GLEventListener listener = new GLEventListener() { - GLU glu; - float xrot,yrot,zrot; - float dpth = 0.2f; - boolean filled = true, fnorm = true; - net.java.joglutils.lighting.Light lt; - net.java.joglutils.lighting.Material mt; - - - public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { - } - - public void init(GLAutoDrawable drawable) { - drawable.setGL(new DebugGL(drawable.getGL())); - glu = new GLU(); - switch(argsFin.length) { - case 6: - fnorm = Boolean.parseBoolean(argsFin[5]); - case 5: - filled = Boolean.parseBoolean(argsFin[4]); - case 4: - rotSteps[2] = Float.parseFloat(argsFin[3]); - case 3: - rotSteps[1] = Float.parseFloat(argsFin[2]); - case 2: - rotSteps[0] = Float.parseFloat(argsFin[1]); - case 1: - dpth = Float.parseFloat(argsFin[0]); - } - dttf.setDepth(dpth); - dttf.setFill(filled); - dttf.setFlatNormals(fnorm); - - xrot = 0;yrot = 0;zrot = 0; - GL gl = drawable.getGL(); - lt = new net.java.joglutils.lighting.Light(gl); - //mt = new net.java.joglutils.lighting.Material(gl); - - - lt.setLightPosition(0,0,1); - lt.enable(); - lt.apply(); - //mt.apply(); - gl.glColorMaterial( GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE ) ; - - gl.glEnable(GL.GL_DEPTH_TEST); - gl.glEnable(GL.GL_LIGHTING); - gl.glEnable(GL.GL_NORMALIZE); - - gl.glClearColor(0.3f,0.5f,0.2f,0); - } - - public void drawAxis(GL gl) { - gl.glDisable(GL.GL_LIGHTING); - gl.glBegin(GL.GL_LINES); - gl.glColor3f(1,0,0); - gl.glVertex3i(0,0,0); - gl.glVertex3i(10,0,0); - gl.glColor3f(0,1,0); - gl.glVertex3i(0,0,0); - gl.glVertex3i(0,10,0); - gl.glColor3f(0,0,1); - gl.glVertex3i(0,0,0); - gl.glVertex3i(0,0,10); - gl.glEnd(); - gl.glEnable(GL.GL_LIGHTING); - } - - public void display(GLAutoDrawable drawable) { - GL gl = drawable.getGL(); - gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); - - gl.glMatrixMode(GL.GL_PROJECTION); - gl.glLoadIdentity(); - glu.gluPerspective(90,1,0.001,10); - //gl.glFrustum(-1.5f,1.5f,-1.5f,1.5f,1,5); - //gl.glOrtho(-5,5,-5,5,-5,5); - - gl.glMatrixMode(GL.GL_MODELVIEW); - gl.glLoadIdentity(); - glu.gluLookAt(0,0,2,0,0,0,0,1,0); - //drawAxis(gl); - gl.glRotatef(xrot,1.0f,0,0); - gl.glRotatef(yrot,0,1.0f,0); - gl.glRotatef(zrot,0,0,1.0f); - xrot+=rotSteps[0]; - yrot+=rotSteps[1]; - zrot+=rotSteps[2]; - - - drawAxis(gl); - dttf.drawString(upperStr.toString(),glu,gl); - dttf.drawString(lowerStr.toString(),glu,gl,-0.8f,-0.8f,0); - } - - public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { - } - - }; - final net.java.joglutils.GLJFrame gljf = new net.java.joglutils.GLJFrame("FontDrawerDemo", listener, 600, 600); - gljf.setDefaultCloseOperation(gljf.EXIT_ON_CLOSE); - gljf.addKeyListener(new java.awt.event.KeyAdapter() { - - public void keyPressed(KeyEvent e) { - switch (e.getKeyChar()) { - case 'f': - FontDrawer fd = dttf; - dttf.setFill(!dttf.isFill()); - break; - case 'n': - dttf.setFlatNormals(!dttf.isFlatNormals()); - break; - case 'r': - Animator anim = gljf.getAnimator(); - if(anim.isAnimating()) - anim.stop(); - else - anim.start(); - break; - case 'R': - //TODO:change rotation speed - String strRes; - strRes = JOptionPane.showInputDialog("X Rotation Speed?",Float.toString(rotSteps[0])); - if (strRes != null) { - rotSteps[0] = Float.parseFloat(strRes); - strRes = JOptionPane.showInputDialog("Y Rotation Speed?",Float.toString(rotSteps[1])); - if (strRes != null) { - rotSteps[1] = Float.parseFloat(strRes); - strRes = JOptionPane.showInputDialog("Z Rotation Speed?",Float.toString(rotSteps[2])); - if (strRes != null) - rotSteps[2] = Float.parseFloat(strRes); - } - } - break; - case '>': - case '.': - float depthStep = dttf.getFont().getSize()/20.0f; - dttf.setDepth(dttf.getDepth() + depthStep); - break; - case '<': - case ',': - depthStep = dttf.getFont().getSize()/20.0f; - dttf.setDepth(dttf.getDepth() - depthStep); - break; - case 't': - case 'T': - String up = JOptionPane.showInputDialog("Upper Text:",upperStr.toString()); - upperStr.delete(0,upperStr.length()); - upperStr.append(up); - String dn = JOptionPane.showInputDialog("Lower Text:",lowerStr.toString()); - lowerStr.delete(0,lowerStr.length()); - lowerStr.append(dn); - break; - case 'F': - Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); - - JPanel pan = new JPanel(); - JComboBox cb = new JComboBox(); - for (Font f : fonts) - cb.addItem(f); - cb.setSelectedItem(dttf.getFont()); - pan.add(cb); - net.java.joglutils.JPanelDialog jpd = new net.java.joglutils.JPanelDialog("Choose Font",pan); - if (jpd.showAsModal()) - dttf.setFont((Font)cb.getSelectedItem()); - break; - case 's': - Font currFont = dttf.getFont(); - String resultStr = JOptionPane.showInputDialog("Font Size?",Integer.toString(currFont.getSize())); - float targSize = Float.parseFloat(resultStr); - dttf.setFont(currFont.deriveFont(currFont.getStyle(),targSize)); - break; - } - gljf.repaint(); - } - }); - gljf.generateAnimator(); - gljf.setVisible(true); - } -} diff --git a/demos/src/jgudemos/BasicGLJFrameDemo.java b/demos/src/jgudemos/BasicGLJFrameDemo.java new file mode 100644 index 0000000..e7d1858 --- /dev/null +++ b/demos/src/jgudemos/BasicGLJFrameDemo.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2007 Erik Tollerud (erik.tollerud@gmail.com) All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * The names of Erik Tollerud, Sun Microsystems, Inc. or the names of + * contributors may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ERIK TOLLERUD, + * SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL ERIK + * TOLLERUD, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT + * OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF ERIK + * TOLLERUD OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed or intended for use + * in the design, construction, operation or maintenance of any nuclear + * facility. + */ + +package jgudemos; + +import net.java.joglutils.*; +import javax.media.opengl.*; + +/** + * + * @author Erik J. Tollerud + * @created January 12, 2007 + */ +public class BasicGLJFrameDemo { + + public static void main(String[] args) { + GLJFrame gljf = new GLJFrame(new GLEventListener() { + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { + } + + public void init(GLAutoDrawable drawable) { + } + + public void display(GLAutoDrawable drawable) { + GL gl = drawable.getGL(); + gl.glColor3f(1.0f,0.323f,0.8f); + gl.glBegin(GL.GL_TRIANGLE_STRIP); + gl.glVertex2d(0,0); + gl.glVertex2d(0.5,1.0); + gl.glVertex2d(-0.3,-0.9); + gl.glEnd(); + } + + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { + } + + }); + gljf.setDefaultCloseOperation(gljf.EXIT_ON_CLOSE); + gljf.setVisible(true); + } + +} diff --git a/demos/src/jgudemos/FontDrawerDemo.java b/demos/src/jgudemos/FontDrawerDemo.java new file mode 100644 index 0000000..301c8c9 --- /dev/null +++ b/demos/src/jgudemos/FontDrawerDemo.java @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2007 Erik Tollerud (erik.tollerud@gmail.com) All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * The names of Erik Tollerud, Sun Microsystems, Inc. or the names of + * contributors may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ERIK TOLLERUD, + * SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL ERIK + * TOLLERUD, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT + * OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF ERIK + * TOLLERUD OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed or intended for use + * in the design, construction, operation or maintenance of any nuclear + * facility. + */ + +package jgudemos; + +import net.java.joglutils.jogltext.*; +import java.awt.geom.*; +import java.awt.font.*; +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import javax.media.opengl.*; +import javax.media.opengl.glu.*; +import com.sun.opengl.util.Animator; + +/** + * This Demo application uses the Lighting class and the FontDrawer class to render 3D text into a GLJFrame. + * See the console for keyboard commands and command line option instructions. + * @author Erik J. Tollerud + * @created January 12, 2007 + */ +public class FontDrawerDemo { + + /** + * Generates {@link net.java.joglutils.GLJFrame} + * Generates a GLJFrame with a FontDrawer demo. Console output describes input. + * @param args Command Line argument order: textDepth xRotspeed yRotspeed zRotspeed filled flatnormal + * + */ + + + + public static void main(String[] args) { + final float[] rotSteps = {0.0f, 0.3f, 0.0f}; + + System.out.println("Option Command line argument order (first 4 numerical, last 2 boolean)\ntextDepth xRotspeed yRotspeed zRotspeed filled flatnormal"); + System.out.println("Keyboard Inputs (case sensitive)\n" + + "r: toggle rotation\n" + + "R: change rotation speeds\n" + + "n: toggle flat normals\n" + + "f: toggle filled text\n" + + "t: edit text\n" + + ": decrease/increase text depth\n" + + "F: change font\n" + + "s: resize font"); + final String[] argsFin = args; + Font font = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts()[5]; + final FontDrawer dttf = new FontDrawer(font); + final StringBuffer upperStr = new StringBuffer("0,0"); + final StringBuffer lowerStr = new StringBuffer("-1,-1"); + + GLEventListener listener = new GLEventListener() { + GLU glu; + float xrot,yrot,zrot; + float dpth = 0.2f; + boolean filled = true, fnorm = true; + net.java.joglutils.lighting.Light lt; + net.java.joglutils.lighting.Material mt; + + + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { + } + + public void init(GLAutoDrawable drawable) { + drawable.setGL(new DebugGL(drawable.getGL())); + glu = new GLU(); + switch(argsFin.length) { + case 6: + fnorm = Boolean.parseBoolean(argsFin[5]); + case 5: + filled = Boolean.parseBoolean(argsFin[4]); + case 4: + rotSteps[2] = Float.parseFloat(argsFin[3]); + case 3: + rotSteps[1] = Float.parseFloat(argsFin[2]); + case 2: + rotSteps[0] = Float.parseFloat(argsFin[1]); + case 1: + dpth = Float.parseFloat(argsFin[0]); + } + dttf.setDepth(dpth); + dttf.setFill(filled); + dttf.setFlatNormals(fnorm); + + xrot = 0;yrot = 0;zrot = 0; + GL gl = drawable.getGL(); + lt = new net.java.joglutils.lighting.Light(gl); + //mt = new net.java.joglutils.lighting.Material(gl); + + + lt.setLightPosition(0,0,1); + lt.enable(); + lt.apply(); + //mt.apply(); + gl.glColorMaterial( GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE ) ; + + gl.glEnable(GL.GL_DEPTH_TEST); + gl.glEnable(GL.GL_LIGHTING); + gl.glEnable(GL.GL_NORMALIZE); + + gl.glClearColor(0.3f,0.5f,0.2f,0); + } + + public void drawAxis(GL gl) { + gl.glDisable(GL.GL_LIGHTING); + gl.glBegin(GL.GL_LINES); + gl.glColor3f(1,0,0); + gl.glVertex3i(0,0,0); + gl.glVertex3i(10,0,0); + gl.glColor3f(0,1,0); + gl.glVertex3i(0,0,0); + gl.glVertex3i(0,10,0); + gl.glColor3f(0,0,1); + gl.glVertex3i(0,0,0); + gl.glVertex3i(0,0,10); + gl.glEnd(); + gl.glEnable(GL.GL_LIGHTING); + } + + public void display(GLAutoDrawable drawable) { + GL gl = drawable.getGL(); + gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); + + gl.glMatrixMode(GL.GL_PROJECTION); + gl.glLoadIdentity(); + glu.gluPerspective(90,1,0.001,10); + //gl.glFrustum(-1.5f,1.5f,-1.5f,1.5f,1,5); + //gl.glOrtho(-5,5,-5,5,-5,5); + + gl.glMatrixMode(GL.GL_MODELVIEW); + gl.glLoadIdentity(); + glu.gluLookAt(0,0,2,0,0,0,0,1,0); + //drawAxis(gl); + gl.glRotatef(xrot,1.0f,0,0); + gl.glRotatef(yrot,0,1.0f,0); + gl.glRotatef(zrot,0,0,1.0f); + xrot+=rotSteps[0]; + yrot+=rotSteps[1]; + zrot+=rotSteps[2]; + + + drawAxis(gl); + dttf.drawString(upperStr.toString(),glu,gl); + dttf.drawString(lowerStr.toString(),glu,gl,-0.8f,-0.8f,0); + } + + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { + } + + }; + final net.java.joglutils.GLJFrame gljf = new net.java.joglutils.GLJFrame("FontDrawerDemo", listener, 600, 600); + gljf.setDefaultCloseOperation(gljf.EXIT_ON_CLOSE); + gljf.addKeyListener(new java.awt.event.KeyAdapter() { + + public void keyPressed(KeyEvent e) { + switch (e.getKeyChar()) { + case 'f': + FontDrawer fd = dttf; + dttf.setFill(!dttf.isFill()); + break; + case 'n': + dttf.setFlatNormals(!dttf.isFlatNormals()); + break; + case 'r': + Animator anim = gljf.getAnimator(); + if(anim.isAnimating()) + anim.stop(); + else + anim.start(); + break; + case 'R': + //TODO:change rotation speed + String strRes; + strRes = JOptionPane.showInputDialog("X Rotation Speed?",Float.toString(rotSteps[0])); + if (strRes != null) { + rotSteps[0] = Float.parseFloat(strRes); + strRes = JOptionPane.showInputDialog("Y Rotation Speed?",Float.toString(rotSteps[1])); + if (strRes != null) { + rotSteps[1] = Float.parseFloat(strRes); + strRes = JOptionPane.showInputDialog("Z Rotation Speed?",Float.toString(rotSteps[2])); + if (strRes != null) + rotSteps[2] = Float.parseFloat(strRes); + } + } + break; + case '>': + case '.': + float depthStep = dttf.getFont().getSize()/20.0f; + dttf.setDepth(dttf.getDepth() + depthStep); + break; + case '<': + case ',': + depthStep = dttf.getFont().getSize()/20.0f; + dttf.setDepth(dttf.getDepth() - depthStep); + break; + case 't': + case 'T': + String up = JOptionPane.showInputDialog("Upper Text:",upperStr.toString()); + upperStr.delete(0,upperStr.length()); + upperStr.append(up); + String dn = JOptionPane.showInputDialog("Lower Text:",lowerStr.toString()); + lowerStr.delete(0,lowerStr.length()); + lowerStr.append(dn); + break; + case 'F': + Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); + + JPanel pan = new JPanel(); + JComboBox cb = new JComboBox(); + for (Font f : fonts) + cb.addItem(f); + cb.setSelectedItem(dttf.getFont()); + pan.add(cb); + net.java.joglutils.JPanelDialog jpd = new net.java.joglutils.JPanelDialog("Choose Font",pan); + if (jpd.showAsModal()) + dttf.setFont((Font)cb.getSelectedItem()); + break; + case 's': + Font currFont = dttf.getFont(); + String resultStr = JOptionPane.showInputDialog("Font Size?",Integer.toString(currFont.getSize())); + float targSize = Float.parseFloat(resultStr); + dttf.setFont(currFont.deriveFont(currFont.getStyle(),targSize)); + break; + } + gljf.repaint(); + } + }); + gljf.generateAnimator(); + gljf.setVisible(true); + } +} -- cgit v1.2.3