JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.graph.ui.Tooltip Class Referenceabstract

A HUD tooltip for Shape, see Shape#setToolTip(Tooltip). More...

Inheritance diagram for com.jogamp.graph.ui.Tooltip:
Collaboration diagram for com.jogamp.graph.ui.Tooltip:

Public Member Functions

String toString ()
 
final Shape getTool ()
 Returns Shape 'tool' owning this tooltip, set after Shape#setToolTip(Tooltip). More...
 
final boolean stop (final boolean clearForced)
 Stops the timer if not enforced via now() or clearForced is true. More...
 
final void start ()
 Starts the timer. More...
 
final void now ()
 Enforce tooltip display with next tick(). More...
 
final boolean forced ()
 Returns true if display is enforced via now(). More...
 
final boolean tick ()
 Send tick to this tooltip. More...
 
AABBox getToolMvBounds (final PMVMatrix4f pmv)
 Little helper for createTip(Scene, AABBox) returning the Mv AABBox of the tool within Scene Mv space. More...
 
Vec2f getTipMvPosition (final Scene scene, final PMVMatrix4f pmv, final float tipWidth, final float tipHeight)
 Little helper for createTip(Scene, AABBox) returning the Mv position of the tip within Scene Mv space. More...
 
Vec2f getTipMvPosition (final Scene scene, final AABBox toolMvBounds, final float tipWidth, final float tipHeight)
 Little helper for createTip(Scene, AABBox) returning the Mv position of the tip @ center within Scene Mv space. More...
 
Vec2f getTipMvPosition (final Scene scene, final Vec3f toolMvPos, final float tipWidth, final float tipHeight)
 Little helper for createTip(Scene, AABBox) returning the Mv position of the tip @ center within Scene Mv space. More...
 
abstract Shape createTip (final Scene scene, AABBox toolMvBounds)
 Create a new HUD tip shape, usually called by Scene. More...
 
void destroyTip (final GL2ES2 gl, final RegionRenderer renderer, final Shape tip)
 Destroy a created HUD tip. More...
 

Static Public Attributes

static final long DEFAULT_DELAY = 1000
 Default tooltip delay is {@value}ms. More...
 

Protected Member Functions

 Tooltip (final Vec4f backColor, final Vec4f frontColor, final long delayMS, final int renderModes)
 

Protected Attributes

final int renderModes
 Graph's Region render modes, see create(..). More...
 
final Vec4f backColor = new Vec4f(1, 1, 1, 0.9f)
 
final Vec4f frontColor = new Vec4f(0.2f, 0.2f, 0.2f, 1)
 

Detailed Description

A HUD tooltip for Shape, see Shape#setToolTip(Tooltip).

Definition at line 44 of file Tooltip.java.

Constructor & Destructor Documentation

◆ Tooltip()

com.jogamp.graph.ui.Tooltip.Tooltip ( final Vec4f  backColor,
final Vec4f  frontColor,
final long  delayMS,
final int  renderModes 
)
protected
Parameters
backColoroptional HUD tip background color, if null a slightly transparent white background is used
frontColoroptional HUD tip front color, if null an opaque almost-black is used
delayMSdelay until HUD tip is visible after timer start (mouse moved), zero implies no time based alarm
renderModesGraph's Region render modes, see create(..).

Definition at line 73 of file Tooltip.java.

Here is the call graph for this function:

Member Function Documentation

◆ createTip()

abstract Shape com.jogamp.graph.ui.Tooltip.createTip ( final Scene  scene,
AABBox  toolMvBounds 
)
abstract

Create a new HUD tip shape, usually called by Scene.

Parameters
scenethe Scene caller for which this HUD tip shape is created
toolMvBoundsAABBox of the getTool() in model-view (Mv) space of the given Scene
Returns
newly created HUD tip shape
See also
destroyTip(GL2ES2, RegionRenderer, Shape)

Reimplemented in com.jogamp.graph.ui.TooltipShape, and com.jogamp.graph.ui.TooltipText.

◆ destroyTip()

void com.jogamp.graph.ui.Tooltip.destroyTip ( final GL2ES2  gl,
final RegionRenderer  renderer,
final Shape  tip 
)

Destroy a created HUD tip.

Called after Scene#removeShape(Shape), allowing implementation to perform certain resource cleanup tasks. Even keeping the Shape tip alive is possible.

This default implementation simply calls Shape#destroy(GL2ES2, RegionRenderer).

