User's
Manual
Programming by Jcalcomp
Class library
Oct.10,1997
Ver. 0.98
Hiroshi Sakuta
hsakuta@mit.edu
- Programming by Java Language
- 3D Graphics by Vector Analysis
- Virtual Library for Engineering
Contents
Figure List
See also:
1.Preparation
-
Hardware :
-
PC (Windows NT/95;CPU:desirable P5 90 or upper;Memory
32 MB; LAN : T-1 or PPP )
-
Unix X-window
-
Software :
-
Compiler ( javac[Sunmicro JDK] , or J++[Microsoft])
,
-
Text Editor,
-
Browser( Netscape Communicator 4.0 , Internet
Explore 4.0)
-
Basic Requirements for Users
-
C programming in basic level
-
Text editing
-
Browser handling
-
Concept of FTP
-
Desirable
-
Knowledge about Object Oriented Programming System
-
Html Writing
2. Java Programming
2.1 Concept of Object Oriented Programming
2.2 Compile & Work Flow
1) Start J++
Usually, Visula J++ has its icon
for starting, wich may not be on start menu nor desktop. If there is no
starter, find Msdev application from C:\Msdev\bin directory. "Msdev" is
clickable and can start J++.
J++ is integrated environment for Java
programming, which is released from Microsoft and its browser is fixed
to "Internet Explore" to run the applet developed.
Msdev starter is common for other compilers,
i.e. Visual C++.
2) Create New Workspace
-After start Msdev(J++), integrated environment desktop is pop-up like
Fig. 1.
-If a new program is to be developped, a new Project Workspace has to be
created by File-New pulldown menu(Fig.001).
-Fig.001-
- The Project Workspace
and other scratch files except *.java files are featured by J++, and in
raw compiler in DOS or Unix, one only needs *.java files and class libraries.
- Use Java Applet Wizard, which make applet based
Java program.
-Fig.002-
- The name of Workspace corresponds its class
file name. Then it should be its own name. As a componet of class libraries,
the class file is placed in a directory where other class files lie in.
- Every class has just one class file, even though
its source file include multiple class source. If a multiple class source
file is compiled, the class files corresponding to the class in source
will be generated.
- Fig003-
-Fig.004-
- An applet is able to work only on browsers, which
are "Hot Java", "Netscape", "Internet Explore" etc.
- The HTML file generated by Applet Wizard is including
the applet starter script.
It order the browser to open specified area to run the applet. It can
give some parameters in the script like inline parameters for Unix or DOS
commands.
- In Fig.005, the width and the height of the area
to be run can be fixed. If is not suitable, they can be eited afterward.
-Fig.005-
- The multi-thread option may be regarded as consideration
of independent working of some operation. Most typical example is the animated
feature, which is shown in the left side of the figure. A globe is rotating
independently to user's operation.
- If the multi-thread option is selected,
the class has the "implements Runnable" option and some thread variables
in the class. As the secondary effect, J++ makes a directory for image
animation where the example of rotating globe copied initially.
-Fig.006-
- "No, thank you" is recommendable for the 1st
program.
- After this dialog box(3/5), J++ only shows the
information about this class.
-Fig.007-
3) Settings
- Afer the specification about the new Workspace, the
desktop is like Fig007.
- In this case the name of class is "Sample001".
- Before start editing the source file, some setting
for the location of class files should be fixed.
- In Unix and Windows system, the default path for
class libraries is set by environment variables.
In the DOS window, "set" gives
the class path which is the search path for class libraries.
TMP=C:\WINDOWS\TEMP
TEMP=C:\WINDOWS\TEMP
PROMPT=$p$g
winbootdir=C:\WINDOWS
COMSPEC=C:\WINDOWS\COMMAND.COM
PATH=C:\PAGEMGR;C:\PTEX\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND
CLASSPATH=.;C:\Msdev\projects\
TEXENV=C:\ptex\tex.env
windir=C:\WINDOWS
BLASTER=A220 I5 D1 T4
- If there is a need for changing the class
path, one should order it by resource editor or edit "Autoexec.bat" file.
-Fig.008-
- Arbitrary paths can be specified in "Class path directories"
dialog box, where each path should be separated by ";"(semi-colon). "Output
directory" dialog box has only one path for output the class file.
- It is very convinient to specify "Output directory"
to common directory among all developed programs. If they use common class
files as class libraries, this option make it available.
-Fig.009-
-Fig.010-
- By clicking directory tree, one can view the source
file itself in the right box.
- Editing operation is following Windows desktop
operation scheme.
- Inserted file from other examples usually makes
discrepancy of the class name. It is easily found and fixed bug. All of
the class name including the constructor should be exchanged t the correct
one in one time.
-Fig.011-
4) Compile
- After editing, some bug-fixed cimpile may be run. The errors
are shown in the bottom box and can be found the place of error in the
source text by clicking the error message.
- Compiling starts by "Buid" or "Rebuid" in the
pull down menu(Fig.012)
-Fig.012-
5) Run the applet
- If there is no error, the applet is ready to run on
the browser.
- "Execute" on the pull down menu folks "Internet
Explore" browser and start the applet on it.
-Fig.013-
3.Publishing
- Publishing developed applets is by operations
of movement of files to suitable directory on a Web server, which are *.class
, *.html , *.img and/or datafiles. The most popular operation is
FTP. FTP allpication is attached to Windows system. Adding that some FTP
applications are available on Windows. Of cource, on Unix FTP is one of
the most usual commands.
- If Athena in MIT is the target server, this URL
is convinient to create the Home Page
How to Create your Home Page in Athena :http://web.mit.edu/olc-www/www/howto.html.
4. Location of Files
- The set of class Libraries and its manual is in following
URL.
Manual:
http://web.mit.edu/hsakuta/www/Doc/JCalcomp.htm
Class libraries: ftp://web.mit.edu/hsakuta/www/Doc/*.class
- The set of class libraries can be downloaded by FTP or other
utilities.
Reference book
-Fig014-
-
For beginners
- Java by examples:J.R.Jackson, A.L. McClellan,Sun microsystems,ISBN
0-13-565763-6
- J++ guidebook (Many from Microsoft/Other)
-
For C users
- Java in a Nutshell: D.Flanagan,O'Reilly,ISBN 1-56592-262-X
- Core Java-2nd Edition- :G Cornell,C.S.Horstmann,Sun microsystems,ISBN
0-13-596891-7
-
For freeks
- Late night Java
-
Common
- Class libraries An Annotated Reference,P.Chan,R.Lee,Addison
Wesley,ISBN 0-201-63458-9
-http://www.prenhall.com/~java_sun