GF4J 0.9.4 Beta

gameframe.engines.jdk11x
Class CEngineFactory

java.lang.Object
  |
  +--gameframe.engines.jdk11x.CEngineFactory
All Implemented Interfaces:
EngineFactory

public class CEngineFactory
extends java.lang.Object
implements EngineFactory

Implementation of an engine factory for Java 1.1.x JVM's.

Since:
GameFrame for Java 0.9
Version:
GameFrame for Java 0.9.3

Field Summary
private  java.util.Vector m_finalizableObjects
          All objects that must be finalized upon engine factory finalization.
private  java.awt.Component m_focusComponent
          Reference to the singleton focus component.
private  GraphicsEngine m_graphicsEngine
          Reference to the singleton graphics engine implementation.
private  InputEngine m_inputEngine
          Reference to the singleton input engine implementation.
private  GameFrameSettings m_settings
          The main factory settings used for this engine factory.
private  SoundEngine m_soundEngine
          Reference to the singleton sound engine implementation.
private static CEngineFactory mStatic_engineFactory
          The singleton reference to an instance of this engine factory.
 
Fields inherited from interface gameframe.engines.EngineFactory
SUITABILITY_GOOD, SUITABILITY_NOT_SUITED, SUITABILITY_POOR, SUITABILITY_ULTIMATE
 
Constructor Summary
private CEngineFactory(GameFrameSettings settings)
          Constructs the engine factory without constructing any engines.
 
Method Summary
 Timer createTimer()
          Returns a new timer instance.
 void finalizationNotify(Timer timer)
          Notifies that the given timer has been finalized.
 void finalize()
          Invoked before application exits.
 java.lang.String getDescription()
          Returns the description of the engine factory implementation.
 GraphicsEngine getGraphicsEngine()
          Returns the graphics engine implementation for the current platform.
 InputEngine getInputEngine()
          Returns the input engine implementation for the current platform.
static CEngineFactory getInstance(GameFrameSettings settings)
          Returns the singleton instance of this engine factory (the instace will be created upon the first call to this method).
 java.lang.String getName()
          Returns the short name (max 8 characters) of this engine factory implementation which is "Java1.1"
 SoundEngine getSoundEngine()
          Returns the sound engine implementation for the current platform.
 int getSuitabilityForPlatform()
          Returns the suitability of this engine implementation for the current platform as one of the enumerated values.
 java.lang.String[] getSupportedResolutions()
          As the graphics engines created by this factory don't support fullscreen modes, this method returns null.
static boolean isRunnableOnPlatform()
          Returns true if this engine factory is runnable on the platform.
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

mStatic_engineFactory

private static CEngineFactory mStatic_engineFactory
The singleton reference to an instance of this engine factory.

m_soundEngine

private SoundEngine m_soundEngine
Reference to the singleton sound engine implementation.

m_graphicsEngine

private GraphicsEngine m_graphicsEngine
Reference to the singleton graphics engine implementation.

m_inputEngine

private InputEngine m_inputEngine
Reference to the singleton input engine implementation.

m_focusComponent

private java.awt.Component m_focusComponent
Reference to the singleton focus component.

m_finalizableObjects

private java.util.Vector m_finalizableObjects
All objects that must be finalized upon engine factory finalization.

m_settings

private GameFrameSettings m_settings
The main factory settings used for this engine factory.
Constructor Detail

CEngineFactory

private CEngineFactory(GameFrameSettings settings)
Constructs the engine factory without constructing any engines.
Parameters:
settings - The settings to be used in this engine factory.
Method Detail

getInstance

public static CEngineFactory getInstance(GameFrameSettings settings)
Returns the singleton instance of this engine factory (the instace will be created upon the first call to this method).
Parameters:
settings - The settings to be used in this engine factory.
Returns:
The singleton instance of this engine factory.

getName

public java.lang.String getName()
Returns the short name (max 8 characters) of this engine factory implementation which is "Java1.1"
Specified by:
getName in interface EngineFactory
Returns:
The short name of the engine factory.

getDescription

public java.lang.String getDescription()
Returns the description of the engine factory implementation.
Specified by:
getDescription in interface EngineFactory
Returns:
A description of the engine factory.

getSuitabilityForPlatform

public int getSuitabilityForPlatform()
Returns the suitability of this engine implementation for the current platform as one of the enumerated values. Currently return POOR so that any better implementation will override this implementation.
Specified by:
getSuitabilityForPlatform in interface EngineFactory
Returns:
Suitability of the engine factory for this platform.

isRunnableOnPlatform

public static boolean isRunnableOnPlatform()
Returns true if this engine factory is runnable on the platform.

getSupportedResolutions

public java.lang.String[] getSupportedResolutions()
As the graphics engines created by this factory don't support fullscreen modes, this method returns null.
Specified by:
getSupportedResolutions in interface EngineFactory
Returns:
Allways null.

getSoundEngine

public SoundEngine getSoundEngine()
                           throws GameFrameException
Returns the sound engine implementation for the current platform. If not successfull returns the do-nothing implementation of a sound engine.
Specified by:
getSoundEngine in interface EngineFactory
Returns:
The sound engine for this platform.

getGraphicsEngine

public GraphicsEngine getGraphicsEngine()
                                 throws GameFrameException
Returns the graphics engine implementation for the current platform. If not successfull returns null.
Specified by:
getGraphicsEngine in interface EngineFactory
Returns:
The graphics engine for this platform.

getInputEngine

public InputEngine getInputEngine()
                           throws GameFrameException
Returns the input engine implementation for the current platform. If not successfull returns null.
Specified by:
getInputEngine in interface EngineFactory
Returns:
The input engine for this platform.

createTimer

public Timer createTimer()
                  throws GameFrameException
Returns a new timer instance. Several timers can be created with this method. If a native timer can't be for some reason created, this method returns the basic implementation CTimer from the GameFrame.Java11 package.
Specified by:
createTimer in interface EngineFactory
Returns:
Timer instance.

finalizationNotify

public void finalizationNotify(Timer timer)
Notifies that the given timer has been finalized.
Specified by:
finalizationNotify in interface EngineFactory

finalize

public void finalize()
Invoked before application exits. Calls finalize on all created engines.
Specified by:
finalize in interface EngineFactory
Overrides:
finalize in class java.lang.Object

GF4J 0.9.4 Beta