org.xith3d.ui.hud.widgets
Class Widget3D

java.lang.Object
  extended by org.xith3d.ui.hud.base.Widget
      extended by org.xith3d.ui.hud.widgets.Widget3D
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.types.twodee.Positioned2f, org.openmali.types.twodee.Positioned2fRO, org.openmali.types.twodee.Sized2f, org.openmali.types.twodee.Sized2fRO

public class Widget3D
extends Widget

The Widget3D is connected to a RenderPass and controls its Viewport, so that it always covers the Widgets (inner) area.

Note, that it doesn't care about the z-order (z-index). The RenderPass is rendered in the order, that is defined by the RenderPasses' list.

If you're using a FirstPersonInputHandler, you should apply a view-transform (see RenderPassConfig.setViewTransform(org.xith3d.scenegraph.Transform3D)) to the RenderPassConfig, so that the FirstPersonInputHandler doesn't affect the "nested" RenderPass.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
 
Fields inherited from class org.xith3d.ui.hud.base.Widget
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD
 
Constructor Summary
Widget3D(float width, float height, RenderPassConfig rpConfig)
          Creates a new Widget3D.
 
Method Summary
protected  void applyLocationToRenderPass(float x, float y)
           
protected  void applySizeToRenderPass(float w, float h)
           
protected  void drawWidget(Texture2DCanvas texCanvas, int offsetX, int offsetY, int width, int height, boolean drawsSelf)
          
 RenderPassConfig getRenderPassConfig()
           
protected  void init()
          This method is called when the WidgetContainer is set.
protected  void onAttachedToHUD(HUD hud)
          This event is fired, when this Widget is added to the HUD live Widget hierarchy.
protected  void onDetachedFromHUD(HUD hud)
          This event is fired, when this Widget is removed from the HUD live Widget hierarchy.
protected  void onLocationChanged(float oldLeft, float oldTop, float newLeft, float newTop)
          
protected  void onSizeChanged(float oldWidth, float oldHeight, float newWidth, float newHeight)
          
 
Methods inherited from class org.xith3d.ui.hud.base.Widget
addContainerListener, addControllerListener, addFocusListener, addInputListener, addKeyboardListener, addLocationListener, addMouseListener, addSizeListener, addVisibilityListener, bindToGlobalMouseMovement, blocksFocusMoveDeviceComponent, calculateTransformHeight_Pixels2HUD, calculateTransformWidth_Pixels2HUD, compareAbsZIndex, createShape, detach, drawAndUpdateWidget, drawBackground, drawBorder, drawWidgetAfterWidgetAssembler, drawWidgetContents, getAbsoluteLocationOnHUD_, getAspect, getAssembly, getBorder, getContainer, getContentAspect, getContentHeight, getContentHeightPX, getContentLeftPX, getContentOffset, getContentTopPX, getContentWidth, getContentWidthPX, getContextMenu, getCursor, getEqualHeight_, getEqualWidth_, getForcedRedrawFrequency, getHeight, getHeightPX, getHUD, getLeft, getLevel, getLocation, getLocation, getLocationHUD2Pixels_, getLocationHUD2SG_, getLocationPixels2HUD_, getLocationSG2HUD_, getMaxRedrawFrequency, getMinHeight, getMinWidth, getName, getParentWindow, getPickHeight, getPickWidth, getRelLocationHUD2Pixels_, getRootHostWidget, getShape, getSize, getSizeHUD2Pixels_, getSizeHUD2SG_, getSizeOfPixels_, getSizePixels2HUD_, getSizeSG2HUD_, getToolTip, getTop, getTransparency, getUserObject, getWidgetAssembler, getWidth, getWidthPX, getZIndex, hasDropShadow, hasFocus, hasFocus, hasToolTip, initSize, isAHostedWidgetDirty, isClickable, isDraggable, isFocussable, isHeavyWeight, isHovered, isInitialized, isInitializing, isPickable, isThisWidgetDirty, isVisible, notifyOnDragStopped, onAttachedToContainer, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetachedFromContainer, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseExited, onMouseMoved, onMouseStopped, onMouseWheelMoved, onVisibilityChanged, pick, pickConditionsMatch, removeContainerListener, removeControllerListener, removeFocusListener, removeInputListener, removeKeyboardListener, removeLocationListener, removeMouseListener, removeSizeListener, removeVisibilityListener, requestFocus, resetWidgetDirty, setBorder, setBorder, setClickable, setContentClipRect, setContextMenu, setCursor, setDraggable, setFocussable, setForcedRedrawFrequency, setHasDropShadow, setHeight, setHostedWidgetDirty, setHostTextureDirty, setHostTextureDirty, setHostWidget, setLocation, setLocation, setLocation, setMaxRedrawFrequency, setName, setPickable, setSize, setSize, setSize, setSize, setTextureDirty, setTextureDirty, setToolTip, setTransparency, setTransparency, setUserObject, setVisible, setWidgetDirty, setWidth, setZIndex, startDragging, toString, update, updateAbsZIndex, updateSizeFactors, updateTranslation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Widget3D

public Widget3D(float width,
                float height,
                RenderPassConfig rpConfig)
Creates a new Widget3D.

Parameters:
width -
height -
rpConfig -
Method Detail

getRenderPassConfig

public final RenderPassConfig getRenderPassConfig()
Returns:
the attached RenderPassConfig.

applyLocationToRenderPass

protected void applyLocationToRenderPass(float x,
                                         float y)

applySizeToRenderPass

protected void applySizeToRenderPass(float w,
                                     float h)

onAttachedToHUD

protected void onAttachedToHUD(HUD hud)
This event is fired, when this Widget is added to the HUD live Widget hierarchy.

Overrides:
onAttachedToHUD in class Widget
Parameters:
hud - the HUD, the Widget is added to

onDetachedFromHUD

protected void onDetachedFromHUD(HUD hud)
This event is fired, when this Widget is removed from the HUD live Widget hierarchy.

Overrides:
onDetachedFromHUD in class Widget
Parameters:
hud - the HUD, the Widget is removed from

onLocationChanged

protected void onLocationChanged(float oldLeft,
                                 float oldTop,
                                 float newLeft,
                                 float newTop)

Overrides:
onLocationChanged in class Widget

onSizeChanged

protected void onSizeChanged(float oldWidth,
                             float oldHeight,
                             float newWidth,
                             float newHeight)

Overrides:
onSizeChanged in class Widget

drawWidget

protected void drawWidget(Texture2DCanvas texCanvas,
                          int offsetX,
                          int offsetY,
                          int width,
                          int height,
                          boolean drawsSelf)

Specified by:
drawWidget in class Widget

init

protected void init()
This method is called when the WidgetContainer is set.

Specified by:
init in class Widget