org.xith3d.ui.hud
Class HUD

java.lang.Object
  extended by org.xith3d.ui.hud.HUD

public class HUD
extends java.lang.Object

This is a 3D HUD implementation. A HUD can contain WidgetContainers and Widgets.


Nested Class Summary
static class HUD.FocusMoveDirection
           
 
Field Summary
static int CROSSHAIR_Z_INDEX
           
static int CURSOR_Z_INDEX
           
static int POPUP_Z_INDEX
           
static int TOOLTIP_Z_INDEX
           
static int WINDOW_BASE_Z_INDEX
           
 
Constructor Summary
  HUD(int canvasWidth, int canvasHeight)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(int canvasWidth, int canvasHeight, float resX)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(int canvasWidth, int canvasHeight, float resX, float resY)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(int canvasWidth, int canvasHeight, float resX, float resY, WidgetContainer contentPane)
          Creates a new HUD with a coordinate system with the given width and height.
  HUD(int canvasWidth, int canvasHeight, float resX, WidgetContainer contentPane)
          Creates a new HUD with a coordinate system with the given width and height.
  HUD(int canvasWidth, int canvasHeight, org.openmali.types.twodee.Sized2fRO resolution)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(int canvasWidth, int canvasHeight, org.openmali.types.twodee.Sized2fRO resolution, WidgetContainer contentPane)
          Creates a new HUD with a coordinate system with the given width and height.
protected HUD(int canvasWidth, int canvasHeight, org.openmali.types.twodee.Sized2fRO resolution, WidgetContainer contentPane, boolean createHeavyWeightContentPane)
          Creates a new HUD with a coordinate system with the given width and height.
  HUD(org.openmali.types.twodee.Sized2iRO canvas)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, boolean createHeavyWeightContentPane)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, float resX)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, float resX, boolean createHeavyWeightContentPane)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, float resX, float resY)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, float resX, float resY, boolean createHeavyWeightContentPane)
          Creates a new HUD with a coordinate system with the given width and height and a default content pane.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, float resX, float resY, WidgetContainer contentPane)
          Creates a new HUD with a coordinate system with the given width and height.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, float resX, WidgetContainer contentPane)
          Creates a new HUD with a coordinate system with the given width and height.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, org.openmali.types.twodee.Sized2fRO resolution)
          Creates a new HUD with a coordinate system with the given resolution and a default content pane.
  HUD(org.openmali.types.twodee.Sized2iRO canvas, org.openmali.types.twodee.Sized2fRO resolution, WidgetContainer contentPane)
          Creates a new HUD with a coordinate system with the given resolution.
 
Method Summary
 void addGlobalContainerListener(WidgetContainerListener l)
          Adds a new WidgetContainerListener to be notified of global widget container events.
 void addGlobalInputListener(WidgetInputListener l)
          Adds a new WidgetInputListener to be notified of global widget input events.
 void addPickMissedListener(int mask, HUDPickMissedListener l)
          Adds a new HUDPickMissedListener to be notified of a pick event, that didn't hit any Widget.
 Window addWindow(Window window)
          Adds a Window to this HUD at the default location.
 Window addWindow(Window window, float locX, float locY)
          Adds a Window to this HUD.
 Window addWindowCentered(Window window)
          Adds a Window to this HUD centered within the HUD.
 void bindFocusMoveAccessor(org.jagatoo.input.devices.components.DeviceComponent comp, HUD.FocusMoveDirection direction)
          Binds a DeviceComponent to this HUD, that works as a focus-move-accessor for a given direction.
 void connect(org.openmali.types.twodee.ExtSized2i canvas)
          Connects this HUD to the given Sized2i instance (e.g. a Canvas3D) and listens for its resized event.
 void connect(org.jagatoo.input.InputSystem inputSystem)
          Connects this HUD to the given InputSystem.
