Please excuse the delay in getting Assignment 2 on-line. On Friday I looked over the results of Assignment 1. Ten teams have checked in their work. There is a pleasing variety in the results; there is a range of subject matter, and a range of difficulty. Some of the applications are impressive! It’s clear that there is a wide range of experience levels in Java programming, and familiarity with 3D graphics. For this reason I’ve decided to postpone moving on the Assignment 2 this week. I’m renaming it as Assignment 3 and have prepared a different Assignment 2 for this week. We’ll get back to Assignment 3 as soon as we’ve worked through the new Assignment 2, which I now want to describe.
Assignment 2 is a continuation of Assignment 1. I’ve created a new class named simply Assignment and checked it in in the package named util. Your Assignment2 class should be a sub-class of Assignment, which has a number of methods to make your applications more useful and convenient. The extensions center around three main features:
- flexible setup of JRViewer,
- support for creating inspection panels (to control the parameters of your class), and
- use of web browser to display on-line documentation.
Consult the class gunn.Assignment2 to see how I adapted gunn.Assignment1 to use these features. Study in particular how gunn.Assignment2 overrides the following methods from Assignment. (Note: the safest way to implement these methods in eclipseis via the menu item “Source->Override/Implement Methods”.)
- getContent(): this SceneGraphComponent is used as the content of the JRViewer. You must implement this method, as it is declared abstract in Assignment.
- getDocumentationFile(): This String gives the name of the file containing the on-line documentation for the class. I’ve generated html files and put them in the subpackage gunn.html. In the case the String is “html/Assignment2.html”.
- getInspector(): This java.awt.Component contains GUI to interact with the parameters which behavior of this class. If you don’t override this method, you’ll get a default inspector based on Java beans technology; if you don’t want any inspector, overwrite getInspector() and return null explicitly.
- display(): This method activates the assignment, invokes an instance of JRViewer (which you can customize by overriding the method setupJRViewer()), registers the inspector panel, and sets up the keystroke shortcut ‘h’ to activate the display of the on-line documentation. My Assignment2 invokes this method in its main() method.
Summing up, here’s the next assignment follows.
- Re-write Assignment1 to be a subclass of util.Assignment (name the result Assignment2, leaving Assignment1 unchanged).
- For those whose original assignment consisted of one shape or one surface: extend the mathematical content so that it depends on a real parameter in a non-trivial way. For example, implement a family of polyhedra or a family of surfaces. This is a prerequisite [Voraussetzung] for the next point:
- Implement the inherited method getInspector() to include at least one slider. Use the value of this slider to control a movement in the content of your class. For example, the angle of a rotation or length of a translation. More interesting of course are movements which change the geometry you are displaying. You can, for example, use this value to control the truncation of the vertices of a polyhedron; to move among a family of surfaces (such from a catenoid to a helicoid); or to control any of the appearance parameters in your program — the possibilities are only limited by your imagination. I encourage you to include other controls (non-sliders) for other types of parameters (integer, boolean, Color …). As usual, consult gunn.Assignment2.
- Generate on-line documentation, preferably a html file located in a sub-package of your package named html. In this documentation file. Of course, you can write in German if you wish!The file should contain, in whichever language you write, the following:
- Give a description of the mathematical content of your class, focusing on the features which you have implemented.
- Then, give a description of how to use your application. A screenshot of the running application can be a big help here.
- Finally, conclude with a brief description directions of further work, if you were to work on it further. You can also use this section to describe any difficulties you encountered in implementing your ideas.
- Steal this program! I encourage you to follow the example contained in gunn.Assigmnent2 as much as possible. Copy and paste from gunn.Assignment2 as much as you wish; every minute you save at this level is a minute you can use to customize the result according to your own wishes. The same goes for the html documentation file.