org.xith3d.ui.hud.widgets
Class LineWidget

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

public class LineWidget
extends WidgetBase

A LineWidget is a very simple Widget just drawing a line on the HUD.


Nested Class Summary
 
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
LineWidget(org.openmali.vecmath2.Vector2f vec, org.openmali.vecmath2.Colorf color)
          Creates a new LineWidget along the given vector (and with it's length).
LineWidget(org.openmali.vecmath2.Vector2f vec, org.openmali.vecmath2.Colorf color, org.jagatoo.opengl.enums.LinePattern linePattern)
          Creates a new LineWidget along the given vector (and with it's length).
LineWidget(org.openmali.vecmath2.Vector2f vec, float lineWidth, org.openmali.vecmath2.Colorf color)
          Creates a new LineWidget along the given vector (and with it's length).
LineWidget(org.openmali.vecmath2.Vector2f vec, float lineWidth, org.openmali.vecmath2.Colorf color, org.jagatoo.opengl.enums.LinePattern linePattern)
          Creates a new LineWidget along the given vector (and with it's length).
LineWidget(org.openmali.vecmath2.Vector2f vec, int zIndex, org.openmali.vecmath2.Colorf color)
          Creates a new LineWidget along the given vector (and with it's length).
LineWidget(org.openmali.vecmath2.Vector2f vec, int zIndex, org.openmali.vecmath2.Colorf color, org.jagatoo.opengl.enums.LinePattern linePattern)
          Creates a new LineWidget along the given vector (and with it's length).
LineWidget(org.openmali.vecmath2.Vector2f vec, int zIndex, float lineWidth, org.openmali.vecmath2.Colorf color)
          Creates a new LineWidget along the given vector (and with it's length).
LineWidget(org.openmali.vecmath2.Vector2f vec, int zIndex, float lineWidth, org.openmali.vecmath2.Colorf color, org.jagatoo.opengl.enums.LinePattern linePattern)
          Creates a new LineWidget along the given vector (and with it's length).
 
Method Summary
 Line getLine()
           
 org.openmali.vecmath2.Vector2f getLineVector()
           
 float getLineWidth()
           
 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.
 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.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

LineWidget

public LineWidget(org.openmali.vecmath2.Vector2f vec,
                  int zIndex,
                  float lineWidth,
                  org.openmali.vecmath2.Colorf color,
                  org.jagatoo.opengl.enums.LinePattern linePattern)
Creates a new LineWidget along the given vector (and with it's length).

Parameters:
vec - the vector carrying the direction and length information
zIndex - the Widget's z-index
lineWidth - the line's width
color - the line's color
linePattern - the LinePattern to use for the Line

LineWidget

public LineWidget(org.openmali.vecmath2.Vector2f vec,
                  int zIndex,
                  float lineWidth,
                  org.openmali.vecmath2.Colorf color)
Creates a new LineWidget along the given vector (and with it's length).

Parameters:
vec - the vector carrying the direction and length information
zIndex - the Widget's z-index
lineWidth - the line's width
color - the line's color

LineWidget

public LineWidget(org.openmali.vecmath2.Vector2f vec,
                  int zIndex,
                  org.openmali.vecmath2.Colorf color)
Creates a new LineWidget along the given vector (and with it's length).

Parameters:
vec - the vector carrying the direction and length information
zIndex - the Widget's z-index
color - the line's color

LineWidget

public LineWidget(org.openmali.vecmath2.Vector2f vec,
                  int zIndex,
                  org.openmali.vecmath2.Colorf color,
                  org.jagatoo.opengl.enums.LinePattern linePattern)
Creates a new LineWidget along the given vector (and with it's length).

Parameters:
vec - the vector carrying the direction and length information
zIndex - the Widget's z-index
color - the line's color
linePattern - the LinePattern to use for the Line

LineWidget

public LineWidget(org.openmali.vecmath2.Vector2f vec,
                  float lineWidth,
                  org.openmali.vecmath2.Colorf color,
                  org.jagatoo.opengl.enums.LinePattern linePattern)
Creates a new LineWidget along the given vector (and with it's length).

Parameters:
vec - the vector carrying the direction and length information
lineWidth - the line's width
color - the line's color
linePattern - the LinePattern to use for the Line

LineWidget

public LineWidget(org.openmali.vecmath2.Vector2f vec,
                  float lineWidth,
                  org.openmali.vecmath2.Colorf color)
Creates a new LineWidget along the given vector (and with it's length).

Parameters:
vec - the vector carrying the direction and length information
lineWidth - the line's width
color - the line's color

LineWidget

public LineWidget(org.openmali.vecmath2.Vector2f vec,
                  org.openmali.vecmath2.Colorf color)
Creates a new LineWidget along the given vector (and with it's length).

Parameters:
vec - the vector carrying the direction and length information
color - the line's color

LineWidget

public LineWidget(org.openmali.vecmath2.Vector2f vec,
                  org.openmali.vecmath2.Colorf color,
                  org.jagatoo.opengl.enums.LinePattern linePattern)
Creates a new LineWidget along the given vector (and with it's length).

Parameters:
vec - the vector carrying the direction and length information
color - the line's color
linePattern - the LinePattern to use for the Line
Method Detail

getLine

public Line getLine()

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

Returns:
the whole Widget's Transparency.

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.

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.

getLineVector

public org.openmali.vecmath2.Vector2f getLineVector()
Returns:
the vector, the Line's goes along

getLineWidth

public float getLineWidth()
Returns:
the width of this line

setSize

public 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