protected  WidgetContainer createDefaultContentPane(boolean heavyWeight, float resX, float resY)
          Creates the default content pane for this HUD.
 void detach()
          Detaches this HUD.
 void disconnect(org.openmali.types.twodee.ExtSized2i canvas)
          Disconnects this HUD from the given Sized2i instance (e.g. a Canvas3D) and does not listen for its resized event anymore.
 void disconnect(org.jagatoo.input.InputSystem inputSystem)
          Disconnects this HUD from the given InputSystem.
 void disposeFocus()
          Unfocusses all Widgets.
 float getAspect()
          Returns the aspect ratio of this HUD.
 WidgetContainer getContentPane()
          Returns the content pane, where all other Widgets (except for windows) must be added to.
 ContextMenu getContextMenu()
          Returns the ContextMenu.
 HUDCoordinatesConverter getCoordinatesConverter()
          Returns the converter utility to convert from different coordinate spaces.
 CursorSet getCursorSet()
          Returns the CursorSet used to manage the standard cursor types.
 DropShadowFactory getDropShadowFactory()
          Returns the DropShadowFactory used to render drop shadows.
 float getHeight()
          Returns this HUD's height.
 java.lang.String getName()
          Returns the name of this HUD.
 OperationScheduler getOperationScheduler()
          Returns this HUD's OperationScheduler.
 ForegroundRenderPass getRenderPass()
          Walks up the SceneGraph to the root BranchGroup.
 float getResAspect()
          Returns the aspect ratio of the resolution.
 org.openmali.vecmath2.Tuple2f getResolution()
          Returns the resolution of the HUD.
 float getResX()
          Returns the x-resolution of the HUD.
 float getResY()
          Returns the y-resolution of the HUD.
 BranchGroup getSGGroup()
          Returns the BranchGroup associated with this HUD.
 org.openmali.types.twodee.Sized2fRO getSize()
          Return this size of this HUD.
static WidgetTheme getTheme()
          Returns the WidgetTheme to use for default textures and some default properties.
 ToolTipFactory getToolTipFactory()
          Returns the ToolTipFactory used to generate tooltip-Widgets.
 float getTransparency()
          Gets the content pane's transparency.
 float getWidth()
          Returns this HUD's width.
 boolean hasCustomResolution()
          Returns whether a custom resolution is defined for the HUD.
 boolean isConnected()
          Checks whether the HUD is currently connected with the SceneGraph.
 boolean isCrosshairVisible()
          Returns the crosshair's current visibility.
 boolean isCursorVisible()
          Returns the cursor's current visibility.
 boolean isVisible()
          Returns whether the whole HUD is visible or invisible.
 void removeGlobalContainerListener(WidgetContainerListener l)
          Removes a global WidgetContainerListener.
 void removeGlobalInputListener(WidgetInputListener l)
          Removes a global WidgetInputListener.
 void removePickMissedListener(HUDPickMissedListener l)
          Removes a HUDPickMissedListener.
 void removeWindow(Window window)
          Removes the given Window from this HUD.
 void setContentPane(WidgetContainer contentPane)
          Sets the content pane, where all other Widgets (except for windows) must be added to.
 void setContextMenu(ContextMenu contextMenu)
          Sets the ContextMenu.
 void setCrosshair(java.lang.String texture)
           Sets the Texture for the crosshair.
 void setCrosshair(java.lang.String texture, int hotspotX, int hotspotY)
           Sets the Texture for the crosshair.
 void setCrosshair(java.lang.String texture, org.openmali.vecmath2.Tuple2i hotspot)
           Sets the Texture for the crosshair.
 void setCrosshair(Texture2D texture)
           Sets the Texture for the crosshair.
 void setCrosshair(Texture2D texture, int hotspotX, int hotspotY)
           Sets the Texture for the crosshair.
 void setCrosshair(Texture2D texture, org.openmali.vecmath2.Tuple2i hotspot)
           Sets the Texture for the crosshair.
 void setCrosshairVisible(boolean visible)
           Sets the crosshair's visibility.
 void setCursor(Cursor pointer1)
          This is a convenience (and backwards-compatible) method to set the Cursor.
 void setCursor(java.lang.String pointer1)
          This is a convenience (and backwards-compatible) method to set the Cursor.
 void setCursorSet(CursorSet cursorSet)
          Sets the CursorSet with standard cursor types.
 void setCursorVisible(boolean visible)
           Sets the cursor's visibility.
 void setDropShadowFactory(DropShadowFactory dsf)
          Sets the DropShadowFactory to be used to render drop shadows.
 void setHeight(float height)
          Sets the new height of the HUD.
 void setName(java.lang.String name)
          Sets the name for this HUD.
 HUD setSize(float resX, float resY)
          Resizes this HUD's coordinate system to the given width and height.
