Package com.jogamp.graph.ui.layout
Class Margin
- java.lang.Object
-
- com.jogamp.graph.ui.layout.Margin
-
public class Margin extends Object
GraphUI CSS property Margin, space between or around elements and not included in the element's size. The CSS margin properties are used to create space around elements, outside of any defined borders.CENTER
is mapped to `zero` while earmarkingisCenteredHoriz()
andisCenteredVert()
. The container must be sized via its layout horizontally and/or vertically matching the centered axis, similar to CSS.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
height()
Return height of vertical values bottom + top.boolean
isCentered()
Returns true ifisCenteredHoriz()
andisCenteredVert()
is true, i.e.boolean
isCenteredHoriz()
boolean
isCenteredVert()
String
toString()
float
width()
Return width of horizontal values top + right.boolean
zeroSumHeight()
boolean
zeroSumSize()
boolean
zeroSumWidth()
-
-
-
Field Detail
-
CENTER
public static final float CENTER
Auto margin value to horizontally and/or vertically center an element within its sized-layout container, value ifFloat.NaN
.- See Also:
- Constant Field Values
-
top
public final float top
Top value
-
right
public final float right
Right value
-
bottom
public final float bottom
Bottom value
-
left
public final float left
Left value
-
-
Constructor Detail
-
Margin
public Margin()
Ctor w/ zero values
-
Margin
public Margin(float top, float right, float bottom, float left)
Ctor- Parameters:
top
- top valueright
- right valuebottom
- bottom valueleft
- left value
-
Margin
public Margin(float top, float rl, float bottom)
Ctor- Parameters:
top
- top valuerl
- right and left value, useCENTER
to horizontally center the element in its containerbottom
- bottom value
-
Margin
public Margin(float tb, float rl)
Ctor
-
Margin
public Margin(float trbl)
Ctor- Parameters:
trbl
- top, right, bottom and left value, useCENTER
to horizontally and vertically center the element in its container.
-
-
Method Detail
-
isCenteredHoriz
public boolean isCenteredHoriz()
-
isCenteredVert
public boolean isCenteredVert()
-
isCentered
public boolean isCentered()
Returns true ifisCenteredHoriz()
andisCenteredVert()
is true, i.e. for horizontal and vertical center.
-
width
public float width()
Return width of horizontal values top + right. Zero ifisCenteredHoriz()
.
-
height
public float height()
Return height of vertical values bottom + top. Zero ifisCenteredVert()
.
-
zeroSumWidth
public boolean zeroSumWidth()
-
zeroSumHeight
public boolean zeroSumHeight()
-
zeroSumSize
public boolean zeroSumSize()
-
-