Panorama Applet version B

Description:
The applet scrolls a panoramic picture.
Its possible to drag the picture with the mouse.
This way the direction movement can be controlled.
The applet is capable of communicating with JavaScript.
This way JavaScript can control the speed and direction.
Also its possible to let it use another picture with JavaScript.

Disclaimer:
Use of this applet is at own risk.
Due to the price and nature of the Internet I can't accept claims.

Copyright:
The applet may be used for free on non commercial private personal home pages.
All other users should pay a license fee of US $25.--

http://alpha.comweb.nl/payment_info.htm
The reason for this is I don't want other people to earn money out of the work I'm doing.
Simply because I do have to make expenses and offer my time to create these things.
Also I do want to earn a little out of it.

About this document:
I'm not planning to give you a complete description of Java applets.
Think there are better documents for that.
Otherwise I'll have to type this things in all the instruction files I write.
But I'll give you a brief instruction on how to install this applet.
The document assumes that you are familiar with html and a little JavaScript.

Brief install instruction:
Copy the applet tags in your html page.
Upload : the class files ,  html page and the pictures the applet  uses to your providers computer
Class files and pictures do need to be uploaded as binary files.
If you upload them as plain text then there is a good change they get corrupted.
This will most likely result in a ClassFormatException.
Also note that your providers computer is case sensitive.
This means you mustn't change the letter casing of the class files.
If the browser can't find a class file it will report a ClassNotFoundException at the browsers Java console.
You simply can check if the class file is their by typing the url of it at your browsers command line.
For example http://www.nonExistingServer/myClassFile.class will result in a 404 error (File not found).
If you are new to applets I suggest not to use the codebase attribute , just put all the files in the same directory.

Applet tags:
<applet CODE="PanoramB.class" WIDTH="418" HEIGHT="80" NAME="pano" MAYSCRIPT>
This is the first applet tag.
It tells the browse the name of the class file to load.
Actually it tells the main class file is PanoramB.class.
The applet also uses a second class file PanoramBBeanInfo.class.
This one is only used by modern browsers.
If you omit it then there is a change it will not work on some of them.
Width and height should be obvious.
The name attribute is mandatory if you want the applet to communicate with JavaScript.
Otherwise JavaScript will not have a reference to the applet.
Also mandatory for JavaScript is the MAYSCRIPT attribute.
It tells the browser the applet methods may be called by JavaScript.
Omitting that will not let the applet work with some browsers.


<
param name="picture_1" value="baths3PL.jpg">
<
param name="picture_2" value="cruzbay.gif">
<
param name="picture_3" value="cloudpan2.jpg">
You can use several pictures with the applet.
Supported are only jpg and gif.
The applet always starts up with picture_1

<param name="delay" value="50">
This parameter is used to delay the applet program cycle.
With every cycle the picture is moved.
50 ms  just is a good value.
Don't set it to low or the applet will consume a lot of the computer CPU time.


<
param name="x_add" value="1">
This is the initial speed of the applet.
The unit are pixels.
With this one the picture is moved one pixel every program cycle.


<
param name="bounce" value="false">
It seems to be difficult for some people to generate a 360 degrees panoramic picture.
The best way to do that is use a digital camera with a panoramic option.
I use panoramic spin from picture works.
But for people not able to create such picture the parameter bounce lets the picture bounce on it edges.


<
param name="load_string" value="loading please wait">
To make it more useful you can change the loading message.
For example if your page is in another language.


<
param name="size_vertical" value="true">
Also a common problem is when not all the pictures are the same height.
Although you are able to drag the picture vertical.
This tag resizes the picture the the applet height.


<
param name="move_when_loading" value="true">;
This one is obsolete.
The old version did support it (only with gif) but wasn't able to do JavaScript Communication.
This applet uses multiple threads for loading , it stops the movement of the picture while loading.


<
/applet>
Simply the applet ending tag.

Adding JavaScript:
Think this is the most difficult part.
The applet uses the 1.1x convention on public method names.
Also for the newer browser a PanoramBBeanInfo.class is provided.
So here are the applet methods that can be called from JavaScript.
Also I've added a small example assuming the name of the applet is pano.
(Set by the name attribute at the first applet tag)

setPicture(int picNum)
setPicture(String picNum)
onClick="document.pano.setPicture('2');"
This one lets the applet the applet load and use picture number 2
Note that the pictures are defined with the applet tags.

setPreviousPicture()
onClick="document.pano.setPreviousPicture();"
This one lets the applet use a picture with a lower number.

setNextPicture(int picNum)
setNextPicture(String picNum)
onClick="document.pano.setNextPicture();"

2000 RJHM van den Bergh.
All Rights Reserved.
http://alpha.comweb.nl or http://www.nedernet.nl/~rvdb
rvdb@comweb.nl or rvdb@nedernet.nl