org.xith3d.ui.hud.widgets
Class ColoredBorder

java.lang.Object
  extended by org.xith3d.ui.hud.base.WidgetBase
      extended by org.xith3d.ui.hud.widgets.ColoredBorder
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

public class ColoredBorder
extends WidgetBase
implements Border

A ColoredBorder is a Border implementation with no Textures but only a color.


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
ColoredBorder(float width, org.openmali.vecmath2.Colorf color)
          Creates a new ColoredBorder with all sides of the same width.
ColoredBorder(float bottomHeight, float rightWidth, float topHeight, float leftWidth, org.openmali.vecmath2.Colorf color)
          Creates a new ColoredBorder with the given side widths.
 
Method Summary
 float getBottomHeight()
          
 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)
           
 
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, setTransparency, 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

ColoredBorder

public ColoredBorder(float bottomHeight,
                     float rightWidth,
                     float topHeight,
                     float leftWidth,
                     org.openmali.vecmath2.Colorf color)
Creates a new ColoredBorder with the given side widths.

Parameters:
bottomHeight -
rightWidth -
topHeight -
leftWidth -
color -

ColoredBorder

public ColoredBorder(float width,
                     org.openmali.vecmath2.Colorf color)
Creates a new ColoredBorder with all sides of the same width.

Parameters:
width -
color -
Method Detail

getTransparency

public float getTransparency()

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

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