28package com.jogamp.graph.ui;
30import com.jogamp.common.os.Clock;
31import com.jogamp.graph.curve.Region;
32import com.jogamp.graph.curve.opengl.GLRegion;
33import com.jogamp.graph.curve.opengl.RegionRenderer;
34import com.jogamp.math.Vec2f;
35import com.jogamp.math.Vec3f;
36import com.jogamp.math.Vec4f;
37import com.jogamp.math.geom.AABBox;
38import com.jogamp.math.util.PMVMatrix4f;
39import com.jogamp.opengl.GL2ES2;
40import com.jogamp.opengl.GLProfile;
41import com.jogamp.opengl.util.texture.TextureSequence;
50 private final long delayMS;
52 private volatile long alarmT1;
54 private volatile boolean forced;
64 return "Tooltip[d "+delayMS+
", next "+alarmT1+
", forced "+forced+
"]";
74 this.delayMS = delayMS;
86 final void setTool(
final Shape tool) { this.tool = tool; }
98 public final boolean stop(
final boolean clearForced) {
103 }
else if( !this.forced ) {
113 if( !this.forced && delayMS > 0 ) {
114 this.alarmT1 = Clock.currentMillis() + delayMS;
121 this.alarmT1 = Clock.currentMillis() - 1;
137 if( Clock.currentMillis() < alarmT1 ) {
165 if( toolMvBounds.
getCenter().x() - tipWidth/2 < sceneAABox.
getLow().x() ) {
167 }
else if( toolMvBounds.
getCenter().x() + tipWidth/2 > sceneAABox.
getHigh().x() ) {
172 if( toolMvBounds.
getCenter().y() + tipHeight <= sceneAABox.
getHigh().y() ) {
174 }
else if( toolMvBounds.
getHigh().y() >= tipHeight ) {
175 pos.
setY( toolMvBounds.
getHigh().y() - tipHeight );
185 if( toolMvPos.x() - tipWidth/2 < sceneAABox.
getLow().x() ) {
187 }
else if( toolMvPos.x() + tipWidth/2 > sceneAABox.
getHigh().x() ) {
190 pos.
setX( toolMvPos.x()-tipWidth/2 );
192 if( toolMvPos.y() + tipHeight <= sceneAABox.
getHigh().y() ) {
193 pos.
setY( toolMvPos.y() );
AABBox getBounds(final PMVMatrix4f pmv, final Shape shape)
Returns AABBox dimension of given Shape from this container's perspective, i.e.
Generic Shape, potentially using a Graph via GraphShape or other means of representing content.
final AABBox getBounds()
Returns the unscaled bounding AABBox for this shape, borrowing internal instance.
final void destroy(final GL2ES2 gl, final RegionRenderer renderer)
Destroys all data.
2D Vector based upon two float components.
3D Vector based upon three float components.
4D Vector based upon four float components.
Vec4f set(final Vec4f o)
this = o, returns this.
Axis Aligned Bounding Box.
final Vec3f getHigh()
Returns the maximum right-top-near (xyz) coordinate.
final Vec3f getLow()
Returns the minimum left-bottom-far (xyz) coordinate.
AABBox transform(final Matrix4f mat, final AABBox out)
Transform this box using the given Matrix4f into out @endiliteral.
final Vec3f getCenter()
Returns computed center of this AABBox of getLow() and getHigh().
PMVMatrix4f implements the basic computer graphics Matrix4f pack using projection (P),...
final Matrix4f getMv()
Returns the modelview matrix (Mv).