Package com.jogamp.graph.ui.shapes
Class HUDShape
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.Group
-
- com.jogamp.graph.ui.shapes.HUDShape
-
- All Implemented Interfaces:
Container
public class HUDShape extends Group
A Head Up Display (HUD)Shape
for a clientShape
using `inner size and Mv position` to be displayed on top in aScene
.Purpose of this class is to provide a convenient tool to create a HUD within
Scene
using a Mv-coordinates and size of a target shape within the tree w/o manually transforming them toScene
.Further, the client shape is wrapped in a layout group, not mutating it and hence allowing it for DAG usage.
This instance determines initial size and position in
Shape.validate(GL2ES2)
, having a valid target shape.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Group
Group.Layout
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Shape
Shape.DrawListener, Shape.EventInfo, Shape.ForwardKeyListener, Shape.ForwardMouseListener, Shape.Listener, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.MoveListener, Shape.PointerListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator, ZDescendingComparator
-
-
Constructor Summary
Constructors Constructor Description HUDShape(Scene scene, float clientWidth, float clientHeight, int renderModes, Shape targetShape, Shape clientShape)
Ctor ofHUDShape
.HUDShape(Scene scene, float clientWidth, float clientHeight, com.jogamp.math.Vec4f backColor, com.jogamp.math.Vec4f borderColor, float borderThickness, Padding padding, int renderModes, Shape targetShape, Shape clientShape)
Ctor ofHUDShape
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.jogamp.math.Vec3f
getClientPos()
Shape
getClientShape()
Returns the clientShape
to be presented in the HUD tipcom.jogamp.math.Vec2f
getClientSize()
Shape
getTargetShape()
Returns the targetShape
this HUD is put on top, used to resolve the Mv matrix for HUD size and positionHUDShape
moveHUDPos(com.jogamp.math.Vec3f clientDelta)
Move about scaled HUD position with givenclientDelta
intargetShape
object Mv-space coordinates.HUDShape
moveToHUDPos(com.jogamp.math.Vec3f clientPos)
Move to scaled HUD position with givenclientPos
intargetShape
object Mv-space coordinates.Shape
removeClient()
Removed the user provided clientShape
from this HUD.HUDShape
setClientSize(float clientWidth, float clientHeight)
-
Methods inherited from class com.jogamp.graph.ui.Group
addShape, addShapes, contains, disableTopLevelWidget, enableTopLevelWidget, getBounds, getClipMvFrustum, getClipOnBounds, getFixedSize, getFixedSize, getLayout, getRelayoutOnDirtyShapes, getRenderedShapes, getShapeByID, getShapeByIdx, getShapeByName, getShapeCount, getShapes, getSubString, hasColorChannel, isCullingEnabled, isGroup, isOutside, isOutside2, isPMvCullingEnabled, isTopLevelWidget, removeAllShapes, removeShape, removeShape, removeShapes, removeShapes, replaceShape, setClipMvFrustum, setClipOnBounds, setFixedSize, setFixedSize, setLayout, setPMvCullingEnabled, setRelayoutOnDirtyShapes
-
Methods inherited from class com.jogamp.graph.ui.Shape
addActivationListener, addKeyListener, addMouseListener, applyMatToMv, clear, destroy, draw, drawToSelect, getActiveColorMod, getAdjustedZ, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getID, getMat, getMat, getName, getPadding, getParent, getPixelPerShapeUnit, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getPressedColorMod, getRotation, getRotationPivot, getScale, getScaledDepth, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, getToggleOffColorMod, getToggleOnColorMod, getTooltip, hasBorder, hasPadding, isActivable, isActive, isDiscarded, isDraggable, isFixedARatioResize, isInteractive, isMatIdentity, isPressed, isResizable, isToggleable, isToggleOn, isVisible, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onDraw, onHover, onMove, onToggle, receiveKeyEvents, receiveMouseEvents, removeActivationListener, removeKeyListener, removeMouseListener, removeToolTip, runSynced, scale, scale, setActivable, setActiveColorMod, setBorder, setBorderColor, setBorderColor, setColor, setColor, setDiscarded, setDragAndResizable, setDraggable, setFixedARatioResize, setID, setInteractive, setName, setPaddding, setPMVMatrix, setPMVMatrix, setPressed, setPressedColorMod, setResizable, setRotation, setRotationPivot, setRotationPivot, setScale, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setToolTip, setVisible, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, updateMat, validate, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Constructor Detail
-
HUDShape
public HUDShape(Scene scene, float clientWidth, float clientHeight, int renderModes, Shape targetShape, Shape clientShape)
Ctor ofHUDShape
.Adjust HUD position using
targetShape
object Mv-space coordinates viamoveToHUDPos(Vec3f)
andmoveHUDPos(Vec3f)
.- Parameters:
scene
- theScene
top-level containerclientWidth
- width of this HUD in giventargetShape
object Mv-space, notscene
.clientHeight
- height of this HUD in giventargetShape
object Mv-space, notscene
.renderModes
- Graph'sRegion
render modes, seecreate(..)
.targetShape
- targetShape
this HUD is put on top, used to resolve the Mv matrix for HUD size and positionclientShape
- clientShape
to be presented in the HUD tip
-
HUDShape
public HUDShape(Scene scene, float clientWidth, float clientHeight, com.jogamp.math.Vec4f backColor, com.jogamp.math.Vec4f borderColor, float borderThickness, Padding padding, int renderModes, Shape targetShape, Shape clientShape)
Ctor ofHUDShape
.Adjust HUD position using
targetShape
object Mv-space coordinates viamoveToHUDPos(Vec3f)
andmoveHUDPos(Vec3f)
.- Parameters:
scene
- theScene
top-level containerclientWidth
- width of this HUD in giventargetShape
object Mv-space, notscene
.clientHeight
- height of this HUD in giventargetShape
object Mv-space, notscene
.backColor
- optional background color, will add a frame to this HUD if notnull
borderColor
- optional border color, only used withbackColor
borderThickness
- border thickness, only used withbackColor
padding
- optional padding for the givenclientShape
for the internal wrapper grouprenderModes
- Graph'sRegion
render modes, seecreate(..)
.targetShape
- targetShape
this HUD is put on top, used to resolve the Mv matrix for HUD size and positionclientShape
- clientShape
to be presented in the HUD tip
-
-
Method Detail
-
moveToHUDPos
public HUDShape moveToHUDPos(com.jogamp.math.Vec3f clientPos)
Move to scaled HUD position with givenclientPos
intargetShape
object Mv-space coordinates. SeeShape.moveTo(Vec3f)
.- See Also:
moveHUDPos(Vec3f)
-
moveHUDPos
public HUDShape moveHUDPos(com.jogamp.math.Vec3f clientDelta)
Move about scaled HUD position with givenclientDelta
intargetShape
object Mv-space coordinates. SeeShape.move(Vec3f)
.- See Also:
moveToHUDPos(Vec3f)
-
setClientSize
public HUDShape setClientSize(float clientWidth, float clientHeight)
-
getClientSize
public com.jogamp.math.Vec2f getClientSize()
-
getClientPos
public com.jogamp.math.Vec3f getClientPos()
-
getClientShape
public Shape getClientShape()
Returns the clientShape
to be presented in the HUD tip
-
getTargetShape
public Shape getTargetShape()
Returns the targetShape
this HUD is put on top, used to resolve the Mv matrix for HUD size and position
-
-