Menus & Messages Java Applet


 

Class File Name: MenuMsg.class
Class File Size: 16K
Notice Tag: Menus & Messages, Copyright (c) 1997 OpenCube Technologies, Registered 6251

Note: When testing this menu locally it is possible that a Java security exception will arise in Microsoft Internet Explorer (v3.02). Usually when this happens the applet will say loading images, however will never actually load the images. To work around this, view your menu in Netscape or place the image files on the server and view the applet. This issue is a local problem only and will not arise once the applet is located on the internet.

 

To see a animated sample of the applet click here.

 

How to use the applet tags:

The applet tag identifies the location, class file name, and size of a Java applet. Below is a small sample applet tag (or view the source for this document to see the applet tag for the above implementation of Sliding Messages). The first part of the tag code="MenuMsg.class" identifies the name of the Java program. The second part codebase="java/" identifies the relative location of the file (leave codebase out of the tag if the class file is located in the same directory as the HTML document).

<applet code="MenuMsg.class" codebase="java/" width="500" height="100">
<param name="desc0"value="OpenCube Technologies">
<param name="desc1"value="The Second Message">
</applet>

The third and fourth part of the applet tag identifies the width and height of the applet (usually measured in screen pixels).

The parameters are defined below the applet start tag with the parameter name first, followed by the value of the parameter. (see below for the complete Menus & Messages parameter list). You may add as many parameters as the applet allows for, with Menus & Messages it is unlimited. (If a parameter is not working, first double check its spelling and case are typed correctly.)

The last part works like all other HTML tags and defines the end of the applet tag </applet>.

 

The Parameters and how to define them:

Parameter 1 must be included in the applet tag in order for the applet to work. Most of the parameters will default if you fail to define them, however we suggest you include all the parameters so the applet is ensured give the desired look. Usually the easiest thing to do is cut and paste the applet tag info used in the sample and modify it to fit your web page.

Color Definition: This applet uses a simple RGB color scheme. To define a color in one of the color parameters use a value between 0 - 255 for the red, green, and blue components separated by commas and typed out in the correct r,g,b order. Below is a sample of how a color parameter should look, the example specifies several different sample colors for the "bgcolor" parameter.

WHITE: <param name="bgcolor" value="255,255,255">
GREEN: <param name="bgcolor" value="0,255,0">
BLACK: <param name="bgcolor" value="0,0,0">
YELLOW: <param name="bgcolor" value="255,255,0">
OFF WHITE: <param name="bgcolor" value="240,239,234">

The best way to choose the exact color you are looking for without having to guess the numbers is to access your systems Color Picker. Color Pickers usually allow you to drag the mouse over a rainbow type color grid to select a color, and show you the appropriate RGB values. In windows the Color Picker is accessible through MS Paint as well as a majority of the popular Imaging and HTML Authoring Software.

Parameters used to customize a specific image location or message are indicated using a range, such as "imagefile0" - "imagefileN". To define a parameter for a specific image or message (available when noted as above), use "bgcolor0" to define, in this case, the background color for the 1st message - "bgcolor3" would define the background color for the fourth message etc, etc. All of these range parameters, except for the "imagefile" ("imagefile0" - "imagefileN") also have a default which is the parameter name without a reference number. The defaults sets the attributes for all images and messages and are only overridden when a custom parameter, such as the background color example above is defined. This makes for very simple customization of the entire applet with the option to further define some or all of the images and messages.

The origin of the applets coordinate system is located at the upper left corner of the applet. The x (horizontal) coordinate start at the left border with 0 and go as far to the right as the applet is wide (defined with the width tag - see above). The y (vertical) coordinate start at the top of the applet with 0 and go down as far as the applet is high (defined with the height tag - see above).

 

Copyright Notice

Parameter 1
Attribute: Copyright notice.
param name="Notice"
value="Menus & Messages, Copyright (c) 1997 OpenCube Technologies, Registered 6251"
Note: This must be included for the applet to work.

 

The Images

Parameter 2
Attribute: Image File Location and Name
param name = "imagefile0" - "imagefileN"
Value = X. Where X is the relative location and name of the imagefile to be displaced in the applet area. This must be defined relative to the location of the MenuMsg.class file. (e.g. the class file is in a folder called Java and your images are located in a folder called images which is located in the Java folder. The imagefile tag would read "images/myimage.gif")

