org.jdesktop.wonderland.client.hud
Class HUDFactory

java.lang.Object
  extended by org.jdesktop.wonderland.client.hud.HUDFactory

public class HUDFactory
extends java.lang.Object

A HUD factory which creates new HUD object instances. A Wonderland client will typically have one HUDFactory which is the source of all HUD instances.

Author:
nsimpson

Constructor Summary
HUDFactory()
           
 
Method Summary
static HUD createHUD(java.awt.Dimension displayBounds)
          Creates a new Wonderland HUD instance the same size as the display.
static HUD createHUD(java.awt.Dimension displayBounds, float xPercent, float yPercent, float widthPercent, float heightPercent)
          Creates a new HUD instance with scalable bounds.
static HUD createHUD(java.awt.Dimension displayBounds, int x, int y, int width, int height)
          Creates a new Wonderland HUD instance with a fixed size.
static HUD createHUD(java.awt.Dimension displayBounds, java.awt.Rectangle hudBounds)
          Creates a new Wonderland HUD instance using percentages of the display size for the bounds of the HUD.
static HUD createHUD(java.awt.Dimension displayBounds, java.awt.geom.Rectangle2D.Float scalableBounds)
          Creates a new Wonderland HUD instance using percentages of the display size for the bounds of the HUD.
static void setHUDFactorySPI(HUDFactorySPI spii)
          Binds a specific HUD factory service provider to this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HUDFactory

public HUDFactory()
Method Detail

setHUDFactorySPI

public static void setHUDFactorySPI(HUDFactorySPI spii)
Binds a specific HUD factory service provider to this factory.

Parameters:
spii - an instance of a HUD factory service provider

createHUD

public static HUD createHUD(java.awt.Dimension displayBounds)
Creates a new Wonderland HUD instance the same size as the display.

Parameters:
displayBounds - the size of the display
Returns:
a new HUD instance, sized to the display

createHUD

public static HUD createHUD(java.awt.Dimension displayBounds,
                            int x,
                            int y,
                            int width,
                            int height)
Creates a new Wonderland HUD instance with a fixed size.

Parameters:
displayBounds - the size of the display in pixels
x - the x position of the HUD relative to the x origin of the view
y - the y position of the HUD relative to the y origin of the view
width - the width of the HUD relative to the width of the view
height - the height of the HUD relative to the height of the view
Returns:
a new HUD instance with the specified fixed size

createHUD

public static HUD createHUD(java.awt.Dimension displayBounds,
                            java.awt.Rectangle hudBounds)
Creates a new Wonderland HUD instance using percentages of the display size for the bounds of the HUD.

Parameters:
displayBounds - the size of the display in pixels
hudBounds - the size and position of the HUD expressed in pixels
Returns:
a new HUD instance with the specified fixed size

createHUD

public static HUD createHUD(java.awt.Dimension displayBounds,
                            java.awt.geom.Rectangle2D.Float scalableBounds)
Creates a new Wonderland HUD instance using percentages of the display size for the bounds of the HUD.

Parameters:
displayBounds - the size of the display in pixels
scalableBounds - the size and position of the HUD expressed in percentages

createHUD

public static HUD createHUD(java.awt.Dimension displayBounds,
                            float xPercent,
                            float yPercent,
                            float widthPercent,
                            float heightPercent)
Creates a new HUD instance with scalable bounds.

Parameters:
displayBounds - the size of the display in pixels
xPercent - the x-coordinate of the HUD as a percentage of the width of the display
yPercent - the y-coordinate of the HUD as a percentage of the height of the display
widthPercent - the width of the HUD as a percentage of the width of the display
heightPercent - the height of the HUD as a percentage of the height of the display
Returns:
a new HUD instance with scalable bounds.


Open Wonderland - http://openwonderland.org