org.xith3d.ui.hud.widgets
Class BorderWidget

java.lang.Object
  extended by org.xith3d.ui.hud.base.WidgetBase
      extended by org.xith3d.ui.hud.base.RectangularWidget
          extended by org.xith3d.ui.hud.widgets.BorderWidget
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, Border, Widget
Direct Known Subclasses:
BevelBorder, RoundedCornersBorder

public class BorderWidget
extends RectangularWidget
implements Border

This is a general Border implementation for your HUD. Instantiate a Border.Description and pass is to the constructor.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Border
Border.Description
 
Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
 
Fields inherited from class org.xith3d.ui.hud.base.WidgetBase
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER
 
Constructor Summary
BorderWidget(Border.Description borderDesc)
          Creates a new Border Widget.
BorderWidget(Border.Description borderDesc, int zIndex)
          Creates a new Border Widget.
BorderWidget(float width, float height)
          Creates a new Border Widget.
BorderWidget(float width, float height, Border.Description borderDesc)
          Creates a new Border Widget.
BorderWidget(float width, float height, int zIndex)
          Creates a new Border Widget.
BorderWidget(float width, float height, int zIndex, Border.Description borderDesc)
          Creates a new Border Widget.
BorderWidget(org.openmali.types.twodee.Sized2fRO size, Border.Description borderDesc)
          Creates a new Border Widget.
BorderWidget(org.openmali.types.twodee.Sized2fRO size, int zIndex, Border.Description borderDesc)
          Creates a new Border Widget.
 
Method Summary
 float getBottomHeight()
          
 Border.Description getDescription()
           
 float getLeftWidth()
          
 float getRightWidth()
          
 float getTopHeight()
          
 float getTransparency()
          
protected  void init()
          This method is called when the WidgetContainer is set.
 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  boolean setSize(float width, float height, boolean forced)
          
 void setTransparency(float transparency)
          Sets the whole Widget's Transparency.
 
Methods inherited from class org.xith3d.ui.hud.base.RectangularWidget
getPickHeight, getPickSGZPosition, getPickWidth
 
Methods inherited from class org.xith3d.ui.hud.base.WidgetBase
addContainerListener, addFocusListener, addInputListener, addLocationListener, addSizeListener, addVisibilityListener, detach, detach, getAspect, getAssembly, getCachedToolTipWidget, getContainer, getContextMenu, getCursor, getHeight, getHUD, getInheritedCursor, getLeft, getLocation, getName, getSGNode, getSGZPosition, getSize, getToolTip, getTop, getUserObject, getWidgetAssembler, getWidth, getZIndex, hasFocus, hasFocus, hasToolTip, isClickable, isDraggable, isFocussable, isInitialized, isInitializing, isPickable, isVisible, onAddedToContainer, onAddedToHUD, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetached, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseLeft, onMouseMoved, onMouseStopped, onMouseUnbound, onMouseWheelMoved, onRemovedFromContainer, pickWidgetAssembler, removeContainerListener, removeFocusListener, removeInputListener, removeLocationListener, removeSizeListener, removeVisibilityListener, requestFocus, setAssembly, setCachedToolTipWidget, setClickable, setContainer, setContextMenu, setCursor, setDraggable, setFocussable, setHeight, setLocation, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setToolTip, setUserObject, setVisible, setWidth, setZIndex, toString, update, updateTranslation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BorderWidget

public BorderWidget(float width,
                    float height,
                    int zIndex,
                    Border.Description borderDesc)
Creates a new Border Widget.

Parameters:
width -
height -
zIndex -
borderDesc -

BorderWidget

public BorderWidget(float width,
                    float height,
                    Border.Description borderDesc)
Creates a new Border Widget.

Parameters:
width -
height -
borderDesc -

BorderWidget

public BorderWidget(org.openmali.types.twodee.Sized2fRO size,
                    int zIndex,
                    Border.Description borderDesc)
Creates a new Border Widget.

Parameters:
size -
zIndex -
borderDesc -

BorderWidget

public BorderWidget(org.openmali.types.twodee.Sized2fRO size,
                    Border.Description borderDesc)
Creates a new Border Widget.

Parameters:
size -
borderDesc -

BorderWidget

public BorderWidget(float width,
                    float height,
                    int zIndex)
Creates a new Border Widget.

Parameters:
width -
height -
zIndex -

BorderWidget

public BorderWidget(float width,
                    float height)
Creates a new Border Widget.

Parameters:
width -
height -

BorderWidget

public BorderWidget(Border.Description borderDesc,
                    int zIndex)
Creates a new Border Widget.

Parameters:
borderDesc -
zIndex -

BorderWidget

public BorderWidget(Border.Description borderDesc)
Creates a new Border Widget.

Parameters:
borderDesc -
Method Detail

setTransparency

public void setTransparency(float transparency)
Sets the whole Widget's Transparency.

Specified by:
setTransparency in interface Widget
Overrides:
setTransparency in class WidgetBase

getTransparency

public float getTransparency()

Specified by:
getTransparency in interface Widget
Returns:
the whole Widget's Transparency.

getDescription

public Border.Description getDescription()
Returns:
the Border.Description this Border is built from

getBottomHeight

public float getBottomHeight()

Specified by:
getBottomHeight in interface Border
Returns:
the height of the bottom side of this Border

getRightWidth

public float getRightWidth()

Specified by:
getRightWidth in interface Border
Returns:
the width of the right side of this Border

getTopHeight

public float getTopHeight()

Specified by:
getTopHeight in interface Border
Returns:
the height of the top side of this Border

getLeftWidth

public float getLeftWidth()

Specified by:
getLeftWidth in interface Border
Returns:
the width of the left side of this Border

pick

public 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.

Specified by:
pick in interface Widget
Overrides:
pick in class RectangularWidget
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.

setSize

protected boolean setSize(float width,
                          float height,
                          boolean forced)

Overrides:
setSize in class WidgetBase

init

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

Specified by:
init in class WidgetBase