aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java6
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBoxGridOffset01.java6
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java2
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Shape.java4
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java42
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java2
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/layout/Margin.java6
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/layout/Padding.java6
8 files changed, 37 insertions, 37 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java
index 506ed09b6..43f403e8b 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java
@@ -263,7 +263,7 @@ public class UILayoutBox01 {
if( true ) {
// 13
- final Group g = fillDemoGroup(new Group( new BoxLayout(1f, 1f) ),
+ final Group g = fillDemoGroup(new Group( new BoxLayout(1f, 1f, Alignment.None) ),
reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener);
groups.add(g);
}
@@ -452,8 +452,8 @@ public class UILayoutBox01 {
final BoxLayout l = (BoxLayout)g.getLayout();
final String text = String.format("G %2d, size[total %.1f x %.1f, cell %.1f x %.1f]%n%s%n%s%nAlign %s",
id, g.getBounds().getWidth(), g.getBounds().getHeight(), l.getCellSize().x(), l.getCellSize().y(),
- ( null == l.getPadding() || l.getPadding().zeroSumSize() ) ? "Padding none" : l.getPadding().toString(),
- l.getMargin().zeroSumSize() ? "Margin none" : l.getMargin().toString(),
+ ( null == l.getPadding() || l.getPadding().zeroSize() ) ? "Padding none" : l.getPadding().toString(),
+ l.getMargin().zeroSize() ? "Margin none" : l.getMargin().toString(),
l.getAlignment() );
final Shape label = new Label(options.renderModes, font, text).setColor(0, 0, 0, 1).validate(reqGLP);
label.scale(l_sxy, l_sxy, 1).moveTo(sceneBox.getLow()).move(nextPos).move(l_sxy*X_width, g.getScaledHeight(), 0)
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBoxGridOffset01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBoxGridOffset01.java
index b3af0f9a5..9cec36c41 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBoxGridOffset01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBoxGridOffset01.java
@@ -330,15 +330,15 @@ public class UILayoutBoxGridOffset01 {
final GridLayout gl = (GridLayout)l;
text = String.format("Grid %2d, off %.3f/%.3f, size[total %.1f x %.1f, cell %.1f x %.1f]%n%s%n%s, Align %s",
id, offX, offY, g.getBounds().getWidth(), g.getBounds().getHeight(), gl.getCellSize().x(), gl.getCellSize().y(),
- ( null == gl.getPadding() || gl.getPadding().zeroSumSize() ) ? "Padding none" : gl.getPadding().toString(),
+ ( null == gl.getPadding() || gl.getPadding().zeroSize() ) ? "Padding none" : gl.getPadding().toString(),
gl.getGap().zeroSumSize() ? "Gap none" : gl.getGap().toString(),
gl.getAlignment() );
} else if( l instanceof BoxLayout ){
final BoxLayout bl = (BoxLayout)l;
text = String.format("Box %2d, off %.3f/%.3f, size[total %.1f x %.1f, cell %.1f x %.1f]%n%s%n%s, Align %s",
id, offX, offY, g.getBounds().getWidth(), g.getBounds().getHeight(), bl.getCellSize().x(), bl.getCellSize().y(),
- ( null == bl.getPadding() || bl.getPadding().zeroSumSize() ) ? "Padding none" : bl.getPadding().toString(),
- bl.getMargin().zeroSumSize() ? "Margin none" : bl.getMargin().toString(),
+ ( null == bl.getPadding() || bl.getPadding().zeroSize() ) ? "Padding none" : bl.getPadding().toString(),
+ bl.getMargin().zeroSize() ? "Margin none" : bl.getMargin().toString(),
bl.getAlignment() );
} else {
text = String.format("Layout %2d, off %.3f/%.3f, size[total %.1f x %.1f", id, offX, offY, g.getBounds().getWidth(), g.getBounds().getHeight());
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java
index 09ce93577..e1558e7b3 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java
@@ -418,7 +418,7 @@ public class UILayoutGrid01 {
final GridLayout l = (GridLayout)g.getLayout();
final String text = String.format("G %2d, size[total %.1f x %.1f, cell %.1f x %.1f]%n%s%n%s, Align %s",
id, g.getBounds().getWidth(), g.getBounds().getHeight(), l.getCellSize().x(), l.getCellSize().y(),
- ( null == l.getPadding() || l.getPadding().zeroSumSize() ) ? "Padding none" : l.getPadding().toString(),
+ ( null == l.getPadding() || l.getPadding().zeroSize() ) ? "Padding none" : l.getPadding().toString(),
l.getGap().zeroSumSize() ? "Gap none" : l.getGap().toString(),
l.getAlignment() );
final Shape label = new Label(options.renderModes, font, text).setColor(0, 0, 0, 1).validate(reqGLP);
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+"]"; }