diff options
author | Sven Göthel <[email protected]> | 2024-01-22 22:04:31 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-22 22:04:31 +0100 |
commit | 48f907dc431817806f8bd766d98dcca59dc8290c (patch) | |
tree | 9c95afa6160d29746e24ed8de1a50a1b443af8f9 | |
parent | 234ca0c815a6261ac59c20ad30bf97eb997df63e (diff) |
GraphUI Demos: Minor fixes
3 files changed, 6 insertions, 21 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java index cd81bb851..a59cdfb74 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/FontView01.java @@ -170,6 +170,7 @@ public class FontView01 { window.setSize(options.surface_width, options.surface_height); window.setTitle(FontView01.class.getSimpleName()+": "+font.getFullFamilyName()+", "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight()); window.setVisible(true); + System.out.println("Chosen: " + window.getChosenGLCapabilities()); window.addWindowListener(new WindowAdapter() { @Override public void windowResized(final WindowEvent e) { @@ -279,7 +280,8 @@ public class FontView01 { final Group glyphInfoView = new Group(new GridLayout(2, 0f, 0f, Alignment.None)); { // final float gapSizeX = ( gridDim.rawSize.x() - 1 ) * cellSize * 0.1f; - final Group glyphGrid = new Group(new GridLayout(gridDim.columns, glyphGridCellSize*0.9f, glyphGridCellSize*0.9f, Alignment.FillCenter, new Gap(glyphGridCellSize*0.1f))); + final Group glyphGrid = new Group(new GridLayout(gridDim.columns, glyphGridCellSize*0.9f, glyphGridCellSize*0.9f, Alignment.FillCenter, + new Gap(glyphGridCellSize*0.1f))); glyphGrid.setInteractive(true).setDragAndResizeable(false).setToggleable(false).setName("GlyphGrid"); addGlyphs(reqCaps.getGLProfile(), font, glyphGrid, gridDim, showUnderline, showLabel, fontStatus, fontInfo, glyphMouseListener); glyphGrid.setRelayoutOnDirtyShapes(false); // avoid group re-validate to ease load in Group.isShapeDirty() w/ thousands of glyphs @@ -297,7 +299,7 @@ public class FontView01 { final RangedGroup glyphView = new RangedGroup(options.renderModes, glyphGrid, glyphGridSize, null, new SliderParam(new Vec2f(glyphGridCellSize/4f, glyphGridSize.y()), glyphGridCellSize/10f, true)); - glyphView.getVertSlider().setColor(0.3f, 0.3f, 0.3f, 0.7f); + glyphView.getVertSlider().setColor(0.3f, 0.3f, 0.3f, 0.7f).setName("GlyphView"); if( VERBOSE_UI ) { glyphView.getVertSlider().addSliderListener(new SliderAdapter() { @Override diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid00.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid00.java index 19b0bdc4d..a49c04621 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid00.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid00.java @@ -113,6 +113,7 @@ public class UIMediaGrid00 { final GLWindow window = GLWindow.create(reqCaps); window.setSize(options.surface_width, options.surface_height); window.setVisible(true); + System.out.println("Chosen: " + window.getChosenGLCapabilities()); window.setTitle(UIMediaGrid00.class.getSimpleName()+": "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight()); window.addWindowListener(new WindowAdapter() { @Override diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java index 8ceaabc88..f4a2898a1 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java @@ -171,6 +171,7 @@ public class UIMediaGrid01 { final GLWindow window = GLWindow.create(reqCaps); window.setSize(options.surface_width, options.surface_height); window.setVisible(true); + System.out.println("Chosen: " + window.getChosenGLCapabilities()); window.setTitle(UIMediaGrid01.class.getSimpleName()+": "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight()); window.addWindowListener(new WindowAdapter() { @Override @@ -224,27 +225,8 @@ public class UIMediaGrid01 { final short keySym = e.getKeySymbol(); if( keySym == KeyEvent.VK_S ) { printScreenOnGLThread(scene, window.getChosenGLCapabilities()); - } else if( keySym == KeyEvent.VK_DOWN ) { - } else if( keySym == KeyEvent.VK_PAGE_DOWN ) { - } else if( keySym == KeyEvent.VK_UP ) { - } else if( keySym == KeyEvent.VK_PAGE_UP ) { } else if( keySym == KeyEvent.VK_F4 || keySym == KeyEvent.VK_ESCAPE || keySym == KeyEvent.VK_Q ) { MiscUtils.destroyWindow(window); - } else if( keySym == KeyEvent.VK_SPACE ) { - final Shape a = scene.getActiveShape(); - if( a instanceof MediaButton ) { - final MediaButton b = (MediaButton)a; - final GLMediaPlayer mPlayer = b.getGLMediaPlayer(); - if( GLMediaPlayer.State.Paused == mPlayer.getState() ) { - mPlayer.resume(); - } else if(GLMediaPlayer.State.Uninitialized == mPlayer.getState()) { - mPlayer.playStream(mPlayer.getUri(), GLMediaPlayer.STREAM_ID_AUTO, aid, GLMediaPlayer.TEXTURE_COUNT_DEFAULT); - } else if( e.isShiftDown() ) { - mPlayer.stop(); - } else { - mPlayer.pause(false); - } - } } } }); |