JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
UILayoutBox01.java
Go to the documentation of this file.
1/**
2 * Copyright 2010-2023 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28package com.jogamp.opengl.demos.graph.ui;
29
30import java.io.IOException;
31import java.util.ArrayList;
32import java.util.List;
33
34import com.jogamp.graph.curve.Region;
35import com.jogamp.graph.font.Font;
36import com.jogamp.graph.font.FontFactory;
37import com.jogamp.graph.font.FontSet;
38import com.jogamp.graph.ui.Group;
39import com.jogamp.graph.ui.Scene;
40import com.jogamp.graph.ui.Shape;
41import com.jogamp.graph.ui.layout.Alignment;
42import com.jogamp.graph.ui.layout.BoxLayout;
43import com.jogamp.graph.ui.layout.Margin;
44import com.jogamp.graph.ui.layout.Padding;
45import com.jogamp.graph.ui.shapes.Button;
46import com.jogamp.graph.ui.shapes.Label;
47import com.jogamp.math.FloatUtil;
48import com.jogamp.math.Vec3f;
49import com.jogamp.math.Vec4f;
50import com.jogamp.math.geom.AABBox;
51import com.jogamp.math.geom.plane.AffineTransform;
52import com.jogamp.graph.ui.shapes.BaseButton;
53import com.jogamp.newt.event.MouseEvent;
54import com.jogamp.newt.event.WindowAdapter;
55import com.jogamp.newt.event.WindowEvent;
56import com.jogamp.newt.opengl.GLWindow;
57import com.jogamp.opengl.GL;
58import com.jogamp.opengl.GLAutoDrawable;
59import com.jogamp.opengl.GLCapabilities;
60import com.jogamp.opengl.GLProfile;
61import com.jogamp.opengl.demos.graph.ui.util.Tooltips;
62import com.jogamp.opengl.demos.util.CommandlineOptions;
63import com.jogamp.opengl.util.Animator;
64
65import jogamp.graph.ui.TreeTool;
66
67/**
68 * Res independent {@link Shape}s in a {@link Group} using a {@link BoxLayout}, contained within a Scene attached to GLWindow.
69 * <p>
70 * Pass '-keep' to main-function to keep running after animation,
71 * then user can test Shape drag-move and drag-resize w/ 1-pointer.
72 * </p>
73 */
74public class UILayoutBox01 {
75 static CommandlineOptions options = new CommandlineOptions(1920, 1080, Region.VBAA_RENDERING_BIT);
76
77 static boolean reLayout = true;
78 static final int reLayoutSleep = 500;
79
80 public static void main(final String[] args) throws IOException {
81 if( 0 != args.length ) {
82 final int[] idx = { 0 };
83 for (idx[0] = 0; idx[0] < args.length; ++idx[0]) {
84 if( options.parse(args, idx) ) {
85 continue;
86 } else if (args[idx[0]].equals("-no_relayout")) {
87 reLayout = false;
88 }
89 }
90 }
91 System.err.println(options);
92
93 final GLCapabilities reqCaps = options.getGLCaps();
94 System.out.println("Requested: " + reqCaps);
95
96 final Animator animator = new Animator(0 /* w/o AWT */);
97
98 final GLWindow window = GLWindow.create(reqCaps);
99 window.setSize(options.surface_width, options.surface_height);
100 window.setTitle(UILayoutBox01.class.getSimpleName()+": "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight());
101 window.addWindowListener(new WindowAdapter() {
102 @Override
103 public void windowResized(final WindowEvent e) {
104 window.setTitle(UILayoutBox01.class.getSimpleName()+": "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight());
105 }
106 @Override
107 public void windowDestroyNotify(final WindowEvent e) {
108 animator.stop();
109 }
110 });
111
112
113 final int zBits = 16;
114 final Scene scene = new Scene(options.graphAASamples);
116 System.err.println("Z16-Precision: default "+Scene.DEFAULT_Z16_EPSILON);
117 System.err.println("Z16-Precision: zDist -1f, zNear 0.1f "+FloatUtil.getZBufferEpsilon(zBits, -1f, 0.1f));
118 System.err.println("Z16-Precision: current "+scene.getZEpsilon(zBits));
119 scene.setClearParams(new float[] { 1f, 1f, 1f, 1f}, GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
120 scene.setPMvCullingEnabled(true);
121 scene.attachInputListenerTo(window);
122 window.addGLEventListener(scene);
123 window.setVisible(true);
124 scene.waitUntilDisplayed();
125
126 animator.setUpdateFPSFrames(1*60, null); // System.err);
127 animator.add(window);
128 animator.start();
129
130 /**
131 * We can share this instance w/ all UI elements,
132 * since only mouse action / gesture is complete for a single one (press, drag, released and click).
133 */
134 final Shape.MouseGestureAdapter dragZoomRotateListener = new Shape.MouseGestureAdapter() {
135 @Override
136 public void mouseWheelMoved(final MouseEvent e) {
137 final Shape.EventInfo shapeEvent = (Shape.EventInfo) e.getAttachment();
138 final Shape shape = shapeEvent.shape;
139 final Vec3f rot = new Vec3f(e.getRotation()).scale( FloatUtil.PI / 180.0f );
140 // swap axis for onscreen rotation matching natural feel
141 final float tmp = rot.x(); rot.setX( rot.y() ); rot.setY( tmp );
142 shape.setRotation( shape.getRotation().rotateByEuler( rot.scale( 2f ) ) );
143 }
144 };
145
146 //
147 // Resolution independent, no screen size
148 //
150 System.err.println("Font: "+font.getFullFamilyName());
151
152 final AABBox sceneBox = scene.getBounds();
153 final float zEps = scene.getZEpsilon(zBits); // Z Epsilon, i.e. minimum recognized delta (resolution)
154 System.err.println("SceneBox "+sceneBox+", zEps "+zEps);
155
156 final float cellGap = 1.5f;
157 final float sxy = 1/8.5f * sceneBox.getWidth();
158 System.err.println("Scale xy "+sxy);
159 final Vec3f nextPos = new Vec3f();
160 final List<Group> groups = new ArrayList<Group>();
161
162 //
163 //
164 //
165 fillDemoScene(groups, reqCaps.getGLProfile(), scene, zEps, sxy, nextPos, cellGap,
166 new Margin(0.04f, 0.04f, 0.10f, 0.10f),
167 new Padding(0.03f, 0.03f, 0.07f, 0.07f), font, dragZoomRotateListener);
168
169 if( reLayout ) {
170 try { Thread.sleep(reLayoutSleep); } catch (final InterruptedException e1) { }
171 int idx = 0;
172 for(final Group g : groups) {
173 System.err.println("Group["+idx+"].2.0 "+g);
174 System.err.println("Group["+idx+"].2.0 "+g.getLayout());
175 g.markShapeDirty();
176 g.validate(reqCaps.getGLProfile());
177 System.err.println("Group["+idx+"].2.1 "+g);
178 System.err.println("Group["+idx+"].2.1 "+g.getLayout());
179 ++idx;
180 }
181 }
182
183 try { Thread.sleep(1000); } catch (final InterruptedException e1) { }
184 scene.screenshot(true, scene.nextScreenshotFile(null, UILayoutBox01.class.getSimpleName(), options.renderModes, reqCaps, null));
185 {
186 int idx = 0;
187 for(final Group g : groups) {
188 System.err.println("Group["+idx+"].2.0 "+g);
189 System.err.println("Group["+idx+"].2.0 "+g.getLayout());
190 ++idx;
191 }
192 }
193 window.invoke(true, (final GLAutoDrawable drawable) -> {
194 scene.removeAllShapes(drawable.getGL().getGL2ES2());
195 return true;
196 });
197 groups.clear();
198
199 //
200 //
201 //
202 nextPos.set(0, 0, 0);
203
204 fillDemoScene(groups, reqCaps.getGLProfile(), scene, zEps, sxy, nextPos, cellGap,
205 new Margin(0.07f, 0.07f),
206 new Padding(0.10f, 0.10f), font, dragZoomRotateListener);
207
208 if( reLayout ) {
209 try { Thread.sleep(reLayoutSleep); } catch (final InterruptedException e1) { }
210 int idx = 0;
211 for(final Group g : groups) {
212 System.err.println("Group["+idx+"].2.0 "+g);
213 System.err.println("Group["+idx+"].2.0 "+g.getLayout());
214 g.markShapeDirty();
215 g.validate(reqCaps.getGLProfile());
216 System.err.println("Group["+idx+"].2.1 "+g);
217 System.err.println("Group["+idx+"].2.1 "+g.getLayout());
218 ++idx;
219 }
220 }
221
222 try { Thread.sleep(1000); } catch (final InterruptedException e1) { }
223 scene.screenshot(true, scene.nextScreenshotFile(null, UILayoutBox01.class.getSimpleName(), options.renderModes, reqCaps, null));
224 {
225 int idx = 0;
226 for(final Group g : groups) {
227 System.err.println("Group["+idx+"].3.0 "+g);
228 System.err.println("Group["+idx+"].3.0 "+g.getLayout());
229 ++idx;
230 }
231 }
232
233 if( !options.stayOpen ) {
234 window.destroy();
235 }
236 }
237
238 @SuppressWarnings("unused")
239 static void fillDemoScene(final List<Group> groups, final GLProfile reqGLP, final Scene scene,
240 final float zEps, final float sxy, final Vec3f nextPos, final float cellGap,
241 final Margin margin, final Padding padding,
242 final Font font, final Shape.MouseGestureListener dragZoomRotateListener)
243 {
244 //
245 // 1. Row
246 //
247 int id = 11;
248 if( true ) {
249 // 11
250 final Group g = fillDemoGroup(new Group( new BoxLayout() ),
251 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
252 groups.add(g);
253 }
254 nextPos.setX( nextPos.x() + sxy * cellGap );
255 ++id;
256
257 if( true ) {
258 // 12
259 final Group g = fillDemoGroup(new Group( new BoxLayout( padding ) ),
260 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
261 groups.add(g);
262 }
263 nextPos.setX( nextPos.x() + sxy * cellGap );
264 ++id;
265
266 if( true ) {
267 // 13
268 final Group g = fillDemoGroup(new Group( new BoxLayout(1f, 1f, Alignment.None) ),
269 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
270 groups.add(g);
271 }
272 nextPos.setX( nextPos.x() + sxy * cellGap );
273 ++id;
274
275 if( true ) {
276 // 14
277 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, margin ) ),
278 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
279 groups.add(g);
280 }
281 nextPos.setX( nextPos.x() + sxy * cellGap );
282 ++id;
283
284 if( true ) {
285 // 15
286 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, padding ) ),
287 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
288 groups.add(g);
289 }
290 nextPos.setX( nextPos.x() + sxy * cellGap );
291 ++id;
292
293 if( true ) {
294 // 16
295 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, margin, padding ) ),
296 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
297 groups.add(g);
298 }
299 ++id;
300 nextPos.set(0, nextPos.y() + sxy * cellGap, 0);
301
302 //
303 // 2. Row
304 //
305 id = 21;
306 if( true ) {
307 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, new Alignment(Alignment.Bit.CenterHoriz) ) ),
308 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
309 groups.add(g);
310 }
311 nextPos.setX( nextPos.x() + sxy * cellGap );
312 ++id;
313
314 if( true ) {
315 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, new Alignment(Alignment.Bit.CenterVert) ) ),
316 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
317 groups.add(g);
318 }
319 nextPos.setX( nextPos.x() + sxy * cellGap );
320 ++id;
321
322 if( true ) {
323 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Center ) ),
324 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
325 groups.add(g);
326 }
327 nextPos.setX( nextPos.x() + sxy * cellGap );
328 ++id;
329
330 if( true ) {
331 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Fill ) ),
332 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
333 groups.add(g);
334 }
335 nextPos.setX( nextPos.x() + sxy * cellGap );
336 ++id;
337
338 if( true ) {
339 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.FillCenter ) ),
340 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
341 groups.add(g);
342 }
343 ++id;
344 nextPos.setX( nextPos.x() + sxy * cellGap );
345
346 if( true ) {
347 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.FillCenter, margin, null ) ),
348 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
349 groups.add(g);
350 }
351 nextPos.set(0, nextPos.y() + sxy * cellGap, 0);
352 ++id;
353
354 //
355 // 3. Row
356 //
357 id = 31;
358 if( true ) {
359 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Center, margin, null ) ),
360 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
361 groups.add(g);
362 }
363 nextPos.setX( nextPos.x() + sxy * cellGap );
364 ++id;
365
366 if( true ) {
367 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Center, Margin.None, padding ) ),
368 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
369 groups.add(g);
370 }
371 nextPos.setX( nextPos.x() + sxy * cellGap );
372 ++id;
373
374 if( true ) {
375 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Center, margin, padding ) ),
376 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
377 groups.add(g);
378 }
379 nextPos.setX( nextPos.x() + sxy * cellGap );
380 ++id;
381
382 if( true ) {
383 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Fill, margin, null ) ),
384 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
385 groups.add(g);
386 }
387 nextPos.setX( nextPos.x() + sxy * cellGap );
388 ++id;
389
390 if( true ) {
391 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Fill, margin, padding ) ),
392 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
393 groups.add(g);
394 }
395 nextPos.setX( nextPos.x() + sxy * cellGap );
396 ++id;
397
398 if( true ) {
399 final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.FillCenter, margin, padding ) ),
400 reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
401 groups.add(g);
402 }
403 ++id;
404 nextPos.set(0, nextPos.y() + sxy * cellGap, 0);
405
406 {
407 final AABBox sceneDim = scene.getBounds();
408 final String text = " Press group description to magnify! ";
409 final AABBox textDim = font.getGlyphBounds(text, new AffineTransform(), new AffineTransform());
410 final float l_sxy = 1/4f * sceneDim.getWidth() / textDim.getWidth();
411
412 final Shape label = new Label(options.renderModes, font, text).setColor(0, 0, 0, 1).setInteractive(false)
413 .scale(l_sxy, l_sxy, 1).moveTo(sceneDim.getLow())
414 .move(0, sceneDim.getHeight() - textDim.getHeight()*l_sxy, 0);
415 scene.addShape(label);
416 }
417 }
418
419 private static final Vec4f groupBorderColor = new Vec4f(0, 0, 1f, 0.6f);
420 private static final float borderThickness = 0.01f;
421
422 static Group fillDemoGroup(final Group g, final GLProfile reqGLP, final Scene scene, final float zEps, final float sxy, final Vec3f nextPos,
423 final Font font, final int id,
424 final Shape.MouseGestureListener dragZoomRotateListener)
425 {
426 final String suffix = String.format("%2d", id);
427 g.setID(id);
428 final AABBox sceneBox = scene.getBounds();
429 {
430 g.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setPerp().setColor(0, 1, 0, 1).setBorder(borderThickness).addMouseListener(dragZoomRotateListener) );
431 g.addShape( new Button(options.renderModes, font, "stack-"+suffix, 0.50f, 0.50f/2f, zEps).setPerp().move(0, 0, zEps).setInteractive(false) );
432 g.addShape( new Label(options.renderModes, font, 0.70f/4f, "A"+suffix+" pajq").setColor(0, 0, 1, 1).move(0, 0, 2*zEps).setInteractive(false) );
433 }
434 g.scale(sxy, sxy, 1);
435 g.moveTo(sceneBox.getLow()).move(nextPos);
436 g.setBorder(borderThickness).setBorderColor(groupBorderColor);
437 g.validate(reqGLP);
438 System.err.println("Group-A"+suffix+" "+g);
439 System.err.println("Group-A"+suffix+" Layout "+g.getLayout());
440 TreeTool.forAll(g, (shape) -> { System.err.println("Shape... "+shape); return false; });
441 scene.addShape(g);
442 {
443 final float X_width = font.getGlyph( ' ' ).getAdvanceWidth();
444 /**
445 * G 23, size[total 2.1 x 1.7, cell 1.0 x 0.5]
446 * Padding[t 0.05, r 0.05, b 0.05, l 0.05]
447 * Margin[t 0.05, r 0.05, b 0.05, l 0.05]
448 * Align [CenterHoriz, CenterVert, Fill]
449 */
450 final String fixed_text = "G 23, size[total 2.1 x 1.7, cell 1.0";
451 // final float l_sxy = g.getScaledWidth() / font.getGlyphBounds(fixed_text, new AffineTransform(), new AffineTransform()).getWidth();
452 final float l_sxy = sxy / font.getGlyphBounds(fixed_text, new AffineTransform(), new AffineTransform()).getWidth();
453
454 final BoxLayout l = (BoxLayout)g.getLayout();
455 final String text = String.format("G %2d, size[total %.1f x %.1f, cell %.1f x %.1f]%n%s%n%s%nAlign %s",
456 id, g.getBounds().getWidth(), g.getBounds().getHeight(), l.getCellSize().x(), l.getCellSize().y(),
457 ( null == l.getPadding() || l.getPadding().zeroSize() ) ? "Padding none" : l.getPadding().toString(),
458 l.getMargin().zeroSize() ? "Margin none" : l.getMargin().toString(),
459 l.getAlignment() );
460 final Shape label = new Label(options.renderModes, font, text).setColor(0, 0, 0, 1).validate(reqGLP);
461 label.scale(l_sxy, l_sxy, 1).moveTo(sceneBox.getLow()).move(nextPos).move(l_sxy*X_width, g.getScaledHeight(), 0)
462 .addMouseListener(new Tooltips.ZoomLabelOnClickListener(scene, options.renderModes, 1/4f)).setDragAndResizable(false);
463 scene.addShape(label);
464 System.err.println("ID "+id+": "+label);
465 }
466 return g;
467 }
468}
Abstract Outline shape representation define the method an OutlineShape(s) is bound and rendered.
Definition: Region.java:62
static final int VBAA_RENDERING_BIT
Rendering-Mode bit for Region.
Definition: Region.java:115
The optional property jogamp.graph.font.ctor allows user to specify the FontConstructor implementatio...
static final FontSet get(final int font)
static final int UBUNTU
Ubuntu is the default font family, {@value}.
Group of Shapes, optionally utilizing a Group.Layout.
Definition: Group.java:61
Default implementation of Scene.PMVMatrixSetup, implementing Scene.PMVMatrixSetup#set(PMVMatrix4f,...
Definition: Scene.java:1506
GraphUI Scene.
Definition: Scene.java:102
final void setClearParams(final float[] clearColor, final int clearMask)
Sets the clear parameter for glClearColor(..) and glClear(..) to be issued at display(GLAutoDrawable)...
Definition: Scene.java:221
final void setPMvCullingEnabled(final boolean v)
Enable or disable Project-Modelview (PMv) frustum culling per Shape for this container.
Definition: Scene.java:230
void waitUntilDisplayed()
Blocks until first display(GLAutoDrawable) has completed after construction or dispose(GLAutoDrawable...
Definition: Scene.java:584
final void setPMVMatrixSetup(final PMVMatrixSetup setup)
Set a custom PMVMatrixSetup.
Definition: Scene.java:745
void removeAllShapes(final GL2ES2 gl, final RegionRenderer renderer)
Removes all contained shapes with Shape#destroy(GL2ES2, RegionRenderer).
Definition: Scene.java:338
static final float DEFAULT_Z16_EPSILON
Default Z precision on 16-bit depth buffer using DEFAULT_SCENE_DIST z-position and DEFAULT_ZNEAR.
Definition: Scene.java:112
static float getZEpsilon(final int zBits, final PMVMatrixSetup setup)
Default Z precision on 16-bit depth buffer using -1 z-position and DEFAULT_ZNEAR.
Definition: Scene.java:126
AABBox getBounds(final PMVMatrix4f pmv, final Shape shape)
Returns AABBox dimension of given Shape from this container's perspective, i.e.
Definition: Scene.java:676
synchronized void attachInputListenerTo(final GLWindow window)
Definition: Scene.java:246
File nextScreenshotFile(final String dir, final String prefix, final int renderModes, final GLCapabilitiesImmutable caps, final String contentDetail)
Return the unique next technical screenshot PNG File instance as follows:
Definition: Scene.java:1434
Shape event info for propagated NEWTEvents containing reference of the intended shape as well as the ...
Definition: Shape.java:1896
Convenient adapter combining dummy implementation for MouseListener and GestureListener.
Definition: Shape.java:1884
Generic Shape, potentially using a Graph via GraphShape or other means of representing content.
Definition: Shape.java:87
final Quaternion getRotation()
Returns Quaternion for rotation.
Definition: Shape.java:595
final Shape setRotation(final Quaternion q)
Sets the rotation Quaternion.
Definition: Shape.java:604
GraphUI Stack Group.Layout.
Definition: BoxLayout.java:53
GraphUI CSS property Margin, scaled space between or around elements and not included in the element'...
Definition: Margin.java:41
GraphUI CSS property Padding, unscaled space belonging to the element and included in the element's s...
Definition: Padding.java:38
Basic Float math utility functions.
Definition: FloatUtil.java:83
static float getZBufferEpsilon(final int zBits, final float z, final float zNear)
Returns resolution of Z buffer of given parameter, see Love Your Z-Buffer.
static final float PI
The value PI, i.e.
final Quaternion rotateByEuler(final Vec3f angradXYZ)
Rotates this quaternion from the given Euler rotation array angradXYZ in radians.
3D Vector based upon three float components.
Definition: Vec3f.java:37
void setX(final float x)
Definition: Vec3f.java:158
Vec3f scale(final float s)
this = this * s, returns this.
Definition: Vec3f.java:218
void setY(final float y)
Definition: Vec3f.java:159
Vec3f set(final Vec3f o)
this = o, returns this.
Definition: Vec3f.java:79
Axis Aligned Bounding Box.
Definition: AABBox.java:54
final float getWidth()
Definition: AABBox.java:879
Pointer event of type PointerType.
Definition: MouseEvent.java:74
final float[] getRotation()
Returns a 3-component float array filled with the values of the rotational axis in the following orde...
NEWT Window events are provided for notification purposes ONLY.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
Definition: GLWindow.java:121
final int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
Definition: GLWindow.java:466
final void setTitle(final String title)
Definition: GLWindow.java:297
final int getSurfaceWidth()
Returns the width of this GLDrawable's surface client area in pixel units.
Definition: GLWindow.java:461
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
Definition: GLWindow.java:625
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
Definition: GLWindow.java:615
final void addWindowListener(final WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
Definition: GLWindow.java:882
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
Definition: GLWindow.java:605
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Definition: GLWindow.java:169
Specifies a set of OpenGL capabilities.
final GLProfile getGLProfile()
Returns the GL profile you desire or used by the drawable.
Specifies the the OpenGL profile.
Definition: GLProfile.java:77
Res independent Shapes in a Group using a BoxLayout, contained within a Scene attached to GLWindow.
static void main(final String[] args)
int graphAASamples
Sample count for Graph Region AA render-modes: Region#VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT...
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final void setUpdateFPSFrames(final int frames, final PrintStream out)
final synchronized boolean start()
Starts this animator, if not running.
Definition: Animator.java:344
final synchronized boolean stop()
Stops this animator.
Definition: Animator.java:368
static final int FAMILY_LIGHT
Font family LIGHT, {@value}.
Definition: FontSet.java:39
Font get(int family, int stylebits)
static final int STYLE_SERIF
SERIF style/family bit flag.
Definition: FontSet.java:54
Interface wrapper for font implementation.
Definition: Font.java:60
String getFullFamilyName()
Shall return the family and subfamily name, separated a dash.
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
boolean invoke(boolean wait, GLRunnable glRunnable)
Enqueues a one-shot GLRunnable, which will be executed within the next display() call after all regis...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GL2ES2 getGL2ES2()
Casts this object to the GL2ES2 interface.
static final int GL_DEPTH_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_BUFFER_BIT" wit...
Definition: GL.java:738