protected  boolean setSize(float resX, float resY, boolean forced)
          Resizes this HUD's coordinate system to the given width and height.
 void setSize(int canvasWidth, int canvasHeight)
          Creates a new coordinate system on the HUD.
 void setSize(int canvasWidth, int canvasHeight, float resX, float resY)
          Creates a new coordinate system on the HUD.
 void setSize(int canvasWidth, int canvasHeight, org.openmali.types.twodee.Sized2fRO resolution)
          Creates a new coordinate system on the HUD.
 HUD setSize(org.openmali.types.twodee.Sized2fRO resolution)
          Resizes this HUD's coordinate system to the given width and height.
 void setSize(org.openmali.types.twodee.Sized2iRO canvas)
          Creates a new coordinate system on the HUD.
 void setSize(org.openmali.types.twodee.Sized2iRO canvas, float resX, float resY)
          Creates a new coordinate system on the HUD.
 void setSize(org.openmali.types.twodee.Sized2iRO canvas, org.openmali.types.twodee.Sized2fRO resolution)
          Creates a new coordinate system on the HUD.
 HUD setSize(org.openmali.vecmath2.Tuple2f resolution)
          Resizes this HUD's coordinate system to the given width and height.
static void setTheme(java.lang.String theme)
          Sets the built-in WidgetTheme to use for default textures and some default properties.
static void setTheme(WidgetTheme theme)
          Sets the WidgetTheme to use for default textures and some default properties.
 void setToolTipFactory(ToolTipFactory ttf)
          Sets the ToolTipFactory to be used to generate tooltip-Widgets.
 void setTransparency(float transparency)
          Sets all Widgets' transparency.
 void setUseVoidContextMenu(boolean use)
          Defines whether a ContextMenu is to be used if the mouse was clicked in an empty space (where no Widget is displayed).
 void setVisible(boolean visible)
          Sets the whole HUD visible/invisible.
 void setWidth(float width)
          Sets the new width of the HUD.
 void unbindFocusMoveAccessor(org.jagatoo.input.devices.components.DeviceComponent comp, HUD.FocusMoveDirection direction)
          Unbinds the given focus-move-accessor DeviceComponent from this HUD for the given direction.
 void update()
          Updates the HUD.
 boolean useVoidContextMenu()
          Returns whether a ContextMenu is to be used if the mouse was clicked in an empty space (where no Widget is displayed).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WINDOW_BASE_Z_INDEX

public static final int WINDOW_BASE_Z_INDEX
See Also:
Constant Field Values

POPUP_Z_INDEX

public static final int POPUP_Z_INDEX
See Also:
Constant Field Values

TOOLTIP_Z_INDEX

public static final int TOOLTIP_Z_INDEX
See Also:
Constant Field Values

CROSSHAIR_Z_INDEX

public static final int CROSSHAIR_Z_INDEX
See Also:
Constant Field Values

CURSOR_Z_INDEX

public static final int CURSOR_Z_INDEX
See Also:
Constant Field Values
Constructor Detail

HUD

protected HUD(int canvasWidth,
              int canvasHeight,
              org.openmali.types.twodee.Sized2fRO resolution,
              WidgetContainer contentPane,
              boolean createHeavyWeightContentPane)
Creates a new HUD with a coordinate system with the given width and height.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect ratio from
canvasHeight - the height of the Canvas3D to take the resolution and aspect ratio from
resolution - the resolution of the coordinate system
contentPane - the content pane to use
createHeavyWeightContentPane - true if it is to be heavyweight; false otherwise

