diff options
author | Sven Göthel <sgothel@jausoft.com> | 2024-01-20 05:07:10 +0100 |
---|---|---|
committer | Sven Göthel <sgothel@jausoft.com> | 2024-01-20 05:07:10 +0100 |
commit | 5a24e0bbaaa0cdb61292e264b4919295fff40a2a (patch) | |
tree | 542bdef54a805a8209ee748def010fe2e308bc2c | |
parent | 5e2160edfb53d8896e4f8f0ed43e59a8e963d991 (diff) |
GraphUI Group: Add ctor with most usable values, allowing injecting a Group as a one-liner in code
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/Group.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java index 0cba294cc..29352fff0 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Group.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java @@ -96,7 +96,7 @@ public class Group extends Shape implements Container { * </p> */ public Group() { - this(null); + this(null, null, null, null); } /** @@ -107,9 +107,32 @@ public class Group extends Shape implements Container { * @param l optional {@link Layout}, maybe {@code null} */ public Group(final Layout l) { + this(null, l, null, null); + } + + /** + * Create a group of {@link Shape}s w/ given {@link Group.Layout} and {@link Shape}. + * <p> + * Default is non-interactive, see {@link #setInteractive(boolean)}. + * </p> + * @param name optional name for {@link #setName(String)} + * @param l optional {@link Layout}, maybe {@code null} + * @param fixedSize optional fixed size for {@link #setFixedSize(Vec2f)} + * @param s optional {@link Shape} for {@link #addShape(Shape)} + */ + public Group(final String name, final Layout l, final Vec2f fixedSize, final Shape s) { super(); + if( null != name ) { + this.setName(name); + } this.layouter = l; this.setInteractive(false); + if( null != fixedSize ) { + this.setFixedSize(fixedSize); + } + if( null != s ) { + addShape(s); + } } @Override |