org.xith3d.ui.hud.widgets
Class Panel

java.lang.Object
  extended by org.xith3d.ui.hud.base.Widget
      extended by org.xith3d.ui.hud.base.BackgroundSettableWidget
          extended by org.xith3d.ui.hud.base.WidgetContainer
              extended by org.xith3d.ui.hud.widgets.Panel
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, PaddingSettable
Direct Known Subclasses:
MenuBase, MenuGroupWidget, ScrollPanel

public class Panel
extends WidgetContainer


Nested Class Summary
 
Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget
BackgroundSettableWidget.BackgroundSettableDescriptionBase
 
Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
protected static boolean DEFAULT_HEAVYWEIGHT
           
 
Fields inherited from class org.xith3d.ui.hud.base.WidgetContainer
childrenOffset_HUD, childrenOffset_PX
 
Fields inherited from class org.xith3d.ui.hud.base.Widget
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD
 
Constructor Summary
protected Panel(boolean isHeavyWeight, boolean hasWidgetAssembler, float width, float height, org.openmali.vecmath2.Colorf backgroundColor, Texture2D backgroundTex, TileMode backgroundTileMode)
          Creates a new Panel with the given width and height.
  Panel(boolean isHeavyWeight, float width, float height)
          Creates a new Panel with the given width and height.
  Panel(boolean isHeavyWeight, float width, float height, org.openmali.vecmath2.Colorf backgroundColor)
          Creates a new Panel with the given width and height.
  Panel(boolean isHeavyWeight, float width, float height, org.openmali.vecmath2.Colorf backgroundColor, Texture2D backgroundTex)
          Creates a new Panel with the given width and height.
  Panel(boolean isHeavyWeight, float width, float height, org.openmali.vecmath2.Colorf backgroundColor, Texture2D backgroundTex, TileMode backgroundTileMode)
          Creates a new Panel with the given width and height.
  Panel(boolean isHeavyWeight, float width, float height, java.lang.String backgroundTex)
          Creates a new Panel with the given width and height.
  Panel(boolean isHeavyWeight, float width, float height, Texture2D backgroundTex)
          Creates a new Panel with the given width and height.
  Panel(float width, float height)
          Creates a new Panel with the given width and height.
  Panel(float width, float height, org.openmali.vecmath2.Colorf backgroundColor)
          Creates a new Panel with the given width and height.
  Panel(float width, float height, org.openmali.vecmath2.Colorf backgroundColor, java.lang.String backgroundTex)
          Creates a new Panel with the given width and height.
  Panel(float width, float height, org.openmali.vecmath2.Colorf backgroundColor, Texture2D backgroundTex)
          Creates a new Panel with the given width and height.
  Panel(float width, float height, java.lang.String backgroundTex)
          Creates a new Panel with the given width and height.
  Panel(float width, float height, Texture2D backgroundTex)
          Creates a new Panel with the given width and height.
 
Method Summary
static Panel createContentPane(float width, float height)
          Creates a new non scrollable Panel with the given width and height.
static Panel createContentPane(float width, float height, boolean scrollable)
          Creates a new Panel with the given width and height.
protected  void drawForeground(Texture2DCanvas texCanvas, int offsetX, int offsetY, int width, int height)
           
protected  void drawWidget(Texture2DCanvas texCanvas, int offsetX, int offsetY, int width, int height, boolean drawsSelf)
          
 Texture2D getForegroundTexture()
           
protected  void init()
          This method is called when the WidgetContainer is set.
 void setForegroundTexture(java.lang.String texture)
          Sets the foreground texture of the WidgetContainer.
 void setForegroundTexture(Texture2D texture)
          Sets the foreground texture of the WidgetContainer.
 
Methods inherited from class org.xith3d.ui.hud.base.WidgetContainer
addWidget, addWidget, addWidget, addWidget, addWidget, addWidget, addWidgetCentered, addWidgetCentered, calculateTransformHeight_Pixels2HUD, calculateTransformWidth_Pixels2HUD, clear, createChildrenGroup, drawChildWidgets, focus, getCurrentFocusedWidget, getCurrentFocusedWidget, getCurrentHoveredWidget, getCurrentHoveredWidget, getEqualHeight, getEqualWidth, getLayout, getLocationHUD2Pixels, getLocationHUD2SG, getLocationPixels2HUD, getLocationSG2HUD, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParentWindow, getRelLocationHUD2Pixels, getResAspect, getResolution, getResX, getResY, getSGGroup, getSizeHUD2Pixels, getSizeHUD2SG, getSizeOfPixels, getSizePixels2HUD, getSizeSG2HUD, getWidget, getWidgets, getWidgetsCount, hasCustomResolution, isClippingEnbaled, isContentPane, onAttachedToHUD, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseExited, onSizeChanged, onVisibilityChanged, pick, removeWidget, resetCurrentHoveredWidget, setClippingEnabled, setLayout, setPadding, setPadding, setResolution, setTransparency, setWidgetDirty, setZIndexSortingDirty, update, updateAbsZIndex, updateTranslation
 
Methods inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget
drawBackground, getBackgroundColor, getBackgroundTexture, getBackgroundTileMode, setBackground, setBackground, setBackground, setBackgroundColor, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTileMode, setNoBackground
 
