next up previous contents index
Next: Bibliography Up: Lookout For A Free Previous: 3. The Java Development   Contents   Index

Subsections

4. The Jau-Package

4.1 Goals

The goals of the Jau-Package is to support java developers with:
1.
Bubble-Help ( for Swing-JComponents using ToolTips )
2.
HTML-Online-Manual (using Swings-Packages Html/Text View)
3.
GUI-Text settings (e.g. for language)
4.
Configure Swings-Tree GUI (not yet implemented)
5.
Runtime configuration with text files (e.g. for the above)
6.
EMail sending (SMTP)
7.
Misc. Stuff:
(a)
timer
(b)
assert-functions
(c)
graphical utilities (e.g. turtel graphics)
(d)
easy standard windows (e.g. setup, system infos)
(e)
new gui elements

Many of the above goals are allready implemented and tested with some demonstration applications.

This package does not want to be a kind of concurence to the new Swing package or other wonderfull tools. It is just a little help and just a demonstration. As you can see above, this package uses Swing allready.

The packages generated documentation is here: packages.html.

At the FileArea at the top of jausoft, you can download the complete development-structure.

4.2 Prerequisites

To use the jau package, you need to have installed:

To compile the jau package, you need to have installed:

To generate this documentation, you need to have installed:

4.3 The Used Development Environment

4.3.1 The directory structure

jau The THISDIR path (see makefile)
jau/resources The resources-area: icons, ....
jau/jau The path of the Jau-Package
jau/jau/componentcfg The jau.componentcfg package
jau/jau/awt The jau.awt package
jau/jau/infomisc The jau.infomisc package
jau/jau/timemisc The jau.timemisc package
jau/jau/gfxmisc The jau.gfxmisc package
jau/jau/tool The jau.tool package
jau/jau/netmisc The jau.netmisc package
jau/jau/misc The jau.misc package
jau/tests The demonstartion path
jau/tests/SinusCoss The shooting game with system infos
jau/docs-src The source path for the documentation
jau/docs The destination of all generated documentation
jau/docs/icons The javadoc icons
jau/docs/images The /LaTeX/-2Html images

4.3.2 Installation

If every prerequisites are complete, you can compile and install the package with:

1.
Edit the makefile to enter YOUR directory structure.
2.
Compile java-classes with ´make´.
3.
Generate the html-doku with ´make htmldoc´
4.
Copy everything to your classpath with ´make classcpy´,
5.
assume that the makefile-makro DESTDIR contains your destination-path
6.
cd to ´test/SinusCoss´ and call ´javac *.java´ to generate the game SinusCoss 1.2 !

If DESTDIR is in your CLASSPATH, you can now invoke the game either with ´java SinusCoss´ or as an applet (with sound) with ´appletviewer SinusCoss.html´.

4.3.3 The Makefile

To compile, generate the complete documentation and other tasks, a central makefile is used.

# *********************************************************
#
# This is the standard makefile for compilation the java code 
# and to generate the documentation
#
# A korn-shell is assumed to be used as the default shell
#
# This Makefile has the following basic recipes:
#
#    all: generate all Jau-Package's *.class files
#      test: generate all demonstrations
#   htmldoc: generate the documentation
#  classcpy: copy all *.class files to the DESTDIR (define lower)
#     clean: remove all generated files except the documentation
#
# *********************************************************
#
# ! Check these directories to modify !
#

# ... The local directory structure
PREFIX = /usr/local
THISDIR = /usr/local/projects/java-1.1.X/jau

# ... Here we have the java place
JAVA_VERSION = 1.1.X
JDK_HOME = $(PREFIX)/jdk$(JAVA_VERSION)

# ... Some informations for javadoc
SOURCEPATH=$(JDK_HOME)/lib/classes.zip:$(THISDIR)

# ... The place where the *.class files should be copied to, 
# ... Using the recipe ´classcpy´
DESTDIR = $(PREFIX)/classes-$(JAVA_VERSION)

# ... The standard java tools and its standard invocation

# ... ´javac´ is invoked with ´-depend´, to compile all needed class-files also
JAVAC = javac -depend