HUD

public HUD(int canvasWidth,
           int canvasHeight,
           org.openmali.types.twodee.Sized2fRO resolution,
           WidgetContainer contentPane)
Creates a new HUD with a coordinate system with the given width and height.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect ratio from
canvasHeight - the height of the Canvas3D to take the resolution and aspect ratio from
resolution - the resolution of the coordinate system
contentPane - the content pane to use

HUD

public HUD(int canvasWidth,
           int canvasHeight,
           org.openmali.types.twodee.Sized2fRO resolution)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect ratio from
canvasHeight - the height of the Canvas3D to take the resolution and aspect ratio from
resolution - the resolution of the coordinate system

HUD

public HUD(int canvasWidth,
           int canvasHeight,
           float resX,
           float resY)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect ratio from
canvasHeight - the height of the Canvas3D to take the resolution and aspect ratio from
resX - the width of the coordinate system
resY - the height of the coordinate system

HUD

public HUD(int canvasWidth,
           int canvasHeight,
           float resX,
           float resY,
           WidgetContainer contentPane)
Creates a new HUD with a coordinate system with the given width and height.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect ratio from
canvasHeight - the height of the Canvas3D to take the resolution and aspect ratio from
resX - the width of the coordinate system
resY - the height of the coordinate system
contentPane - the content pane to use

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           org.openmali.types.twodee.Sized2fRO resolution)
Creates a new HUD with a coordinate system with the given resolution and a default content pane.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resolution - the resolution of the coordinate system

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           org.openmali.types.twodee.Sized2fRO resolution,
           WidgetContainer contentPane)
Creates a new HUD with a coordinate system with the given resolution.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resolution - the resolution of the coordinate system
contentPane - the content pane to use

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           float resX)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resX - the x-resolution of the coordinate system. The y-resolution is calculated by ( resX / canvasAspect).

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           float resX,
           boolean createHeavyWeightContentPane)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resX - the x-resolution of the coordinate system. The y-resolution is calculated by ( resX / canvasAspect).
createHeavyWeightContentPane - true if it is to be heavyweight; false otherwise

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           float resX,
           WidgetContainer contentPane)
Creates a new HUD with a coordinate system with the given width and height.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resX - the x-resolution of the coordinate system. The y-resolution is calculated by ( resX / canvasAspect).
contentPane - the content pane to use

HUD

public HUD(int canvasWidth,
           int canvasHeight,
           float resX)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect ratio from
canvasHeight - the height of the Canvas3D to take the resolution and aspect ratio from
resX - the x-resolution of the coordinate system. The y-resolution is calculated by ( resX / canvasAspect).

HUD

public HUD(int canvasWidth,
           int canvasHeight,
           float resX,
           WidgetContainer contentPane)
Creates a new HUD with a coordinate system with the given width and height.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect ratio from
canvasHeight - the height of the Canvas3D to take the resolution and aspect ratio from
resX - the x-resolution of the coordinate system. The y-resolution is calculated by ( resX / canvasAspect).
contentPane - the content pane to use

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           float resX,
           float resY)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resX - the width of the coordinate system
resY - the height of the coordinate system

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           float resX,
           float resY,
           boolean createHeavyWeightContentPane)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resX - the width of the coordinate system
resY - the height of the coordinate system
createHeavyWeightContentPane - true if it is to be heavyweight; false otherwise

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           float resX,
           float resY,
           WidgetContainer contentPane)
Creates a new HUD with a coordinate system with the given width and height.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resX - the width of the coordinate system
resY - the height of the coordinate system
contentPane - the content pane to use

HUD

public HUD(int canvasWidth,
           int canvasHeight)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect ratio from
canvasHeight - the width of the Canvas3D to take the resolution and aspect ratio from

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvas - the Canvas3D to take the resolution and aspect ratio from

HUD

public HUD(org.openmali.types.twodee.Sized2iRO canvas,
           boolean createHeavyWeightContentPane)
Creates a new HUD with a coordinate system with the given width and height and a default content pane.

