diff options
author | Sven Göthel <[email protected]> | 2024-01-12 05:28:07 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-12 05:28:07 +0100 |
commit | 76a74ca56e2708c967b3e5aafaa24eb9603bbb99 (patch) | |
tree | 303ee3c177c3ff1892829761738e4bb3dd43779f /src/graphui/classes/com | |
parent | 335dd0a493fff1435cad1cd22e4ac5a20d7df03a (diff) |
GraphUI Margin/Padding: Rename zeroSum*() -> zero*()
Diffstat (limited to 'src/graphui/classes/com')
5 files changed, 30 insertions, 30 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/Shape.java index 6d1a80a06..3ba5dbb32 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java @@ -271,8 +271,8 @@ public abstract class Shape { */ public Padding getPadding() { return padding; } - /** Returns true if {@link #setPaddding(Padding)} added a non {@link Padding#zeroSumSize()} spacing to this shape. */ - public boolean hasPadding() { return null != padding && !padding.zeroSumSize(); } + /** Returns true if {@link #setPaddding(Padding)} added a non {@link Padding#zeroSize()} spacing to this shape. */ + public boolean hasPadding() { return null != padding && !padding.zeroSize(); } /** * Sets the thickness of the border, which is included in {@link #getBounds()} and is outside of {@link #getPadding()}. Default is zero for no border. diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java b/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java index d8e670fab..eb2d752be 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java +++ b/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java @@ -73,14 +73,10 @@ public class BoxLayout implements Group.Layout { this(0f, 0f, Alignment.None, Margin.None, padding); } - public BoxLayout(final float cellWidth, final float cellHeight) { - this(cellWidth, cellHeight, Alignment.None, Margin.None, null); - } - /** * - * @param cellWidth - * @param cellHeight + * @param cellWidth optional cell width, zero for none + * @param cellHeight optional cell height, zero for none * @param alignment */ public BoxLayout(final float cellWidth, final float cellHeight, final Alignment alignment) { @@ -89,8 +85,8 @@ public class BoxLayout implements Group.Layout { /** * - * @param cellWidth - * @param cellHeight + * @param cellWidth optional cell width, zero for none + * @param cellHeight optional cell height, zero for none * @param margin {@link Margin} is applied unscaled and ignored with only center {@link Alignment} w/o {@link Alignment.Bit#Fill} scale */ public BoxLayout(final float cellWidth, final float cellHeight, final Margin margin) { @@ -99,8 +95,8 @@ public class BoxLayout implements Group.Layout { /** * - * @param cellWidth - * @param cellHeight + * @param cellWidth optional cell width, zero for none + * @param cellHeight optional cell height, zero for none * @param padding {@link Padding} applied to each {@Shape} via {@link Shape#setPaddding(Padding)} and is scaled if {@link Alignment.Bit#Fill} */ public BoxLayout(final float cellWidth, final float cellHeight, final Padding padding) { @@ -109,8 +105,8 @@ public class BoxLayout implements Group.Layout { /** * - * @param cellWidth - * @param cellHeight + * @param cellWidth optional cell width, zero for none + * @param cellHeight optional cell height, zero for none * @param margin {@link Margin} is applied unscaled and ignored with only center {@link Alignment} w/o {@link Alignment.Bit#Fill} scale * @param padding {@link Padding} applied to each {@Shape} via {@link Shape#setPaddding(Padding)} and is scaled if {@link Alignment.Bit#Fill} */ @@ -120,8 +116,8 @@ public class BoxLayout implements Group.Layout { /** * - * @param cellWidth - * @param cellHeight + * @param cellWidth optional cell width, zero for none + * @param cellHeight optional cell height, zero for none * @param margin {@link Margin} is applied unscaled */ public BoxLayout(final float cellWidth, final float cellHeight, final Alignment alignment, final Margin margin) { @@ -130,8 +126,8 @@ public class BoxLayout implements Group.Layout { /** * - * @param cellWidth - * @param cellHeight + * @param cellWidth optional cell width, zero for none + * @param cellHeight optional cell height, zero for none * @param alignment * @param padding {@link Padding} applied to each {@Shape} via {@link Shape#setPaddding(Padding)} and is scaled if {@link Alignment.Bit#Fill} */ @@ -141,8 +137,8 @@ public class BoxLayout implements Group.Layout { /** * - * @param cellWidth - * @param cellHeight + * @param cellWidth optional cell width, zero for none + * @param cellHeight optional cell height, zero for none * @param alignment * @param margin {@link Margin} is applied unscaled and ignored with only center {@link Alignment} w/o {@link Alignment.Bit#Fill} scale * @param padding {@link Padding} applied to each {@Shape} via {@link Shape#setPaddding(Padding)} and is scaled if {@link Alignment.Bit#Fill} @@ -153,6 +149,7 @@ public class BoxLayout implements Group.Layout { this.margin = margin; this.padding = padding; } + // Vec2f totalSize /** Returns the preset cell size */ public Vec2f getCellSize() { return cellSize; } @@ -165,7 +162,7 @@ public class BoxLayout implements Group.Layout { @Override public void preValidate(final Shape s) { - if( null != padding ) { + if( null != padding && !padding.zeroSize() ) { s.setPaddding(padding); } } @@ -279,12 +276,15 @@ public class BoxLayout implements Group.Layout { System.err.println("bl("+i+").x: "+box); } } + if( TRACE_LAYOUT ) { + System.err.println("bl(X).x: "+box); + } } @Override public String toString() { - final String p_s = ( null == padding || padding.zeroSumSize() ) ? "" : ", "+padding.toString(); - final String m_s = margin.zeroSumSize() ? "" : ", "+margin.toString(); + final String p_s = ( null == padding || padding.zeroSize() ) ? "" : ", "+padding.toString(); + final String m_s = margin.zeroSize() ? "" : ", "+margin.toString(); return "Box[cell "+cellSize+", a "+alignment+m_s+p_s+"]"; } } diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java b/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java index b89529420..949ec6fec 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java +++ b/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java @@ -385,7 +385,7 @@ public class GridLayout implements Group.Layout { @Override public String toString() { - final String p_s = ( null == padding || padding.zeroSumSize() ) ? "" : ", "+padding.toString(); + final String p_s = ( null == padding || padding.zeroSize() ) ? "" : ", "+padding.toString(); final String g_s = gap.zeroSumSize() ? "" : ", "+gap.toString(); return "Grid["+col_count+"x"+row_count+", "+order+", cell "+cellSize+", a "+alignment+g_s+p_s+"]"; } diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/Margin.java b/src/graphui/classes/com/jogamp/graph/ui/layout/Margin.java index 9deca99ef..9ed1d2612 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/layout/Margin.java +++ b/src/graphui/classes/com/jogamp/graph/ui/layout/Margin.java @@ -111,11 +111,11 @@ public class Margin { /** Return height of vertical values bottom + top. Zero if {@link #isCenteredVert()}. */ public float height() { return bottom + top; } - public boolean zeroSumWidth() { return FloatUtil.isZero( width() ); }; + public boolean zeroWidth() { return FloatUtil.isZero( width() ); }; - public boolean zeroSumHeight() { return FloatUtil.isZero( height() ); }; + public boolean zeroHeight() { return FloatUtil.isZero( height() ); }; - public boolean zeroSumSize() { return zeroSumWidth() && zeroSumHeight(); } + public boolean zeroSize() { return zeroWidth() && zeroHeight(); } @Override public String toString() { return "Margin[t "+top+", r "+right+", b "+bottom+", l "+left+"]"; } diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/Padding.java b/src/graphui/classes/com/jogamp/graph/ui/layout/Padding.java index 6aec0e398..c59f98d1e 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/layout/Padding.java +++ b/src/graphui/classes/com/jogamp/graph/ui/layout/Padding.java @@ -96,11 +96,11 @@ public class Padding { /** Return height of vertical values bottom + top. */ public float height() { return bottom + top; } - public boolean zeroSumWidth() { return FloatUtil.isZero( width() ); }; + public boolean zeroWidth() { return FloatUtil.isZero( width() ); }; - public boolean zeroSumHeight() { return FloatUtil.isZero( height() ); }; + public boolean zeroHeight() { return FloatUtil.isZero( height() ); }; - public boolean zeroSumSize() { return zeroSumWidth() && zeroSumHeight(); } + public boolean zeroSize() { return zeroWidth() && zeroHeight(); } @Override public String toString() { return "Padding[t "+top+", r "+right+", b "+bottom+", l "+left+"]"; } |