com.jme.scene.model.XMLparser.Converters
Class DummyDisplaySystem

java.lang.Object
  extended bycom.jme.system.DisplaySystem
      extended bycom.jme.scene.model.XMLparser.Converters.DummyDisplaySystem

public class DummyDisplaySystem
extends DisplaySystem

Started Date: Jul 2, 2004

This class is a dummy class that is not suppost to be rendered. It is here to allow the easy creation of dummy jME objects (like various RenderState and Spatial) so that they can be used by conversion utilities to read/write jME. It is NOT to be used for rendering as it won't do anything at all.

Author:
Jack Lindamood

Field Summary
 
Fields inherited from class com.jme.system.DisplaySystem
alphaBits, bpp, created, depthBits, frq, fs, height, rendererNames, samples, stencilBits, width
 
Constructor Summary
DummyDisplaySystem()
           
 
Method Summary
 void close()
          close shutdowns and destroys any window contexts.
 java.awt.Canvas createCanvas(int w, int h)
          createCanvas creates an awt canvas with the desired settings.
 void createHeadlessWindow(int w, int h, int bpp)
          createHeadlessWindow creates a headless window with the desired settings.
 TextureRenderer createTextureRenderer(int width, int height, boolean useRGB, boolean useRGBA, boolean useDepth, boolean isRectangle, int target, int mipmaps)
          Crate a TextureRenderer using the underlying system.
 void createWindow(int w, int h, int bpp, int frq, boolean fs)
          createWindow creates a window with the desired settings.
 WidgetFont getFont(java.lang.String fontName)
           
 Renderer getRenderer()
          getRenderer returns the Renderer implementation that is compatible with the chosen DisplaySystem.
 RendererType getRendererType()
          getRendererType returns an instance of a strongly typed enumeration that can be used to determine the renderer that the DisplaySystem is currently using.
 Vector3f getScreenCoordinates(Vector3f worldPosition)
          Translate world to screen coordinates
 Vector3f getScreenCoordinates(Vector3f worldPosition, Vector3f store)
          Translate world to screen coordinates
 Vector3f getWorldCoordinates(Vector2f screenPosition, float zPos)
          Translate screen to world coordinates.
 Vector3f getWorldCoordinates(Vector2f screenPosition, float zPos, Vector3f store)
          Translate screen to world coordinates.
 boolean isClosing()
          isClosing notifies if the window is currently closing.
 boolean isValidDisplayMode(int width, int height, int bpp, int freq)
          isValidDisplayMode determines if the given parameters constitute a valid display mode on this system.
 void recreateWindow(int w, int h, int bpp, int frq, boolean fs)
          recreateWindow recreates a window with the desired settings.
 void reset()
          reset cleans up the display system for closing or restarting.
 void setRenderer(Renderer r)
           
 void setTitle(java.lang.String title)
          Sets the title of the display system.
 void setVSyncEnabled(boolean enabled)
          setVSyncEnabled attempts to enable or disable monitor vertical synchronization.
 
Methods inherited from class com.jme.system.DisplaySystem
getBitDepth, getDisplaySystem, getDisplaySystem, getFrequency, getHeight, getMinAlphaBits, getMinDepthBits, getMinSamples, getMinStencilBits, getWidth, isCreated, isFullScreen, setMinAlphaBits, setMinDepthBits, setMinSamples, setMinStencilBits, updateStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyDisplaySystem

public DummyDisplaySystem()
Method Detail

isValidDisplayMode

public boolean isValidDisplayMode(int width,
                                  int height,
                                  int bpp,
                                  int freq)
Description copied from class: DisplaySystem
isValidDisplayMode determines if the given parameters constitute a valid display mode on this system. Returning true does not necessarily guarantee that the system is capable of running in the specified display mode, merely that it believes it is possible.

Specified by:
isValidDisplayMode in class DisplaySystem
Parameters:
width - the width/horizontal resolution of the display.
height - the height/vertical resolution of the display.
bpp - the bit depth of the display.
freq - the frequency of refresh of the display (in Hz).

setVSyncEnabled

public void setVSyncEnabled(boolean enabled)
Description copied from class: DisplaySystem
setVSyncEnabled attempts to enable or disable monitor vertical synchronization. The method is a "best attempt" to change the monitor vertical refresh synchronization, and is not guaranteed to be successful.

Specified by:
setVSyncEnabled in class DisplaySystem
Parameters:
enabled - true to synchronize, false to ignore synchronization

setTitle

public void setTitle(java.lang.String title)
Description copied from class: DisplaySystem
Sets the title of the display system. This is usually reflected by the renderer as text in the menu bar.

Specified by:
setTitle in class DisplaySystem
Parameters:
title - The new display title.

createWindow

public void createWindow(int w,
                         int h,
                         int bpp,
                         int frq,
                         boolean fs)
Description copied from class: DisplaySystem
createWindow creates a window with the desired settings. The width and height defined by w and h define the size of the window if fullscreen is false, otherwise it defines the resolution of the fullscreen display. The color depth is defined by bpp. The implementing class should only allow 16, 24, and 32. The monitor frequency is defined by the frq parameter and should not exceed the capabilities of the connected hardware, the implementing class should attempt to assure this does not happen. Lastly, the boolean flag fs determines if the display should be windowed or fullscreen. If false, windowed is chosen. This window will be placed in the center of the screen initially. If true fullscreen mode will be entered with the appropriate settings.

Specified by:
createWindow in class DisplaySystem
Parameters:
w - the width/horizontal resolution of the display.
h - the height/vertical resolution of the display.
bpp - the color depth of the display.
frq - the frequency of refresh of the display.
fs - flag determining if fullscreen is to be used or not. True will use fullscreen, false will use windowed mode.

