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 longDEFAULT_DELAYDefault tooltip delay is 1000Lms
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ShapecreateTip(Scene scene, com.jogamp.math.geom.AABBox toolMvBounds)Create a new HUD tip shape, usually called byScenevoiddestroyTip(GL2ES2 gl, RegionRenderer renderer, Shape tip)Destroy acreatedHUD tip.booleanforced()Returns true if display is enforced vianow().com.jogamp.math.Vec2fgetTipMvPosition(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 withinSceneMv space.com.jogamp.math.Vec2fgetTipMvPosition(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv, float tipWidth, float tipHeight)Little helper forcreateTip(Scene, AABBox)returning the Mv position of the tip withinSceneMv space.com.jogamp.math.Vec2fgetTipMvPosition(Scene scene, com.jogamp.math.Vec3f toolMvPos, float tipWidth, float tipHeight)Little helper forcreateTip(Scene, AABBox)returning the Mv position of the tip @ center withinSceneMv space.ShapegetTool()ReturnsShape'tool' owning this tooltip, set afterShape.setToolTip(Tooltip).com.jogamp.math.geom.AABBoxgetToolMvBounds(com.jogamp.math.util.PMVMatrix4f pmv)Little helper forcreateTip(Scene, AABBox)returning the MvAABBoxof the tool withinSceneMv space.voidnow()Enforce tooltip display with nexttick().voidstart()Starts the timer.booleanstop(boolean clearForced)Stops the timer if not enforced vianow()orclearForcedis true.booleantick()Send tick to this tooltipStringtoString()
-
-
-
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()orclearForcedis 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 MvAABBoxof the tool withinSceneMv 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 withinSceneMv 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 withinSceneMv 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 withinSceneMv 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- theScenecaller for which this HUD tip shape is createdtoolMvBounds-AABBoxof 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 acreatedHUD tip.Called after
Scene.removeShape(Shape), allowing implementation to perform certain resource cleanup tasks. Even keeping theShapetip alive is possible.This default implementation simply calls
Shape.destroy(GL2ES2, RegionRenderer).- Parameters:
gl- currentGL2ES2renderModes- Graph'sRegionrender modes, seecreate(..).tip- created tipShapeviacreateTip(Scene, AABBox)- See Also:
createTip(Scene, AABBox)
-
-