GF4J 0.9.4 Beta

gameframe
Class AppletGameFrame

java.lang.Object
  |
  +--gameframe.GameFrame
        |
        +--gameframe.AppletGameFrame

public class AppletGameFrame
extends GameFrame

The GameFrame librarys main entry point class. The methods in this class are mainly used when the game is starting, after that this class is normally not used at all. For this reason many of the methods in this class aren't optimized for speed, but for lesser memory usage. Only exception is the getGameFramePath() method that might be used by implementations to find out e.g. the location of the default font bitmap. This one method is made to be as fast as possible.

Since:
GameFrame for Java 0.9.4
Version:
GameFrame for Java 0.9.4

Field Summary
protected  java.applet.Applet m_applet
          The Applet that is using the GameFrame.
 
Fields inherited from class gameframe.GameFrame
BUILD_NUMBER, ENGINE_FACTORY_CLASS, ENGINE_FACTORY_GET_INSTANCE_METHOD_NAME, ENGINE_FACTORY_GET_INSTANCE_METHOD_PARAM_CLASSES, ENGINE_FACTORY_IS_RUNNABLE_METHOD_NAME, ENGINE_MAIN_PACKAGE_NAME, ENGINE_SUBDIR_NAME, GAME_FRAME_PACKAGE_NAME, IS_STABLE_RELEASE, m_currentEngineFactory, m_engineFactories, m_fGameFrameMainDirectorySearched, m_settings, m_strGameFrameMainDirectory, MAJOR_VERSION, MINOR_VERSION, mStatic_graphicsEngine, mStatic_inputEngine, mStatic_singletonInstance, mStatic_soundEngine
 
Constructor Summary
AppletGameFrame(java.applet.Applet applet)
          Constructs the GameFrame using default settings.
AppletGameFrame(java.applet.Applet applet, GameFrameSettings settings)
          Constructs the GameFrame using the given settings.
 
Method Summary
 java.applet.Applet getApplet()
          Returns the Applet that is using GF4J.
 java.lang.String getDefaultFontBitmapFilename()
          Filename that can be used to load the default font bitmap.
 java.awt.Image getDefaultIcon()
          Returns the Image that is set as the default image icon for all graphics engine windows.
 java.lang.String getGameFramePath()
          Returns the absolute path to the main directory of the library that contains the GameFrame entry point.
protected  void searchEngineFactories()
          Does the core job of adding all engine factories to the list of runnable factories (engine factories that can run on the current platform).
 
Methods inherited from class gameframe.GameFrame
addEngineFactoryClasses, addFactory, createTimer, exit, finalize, findClassesInSubdirectoriesThatImplementInterface, findSubdirectories, getBuild, getDescription, getGraphicsEngine, getInputEngine, getInstance, getMajorVersion, getMinorVersion, getName, getRecommendedEngineFactory, getSoundEngine, getSuitabilityForPlatform, getSupportedResolutions, initEngines, initFromSettings, isInitialized, isStableVersion
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_applet

protected java.applet.Applet m_applet
The Applet that is using the GameFrame.
Constructor Detail

AppletGameFrame

public AppletGameFrame(java.applet.Applet applet)
                throws SettingsException,
                       GameFrameException
Constructs the GameFrame using default settings. Also initializes the recommended engines for the current platform, so that when any of the getXXXXEngine() methods is called no exceptions are thrown.
Parameters:
applet - The Applet that is the applet using gameframe.
Throws:
SettingsException - Thrown if a GameFrame instance allready exists. GameFrame instance can be destroyed by calling the finalize() method.
GameFrameException - Thrown if some engine fails to initialize.
Since:
GameFrame for Java 0.9.1
See Also:
GameFrameSettings

AppletGameFrame

public AppletGameFrame(java.applet.Applet applet,
                       GameFrameSettings settings)
                throws SettingsException,
                       GameFrameException
Constructs the GameFrame using the given settings. Also initializes the recommended engines for the current platform, so that when any of the getXXXXEngine() methods is called no exceptions are thrown.
Parameters:
settings - The settings to use inside the GameFrame library. If null is provided uses default settings.
Throws:
SettingsException - Thrown if a GameFrame instance allready exists. GameFrame instance can be destroyed by calling the finalize() method.
GameFrameException - Thrown if some engine fails to initialize.
Since:
GameFrame for Java 0.9.1
See Also:
GameFrameSettings
Method Detail

getGameFramePath

public java.lang.String getGameFramePath()
Returns the absolute path to the main directory of the library that contains the GameFrame entry point. The directory is found by getting the Applet document base and adding "/" plus the engine package location to the URL. and addig the string "gameframe" as subdirectory to each entry.
Overrides:
getGameFramePath in class GameFrame
Returns:
The directory that is the main directory of the GameFrame library.
Since:
GameFrame for Java 0.9.4

getApplet

public java.applet.Applet getApplet()
Returns the Applet that is using GF4J.
Returns:
The Applet that is using GF4J.
Since:
GameFrame for Java 0.9.4

getDefaultIcon

public java.awt.Image getDefaultIcon()
Returns the Image that is set as the default image icon for all graphics engine windows.
Overrides:
getDefaultIcon in class GameFrame
Returns:
Default icon for engine windows.

getDefaultFontBitmapFilename

public java.lang.String getDefaultFontBitmapFilename()
Filename that can be used to load the default font bitmap.
Overrides:
getDefaultFontBitmapFilename in class GameFrame
Returns:
The default fontbitmap filename.

searchEngineFactories

protected void searchEngineFactories()

Does the core job of adding all engine factories to the list of runnable factories (engine factories that can run on the current platform). Later added engine factories that have the same suitability value will override engine factories that were added earlier.

Note to engine implementors: Engine implementors that add new engines for Applet use must add their engine factories in this method. Also this is the method to override if you want to make your own custom GameFrame subclass.

Overridden to use Applet friendly query tactics.
Overrides:
searchEngineFactories in class GameFrame
Since:
GameFrame for Java 0.9.4

GF4J 0.9.4 Beta