org.jrabbit.standard.intro.base
Class BaseLogoIntro

java.lang.Object
  extended by org.jrabbit.standard.intro.base.ImageIntro
      extended by org.jrabbit.standard.intro.base.ImageAudioIntro
          extended by org.jrabbit.standard.intro.base.BaseLogoIntro
All Implemented Interfaces:
Renderable, Updateable, Createable, Destroyable, Intro
Direct Known Subclasses:
JRabbitIntro

public abstract class BaseLogoIntro
extends ImageAudioIntro

BaseLogoIntro extends ImageAudioIntro to add some default functionality. The end result is an Intro that displays an Image at the center of the screen while a sound plays. Both the color of the main Image and of the background are completely controllable. Obviously, this type of Intro lends itself most easily to some sort of logo display; thus the name. NOTE: Extensions of this class still need to control how the Intro updates itself and changes over time.

Author:
Chris Molini

Field Summary
protected  Color backgroundColor
          The Color that the background will be cleared to.
protected  boolean finished
          This flag is used to determine if the Intro has finished displaying.
protected  Color logoColor
          The Color at which to render the main image.
 
Fields inherited from class org.jrabbit.standard.intro.base.ImageAudioIntro
sound, soundLoader
 
Fields inherited from class org.jrabbit.standard.intro.base.ImageIntro
image, imageLoader
 
Constructor Summary
BaseLogoIntro(Loader imageLoader, Loader soundLoader)
          Creates an BaseLogoIntro that uses the Image and SoundData retrieved from the supplied Loaders.
BaseLogoIntro(java.lang.String imageFilepath, java.lang.String soundFilepath)
          Creates an BaseLogoIntro that uses the Image and SoundData retrieved from the indicated system locations.
 
Method Summary
 boolean finished()
          Determines if the Intro has finished displaying.
 void render()
          Clears the background to the desired Color, then renders the logo Image at the center of the screen with the indicated Color.
 void start()
          This begins the Intro by starting playback of the sound.
 
Methods inherited from class org.jrabbit.standard.intro.base.ImageAudioIntro
create, destroy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jrabbit.base.core.types.Updateable
update
 

Field Detail

logoColor

protected Color logoColor
The Color at which to render the main image.


backgroundColor

protected Color backgroundColor
The Color that the background will be cleared to.


finished

protected boolean finished
This flag is used to determine if the Intro has finished displaying.

Constructor Detail

BaseLogoIntro

public BaseLogoIntro(java.lang.String imageFilepath,
                     java.lang.String soundFilepath)
Creates an BaseLogoIntro that uses the Image and SoundData retrieved from the indicated system locations. NOTE: The logo Color is set to opaque white, and the background color is set to black.

Parameters:
imageFilepath - The system location of the source image.
soundFilepath - The system location of the source audio.

BaseLogoIntro

public BaseLogoIntro(Loader imageLoader,
                     Loader soundLoader)
Creates an BaseLogoIntro that uses the Image and SoundData retrieved from the supplied Loaders. NOTE: The logo Color is set to opaque white, and the background color is set to black.

Parameters:
imageFilepath - The loader that accesses the desired source image.
soundFilepath - The loader that accesses the desired source sound.
Method Detail

start

public void start()
This begins the Intro by starting playback of the sound.


render

public void render()
Clears the background to the desired Color, then renders the logo Image at the center of the screen with the indicated Color.


finished

public boolean finished()
Determines if the Intro has finished displaying.

Returns:
True if any of the following are satisfied: 1: The "finished" flag is set to true. 2: The left mouse button was clicked. 3: The Enter, Escape, or Space keys were pressed.