Parameters:
canvas - the Canvas3D to take the resolution and aspect ratio from
createHeavyWeightContentPane - true if it is to be heavyweight; false otherwise
Method Detail

getRenderPass

public final ForegroundRenderPass getRenderPass()
Walks up the SceneGraph to the root BranchGroup. If there is one the associated RenderPass is searched for and returned. If this HUD is not attached to a BranchGroup or the BranchGroup is not associated with a RenderPass they are created.

Returns:
the RenderPass to add to the Renderer or Xith3DEnvironment

getSGGroup

public final BranchGroup getSGGroup()
Returns the BranchGroup associated with this HUD.

Returns:
the BranchGroup instance

detach

public final void detach()
Detaches this HUD.


setName

public void setName(java.lang.String name)
Sets the name for this HUD.

Parameters:
name - he name to set

getName

public final java.lang.String getName()
Returns the name of this HUD.

Returns:
the name

setTheme

public static void setTheme(WidgetTheme theme)
Sets the WidgetTheme to use for default textures and some default properties.

Parameters:
theme - the new WidgetTheme to use

setTheme

public static void setTheme(java.lang.String theme)
                     throws java.io.IOException
Sets the built-in WidgetTheme to use for default textures and some default properties.

Parameters:
theme - the new WidgetTheme to use
Throws:
java.io.IOException

getTheme

public static final WidgetTheme getTheme()
Returns the WidgetTheme to use for default textures and some default properties.

Returns:
the WidgetTheme

addPickMissedListener

public void addPickMissedListener(int mask,
                                  HUDPickMissedListener l)
Adds a new HUDPickMissedListener to be notified of a pick event, that didn't hit any Widget.

Parameters:
mask - a bitmask to define which HUDPickResult.HUDPickReasons cause the listener to be notified
l - the listener to add
See Also:
HUDPickResult.HUDPickReason.getMaskValue()

removePickMissedListener

public void removePickMissedListener(HUDPickMissedListener l)
Removes a HUDPickMissedListener.

Parameters:
l - the listener to remove

addGlobalInputListener

public void addGlobalInputListener(WidgetInputListener l)
Adds a new WidgetInputListener to be notified of global widget input events.

Parameters:
l - the listener to add

removeGlobalInputListener

public void removeGlobalInputListener(WidgetInputListener l)
Removes a global WidgetInputListener.

Parameters:
l - the listener to remove

addGlobalContainerListener

public void addGlobalContainerListener(WidgetContainerListener l)
Adds a new WidgetContainerListener to be notified of global widget container events.

Parameters:
l - the listener to add

removeGlobalContainerListener

public void removeGlobalContainerListener(WidgetContainerListener l)
Removes a global WidgetContainerListener.

Parameters:
l - the listener to remove

disposeFocus

public void disposeFocus()
Unfocusses all Widgets.


setVisible

public void setVisible(boolean visible)
Sets the whole HUD visible/invisible.

Parameters:
visible - true to make it visible; false to make it invisible

isVisible

public final boolean isVisible()
Returns whether the whole HUD is visible or invisible.

Returns:
true if the HUD is visible; false otherwise

setTransparency

public void setTransparency(float transparency)
Sets all Widgets' transparency.

Parameters:
transparency - the transparency to apply to all Widgets

getTransparency

public final float getTransparency()
Gets the content pane's transparency.

Returns:
the transparency

getWidth

public final float getWidth()
Returns this HUD's width.

Returns:
the width

getHeight

public final float getHeight()
Returns this HUD's height.

Returns:
the height

getAspect

public final float getAspect()
Returns the aspect ratio of this HUD.

Returns:
the aspect ratio

getSize

public final org.openmali.types.twodee.Sized2fRO getSize()
Return this size of this HUD.

Returns:
the size

hasCustomResolution

public final boolean hasCustomResolution()
Returns whether a custom resolution is defined for the HUD.

Returns:
true if a custom resolution is defined; false otherwise

getResX

public final float getResX()
Returns the x-resolution of the HUD.

Returns:
the x-resolution