# ... The java compiler compiler (JavaCC)
JAVACC=javacc

# ... The html-document generator of JavaCC
JJDOC=jjdoc

# ! From here - i guess - nothing must be changed ... !

# ... All the sources of the Jau-Package which should be compiled
SRC = \
jau/gfxmisc/EasyTurtle.java \
jau/infomisc/InfoDialog.java \
jau/infomisc/SetupValue.java \
jau/infomisc/SetupWindow.java \
jau/infomisc/SysInfoWin.java \
jau/misc/Test.java \
jau/netmisc/MailTo.java \
jau/timemisc/SimpleTimer.java \
resources/Resources.java \
jau/tool/JauGlobal.java \
jau/componentcfg/ASCII_CharStream.java \
jau/componentcfg/ComponentCfg.java \
jau/componentcfg/ComponentCfgBase.java \
jau/componentcfg/ComponentCfgBaseConstants.java \
jau/componentcfg/ComponentCfgBaseTokenManager.java \
jau/componentcfg/ComponentCfgException.java \
jau/componentcfg/ComponentCheckOpt.java \
jau/componentcfg/ComponentData.java \
jau/componentcfg/WinComponentData.java \
jau/componentcfg/ParseError.java \
jau/componentcfg/Password.java \
jau/componentcfg/PasswordBlock.java \
jau/componentcfg/Token.java \
jau/componentcfg/ComponentMgr.java \
jau/awt/JauHtmlPanel.java 

# ... All packages included in the Jau-Package, needed for javadoc
PACKAGES = \
resources \
jau.awt \
jau.componentcfg \
jau.gfxmisc \
jau.infomisc \
jau.misc \
jau.netmisc \
jau.timemisc \
jau.tool \
jau.tree

# ... The demonstration programs for the Jau-Package
TSTSRC = \
tests/SinusCoss/SinusCoss.java 

# ... The path of all demonstration programs, needed for javadoc
TSTDIRS=tests:tests/SinusCoss

# ... Here we have the implicite (suffix) rules
# ... We do save all outputs to the ´msg´ file

.SUFFIXES:    .jj .java .class 

# ... We have to invoke JavaCC from the path where the source resides !
.jj.java:
    cd ${<D}; $(JAVACC) ${<F} 2>&1 | tee -a msg
    cat ${<D}/msg >> msg

.java.class:
    $(JAVAC) $< 2>&1 | tee -a msg

# ... Here we have the default recipe, which will generate all
# ... *.class files for the Jau-Package
# ... The documents and other things must be invoked explicite, see the header! 
all: ${SRC:java=class}

# ... Generate the demostrations
test:
    cd tests; $(JAVAC) *.java 2>&1 | tee -a msg
    cd tests/SinusCoss; $(JAVAC) *.java 2>&1 | tee -a msg

# ... Copy all *.class files to DESTDIR
classcpy:
    for i in $$(find . -name \*.class -a -not -path ./tests/\* ) ; do \
        if [ ! -e $(DESTDIR)/$$(dirname $$i) ] ; then \
          mkdir -p $(DESTDIR)/$$(dirname $$i) ; \
        fi ; \
        cp $$i $(DESTDIR)/$$i ; \
    done 
    echo classes copied
    cp -Rf jauimages jaudata $(DESTDIR)/../.