Parameter 3
Attribute: Image x (horizontal) location
param name = "picx0" - "picxN"
Value = X. Where X is the horizontal location of the left border of the image relative to the left margin of the applet. If your applet width is defined as 100, picx="50" would place the left border of the image horizontally dead center.

Parameter 4
Attribute: Image y (vertical) location
param name = "picy0" - "picyN"
Value = X. Where X is the vertical location of the top border of the image relative to the top of the applet.

 

The Associated Messages

Parameter 5
Attribute: Default Message Description
param name = "desc"
Value = X. Where X is the default message that is initially loaded before the mouse moves over any image. The messages associated with images automatically inherit this default message unless specifically defined using the parameter 6. If your text is longer than the width of the applet it will automatically be formatted to multiple lines. You may use a horizontal bar ('|') character to force a paragraph break. For example "this is the first paragraph|this second paragraph automatically has a space between itself and the first paragraph by using the horizontal bar character" You may force as may paragraph breaks as you wish so long as the length of the message does not exceed the available message length area.

Parameter 6
Attribute: Specific Messages associated with an Image
param name = "desc0" - "descN"
Value = X, Where x is the message that corresponds to the index used to identify an image defined in parameter 2. This is the specific message that will appear when the mouse moves over its related image.

Parameter 7
Attribute: Message Bold
param name = "bold"
Value = true or false, true = yes bold text, false = normal text.

Parameter 8
Attribute: Message Italic
param name = "italic"
Value = true or false, true = yes bold text, false = normal text.

Parameter 9
Attribute: Default Font Size
param name = "size"
Value = X. Where X is the default size of the font for all messages.

Parameter 10
Attribute: Specific Font Size
param name = "size0" - "sizeN"
Value = X, Where X is the size of the font for a specific message.