getResY

public final float getResY()
Returns the y-resolution of the HUD.

Returns:
the y-resolution

getResolution

public final org.openmali.vecmath2.Tuple2f getResolution()
Returns the resolution of the HUD.

Returns:
the resolution

getResAspect

public final float getResAspect()
Returns the aspect ratio of the resolution.

Returns:
the aspect ratio

getCoordinatesConverter

public final HUDCoordinatesConverter getCoordinatesConverter()
Returns the converter utility to convert from different coordinate spaces.

Returns:
the converter

update

public void update()
Updates the HUD.


setSize

protected boolean setSize(float resX,
                          float resY,
                          boolean forced)
Resizes this HUD's coordinate system to the given width and height.

Parameters:
resX - the new width of this HUD's coordinate system
resY - the new height of this HUD's coordinate system
forced - true to force the resize

setSize

public final HUD setSize(float resX,
                         float resY)
Resizes this HUD's coordinate system to the given width and height.

Parameters:
resX - the new width of this HUD's coordinate system
resY - the new height of this HUD's coordinate system

setSize

public final HUD setSize(org.openmali.types.twodee.Sized2fRO resolution)
Resizes this HUD's coordinate system to the given width and height.

Parameters:
resolution - the new resolution of this HUD's coordinate system

setSize

public final HUD setSize(org.openmali.vecmath2.Tuple2f resolution)
Resizes this HUD's coordinate system to the given width and height.

Parameters:
resolution - the new resolution of this HUD's coordinate system

setSize

public final void setSize(int canvasWidth,
                          int canvasHeight,
                          float resX,
                          float resY)
Creates a new coordinate system on the HUD. It does not actually resize the HUD.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect from
canvasHeight - the width of the Canvas3D to take the resolution and aspect from
resX - the view width of the coordinate system
resY - the view height of the coordinate system

setSize

public final void setSize(org.openmali.types.twodee.Sized2iRO canvas,
                          float resX,
                          float resY)
Creates a new coordinate system on the HUD. It does not actually resize the HUD.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resX - the view width of the coordinate system
resY - the view height of the coordinate system

setSize

public final void setSize(int canvasWidth,
                          int canvasHeight,
                          org.openmali.types.twodee.Sized2fRO resolution)
Creates a new coordinate system on the HUD. It does not actually resize the HUD.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect from
canvasHeight - the width of the Canvas3D to take the resolution and aspect from
resolution - the resolution of the coordinate system

setSize

public final void setSize(org.openmali.types.twodee.Sized2iRO canvas,
                          org.openmali.types.twodee.Sized2fRO resolution)
Creates a new coordinate system on the HUD. It does not actually resize the HUD.

Parameters:
canvas - the Canvas3D to take the aspect ratio from
resolution - the resolution of the coordinate system

setSize

public final void setSize(int canvasWidth,
                          int canvasHeight)
Creates a new coordinate system on the HUD. It does not actually resize the HUD.

Parameters:
canvasWidth - the width of the Canvas3D to take the resolution and aspect from
canvasHeight - the width of the Canvas3D to take the resolution and aspect from

setSize

public final void setSize(org.openmali.types.twodee.Sized2iRO canvas)
Creates a new coordinate system on the HUD. It does not actually resize the HUD.

Parameters:
canvas - the canvas to take the resolution and aspect from

setWidth

public final void setWidth(float width)
Sets the new width of the HUD.

Parameters:
width - the new width to set

setHeight

public final void setHeight(float height)
Sets the new height of the HUD.

Parameters:
height - the new height to set

addWindow

public Window addWindow(Window window,
                        float locX,
                        float locY)
Adds a Window to this HUD.

Parameters:
window - the Window to add
locX - the x-location of the Window
locY - the y-location of the Window
Returns:
the just added Window

addWindow

public final Window addWindow(Window window)
Adds a Window to this HUD at the default location.

Parameters:
window - the Window to add
Returns:
the just added Window

addWindowCentered

public final Window addWindowCentered(Window window)
Adds a Window to this HUD centered within the HUD.