# ... Generate the HTML documentation
htmldoc:
    rm -f docs/*.html docs/*.css 
    cd docs-src; UpdateHtml
    cd jau/componentcfg ; \
    $(JJDOC) -OUTPUT_FILE=$(THISDIR)/docs/ComponentCfgBaseEBNF.html ComponentCfgBase.jj
    javadoc -d docs \
    -sourcepath $(SOURCEPATH):$(TSTDIRS) \
    -author -version \
    $(PACKAGES) $(TSTSRC)

rmmsg:
    rm -f $$(find . -name msg)

rmclass:
    rm -f $$(find . -name \*.class)

# ... Clean up all generated files, except the documentation
clean: rmmsg rmclass
    rm -f jau/componentcfg/ASCII_CharStream.* \
       jau/componentcfg/ComponentCfgBase.java \
       jau/componentcfg/ComponentCfgBase.class \
       jau/componentcfg/ComponentCfgBaseConstants.* \
       jau/componentcfg/ComponentCfgBaseTokenManager.* \
       jau/componentcfg/ParseError.*

# ... Special dependencies

jau/componentcfg/ASCII_CharStream.java: jau/componentcfg/ComponentCfgBase.java
jau/componentcfg/ComponentCfgBaseConstants.java: jau/componentcfg/ComponentCfgBase.java
jau/componentcfg/ComponentCfgBaseTokenManager.java: jau/componentcfg/ComponentCfgBase.java
jau/componentcfg/ParseError.java: jau/componentcfg/ComponentCfgBase.java

4.4 Using a ASCII-Parser for Runtime-Configuration

Because Jau-Packages is in java, a java parser generator is needed. In C and C++ you used to use Lex & Yacc. Java has JavaCC[3].

The package jau.componentcfg supports the Jau-Package with runtime configuration. The solution is to parse a text file with a specified grammar. The result is saved in a object of the type ComponentCfg.

You can have a look at the generated file ComponentCfgBase.java. The grammar, source, is specified in ComponentCfgBase.jj. If you view the HTML version, you are able to follow the above links. The latter links to a generated grammar description (without terminal-symbols) named ComponentCfgBaseEBNF.html. This file is generated with jjdoc, which is also a part of JavaCC. You can look at a demonstration config-file at ../resources/SinusCoss12/SinusCoss.en.cfg.

To affect a java application or applet, we can use the ComponentMgr.java. The ComponentMgr can add single awt-components or complete awt-container to be affected by the runtime-configuration. The following can be configurated:

1.
Bubble-Help (ToolTips for Swing-Components)
2.
HTML-Online-Manuala
3.
GUI-Text settings (e.g. for language)
4.
Runtime configuration with text files (e.g. for the above)
5.
Error, Warning and Info CheckWindows
6.
Tree-Browser configurationb
7.
Mandatory input fields, with auto checking and CheckWindows invocation4.1 1.
8.
Action-Call definitionsb
9.
Fontsize changing (automatic if screen-resolution changed or manualy)

4.5 The HTML Packages-Documentation

If you view the HTML version of this documentation, you can easily go to the HTML package documentation by following this link: packages.html.

4.6 The Demonstration-Applets and -Applications

Befor you try the listed Applets, please be sure to use an Java 1.1.X capable Browser like HotJava. You also have the JFC (Swing package) 1.1 being installed.

SinusCoss V1.3. JauHtmlBrowser V0.3.

You can reach the Online-Help with F1 :-) !

It is possible that your the JauHtmlBrowser cannot be started as an applet out of Netscape :-(, so you can try also the appletviewer:

	appletviewer http://jausoft.goethel.de/Files/Java/1.1.X/JauPackage/jau/tests/JauBrowser/JauHtmlBrowser.html
	appletviewer http://jausoft.goethel.de/Files/Java/1.1.X/JauPackage/jau/tests/SinusCoss/SinusCoss.html

If you want to try the JauHtmlBrowser as an application, download jau.jar and type on the command shell:

	java jau.awt.JauHtmlBrowserFrame [<a optional start-url>]

4.7 License

jau-package - Version 2 16.1.1999 - many usefull java-classes

Copyright (C) 1999  Sven Goethel

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA  02111-1307, USA.

You can also check the GNU Library General Public License
in the internet at http://www.gnu.org/copyleft/lgpl.html !

If you like to contact the author use:

Sven Goethel, Elpke 5, 33605 Bielefeld, Germany
email: sgoethel@jausoft.com
web  : http://www.jausoft.com
voice: +49-521-2399440
fax  : +49-521-2399442

Sven Goethel, 15 January 1999



Footnotes

... invocation4.1

next up previous contents index
Next: Bibliography Up: Lookout For A Free Previous: 3. The Java Development   Contents   Index
sven goethel
2000-11-21