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 interfaceTooltipShape.DestroyCallbackOptional HUD tipdestroy callbackfor the user providedShape, seeTooltip.destroyTip(GL2ES2, RegionRenderer, Shape).
-
Field Summary
Fields Modifier and Type Field Description static TooltipShape.DestroyCallbackNoOpDtorNo 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 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.ShapegetClientShape()ShaperemoveTip(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
Shapeincluding the user providedclientShapewill be destroyed viadestroyTip(GL2ES2, RegionRenderer, Shape), since noTooltipShape.DestroyCallbackis 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'sRegionrender modes, seecreate(..).clientShape- user/clientShapeto 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
Shapewill be destroyed via providedTooltipShape.DestroyCallbackdtorif notnull, otherwise the defaultTooltip.destroyTip(GL2ES2, RegionRenderer, Shape)gets called.In case
TooltipShape.DestroyCallbackdtoris being used, the userclientShapeis removed from internal layout shapes before they get destroyed and the singleclientShapegets passed toTooltipShape.DestroyCallback.destroy(TooltipShape, GL2ES2, RegionRenderer, Shape).In case user provided
clientShapeis 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 givenclientShapefor the internal wrapper groupscale- scale for the HUD tipdelayMS- delay until HUD tip is visible after timer start (mouse moved)renderModes- Graph'sRegionrender modes, seecreate(..).clientShape- user/clientShapeto 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:TooltipCreate a new HUD tip shape, usually called byScene- Specified by:
createTipin classTooltip- Parameters:
scene- theScenecaller for which this HUD tip shape is createdtoolMvBounds-AABBoxof 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 clientShapefrom thecreatedHUDtipGroup, i.e.TooltipShape's layoutGroup.This allows the user to release its own passed tip back, e.g. before destruction.
- Parameters:
tip- created tipShapeviacreateTip(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:TooltipDestroy 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).- Overrides:
destroyTipin classTooltip- Parameters:
gl- currentGL2ES2tip- created tipShapeviaTooltip.createTip(Scene, AABBox)- See Also:
Tooltip.createTip(Scene, AABBox)
-
-