From 7a2f6bfdfadcaba1d6fecc2389ba7b91e927104a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 19 Apr 2023 20:39:10 +0200 Subject: GraphUI {Round->Base}Button, denoting perpendicular or round corners (aka rectangle or oval shape) - Button + BaseButton setter also pass this for chaining - Button {twoPassLabel->label}ZOffset, investigate whether z-offset still required (not if blending is enabled!) - --- .../com/jogamp/opengl/demos/graph/ui/UISceneDemo12.java | 10 +++++----- .../com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/demos') diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo12.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo12.java index 5e3f1031f..846f03184 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo12.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo12.java @@ -43,7 +43,7 @@ import com.jogamp.graph.ui.layout.Padding; import com.jogamp.graph.ui.shapes.Button; import com.jogamp.graph.ui.shapes.Label; import com.jogamp.graph.ui.shapes.Rectangle; -import com.jogamp.graph.ui.shapes.RoundButton; +import com.jogamp.graph.ui.shapes.BaseButton; import com.jogamp.newt.event.WindowAdapter; import com.jogamp.newt.event.WindowEvent; import com.jogamp.newt.opengl.GLWindow; @@ -129,7 +129,7 @@ public class UISceneDemo12 { final Group groupA0 = new Group(new BoxLayout( new Padding(0.15f, 0.15f) ) ); { - groupA0.addShape( new RoundButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); + groupA0.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); groupA0.addShape( new Button(options.renderModes, font, "stack1", 0.50f, 0.50f/2f).setCorner(0f).setDragAndResizeable(false) ); groupA0.addShape( new Label(options.renderModes, font, 0.70f/4f, "pajq").setDragAndResizeable(false).setColor(0, 0, 1, 1) ); } @@ -146,7 +146,7 @@ public class UISceneDemo12 { final Group groupA1 = new Group(new BoxLayout( 1f, 1f, new Margin(0.05f, 0.05f), new Padding(0.10f, 0.10f) ) ); { - groupA1.addShape( new RoundButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); + groupA1.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); groupA1.addShape( new Button(options.renderModes, font, "stack2", 0.50f, 0.50f/2f).setCorner(0f).setDragAndResizeable(false) ); groupA1.addShape( new Label(options.renderModes, font, 0.70f/4f, "pajq").setDragAndResizeable(false).setColor(0, 0, 1, 1) ); } @@ -163,7 +163,7 @@ public class UISceneDemo12 { final Group groupA2 = new Group(new BoxLayout( 1f, 1f, new Margin(0.10f, Margin.CENTER), new Padding(0.05f, 0) ) ); { - groupA2.addShape( new RoundButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); + groupA2.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); groupA2.addShape( new Button(options.renderModes, font, "stack3", 0.50f, 0.50f/2f).setCorner(0f).setDragAndResizeable(false) ); groupA2.addShape( new Label(options.renderModes, font, 0.70f/4f, "pajq").setDragAndResizeable(false).setColor(0, 0, 1, 1) ); } @@ -180,7 +180,7 @@ public class UISceneDemo12 { final Group groupA3 = new Group(new BoxLayout( 1f, 1f, new Margin(Margin.CENTER) ) ); { - groupA3.addShape( new RoundButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); + groupA3.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); groupA3.addShape( new Button(options.renderModes, font, "stack4", 0.50f, 0.50f/2f).setCorner(0f).setDragAndResizeable(false) ); groupA3.addShape( new Label(options.renderModes, font, 0.70f/4f, "pajq").setDragAndResizeable(false).setColor(0, 0, 1, 1) ); } diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java index 735192715..d732795ca 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java @@ -56,7 +56,7 @@ import com.jogamp.graph.ui.shapes.GLButton; import com.jogamp.graph.ui.shapes.ImageButton; import com.jogamp.graph.ui.shapes.Label; import com.jogamp.graph.ui.shapes.MediaButton; -import com.jogamp.graph.ui.shapes.RoundButton; +import com.jogamp.graph.ui.shapes.BaseButton; import com.jogamp.nativewindow.ScalableSurface; import com.jogamp.newt.Display; import com.jogamp.newt.MonitorDevice; @@ -341,8 +341,8 @@ public class UISceneDemo20 implements GLEventListener { sl.addAll(buttonsLeft.getShapes()); sl.addAll(buttonsRight.getShapes()); for(final Shape s : sl) { - if( s instanceof RoundButton ) { - final RoundButton rb = (RoundButton)s; + if( s instanceof BaseButton ) { + final BaseButton rb = (BaseButton)s; final float c = rb.getCorner()+dc; System.err.println("Corner: "+c); rb.setCorner(c); @@ -355,10 +355,10 @@ public class UISceneDemo20 implements GLEventListener { sl.addAll(buttonsLeft.getShapes()); sl.addAll(buttonsRight.getShapes()); for(final Shape s : sl) { - if( s instanceof RoundButton ) { - final RoundButton b = (RoundButton)s; + if( s instanceof BaseButton ) { + final BaseButton b = (BaseButton)s; b.getRotation().setIdentity(); - b.setCorner(RoundButton.DEFAULT_CORNER); + b.setCorner(BaseButton.ROUND_CORNER); if( b instanceof Button ) { ((Button)b).setSpacing(Button.DEFAULT_SPACING_X, Button.DEFAULT_SPACING_Y); } @@ -393,7 +393,7 @@ public class UISceneDemo20 implements GLEventListener { System.err.println("Button Size: "+buttonLWidth+" x "+buttonLHeight); - RoundButton button; + BaseButton button; button = new Button(renderModes, fontButtons, " Next Text ", buttonLWidth, buttonLHeight); button.setName(BUTTON_NEXTTEXT); button.addMouseListener(new Shape.MouseGestureAdapter() { -- cgit v1.2.3