createHeadlessWindow

public void createHeadlessWindow(int w,
                                 int h,
                                 int bpp)
Description copied from class: DisplaySystem
createHeadlessWindow creates a headless window with the desired settings. A headless window is a rendering target that is not shown on screen. It is useful for doing offline rendering, integration and so forth. You can not have a regular and headless window at the same time. The width and height defined by w and h define the size of the window. The color depth is defined by bpp.

Specified by:
createHeadlessWindow in class DisplaySystem
Parameters:
w - the width/horizontal resolution of the display.
h - the height/vertical resolution of the display.
bpp - the color depth of the display.

recreateWindow

public void recreateWindow(int w,
                           int h,
                           int bpp,
                           int frq,
                           boolean fs)
Description copied from class: DisplaySystem
recreateWindow recreates a window with the desired settings.

Specified by:
recreateWindow in class DisplaySystem
Parameters:
w - the width/horizontal resolution of the display.
h - the height/vertical resolution of the display.
bpp - the color depth of the display.
frq - the frequency of refresh of the display.
fs - flag determining if fullscreen is to be used or not. True will use fullscreen, false will use windowed mode.

getRenderer

public Renderer getRenderer()
Description copied from class: DisplaySystem
getRenderer returns the Renderer implementation that is compatible with the chosen DisplaySystem. For example, if LWJGLDisplaySystem is used, the returned Renderer will be LWJGLRenderer.

Specified by:
getRenderer in class DisplaySystem
Returns:
the appropriate Renderer implementation that is compatible with the used DisplaySystem.
See Also:
Renderer

getRendererType

public RendererType getRendererType()
Description copied from class: DisplaySystem
getRendererType returns an instance of a strongly typed enumeration that can be used to determine the renderer that the DisplaySystem is currently using.

Specified by:
getRendererType in class DisplaySystem
Returns:
See Also:
JmeType

isClosing

public boolean isClosing()
Description copied from class: DisplaySystem
isClosing notifies if the window is currently closing. This could be caused via the application itself or external interrupts such as alt-f4 etc.

Specified by:
isClosing in class DisplaySystem
Returns:
true if the window is closing, false otherwise.

reset

public void reset()
Description copied from class: DisplaySystem
reset cleans up the display system for closing or restarting.

Specified by:
reset in class DisplaySystem

close

public void close()
Description copied from class: DisplaySystem
close shutdowns and destroys any window contexts.

Specified by:
close in class DisplaySystem

getFont

public WidgetFont getFont(java.lang.String fontName)
Specified by:
getFont in class DisplaySystem
Parameters:
fontName - - name of the font to loaded
Returns:
an instance of the requested font, null of the isn't loaded.

createTextureRenderer

public TextureRenderer createTextureRenderer(int width,
                                             int height,
                                             boolean useRGB,
                                             boolean useRGBA,
                                             boolean useDepth,
                                             boolean isRectangle,
                                             int target,
                                             int mipmaps)
Description copied from class: DisplaySystem
Crate a TextureRenderer using the underlying system. This should not be user called. It is called when the display system is created.

Specified by:
createTextureRenderer in class DisplaySystem
Parameters:
width - width of texture
height - height of texture
useRGB - if this is true, useRGBA should not be
useRGBA - if this is true, useRGB should not be
useDepth -
isRectangle -
target -
mipmaps -
Returns:
A TextureRenderer for the display system.

getScreenCoordinates

public Vector3f getScreenCoordinates(Vector3f worldPosition)
Description copied from class: DisplaySystem
Translate world to screen coordinates

Specified by:
getScreenCoordinates in class DisplaySystem
Parameters:
worldPosition - Vector3f representing the world position to retrieve.
Returns:
Vector2f The screen position of that vector3f world position.

getScreenCoordinates

public Vector3f getScreenCoordinates(Vector3f worldPosition,
                                     Vector3f store)
Description copied from class: DisplaySystem
Translate world to screen coordinates

Specified by:
getScreenCoordinates in class DisplaySystem
Parameters:
worldPosition - Vector3f representing the world position to retrieve.
store - Vector3f to store the world position in.
Returns:
Vector3f The store vector3f, after storing.

getWorldCoordinates

public Vector3f getWorldCoordinates(Vector2f screenPosition,
                                    float zPos)
Description copied from class: DisplaySystem
Translate screen to world coordinates.

Specified by:
getWorldCoordinates in class DisplaySystem
Parameters:
screenPosition - Vector2f representing the screen position with 0,0 at the bottom left.
zPos - float The z position away from the viewing plane.
Returns:
Vector3f A vector3f representing the vector's world position.

getWorldCoordinates

public Vector3f getWorldCoordinates(Vector2f screenPosition,
                                    float zPos,
                                    Vector3f store)
Description copied from class: DisplaySystem
Translate screen to world coordinates.

Specified by:
getWorldCoordinates in class DisplaySystem
Parameters:
screenPosition - Vector2f representing the screen position with 0,0 at the bottom left
zPos - float The z position away from the viewing plane.
store - Vector3f The vector to store the result in.
Returns:
Vector3f The store vector, after storing it's result.

setRenderer

public void setRenderer(Renderer r)
Specified by:
setRenderer in class DisplaySystem

createCanvas

public java.awt.Canvas createCanvas(int w,
                                    int h)
Description copied from class: DisplaySystem
createCanvas creates an awt canvas with the desired settings. The width and height defined by w and h define the size of the canvas.

Specified by:
createCanvas in class DisplaySystem
Parameters:
w - the width/horizontal resolution of the display.
h - the height/vertical resolution of the display.