diff options
author | Sven Gothel <[email protected]> | 2023-04-18 05:15:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-04-18 05:15:16 +0200 |
commit | c65c750e032118f229050ff8e834961264ed0591 (patch) | |
tree | 8500286ca6086eb21a9b275ccd586185090b1500 /src/graphui/classes/jogamp/graph | |
parent | cd845589eea6c7773007e013bd5f2f37242cbe1a (diff) |
Graph + GraphUI: Consolidate Vertex: Drop SVertex and factory, use Vec[234]f instead of float[] and remove unused VectorUtil methods
After Matrix4f consolidation and proving same or better performance on non array types,
this enhances code readability, simplifies API, reduces bugs and may improve performance.
GraphUI:
- Have RoundButton as a functional class to make a round or rectangular backdrop,
i.e. impl. addShapeToRegion() via reused addRoundShapeToRegion()
Diffstat (limited to 'src/graphui/classes/jogamp/graph')
-rw-r--r-- | src/graphui/classes/jogamp/graph/ui/shapes/Label0.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/graphui/classes/jogamp/graph/ui/shapes/Label0.java b/src/graphui/classes/jogamp/graph/ui/shapes/Label0.java index a091a89ed..1eafcd58c 100644 --- a/src/graphui/classes/jogamp/graph/ui/shapes/Label0.java +++ b/src/graphui/classes/jogamp/graph/ui/shapes/Label0.java @@ -32,14 +32,15 @@ import com.jogamp.graph.curve.opengl.TextRegionUtil; import com.jogamp.graph.font.Font; import com.jogamp.graph.geom.plane.AffineTransform; import com.jogamp.opengl.math.Vec2f; +import com.jogamp.opengl.math.Vec4f; import com.jogamp.opengl.math.geom.AABBox; public class Label0 { protected Font font; protected String text; - protected final float[] rgbaColor; + protected final Vec4f rgbaColor; - public Label0(final Font font, final String text, final float[] rgbaColor) { + public Label0(final Font font, final String text, final Vec4f rgbaColor) { this.font = font; this.text = text; this.rgbaColor = rgbaColor; @@ -47,13 +48,14 @@ public class Label0 { public final String getText() { return text; } - public final float[] getColor() { return rgbaColor; } + public final Vec4f getColor() { return rgbaColor; } public final void setColor(final float r, final float g, final float b, final float a) { - this.rgbaColor[0] = r; - this.rgbaColor[1] = g; - this.rgbaColor[2] = b; - this.rgbaColor[3] = a; + this.rgbaColor.set(r, g, b, a); + } + + public final void setColor(final Vec4f v) { + this.rgbaColor.set(v); } public final void setText(final String text) { |