COOL EFFECTS AND UTILITIES FOR DEVELOPERS

MAIN
BEANS
FAQ
DOWNLOAD
ORDER
ABOUT
CONTACT


Get freeware applets. Visit Mandomartis' partner Plutonium Software

 

RollOffImage
Java Bean
Programming Manual


Written by Anibal Wainstein

Copyright Mandomartis Software Company 2000, all rights reserved

 

INTRODUCTION

Display your images with this slideshow component bean. The bean will roll away an image on top of another using a 3D shading effect. After a pause, the procedure is repeated. The bean has the following features:

  • Images support descriptions.
  • Images are automatically resized to fit in the component window.
  • You can specify the description text and background color.
  • The roll size can be specified.

Before using this Java bean you must read the license agreement.

 

BEAN GENERAL INFORMATION

Developer: Anibal Wainstein
Version: 1.0
Version date: 2000-12-17
Last update information: <NONE>

 

DEPENDENT FILES

The following file must be included with your project in order for this bean to function properly:

rolloffimage.jar (or rolloffimageunregistered.jar)

 

ADDING THE JAVA BEAN TO YOUR PROJECT

To add this Java bean to your Java application project. Make sure this bean is in your classpath. If you want to make an applet. Make sure to add the jar file to the "ARCHIVE" HTML parameter in the applet head HTML code. This bean is part of the mandomartis.* package, so use this line to import the bean to your Java application or applet. Note that this applet is written for Java 1.1 and above and will only work in Java programming projects. Make sure to check that the Java Virtual Machine or the target browser supports this version of Java.

 

THE JAVA BEAN API

Class mandomartis.rolloffimage

Object
   |
   +----Component
           |
           +----Container
                   |
                   +----Panel
                           |
                           +----mandomartis.rolloffimage

public class rolloffimage
extends Panel
implements Runnable

Constuctors


public rolloffimage()
      

Methods


public boolean createEffect(Image[] images,
                            String[] descriptions,
                            int effectwidth,
                            Color descriptionbackgroundcolor,
                            Color descriptiontextcolor)
This method will initialized and run the rolloffimage effect.

Parameters:
images - An java.awt.Image array with the images to be used in the effect. If the images are of a different size as the component size, they will be automatically stretched to fit in the component area.
descriptions - A String array containing the description texts for each image. This array must have the same size as the images argument.
effectwidth - The effect width (the width of the roll) in pixels.
descriptionbackgroundcolor - The description text background color
descriptiontextcolor - The description text color

public int getAnimationStep()
This gets the animation step.

Returns:
The animation step.

public int getDelay()
This gets the general frame delay in milliseconds. The default value is 70.

Returns:
The frame delay in milliseconds

public int getSleeptime()
This gets the "sleeptime" which is the pause before the next image appears.

Returns:
The sleeptime in milliseconds

public void setAnimationStep(int step)
This controls the animation step.

Parameters:
step - The step parameter. The default value is 7.

public void setDelay(int delay)
This controls the general frame delay in milliseconds, and thus the frames per second (FPS). The default value is 70.

Parameters:
delay - The frame delay in milliseconds

public void setSleeptime(int sleeptime)
This sets the "sleeptime" which is the pause before the next image appears.

Parameters:
sleeptime - The value in milliseconds
 

 

SETTING UP THE JAVA BEAN WITH IMAGES AND DESCRIPTIONS

The following example will setup the bean to use two images and descriptions (this example can be run if you try to run the bean as an application):

rolloffimage rolloffimage1 = new rolloffimage();
Image images[]=new Image[2];
images[0]=rolloffimage1.createImage(400,300);
images[1]=rolloffimage1.createImage(400,300);
Graphics g1=images[0].getGraphics();
g1.setColor(Color.blue);
g1.fillRect(0, 0, 400, 300);
g1.setColor(Color.white);
g1.drawString("Anibal's RollOffImage JavaBean",120,156);
Graphics g2=images[1].getGraphics();
g2.setColor(Color.yellow);
g2.fillRect(0, 0, 400, 300);
g2.setColor(Color.black);
g2.drawString("from Mandomartis",160,156);
String descriptions[]=new String[2];
descriptions[0]="From Anibal's Essential Beans";
descriptions[1]="Copyright Mandomartis Software Company";
rolloffimage1.createEffect(images ,descriptions ,30 ,Color.lightGray ,Color.black);

Add your images to the Image array and be sure to add the same number of description texts. If you do not want description texts, then specify "null" as the second parameter. Note that the only image formats supported are JPEG and GIF files. Do not use transparent GIF files in this bean. Also note that each image will be automatically resized to fit in the bean component area. Here is the screenshot of the bean running in an application:

 


This is a Mandomartis site: Visit our other Mandomartis sites:

Company Main Site

Type "Java" for more beans:
www.goto.com Search the Web.
Type it and go!
   

Games For Rent Free Online Courses
Violent Playground - Violent Applets
Essential Applets

Click Here!

© Copyright 2001 Mandomartis Software Company