From 090e0368895ccfe46a852cc66c7e2e6a78ee01be Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 25 Aug 2023 18:42:38 +0200 Subject: GraphUI: Group API doc + remove GlyphShape's redundant many getOrigPos() variants --- src/graphui/classes/com/jogamp/graph/ui/Group.java | 6 ++-- .../com/jogamp/graph/ui/shapes/GlyphShape.java | 41 +++------------------- 2 files changed, 7 insertions(+), 40 deletions(-) (limited to 'src/graphui/classes/com') diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java index d82df3a52..80783d94c 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Group.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java @@ -34,7 +34,6 @@ import java.util.Comparator; import java.util.List; import com.jogamp.graph.curve.Region; -import com.jogamp.graph.curve.opengl.GLRegion; import com.jogamp.graph.curve.opengl.RegionRenderer; import com.jogamp.graph.ui.layout.Padding; import com.jogamp.graph.ui.shapes.Rectangle; @@ -77,7 +76,7 @@ public class Group extends Shape implements Container { private Rectangle border = null; /** - * Create a Graph based {@link GLRegion} UI {@link Shape}. + * Create a group of {@link Shape}s w/o {@link Group.Layout}. *

* Default is non-interactive, see {@link #setInteractive(boolean)}. *

@@ -87,10 +86,11 @@ public class Group extends Shape implements Container { } /** - * Create a Graph based {@link GLRegion} UI {@link Shape} w/ given {@link Group.Layour}. + * Create a group of {@link Shape}s w/ given {@link Group.Layout}. *

* Default is non-interactive, see {@link #setInteractive(boolean)}. *

+ * @param l optional {@link Layout}, maybe {@code null} */ public Group(final Layout l) { super(); diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java index c579cb943..19791d099 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/GlyphShape.java @@ -46,7 +46,7 @@ import com.jogamp.opengl.util.texture.TextureSequence; * Representing a single {@link Font.Glyph} as a {@link GraphShape} * * A GlyphShape is represented in font em-size [0..1] unscaled w/ bottom-left origin at 0/0 - * while preserving an intended position, see {@link #getOrigPos()} and {@link #getOrigPos(float)}. + * while preserving an intended position, see {@link #getOrigPos()}. * * Scaling, if any, should be applied via {@link #setScale(float, float, float)} etc. */ @@ -118,41 +118,6 @@ public class GlyphShape extends GraphShape { * @see #processString(List, int, Font, String) */ public Vec3f getOrigPos() { return origPos; } - - /** - * Returns the unscaled original position of this glyph, e.g. if part of a string, otherwise zero. - * - * @param s {@link Vec3f} storage to be returned - * @return storage containing the unscaled original position - * @see #processString(List, int, Font, String) - */ - public Vec3f getOrigPos(final Vec3f s) { return s.set(origPos); } - - /** - * Returns a copy of the scaled original position of this glyph, see {@link #getOrigPos(Vec3f)} - * @see #processString(List, int, Font, String) - */ - public Vec3f getOrigPos(final float scale) { return origPos.mul(scale); } - - /** - * Returns the scaled original position of this glyph, see {@link #getOrigPos(float)} - * @param s {@link Vec3f} storage to be returned - * @return storage containing the scaled original position - * @see #processString(List, int, Font, String) - */ - public Vec3f getOrigPos(final Vec3f s, final float scale) { return s.set(origPos).scale(scale); } - - /** Resets this Shape's position to the scaled original position, see {@link #getOrigPos(float)}. */ - public void resetPos(final float scale) { - moveTo(origPos.x() * scale, origPos.y() * scale, 0f); - } - - /** Resets this Shape's position to the scaled original position and {@link #setScale(float, float, float) set scale}, see {@link #resetPos(float)}. */ - public void resetPosAndScale(final float scale) { - moveTo(origPos.x() * scale, origPos.y() * scale, 0f); - setScale(scale, scale, 1f); - } - /** Returns {@link Font#getLineHeight()}. */ public float getLineHeight() { return glyph.getFont().getLineHeight(); @@ -168,7 +133,9 @@ public class GlyphShape extends GraphShape { * @see #getOrigX() * @see #getOrigY() */ - public static final AABBox processString(final List res, final int renderModes, final Font font, final String text) { + public static final AABBox processString(final List res, final int renderModes, + final Font font, final CharSequence text) + { final Font.GlyphVisitor fgv = new Font.GlyphVisitor() { @Override public void visit(final char symbol, final Glyph glyph, final AffineTransform t) { -- cgit v1.2.3