org.xith3d.ui.hud.base
Class RectangularWidget
java.lang.Object
org.xith3d.ui.hud.base.WidgetBase
org.xith3d.ui.hud.base.RectangularWidget
- 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
- Direct Known Subclasses:
- AbstractButton, BackgroundSettableRectangularWidget, BorderWidget, ComboBox, Image, Label, List, NumberLabel, ProgressBar, RectangularContentPaneWrapper, Scrollbar, Slider, StateButton, Widget3D, WidgetContainerBase, WindowHeaderWidget
public abstract class RectangularWidget
- extends WidgetBase
This class implements a base for rectangular Widgets.
|
Constructor Summary |
RectangularWidget(float width,
float height)
Creates a new Widget with the given width and height. |
RectangularWidget(float width,
float height,
int zIndex)
Creates a new Widget with the given width, height and z-index. |
| 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, init, 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, 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 |
RectangularWidget
public RectangularWidget(float width,
float height,
int zIndex)
- Creates a new Widget with the given width, height and z-index.
- Parameters:
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widget
RectangularWidget
public RectangularWidget(float width,
float height)
- Creates a new Widget with the given width and height.
- Parameters:
width - the new width of this Widgetheight - the new height of this Widget
getPickWidth
protected float getPickWidth()
- Returns:
- the width on which to pick. By default this is exactly getWidth().
getPickHeight
protected float getPickHeight()
- Returns:
- the height on which to pick. By default this is exactly getHeight().
getPickSGZPosition
protected float getPickSGZPosition()
- Returns:
- the scenegraph-z-position to store in the HUDPickResult.
By default this is exactly getSGZPosition().
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 Canvas3DcanvasY - the y position of the mouse on the Canvas3DpickReason - the action which caused this pick operationbutton - the mouse-button, that caused the pickingwhen - the timestamp of the pickingmeta - 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.