From 64c95ce8d90d3b488fa5909603321b377cae7f9f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 14 Apr 2023 17:49:55 +0200 Subject: GraphUI Container.removeShape(..): Return removed Shape, add removeShape(index) variant; Group.(add|remove)Shape(..) markShapeDirty() to recompute bbox and layout. --- src/graphui/classes/com/jogamp/graph/ui/Scene.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph/ui/Scene.java') diff --git a/src/graphui/classes/com/jogamp/graph/ui/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/Scene.java index a0980246c..c5fb5cd01 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Scene.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Scene.java @@ -221,11 +221,16 @@ public final class Scene implements Container, GLEventListener { shapes.add(s); } @Override - public void removeShape(final Shape s) { + public Shape removeShape(final Shape s) { s.setDebugBox(0f); - shapes.remove(s); + return shapes.remove(s) ? s : null; } - /** Removes all given shapes and destroys them. */ + @Override + public Shape removeShape(final int idx) { + return shapes.remove(idx); + } + + /** Removes given shape and destroy it. */ public void removeShape(final GL2ES2 gl, final Shape s) { s.setDebugBox(0f); shapes.remove(s); -- cgit v1.2.3