Package com.jogamp.graph.ui
Class Tooltip
- java.lang.Object
-
- com.jogamp.graph.ui.Tooltip
-
- Direct Known Subclasses:
TooltipShape
,TooltipText
public abstract class Tooltip extends Object
A HUD tooltip forShape
, seeShape.setToolTip(Tooltip)
.
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_DELAY
Default tooltip delay is 1000Lms
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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.boolean
forced()
Returns true if display is enforced vianow()
.com.jogamp.math.Vec2f
getTipMvPosition(Scene scene, com.jogamp.math.geom.AABBox toolMvBounds, float tipWidth, float tipHeight)
Little helper forcreateTip(Scene, AABBox)
returning the Mv position of the tip @ center withinScene
Mv space.com.jogamp.math.Vec2f
getTipMvPosition(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv, float tipWidth, float tipHeight)
Little helper forcreateTip(Scene, AABBox)
returning the Mv position of the tip withinScene
Mv space.com.jogamp.math.Vec2f
getTipMvPosition(Scene scene, com.jogamp.math.Vec3f toolMvPos, float tipWidth, float tipHeight)
Little helper forcreateTip(Scene, AABBox)
returning the Mv position of the tip @ center withinScene
Mv space.Shape
getTool()
ReturnsShape
'tool' owning this tooltip, set afterShape.setToolTip(Tooltip)
.com.jogamp.math.geom.AABBox
getToolMvBounds(com.jogamp.math.util.PMVMatrix4f pmv)
Little helper forcreateTip(Scene, AABBox)
returning the MvAABBox
of the tool withinScene
Mv space.void
now()
Enforce tooltip display with nexttick()
.void
start()
Starts the timer.boolean
stop(boolean clearForced)
Stops the timer if not enforced vianow()
orclearForced
is true.boolean
tick()
Send tick to this tooltipString
toString()
-
-
-
Field Detail
-
DEFAULT_DELAY
public static final long DEFAULT_DELAY
Default tooltip delay is 1000Lms- See Also:
- Constant Field Values
-
-
Method Detail
-
getTool
public final Shape getTool()
ReturnsShape
'tool' owning this tooltip, set afterShape.setToolTip(Tooltip)
.
-
stop
public final boolean stop(boolean clearForced)
Stops the timer if not enforced vianow()
orclearForced
is true.- Parameters:
clearForced
- if true, also clears enforced flag set bynow()
- Returns:
- true if timer has been stopped, otherwise false
-
start
public final void start()
Starts the timer.
-
now
public final void now()
Enforce tooltip display with nexttick()
.
-
forced
public final boolean forced()
Returns true if display is enforced vianow()
.
-
tick
public final boolean tick()
Send tick to this tooltip
-
getToolMvBounds
public com.jogamp.math.geom.AABBox getToolMvBounds(com.jogamp.math.util.PMVMatrix4f pmv)
Little helper forcreateTip(Scene, AABBox)
returning the MvAABBox
of the tool withinScene
Mv space.Method uses
getTool()
return getTool().getBounds().transform(pmv.getMv(), new AABBox());
-
getTipMvPosition
public com.jogamp.math.Vec2f getTipMvPosition(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv, float tipWidth, float tipHeight)
Little helper forcreateTip(Scene, AABBox)
returning the Mv position of the tip withinScene
Mv space.
-
getTipMvPosition
public com.jogamp.math.Vec2f getTipMvPosition(Scene scene, com.jogamp.math.geom.AABBox toolMvBounds, float tipWidth, float tipHeight)
Little helper forcreateTip(Scene, AABBox)
returning the Mv position of the tip @ center withinScene
Mv space.
-
getTipMvPosition
public com.jogamp.math.Vec2f getTipMvPosition(Scene scene, com.jogamp.math.Vec3f toolMvPos, float tipWidth, float tipHeight)
Little helper forcreateTip(Scene, AABBox)
returning the Mv position of the tip @ center withinScene
Mv space.
-
createTip
public abstract Shape createTip(Scene scene, com.jogamp.math.geom.AABBox toolMvBounds)
Create a new HUD tip shape, usually called byScene
- Parameters:
scene
- theScene
caller for which this HUD tip shape is createdtoolMvBounds
-AABBox
of thegetTool()
in model-view (Mv) space of the givenScene
- Returns:
- newly created HUD tip shape
- See Also:
destroyTip(GL2ES2, RegionRenderer, Shape)
-
destroyTip
public void destroyTip(GL2ES2 gl, RegionRenderer renderer, Shape tip)
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)
.- Parameters:
gl
- currentGL2ES2
renderModes
- Graph'sRegion
render modes, seecreate(..)
.tip
- created tipShape
viacreateTip(Scene, AABBox)
- See Also:
createTip(Scene, AABBox)
-
-