Class Margins


  • public class Margins
    extends Object
    A class for storing margin data.
    Author:
    Vaadin Ltd
    • Constructor Detail

      • Margins

        public Margins​(int marginTop,
                       int marginBottom,
                       int marginLeft,
                       int marginRight)
        Constructs an instance for storing margin data.
        Parameters:
        marginTop - top margin (in pixels)
        marginBottom - bottom margin (in pixels)
        marginLeft - left margin (in pixels)
        marginRight - right margin (in pixels)
    • Method Detail

      • getMarginTop

        public int getMarginTop()
        Returns the height of the top margin.
        Returns:
        top margin (in pixels)
      • getMarginBottom

        public int getMarginBottom()
        Returns the height of the bottom margin.
        Returns:
        bottom margin (in pixels)
      • getMarginLeft

        public int getMarginLeft()
        Returns the width of the left margin.
        Returns:
        left margin (in pixels)
      • getMarginRight

        public int getMarginRight()
        Returns the width of the right margin.
        Returns:
        right margin (in pixels)
      • getHorizontal

        public int getHorizontal()
        Returns the combined width of the left and the right margins.
        Returns:
        the sum of the left and the right margins (in pixels)
      • getVertical

        public int getVertical()
        Returns the combined height of the top and the bottom margins.
        Returns:
        the sum of the top and the bottom margins (in pixels)
      • setMarginTop

        public void setMarginTop​(int marginTop)
        Sets the height of the top margin.
        Parameters:
        marginTop - the top margin to set (in pixels)
      • setMarginBottom

        public void setMarginBottom​(int marginBottom)
        Sets the height of the bottom margin.
        Parameters:
        marginBottom - the bottom margin to set (in pixels)
      • setMarginLeft

        public void setMarginLeft​(int marginLeft)
        Sets the width of the left margin.
        Parameters:
        marginLeft - the left margin to set (in pixels)
      • setMarginRight

        public void setMarginRight​(int marginRight)
        Sets the width of the right margin.
        Parameters:
        marginRight - the right margin to set (in pixels)