Class TooltipShape
- java.lang.Object
-
- com.jogamp.graph.ui.Tooltip
-
- com.jogamp.graph.ui.TooltipShape
-
public class TooltipShape extends Tooltip
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TooltipShape.DestroyCallback
Optional HUD tipdestroy callback
for the user providedShape
, seeTooltip.destroyTip(GL2ES2, RegionRenderer, Shape)
.
-
Field Summary
Fields Modifier and Type Field Description static TooltipShape.DestroyCallback
NoOpDtor
No operationTooltipShape.DestroyCallback
, e.g.-
Fields inherited from class com.jogamp.graph.ui.Tooltip
DEFAULT_DELAY
-
-
Constructor Summary
Constructors Constructor Description TooltipShape(com.jogamp.math.Vec2f scale, long delayMS, int renderModes, Shape clientShape)
Ctor ofTooltipShape
.TooltipShape(com.jogamp.math.Vec4f backColor, com.jogamp.math.Vec4f borderColor, float borderThickness, Padding padding, com.jogamp.math.Vec2f scale, long delayMS, int renderModes, Shape clientShape, TooltipShape.DestroyCallback dtor)
Ctor ofTooltipShape
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Shape
createTip(Scene scene, com.jogamp.math.geom.AABBox toolMvBounds)
Create a new HUD tip shape, usually called byScene
void
destroyTip(GL2ES2 gl, RegionRenderer renderer, Shape tip)
Destroy acreated
HUD tip.Shape
getClientShape()
Shape
removeTip(Shape tip)
-
Methods inherited from class com.jogamp.graph.ui.Tooltip
forced, getTipMvPosition, getTipMvPosition, getTipMvPosition, getTool, getToolMvBounds, now, start, stop, tick, toString
-
-
-
-
Field Detail
-
NoOpDtor
public static TooltipShape.DestroyCallback NoOpDtor
-
-
Constructor Detail
-
TooltipShape
public TooltipShape(com.jogamp.math.Vec2f scale, long delayMS, int renderModes, Shape clientShape)
Ctor ofTooltipShape
.The tip
Shape
including the user providedclientShape
will be destroyed viadestroyTip(GL2ES2, RegionRenderer, Shape)
, since noTooltipShape.DestroyCallback
is being provided viaTooltipShape#TooltipShape(Vec2f, long, Shape, DestroyCallback)
.- Parameters:
scale
- HUD tip scale for the tip shapedelayMS
- delay until HUD tip is visible after timer start (mouse moved)renderModes
- Graph'sRegion
render modes, seecreate(..)
.clientShape
- user/clientShape
to be presented in the HUD tip
-
TooltipShape
public TooltipShape(com.jogamp.math.Vec4f backColor, com.jogamp.math.Vec4f borderColor, float borderThickness, Padding padding, com.jogamp.math.Vec2f scale, long delayMS, int renderModes, Shape clientShape, TooltipShape.DestroyCallback dtor)
Ctor ofTooltipShape
.The tip
Shape
will be destroyed via providedTooltipShape.DestroyCallback
dtor
if notnull
, otherwise the defaultTooltip.destroyTip(GL2ES2, RegionRenderer, Shape)
gets called.In case
TooltipShape.DestroyCallback
dtor
is being used, the userclientShape
is removed from internal layout shapes before they get destroyed and the singleclientShape
gets passed toTooltipShape.DestroyCallback.destroy(TooltipShape, GL2ES2, RegionRenderer, Shape)
.In case user provided
clientShape
is reused within a DAG, the provided implementation shall do nothing, i.e. useNoOpDtor
.- Parameters:
backColor
- optional background colorborderColor
- optional border colorborderThickness
- border thicknesspadding
- optional padding for the givenclientShape
for the internal wrapper groupscale
- scale for the HUD tipdelayMS
- delay until HUD tip is visible after timer start (mouse moved)renderModes
- Graph'sRegion
render modes, seecreate(..)
.clientShape
- user/clientShape
to be presented in the HUD tipdtor
- optionalTooltipShape.DestroyCallback
-
-
Method Detail
-
getClientShape
public Shape getClientShape()
-
createTip
public Shape createTip(Scene scene, com.jogamp.math.geom.AABBox toolMvBounds)
Description copied from class:Tooltip
Create a new HUD tip shape, usually called byScene
- Specified by:
createTip
in classTooltip
- Parameters:
scene
- theScene
caller for which this HUD tip shape is createdtoolMvBounds
-AABBox
of theTooltip.getTool()
in model-view (Mv) space of the givenScene
- Returns:
- newly created HUD tip shape
- See Also:
Tooltip.destroyTip(GL2ES2, RegionRenderer, Shape)
-
removeTip
public Shape removeTip(Shape tip)
Removed the user provided clientShape
from thecreated
HUDtipGroup
, i.e.TooltipShape
's layoutGroup
.This allows the user to release its own passed tip back, e.g. before destruction.
- Parameters:
tip
- created tipShape
viacreateTip(Scene, AABBox)
- Returns:
- the user provided client
Shape
- See Also:
createTip(Scene, AABBox)
-
destroyTip
public void destroyTip(GL2ES2 gl, RegionRenderer renderer, Shape tip)
Description copied from class:Tooltip
Destroy acreated
HUD tip.Called after
Scene.removeShape(Shape)
, allowing implementation to perform certain resource cleanup tasks. Even keeping theShape
tip alive is possible.This default implementation simply calls
Shape.destroy(GL2ES2, RegionRenderer)
.- Overrides:
destroyTip
in classTooltip
- Parameters:
gl
- currentGL2ES2
tip
- created tipShape
viaTooltip.createTip(Scene, AABBox)
- See Also:
Tooltip.createTip(Scene, AABBox)
-
-