Parameters:
window - the Window to add
Returns:
the just added Window

removeWindow

public void removeWindow(Window window)
Removes the given Window from this HUD.

Parameters:
window - the Window to remove

setContentPane

public void setContentPane(WidgetContainer contentPane)
Sets the content pane, where all other Widgets (except for windows) must be added to.

Parameters:
contentPane - the content pane (WidgetContainer) to set

getContentPane

public final WidgetContainer getContentPane()
Returns the content pane, where all other Widgets (except for windows) must be added to.

Returns:
the content pane (WidgetContainer) to return

setToolTipFactory

public void setToolTipFactory(ToolTipFactory ttf)
Sets the ToolTipFactory to be used to generate tooltip-Widgets.

Parameters:
ttf - the ToolTipFactory instance to use

getToolTipFactory

public final ToolTipFactory getToolTipFactory()
Returns the ToolTipFactory used to generate tooltip-Widgets.

Returns:
the ToolTipFactory instance used

setDropShadowFactory

public void setDropShadowFactory(DropShadowFactory dsf)
Sets the DropShadowFactory to be used to render drop shadows.

Parameters:
dsf - the DropShadowFactory to set

getDropShadowFactory

public final DropShadowFactory getDropShadowFactory()
Returns the DropShadowFactory used to render drop shadows.

Returns:
the DropShadowFactory used

setContextMenu

public void setContextMenu(ContextMenu contextMenu)
Sets the ContextMenu.

Parameters:
contextMenu - the ContextMenu to set

getContextMenu

public ContextMenu getContextMenu()
Returns the ContextMenu.

Returns:
the ContextMenu

setUseVoidContextMenu

public void setUseVoidContextMenu(boolean use)
Defines whether a ContextMenu is to be used if the mouse was clicked in an empty space (where no Widget is displayed).

Parameters:
use - true to use a ContextMenu; false otherwise

useVoidContextMenu

public final boolean useVoidContextMenu()
Returns whether a ContextMenu is to be used if the mouse was clicked in an empty space (where no Widget is displayed).

Returns:
true if a ContextMenu is to be used; false otherwise

bindFocusMoveAccessor

public void bindFocusMoveAccessor(org.jagatoo.input.devices.components.DeviceComponent comp,
                                  HUD.FocusMoveDirection direction)
Binds a DeviceComponent to this HUD, that works as a focus-move-accessor for a given direction.

Parameters:
comp - the component to bind
direction - the direction to use
See Also:
HUD.FocusMoveDirection

unbindFocusMoveAccessor

public void unbindFocusMoveAccessor(org.jagatoo.input.devices.components.DeviceComponent comp,
                                    HUD.FocusMoveDirection direction)
Unbinds the given focus-move-accessor DeviceComponent from this HUD for the given direction.

Parameters:
comp - the component to unbind
direction - the direction to use
See Also:
HUD.FocusMoveDirection

setCursorSet

public void setCursorSet(CursorSet cursorSet)
Sets the CursorSet with standard cursor types.

Parameters:
cursorSet - the CursorSet to set

getCursorSet

public final CursorSet getCursorSet()
Returns the CursorSet used to manage the standard cursor types.

Returns:
the CursorSet to return

setCursor

public void setCursor(Cursor pointer1)
This is a convenience (and backwards-compatible) method to set the Cursor. This sets the Cursor.Type#POINTER1 entry in the current CursorSet.

Parameters:
pointer1 - the new cursor to use for POINTER1 (or null for no cursor)

setCursor

public void setCursor(java.lang.String pointer1)
This is a convenience (and backwards-compatible) method to set the Cursor. This sets the Cursor.Type#POINTER1 entry in the current CursorSet.

Parameters:
pointer1 - the new cursor to use for POINTER1 (or null for no cursor)

setCursorVisible

public void setCursorVisible(boolean visible)

Sets the cursor's visibility.

If no cursor image has been set, this call will have no effect!

Parameters:
visible - true to make the cursor visible; false otherwise

isCursorVisible

public final boolean isCursorVisible()
Returns the cursor's current visibility.

