org.xith3d.ui.hud.base
Class WindowHeaderWidget

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.widgets.Label
              extended by org.xith3d.ui.hud.base.WindowHeaderWidget
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, 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, AutoSizable, PaddingSettable, TextWidget

public class WindowHeaderWidget
extends Label

Represents a Window's header bar's Widget.


Nested Class Summary
static class WindowHeaderWidget.Description
           
 
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
static int FLAG_ONLY_WINDOW_HEADER_WIDGET
           
 
Fields inherited from class org.xith3d.ui.hud.widgets.Label
DEFAULT_HEAVYWEIGHT
 
Fields inherited from class org.xith3d.ui.hud.base.Widget
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD
 
Constructor Summary
WindowHeaderWidget(float width, java.lang.String title)
          Creates a new WindowHeaderWidget.
WindowHeaderWidget(float width, java.lang.String title, WindowHeaderWidget.Description desc)
          Creates a new WindowHeaderWidget.
 
Method Summary
protected  AbstractButton createCloseButton(WindowHeaderWidget.Description desc)
          This method creates the close button for the Window.
 AbstractButton getCloseButton()
           
protected  void init()
          This method is called when the WidgetContainer is set.
 boolean isMouseOverBar(float relX, float relY)
          Checks, if the mouse is over the bar (not over any Button, etc.).
protected  void onSizeChanged(float oldWidth, float oldHeight, float newWidth, float newHeight)
          
protected  HUDPickResult pick(int canvasX, int canvasY, HUDPickResult.HUDPickReason pickReason, org.jagatoo.input.devices.components.MouseButton button, long when, long meta, int flags)
          Tests whether a Widget is under the cursor and runs the approriate methods if true.
protected  void setHostTextureDirty(int flags)
          
protected  void setTextureDirty(int flags)
          
 
Methods inherited from class org.xith3d.ui.hud.widgets.Label
drawIcon, drawText, drawWidget, getAlignment, getDisplayedText, getFont, getFont, getFontColor, getFontColor, getFontColorDisabled, getFontDisabled, getIcon, getIconGap, getMinimalHeight, getMinimalSize, getMinimalWidth, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getText, getTextOffsetX, getTextOffsetY, initSize, isAutoSizeEnabled, isEnabled, onAttachedToHUD, prepareText, setAlignment, setAutoSizeEnabled, setEnabled, setEnabledImpl, setFont, setFontColor, setFontColorDisabled, setFontDisabled, setIcon, setIcon, setIconGap, setMinimalSize, setPadding, setPadding, setText, setText, setText, setTextOffset, updateText
 
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, calculateTransformHeight_Pixels2HUD, calculateTransformWidth_Pixels2HUD, 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, getParentWindow, getPickHeight, getPickWidth, getRelLocationHUD2Pixels_, getRootHostWidget, getShape, getSize, getSizeHUD2Pixels_, getSizeHUD2SG_, getSizeOfPixels_, getSizePixels2HUD_, getSizeSG2HUD_, getToolTip, getTop, getTransparency, getUserObject, getWidgetAssembler, getWidth, getWidthPX, getZIndex, hasDropShadow, hasFocus, hasFocus, hasToolTip, isAHostedWidgetDirty, isClickable, isDraggable, isFocussable, isHeavyWeight, isHovered, isInitialized, isInitializing, isPickable, isThisWidgetDirty, isVisible, notifyOnDragStopped, onAttachedToContainer, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetachedFromContainer, onDetachedFromHUD, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onLocationChanged, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseExited, onMouseMoved, onMouseStopped, onMouseWheelMoved, onVisibilityChanged, 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, setHostWidget, setLocation, setLocation, setLocation, setMaxRedrawFrequency, setName, setPickable, setSize, setSize, setSize, setSize, 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
 

Field Detail

FLAG_ONLY_WINDOW_HEADER_WIDGET

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

WindowHeaderWidget

public WindowHeaderWidget(float width,
                          java.lang.String title,
                          WindowHeaderWidget.Description desc)
Creates a new WindowHeaderWidget.

Parameters:
width -
title -
desc -

WindowHeaderWidget

public WindowHeaderWidget(float width,
                          java.lang.String title)
Creates a new WindowHeaderWidget.

Method Detail

getCloseButton

public final AbstractButton getCloseButton()
Returns:
the Button, which closes the Window

isMouseOverBar

public final boolean isMouseOverBar(float relX,
                                    float relY)
Checks, if the mouse is over the bar (not over any Button, etc.).

Parameters:
relX -
relY -

pick

protected HUDPickResult pick(int canvasX,
                             int canvasY,
                             HUDPickResult.HUDPickReason pickReason,
                             org.jagatoo.input.devices.components.MouseButton button,
                             long when,
                             long meta,
                             int flags)
Tests whether a Widget is under the cursor and runs the approriate methods if true.

Overrides:
pick in class Widget
Parameters:
canvasX - the x position of the mouse on the Canvas3D
canvasY - the y position of the mouse on the Canvas3D
pickReason - the action which caused this pick operation
button - the mouse-button, that caused the picking
when - the timestamp of the picking
meta - this could be either the lastPressTime, lastReleaseTime, buttonsState mask or the page-move-boolean. (depends on the pickReason)
Returns:
an instance of HUDPickResult holding the picked Widget and absolute and relative picking positions or null.

onSizeChanged

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

Overrides:
onSizeChanged in class Label

setHostTextureDirty

protected void setHostTextureDirty(int flags)

Overrides:
setHostTextureDirty in class Widget

setTextureDirty

protected void setTextureDirty(int flags)

Overrides:
setTextureDirty in class Widget

init

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

Overrides:
init in class Label

createCloseButton

protected AbstractButton createCloseButton(WindowHeaderWidget.Description desc)
This method creates the close button for the Window. It may return null, if you want.

Parameters:
desc - the WindowHeaderWidget.Description
Returns:
the created close Button