Parameter 11
Attribute: Font
param name = "font"
Value = X. Where X is the name of the font to be used for all messages. (e.g. "Courier)

Parameter 12
Attribute: Default Text Color
param name = "textcolor"
Value = R,G,B. Where R,G,B define the red, green, and blue components of the color as described above.

Parameter 13
Attribute: Specific Text Color
param name = "textcolor0" - "textcolorN"
Value = R,G,B. Where R,G,B define the red, green, and blue components of the color for a specific message as described above.

Parameter 14
Attribute: Default Back Ground Color
param name = "bgcolor"
Value = R,G,B. Where R,G,B define the red, green, and blue components of the back ground color.

Parameter 15
Attribute: Specific Back Ground Color
param name = "bgcolor0" - "bgcolorN"
Value = R,G,B. Where R,G,B define the red, green, and blue components of the back ground color for a specific message.

Parameter 16
Attribute: Default Center or Left Justify Text
param name = "centertext"
Value = true or false. Where true = yes center text, false = no left justify text.

Parameter 17
Attribute: Specific Center or Left Justify Text
param name = "centertext0" - "centertextN"
Value = true or false. Where true = yes center text, false = no left justify text.

Parameter 18
Attribute: Left and Right margin
param name = "xoffset"
Value = X. Where X is the left and right margin not including the border area, if any.

Parameter 19
Attribute: Default Vertical Alignment
param name = "valign"
Value = 1 or 2 or 3. Where 1=align top: 2=align center: 3=align bottom

Parameter 20
Attribute: Specific Vertical Alignment
param name = "valign0" - "valignN"
Value = 1 or 2 or 3. Where 1=align top: 2=align center: 3=align bottom.

Parameter 21
Attribute: Default Border Thickness
param name = "borderthickness"
Value = X, Where X is the thickness of the border for all messages.

Parameter 22
Attribute: Specific Border Thickness
param name = "borderthickness0" - "borderthicknessN"
Value = X, Where X is the thickness of the border for a specific messages.

Parameter 23
Attribute: Default Border Color
param name = "bordercolor"
Value = R,G,B. Where R,G,B define the red, green, and blue components of the border color.

Parameter 24
Attribute: Specific Border Color
param name = "bordercolor0" - "bordercolorN"
Value = R,G,B. Where R,G,B define the red, green, and blue components of the specific border color.

Parameter 25
Attribute: Horizontal X Coordinate of Message
param name = "showx"
Value = X. Where X is the horizontal location, x coordinate of the messages left border using the coordinate system described above.

Parameter 26
Attribute: Vertical Y Coordinate of Message
param name = "showy"
Value = X. Where X is the vertical location, y coordinate of the messages top border using the coordinate system described above.

Parameter 27
Attribute: Message Width
param name = "showwidth"
Value = X. Where X is the width of the message.

Parameter 28
Attribute: Message Height
param name = "showheight"
Value = X. Where X is the height of the message.

 

Defining the Animations

Parameter 29
Attribute: Default Animation Heading for Messages
param name = "heading"
Value = 0 or 1 or 2 or 3 or 4. Where 0=No Animation: 1= Start at Top: 2= Start Right: 3=Start Bottom: 4=Start Left. Note: If your messages move over any images they will get chopped up.

Parameter 30
Attribute: Specific Animation Heading for Messages
param name = "heading0" - "headingN"
Value = 0 or 1 or 2 or 3 or 4. Where 0=No Animation: 1= Start at Top: 2= Start Right: 3=Start Bottom: 4=Start Left. Note: If your messages move over any images they will get chopped up.

Parameter 31
Attribute: Animation Delay
param name = "animationdelay"
Value = X, Where X is the delay time in milliseconds for all animation. (1000 = 1 Second)

Parameter 32
Attribute: Animation Jump Size

param name = "jump"
Value = X, Where X is the jump size in pixels for the animation. A value of 1 yields a slow smooth animation, the larger the value the faster the animation.

 

The Mouse

Parameter 33
Attribute: Image Highlight Border Color
param name = "hcolor"
Value = R,G,B. Where R,G,B defines the red, green, and blue components of an images highlight color

Parameter 34
Attribute: Image Highlight Border Distance from Image Border
param name = "hdist"
Value = X, Where X is the distance from the image borders of the highlight square.

Parameter 35
Attribute: Mouse Delay
param name = "mousedelay"
Value = X, Where X is the delay in milliseconds for mouse coordinate checks as the mouse moves around the applet. This feature is useful when running multiple applets on the same page or when you want a delay time between when the mouse moves over an image and the associated message appears.

Parameter 36
Attribute: Default Message Appears While In
param name = "dmsgwhilein"
Value = true or false, True = The applet displays the default message while the mouse is in the applet area but not on a image. False = The applet displays the default message only when the mouse leaves the applet area. When using a False setting watch you animation's, if they are set slow they may cut off the previous message if the user moves the mouse on and off an image quickly.

 

URL Links

Parameter 37
Attribute: Default Message URL Link
param name = "desturl"
value=X, where X is the link for the default message. Fully qualify all URL's (e.g. "http://www.opencube.com")

Parameter 38
Attribute: Specific Image URL Link
param name = "desturl0" - "desturN"
value=X, where X is the specific link for a image. Fully qualify all URL's (e.g. "http://www.opencube.com")

Parameter 39
Attribute: Default Load Destination URL Where?
param name="loadwhere"
The "loadwhere" tag specifies where the document specified in the "desturl"
tag should be loaded. The default is "_self"

"_self" show in the current frame
"_parent" show in the parent frame
"_top" show in the top-most frame
"_blank" show in a new unnamed top-level window
"name" show in a new top-level window named name

Parameter 40
Attribute: Specific Load Destination URL Where?
param name="loadwhere0" - "loadwhereN"
The "loadwhere" tag specifies where the document specified in the "desturlN"
tag should be loaded. The default is "_self"

"_self" show in the current frame
"_parent" show in the parent frame
"_top" show in the top-most frame
"_blank" show in a new unnamed top-level window
"name" show in a new top-level window named name

 

Other

Parameter 41
Attribute: Applet Background Color
param name = "pagebgcolor"
Value = R,G,B, Where R,G,B are the red, green, and blue components of the applets background color.

 


Menus & Message, � 1996, OpenCube Technologies

OpenCube