Returns:
true if the cursor is currently visible; false otherwise

setCrosshair

public void setCrosshair(Texture2D texture,
                         int hotspotX,
                         int hotspotY)

Sets the Texture for the crosshair.

Use null for texture to remove the crosshair.

Parameters:
texture - the new texture for the crosshair Image (or null for no crosshair)
hotspotX - texture-relative x-location of the crosshair's hotspot
hotspotY - texture-relative y-location of the crosshair's hotspot

setCrosshair

public final void setCrosshair(Texture2D texture,
                               org.openmali.vecmath2.Tuple2i hotspot)

Sets the Texture for the crosshair.

Use null for texture to remove the crosshair.

Parameters:
texture - the new texture for the crosshair Image (or null for no crosshair)
hotspot - texture-relative location of the crosshair's hotspot

setCrosshair

public final void setCrosshair(java.lang.String texture,
                               int hotspotX,
                               int hotspotY)

Sets the Texture for the crosshair. The texture MUST support an alpha channel.

Use null for texture to remove the crosshair.

Parameters:
texture - the new texture for the crosshair Image (or null for no crosshair)
hotspotX - texture-relative x-location of the crosshair's hotspot
hotspotY - texture-relative y-location of the crosshair's hotspot

setCrosshair

public final void setCrosshair(java.lang.String texture,
                               org.openmali.vecmath2.Tuple2i hotspot)

Sets the Texture for the crosshair. The texture MUST support an alpha channel.

Use null for texture to remove the crosshair.

Parameters:
texture - the new texture for the crosshair Image (or null for no crosshair)
hotspot - texture-relative location of the crosshair's hotspot

setCrosshair

public final void setCrosshair(Texture2D texture)

Sets the Texture for the crosshair.

Use null for texture to remove the crosshair.

Parameters:
texture - the new texture for the crosshair Image (or null for no crosshair)

setCrosshair

public final void setCrosshair(java.lang.String texture)

Sets the Texture for the crosshair. The texture MUST support an alpha channel.

Use null for texture to remove the crosshair.

Parameters:
texture - the new texture for the crosshair Image (or null for no crosshair)

setCrosshairVisible

public void setCrosshairVisible(boolean visible)

Sets the crosshair's visibility.

If no crosshair image has been set, this call will have no effect!

Parameters:
visible - true to make the crosshair visible; false otherwise

isCrosshairVisible

public final boolean isCrosshairVisible()
Returns the crosshair's current visibility.

Returns:
true if the crosshair is currently visible; false otherwise

getOperationScheduler

public final OperationScheduler getOperationScheduler()
Returns this HUD's OperationScheduler.

Returns:
the OperationScheduler

connect

public void connect(org.openmali.types.twodee.ExtSized2i canvas)
Connects this HUD to the given Sized2i instance (e.g. a Canvas3D) and listens for its resized event.

Parameters:
canvas -

connect

public void connect(org.jagatoo.input.InputSystem inputSystem)
Connects this HUD to the given InputSystem.

Parameters:
inputSystem - the InputSystem to connect to

disconnect

public void disconnect(org.openmali.types.twodee.ExtSized2i canvas)
Disconnects this HUD from the given Sized2i instance (e.g. a Canvas3D) and does not listen for its resized event anymore.

Parameters:
canvas - the canvas to disconnect from

disconnect

public void disconnect(org.jagatoo.input.InputSystem inputSystem)
Disconnects this HUD from the given InputSystem.

Parameters:
inputSystem - the InputSystem to disconnect from

isConnected

public final boolean isConnected()
Checks whether the HUD is currently connected with the SceneGraph.

Returns:
true if it is connected; false otherwise

createDefaultContentPane

protected WidgetContainer createDefaultContentPane(boolean heavyWeight,
                                                   float resX,
                                                   float resY)
Creates the default content pane for this HUD.

Parameters:
heavyWeight - true if it is to be heavyweight
resX - the x-resolution for the content pane
resY - the y-resolution for the content pane
Returns:
the newly created content pane