org.xith3d.ui.hud.widgets
Class QuadDivider

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

public class QuadDivider
extends Widget

The QuadDivider is used to resize four Widgets in north-west, north-east, south-west and south-east.


Nested Class Summary
static class QuadDivider.QuadPanels
           
 
Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
static float DIVIDER_WIDTH
           
 
Fields inherited from class org.xith3d.ui.hud.base.Widget
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD
 
Constructor Summary
QuadDivider(float width, float height)
           
QuadDivider(float width, float height, org.openmali.vecmath2.Colorf dividerColor)
           
 
Method Summary
 void addQuadDividerListener(QuadDividerListener l)
          Adds a new QuadDividerListener.
protected  void drawWidget(Texture2DCanvas texCanvas, int offsetX, int offsetY, int width, int height, boolean drawsSelf)
           
 float getBottomHeight()
           
 float getBottomTop()
           
 float getLeftWidth()
           
 QuadDivider.QuadPanels getPanelUnderMouse(int canvasX, int canvasY)
          Returns a constant indicating the "panel" under the mouse cursor.
 float getRightLeft()
           
 float getRightWidth()
           
 float getTopHeight()
           
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.
 void removeQuadDividerListener(QuadDividerListener l)
          Removes a QuadDividerListener.
 void setDividerColor(org.openmali.vecmath2.Colorf color)
           
 void setHorizontalDividerTop(float horizTop)
          Sets the top-position of the horizontal divider.
 void setVerticalDividerLeft(float vertLeft)
          Sets the left-position of the vertical diviver.
protected  void updatePanelSizes()
           
 
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, drawBackground, 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, initSize, isAHostedWidgetDirty, isClickable, isDraggable, isFocussable, isHeavyWeight, isHovered, isInitialized, isInitializing, isPickable, isThisWidgetDirty, isVisible, notifyOnDragStopped, onAttachedToContainer, onAttachedToHUD, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetachedFromContainer, onDetachedFromHUD, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onLocationChanged, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseExited, onMouseMoved, onMouseStopped, onMouseWheelMoved, onSizeChanged, 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, setHostTextureDirty, setHostWidget, setLocation, setLocation, setLocation, setMaxRedrawFrequency, setName, setPickable, setSize, setSize, setSize, setSize, setTextureDirty, 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

DIVIDER_WIDTH

public static final float DIVIDER_WIDTH
See Also:
Constant Field Values
Constructor Detail

QuadDivider

public QuadDivider(float width,
                   float height,
                   org.openmali.vecmath2.Colorf dividerColor)

QuadDivider

public QuadDivider(float width,
                   float height)
Method Detail

updatePanelSizes

protected void updatePanelSizes()

setDividerColor

public void setDividerColor(org.openmali.vecmath2.Colorf color)

setVerticalDividerLeft

public void setVerticalDividerLeft(float vertLeft)
Sets the left-position of the vertical diviver.

Parameters:
vertLeft -

setHorizontalDividerTop

public void setHorizontalDividerTop(float horizTop)
Sets the top-position of the horizontal divider.

Parameters:
horizTop -

getLeftWidth

public final float getLeftWidth()
Returns:
the width of the left-hand panels.

getRightWidth

public final float getRightWidth()
Returns:
the width of the right-hand panels.

getTopHeight

public final float getTopHeight()
Returns:
the height of the top panels.

getBottomHeight

public final float getBottomHeight()
Returns:
the height of the bottom panels.

getRightLeft

public final float getRightLeft()
Returns:
the left-position of the right-hand panels.

getBottomTop

public final float getBottomTop()
Returns:
the top-position of the bottom panels.

getPanelUnderMouse

public QuadDivider.QuadPanels getPanelUnderMouse(int canvasX,
                                                 int canvasY)
Returns a constant indicating the "panel" under the mouse cursor.

Parameters:
canvasX -
canvasY -
Returns:
the "panel". (or null, if the widget has not yet been initialized or the mouse is not over one of the panels)

addQuadDividerListener

public void addQuadDividerListener(QuadDividerListener l)
Adds a new QuadDividerListener.

Parameters:
l -

removeQuadDividerListener

public void removeQuadDividerListener(QuadDividerListener l)
Removes a QuadDividerListener.

Parameters:
l -

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.

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.

drawWidget

protected void drawWidget(Texture2DCanvas texCanvas,
                          int offsetX,
                          int offsetY,
                          int width,
                          int height,
                          boolean drawsSelf)
Specified by:
drawWidget in class Widget

init

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

Specified by:
init in class Widget