aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui/Group.java
diff options
context:
space:
mode:
authorSven Göthel <sgothel@jausoft.com>2024-01-20 05:07:10 +0100
committerSven Göthel <sgothel@jausoft.com>2024-01-20 05:07:10 +0100
commit5a24e0bbaaa0cdb61292e264b4919295fff40a2a (patch)
tree542bdef54a805a8209ee748def010fe2e308bc2c /src/graphui/classes/com/jogamp/graph/ui/Group.java
parent5e2160edfb53d8896e4f8f0ed43e59a8e963d991 (diff)
GraphUI Group: Add ctor with most usable values, allowing injecting a Group as a one-liner in code
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/Group.java')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Group.java25
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