Parameters
glcurrent GL2ES2
renderModesGraph's Region render modes, see create(..).
tipcreated tip Shape via createTip(Scene, AABBox)
See also
createTip(Scene, AABBox)

Reimplemented in com.jogamp.graph.ui.TooltipShape.

Definition at line 223 of file Tooltip.java.

Here is the call graph for this function:

◆ forced()

final boolean com.jogamp.graph.ui.Tooltip.forced ( )

Returns true if display is enforced via now().

Definition at line 125 of file Tooltip.java.

◆ getTipMvPosition() [1/3]

Vec2f com.jogamp.graph.ui.Tooltip.getTipMvPosition ( final Scene  scene,
final AABBox  toolMvBounds,
final float  tipWidth,
final float  tipHeight 
)

Little helper for createTip(Scene, AABBox) returning the Mv position of the tip @ center within Scene Mv space.

Definition at line 162 of file Tooltip.java.

Here is the call graph for this function:

◆ getTipMvPosition() [2/3]

Vec2f com.jogamp.graph.ui.Tooltip.getTipMvPosition ( final Scene  scene,
final PMVMatrix4f  pmv,
final float  tipWidth,
final float  tipHeight 
)

Little helper for createTip(Scene, AABBox) returning the Mv position of the tip within Scene Mv space.

Definition at line 158 of file Tooltip.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTipMvPosition() [3/3]

Vec2f com.jogamp.graph.ui.Tooltip.getTipMvPosition ( final Scene  scene,
final Vec3f  toolMvPos,
final float  tipWidth,
final float  tipHeight 
)

Little helper for createTip(Scene, AABBox) returning the Mv position of the tip @ center within Scene Mv space.

Definition at line 182 of file Tooltip.java.

Here is the call graph for this function:

◆ getTool()

final Shape com.jogamp.graph.ui.Tooltip.getTool ( )

Returns Shape 'tool' owning this tooltip, set after Shape#setToolTip(Tooltip).

Definition at line 89 of file Tooltip.java.

Here is the caller graph for this function:

◆ getToolMvBounds()

AABBox com.jogamp.graph.ui.Tooltip.getToolMvBounds ( final PMVMatrix4f  pmv)

Little helper for createTip(Scene, AABBox) returning the Mv AABBox of the tool within Scene Mv space.

Method uses getTool()

  return getTool().getBounds().transform(pmv.getMv(), new AABBox());

Definition at line 154 of file Tooltip.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ now()

final void com.jogamp.graph.ui.Tooltip.now ( )

Enforce tooltip display with next tick().

Definition at line 119 of file Tooltip.java.

◆ start()

final void com.jogamp.graph.ui.Tooltip.start ( )

Starts the timer.

Definition at line 112 of file Tooltip.java.

◆ stop()

final boolean com.jogamp.graph.ui.Tooltip.stop ( final boolean  clearForced)

Stops the timer if not enforced via now() or clearForced is true.

Parameters
clearForcedif true, also clears enforced flag set by now()
Returns
true if timer has been stopped, otherwise false

Definition at line 98 of file Tooltip.java.

Here is the caller graph for this function:

◆ tick()

final boolean com.jogamp.graph.ui.Tooltip.tick ( )

Send tick to this tooltip.

Returns
true if started timer has been reached or is enforced via now() to createTip(PMVMatrix4f), otherwise false

Definition at line 133 of file Tooltip.java.

◆ toString()

String com.jogamp.graph.ui.Tooltip.toString ( )

Definition at line 63 of file Tooltip.java.

Member Data Documentation

◆ backColor

final Vec4f com.jogamp.graph.ui.Tooltip.backColor = new Vec4f(1, 1, 1, 0.9f)
protected

Definition at line 59 of file Tooltip.java.

◆ DEFAULT_DELAY

final long com.jogamp.graph.ui.Tooltip.DEFAULT_DELAY = 1000
static

Default tooltip delay is {@value}ms.

Definition at line 47 of file Tooltip.java.

◆ frontColor

final Vec4f com.jogamp.graph.ui.Tooltip.frontColor = new Vec4f(0.2f, 0.2f, 0.2f, 1)
protected

Definition at line 60 of file Tooltip.java.

◆ renderModes

final int com.jogamp.graph.ui.Tooltip.renderModes
protected

Graph's Region render modes, see create(..).

Definition at line 58 of file Tooltip.java.


The documentation for this class was generated from the following file: