Image Switch Menu


Class File Names: ism.class, ismrend.class
Total Size: 15K
Notice Tag: Image Switch Menu, Copyright (c) 1997 OpenCube Technologies, Registered 1015

 

For fast customization customize the applet tag using the template.

 

Important Applet Information:

Note: Images in Java can sometimes be rendered inappropriately depending on the the platform and browser being used. jpg images are the most reliable and should work fine under most scenarios such as Win96, NT, and Mac OS using Netscape or Internet Explorer. low color definition gifs (usually 16 colors and less) are often rendered spotty by Netscape.

Note: A class format error in Netscape usually indicates that the class file cannot be found or was not uploaded in binary format to the server.

 

Uploading the applet to the Server

Once you are finished customizing the applet you will need to upload the HTML page containing the applet tag and the two class files ism.class and ismrend.class. Be shore to upload the class files in binary format and ensure that they are located in the same folder as identified by the codebase= value in the applet tag (see below for more information on the codebase value).

 

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 the applet). The first part of the tag code="myclass.class" identifies the name of the Java program. The second part codebase="java/" identifies the relative location of the file (leave codebase blank if the class file is located in the same directory as the HTML document, the above example uses java/ as the directory as this is usually a good name to give your java folder).

<applet code="myclass.class" codebase="java/" width="500" height="100">
<param name="bgcolor"value="defines the applet background color">
<param name="desc0"value="a message description">
<param name="desturl0"value="a URL that the first description links to">
</applet>

The third and fourth part of the applet tag identifies the width and height of the applet using width="x" and height="x" (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 parameter list). You may add as many parameters as the applet allows for (If a parameter is not working, first double check that 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 Required Parameters:

Parameter 1, the notice tag, must be included in the applet tag in order for the applet to work. The only other required parameters are at least one image file and highlight image parameter. Usually the easiest way to customize your applet is to cut and paste the applet tag 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.

 

Defining Multiple attributes with One Parameter:

Single parameters used to customize more than one item such as specific images or messages are done so using a range, such as "imagefile0" - "imagefileN". To define a parameter for a specific item (available when noted as above), use "imagefile0" to define, in this case, the location of the first image file - "imagefile3" would define the fourth image file to use, etc., etc.

 

The Applet Coordinate System:

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

 

The Applet Parameters

 

The Applet

Parameter 1
Attribute: Copyright notice.
param name="Notice"
value="Image Switch Menu, Copyright (c) 1997 OpenCube Technologies, Registered 1015"
Note: This must be included for the applet to work.

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

Parameter 3
Attribute: Status bar text when the mouse is over the applet.
param name = "onsbtext"
Value = X, Where X is the message to be displayed in the status bar when the mouse is over the applet area.
DEFAULT: "OpenCube - Image Switch Menu"

Parameter 4
Attribute: Status bar text when the mouse is not on applet.
param name = "offsbtext"
Value = X, Where X is the message to be displayed in the status bar when the mouse is not located over the applet area.
DEFAULT: "Java by OpenCube"

 

The Images

Parameter 5
Attribute: Image File Locations and Names
param name = "imagefile0" - "imagefileN"
Value = X. Where X is the relative location and name of the image file to be displayed in the applet area as a main menu image. This must be defined relative to the location of the HTML document which contains the applet.

Parameter 6
Attribute: Image x (horizontal) locations
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 7
Attribute: Image y (vertical) locations
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 Highlighted Images

Note: The images defined as Highlight images appear as the mouse moves over a main menu image. The highlighted images are automatically placed directly over the main menu image to which they correspond and therefore should have the same dimensions as the main menu image to which they belong.

Parameter 8
Attribute: Image File Locations and Names
param name = "switchfile0" - "switchfileN"
Value = X. Where X is the relative location and name of the image file to be displayed in the applet area when the mouse is over a main menu image. This must be defined relative to the location of the HTML document which contains the applet.

 

The Associated Sub Menu Messages

Parameter 9
Attribute: Sub Menu Descriptions
param name = "desc0-0" - "descN-N"
Value = X, Where X is the message that corresponds to the index used to identify an image. (e.g to define a the first sub menu message for the first image use "desc0-0", to define the second sub menu message for the first image use "desc0-1", to define the second sub menu message for the third image use "desc2-1", etc.,etc.)

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

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

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

Parameter 13
Attribute: Font
param name = "font"
Value = X. Where X is the name of the font to be used for all messages. (valid Java font names: "Courier", "Helvetica", "TimesRoman", "Dialog", "DialogInput")
DEFAULT: Helvetica

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

Parameter 15
Attribute: Left and Right Margins
param name = "xoffset"
Value = X, Where X is the left and right margin to use for the menu message.

Parameter 16
Attribute: Center or Left Justify Text?
param name = "centertext"
Value = true or false, True = yes, Center Text - False = no, left justify text

 

The Associated Sub Menus Attributes

Parameter 17
Attribute: Sub Menu X (Horizontal) Offset from the left side of the Image
param name = "menuxoffset0" - "menuxoffsetN"
Value = X, Where X is the x offset from the left edge of the image using the coordinate system described above. A value of 0 would place the sub menu's left border at the left edge of the image.

Parameter 18
Attribute: Sub Menu Y (Vertical) Offset from the top of the Image
param name = "menuyoffset0" - "menuyoffsetN"
Value = X, Where X is the y offset from the top of the image using the coordinate system described above. A value of 0 would place the sub menu's top border at the top edge of the image.

Parameter 19
Attribute: Sub Menu Color
param name = "menucolor"
Value = R,G,B. Where R,G,B defines the red, green, and blue components of the pop up sub menu color.
DEFAULT: Yellow

Parameter 20
Attribute: Sub Menu Outline Color
param name = "menuoutlinecolor"
Value = R,G,B. Where R,G,B defines the red, green, and blue components of the pop up sub menus outline color.
DEFAULT: Black

Parameter 21
Attribute: Sub Menu Highlight Background Color
param name = "menuhlcolor"
Value = R,G,B. Where R,G,B defines the red, green, and blue components of the pop up sub menus highlighted background color.
DEFAULT: Red

Parameter 22
Attribute: Sub Menu Highlight Text Color
param name = "menuhltextcolor"
Value = R,G,B. Where R,G,B defines the red, green, and blue components of the pop up sub menus highlighted text color.
DEFAULT: Black

 

URL Links

Parameter 23
Attribute: Image URL Links
param name = "imagedesturl0" - "imagedesturlN"
value=X, where X is the link for the specific image. URL's can be defined relative to the HTML document containing the applet or fully qualified.

Parameter 24
Attribute: Specific Load Destination Image URL Where?
param name="imageloadwhere0" - "imageloadwhereN"
The "loadwhere" tag specifies where the document specified in the "imagedesturlN" 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 25
Attribute: Sub Menu URL Links
param name = "desturl0-0" - "desturlN-N"
value=X, where X is the link for the specific sub menu message. (e.g. to define a link for the first images first sub menu message use "desturl0-0" for the second use "desturl0-1", etc, to define a url link for the third images second sub menu message us "desturl2-1", etc., etc.) URL's can be defined relative to the HTML document containing the applet or fully qualified.

Parameter 26
Attribute: Default Load Destination URL Where?
param name="loadwhere0-0" - "loadwhereN-N"
The "loadwhere" tag specifies where the document specified in the "desturlN-N" 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


Image Switch Menu, � 1996, OpenCube Technologies

OpenCube