Class 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 earmarking isCenteredHoriz() and isCenteredVert(). The container must be sized via its layout horizontally and/or vertically matching the centered axis, similar to CSS.
    • 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 if Float.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 value
        right - right value
        bottom - bottom value
        left - left value
      • Margin

        public Margin​(float top,
                      float rl,
                      float bottom)
        Ctor
        Parameters:
        top - top value
        rl - right and left value, use CENTER to horizontally center the element in its container
        bottom - bottom value
      • Margin

        public Margin​(float tb,
                      float rl)
        Ctor
        Parameters:
        tb - top and bottom value, use CENTER to vertically center the element in its container
        rl - right and left value, use CENTER to horizontally center the element in its container
      • Margin

        public Margin​(float trbl)
        Ctor
        Parameters:
        trbl - top, right, bottom and left value, use CENTER to horizontally and vertically center the element in its container.
    • Method Detail

      • isCenteredHoriz

        public boolean isCenteredHoriz()
        Returns true if left and right is CENTER.
      • isCenteredVert

        public boolean isCenteredVert()
        Returns true if top and bottom is CENTER.
      • width

        public float width()
        Return width of horizontal values top + right. Zero if isCenteredHoriz().
      • height

        public float height()
        Return height of vertical values bottom + top. Zero if isCenteredVert().
      • zeroSumWidth

        public boolean zeroSumWidth()
      • zeroSumHeight

        public boolean zeroSumHeight()
      • zeroSumSize

        public boolean zeroSumSize()