Methods inherited from class org.xith3d.ui.hud.base.Widget
addContainerListener, addControllerListener, addFocusListener, addInputListener, addKeyboardListener, addLocationListener, addMouseListener, addSizeListener, addVisibilityListener, bindToGlobalMouseMovement, blocksFocusMoveDeviceComponent, compareAbsZIndex, createShape, detach, drawAndUpdateWidget, 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, 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, onDetachedFromContainer, onDetachedFromHUD, onLocationChanged, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseMoved, onMouseStopped, onMouseWheelMoved, 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, setUserObject, setVisible, setWidth, setZIndex, startDragging, toString, updateSizeFactors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_HEAVYWEIGHT

protected static final boolean DEFAULT_HEAVYWEIGHT
See Also:
Constant Field Values
Constructor Detail

Panel

protected Panel(boolean isHeavyWeight,
                boolean hasWidgetAssembler,
                float width,
                float height,
                org.openmali.vecmath2.Colorf backgroundColor,
                Texture2D backgroundTex,
                TileMode backgroundTileMode)
Creates a new Panel with the given width and height.

Parameters:
isHeavyWeight -
hasWidgetAssembler -
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color
backgroundTex - the background texture

Panel

public Panel(boolean isHeavyWeight,
             float width,
             float height,
             org.openmali.vecmath2.Colorf backgroundColor,
             Texture2D backgroundTex,
             TileMode backgroundTileMode)
Creates a new Panel with the given width and height.

Parameters:
isHeavyWeight -
hasWidgetAssembler -
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color
backgroundTex - the background texture

Panel

public Panel(boolean isHeavyWeight,
             float width,
             float height,
             org.openmali.vecmath2.Colorf backgroundColor,
             Texture2D backgroundTex)
Creates a new Panel with the given width and height.

Parameters:
isHeavyWeight -
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color
backgroundTex - the background texture

Panel

public Panel(boolean isHeavyWeight,
             float width,
             float height,
             org.openmali.vecmath2.Colorf backgroundColor)
Creates a new Panel with the given width and height.

Parameters:
isHeavyWeight -
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color

Panel

public Panel(boolean isHeavyWeight,
             float width,
             float height,
             Texture2D backgroundTex)
Creates a new Panel with the given width and height.

Parameters:
isHeavyWeight -
width - the new width of this Widget
height - the new height of this Widget
backgroundTex - the background texture

Panel

public Panel(boolean isHeavyWeight,
             float width,
             float height,
             java.lang.String backgroundTex)
Creates a new Panel with the given width and height.

Parameters:
isHeavyWeight -
width - the new width of this Widget
height - the new height of this Widget
backgroundTex - the background texture

Panel

public Panel(boolean isHeavyWeight,
             float width,
             float height)
Creates a new Panel with the given width and height.

Parameters:
isHeavyWeight -
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color

Panel

public Panel(float width,
             float height,
             org.openmali.vecmath2.Colorf backgroundColor,
             Texture2D backgroundTex)
Creates a new Panel with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color
backgroundTex - the background texture

Panel

public Panel(float width,
             float height,
             org.openmali.vecmath2.Colorf backgroundColor,
             java.lang.String backgroundTex)
Creates a new Panel with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color
backgroundTex - the background texture

Panel

public Panel(float width,
             float height,
             org.openmali.vecmath2.Colorf backgroundColor)
Creates a new Panel with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color

Panel

public Panel(float width,
             float height,
             Texture2D backgroundTex)
Creates a new Panel with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
backgroundTex - the background texture

Panel

public Panel(float width,
             float height,
             java.lang.String backgroundTex)
Creates a new Panel with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
backgroundTex - the background texture

Panel

public Panel(float width,
             float height)
Creates a new Panel with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
backgroundColor - the background color
Method Detail

setForegroundTexture

public void setForegroundTexture(Texture2D texture)
Sets the foreground texture of the WidgetContainer. It MUST always have an alpha channel!

Parameters:
texture - the texture resource to use

setForegroundTexture

public final void setForegroundTexture(java.lang.String texture)
Sets the foreground texture of the WidgetContainer. It MUST always have an alpha channel!

Parameters:
texture - the texture resource to use

getForegroundTexture

public final Texture2D getForegroundTexture()
Returns:
the foreground Texture of the WidgetContainer.

drawForeground

protected void drawForeground(Texture2DCanvas texCanvas,
                              int offsetX,
                              int offsetY,
                              int width,
                              int height)

drawWidget

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

Overrides:
drawWidget in class WidgetContainer

init

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

Specified by:
init in class Widget

createContentPane

public static final Panel createContentPane(float width,
                                            float height,
                                            boolean scrollable)
Creates a new Panel with the given width and height.
The Panel will have the background defined in the current theme.
If scrollable is true, a ScrollPanel will be created and returned.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
scrollable - if true, a ScrollPanel will be created and returned
Returns:
a Panel or ScrollPanel (depending on the scrollable parameter).

createContentPane

public static Panel createContentPane(float width,
                                      float height)
Creates a new non scrollable Panel with the given width and height.
The Panel will have the background defined in the current theme.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
Returns:
a Panel.