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/Container.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph/ui/Container.java') diff --git a/src/graphui/classes/com/jogamp/graph/ui/Container.java b/src/graphui/classes/com/jogamp/graph/ui/Container.java index 3cc8e2ce4..845d41c0c 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Container.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Container.java @@ -48,8 +48,18 @@ public interface Container { void addShape(Shape s); - /** Removes given shape, , w/o {@link Shape#destroy(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer) destroying} them. */ - void removeShape(Shape s); + /** + * Removes given shape, w/o {@link Shape#destroy(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer) destroying} them. + * @return the removed shape or null if not contained + */ + Shape removeShape(Shape s); + + /** + * Removes shape at given index, w/o {@link Shape#destroy(com.jogamp.opengl.GL2ES2, com.jogamp.graph.curve.opengl.RegionRenderer) destroying} them. + * @return the removed shape + * @throws IndexOutOfBoundsException if index is out of bounds, i.e. (index < 0 || index >= size()) + */ + Shape removeShape(final int idx); void addShapes(Collection shapes); -- cgit v1.2.3