From d741d4869221f218d76c3b8c38c83116c07598c0 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 5 Sep 2023 02:29:52 +0200 Subject: GraphUI Shape: Add setScale(..) and scale(..) with Vec3f for convenience; Add border-color in toString() if hasBorder() --- src/graphui/classes/com/jogamp/graph/ui/Shape.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph/ui/Shape.java') diff --git a/src/graphui/classes/com/jogamp/graph/ui/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/Shape.java index 43c95c92a..9b45cd36d 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java @@ -344,6 +344,15 @@ public abstract class Shape { return this; } + /** + * Set scale factor to given scale. + * @see #scale(Vec3f) + * @see #getScale() + */ + public final Shape setScale(final Vec3f s) { + scale.set(s); + return this; + } /** * Set scale factor to given scale. * @see #scale(float, float, float) @@ -353,6 +362,15 @@ public abstract class Shape { scale.set(sx, sy, sz); return this; } + /** + * Multiply current scale factor by given scale. + * @see #setScale(Vec3f) + * @see #getScale() + */ + public final Shape scale(final Vec3f s) { + scale.scale(s); + return this; + } /** * Multiply current scale factor by given scale. * @see #setScale(float, float, float) @@ -1078,8 +1096,8 @@ public abstract class Shape { rotateS = ""; } final String ps = hasPadding() ? padding.toString()+", " : ""; - final String bs = hasBorder() ? "Border "+getBorderThickness()+", " : ""; - return getDirtyString()+", enabled "+enabled+", toggle[able "+toggleable+", state "+toggle+ + final String bs = hasBorder() ? "border[l "+getBorderThickness()+", c "+getBorderColor()+"], " : ""; + return getDirtyString()+", id "+name+", enabled "+enabled+", toggle[able "+toggleable+", state "+toggle+ "], able[iactive "+isInteractive()+", resize "+isResizable()+", move "+this.isDraggable()+ "], pos["+position+"], "+pivotS+scaleS+rotateS+ ps+bs+"box"+box; -- cgit v1.2.3