Up Html Tutorial Java Tutorial Reference Doc

Create Applets showing Geometry Models

JavaView offers different ways to include precomputed geometry files in web pages, or to view geometries in a stand-alone applications. Different file formats are supported for import and export.

HTML

How to display geometry files in your web pages

How to include other JavaView applets in your web pages

Windows

How to use the JavaView executable

How to view geometry files without a browser

Unix

How to view geometry files from the UNIX command line prompt

How to attach the JavaView class library to your Java programs

How to display geometry files in your web pages

  1. Download the JavaView archive as described on the download page.
  2. Create your own geometry file myGeom.obj similar to sample.obj. E.g. you can save a geometry from within JavaView and use the file. See Import Formats for a list of supported file formats.
  3. Create your own HTML file myPage.html similar to sample.html, and insert the following applet tag somewhere in the body of the file:
    <applet code=javaview.class archive=javaview.jar width=200 height=200>
    	<param name=Model value=sample.obj>
    	<param name=Control value=Hide>
    </applet>

    code=javaview.class

    name of class file in archive (do not change!)
    archive=javaview.jar
    or

    archive=javaview.jar,jvx.jar,vgpapp.jar
    name of archive (do not change!).
    Use second version if you want to load more complex projects of the Visual Geometry Pages.
    width=200
    horizontal size of applet window in pixels, modify according to your needs
    height=200
    vertical size of applet window in pixels, modify according to your needs
    <param name=Model value=sample.obj>
    name of geometry file to show
    <param name=Control value=Hide>
    if not set or set to Show control panel will show up from beginning

The names of the archive and the geometry file may include path information relative to the codebase of the applet, in case both files are not stored in the same directory as the HTML file.

  1. Load your web page in a browser.

Further information is described in the tutorial. It is also possible to include a panel for browsing a set of files.

How to include other JavaView applets in your web pages

  1. Follow the instructions on the download page to download the JavaView archive.
  2. Look at the HTML code of one of the applets in the JavaView tutorial and copy the complete applet tag into your own page.

How to use the JavaView executable

The JavaView executable contains the full JavaView base system and all applets published on the Visual Geometry Pages. It runs as a standalone application and by using the menu sequence

FILE -> NEW -> PROJECT

any project may be loaded. The executable may be used to browser the disk for displaying geometry models or doing numerics like root finding or solving of differential equations. The executable may also be used to view Mathematica graphics.

The executable runs under Windows95,98, WinNT 4.0 and later if there exists a newer Java Virtual Machine. This is the case if Internet Explorer 4.01 or later is installed on your system. Use the download section to obtain a copy.

How to view geometry files without a browser

  1. Put the batch file javaview.bat in a directory where your system is looking for executables or in the directory of your geometries.
  2. Then adapt it to your needs i.e. open it with an editor of your choice and change the value of the variable 'jv_jar' so it is pointing to the location of the archive.
  3. Hereafter you can view geometries by just typing in a dos box:
    javaview <geometry file>
    where <geometry file> must be replaced with the name of the geometry file you want to view (e.g. javaview sample.obj).

For experts: you might associate the file extensions .byu and .obj with javaview.bat to start JavaView whenever you double-click on a geometry file.

How to view geometry files from the UNIX command line prompt

  1. Download the JavaView archive as described on the download page.
  2. Extract it to for example: /usr/local/javaview.
  3. Optionally, create your own geometry file myGeom.obj similar to sample.obj.
  4. If the location of JavaView is not /usr/local/javaview then edit the shell script bin/javaview and set the variable CODEBASE to the directory, where you installed javaview.
  5. Next make the script file bin/javaview accessible:
    first check if the mode flags are set to executable,
    second put it in a directory thats included in your PATH variable or make there a link to it.
  6. Finally invoke it like:
    [prompt]>> javaview sample.obj
    which should open a new window displaying the geometry.

How to use the JavaView class library to write own Java programs

  1. Follow the instructions on the download page to download the JavaView archive.
  2. Add the JavaView archives to your class path and follow the standard rules to import JavaView classes in your Java code.
  3. Have a look at the JavaView tutorials and the reference documentation which may be downloaded optionally.
 

© 1999-2001 Last modified: 10.05.01 --- http://www.javaview.de --- The JavaView Project