Class Margin

  • All Implemented Interfaces:
    Serializable

    public class Margin
    extends Object
    implements Serializable
    The margins to be used on a component.

    A default margin size can be set for "all" sides of the panel, or the specific margin sizes can be set for each side of the panel.

    Since:
    1.0.0
    Author:
    Jonathan Austin
    See Also:
    Serialized Form
    • Constructor Detail

      • Margin

        public Margin​(Size all)
        A margin equal on all sizes.
        Parameters:
        all - the size of the margin to be used on all sides of the component.
      • Margin

        @Deprecated
        public Margin​(int all)
        Deprecated.
        Parameters:
        all - the size of the margin to be used on all sides of the component.
      • Margin

        public Margin​(Size north,
                      Size east,
                      Size south,
                      Size west)
        The margin sizes to be used on each side of the component.
        Parameters:
        north - the size of the north margin.
        east - the size of the east margin.
        south - the size of the south margin.
        west - the size of the west margin.
      • Margin

        @Deprecated
        public Margin​(int north,
                      int east,
                      int south,
                      int west)
        The margin sizes to be used on each side of the panel.
        Parameters:
        north - the size of the north margin.
        east - the size of the east margin.
        south - the size of the south margin.
        west - the size of the west margin.
    • Method Detail

      • getAll

        @Deprecated
        public int getAll()
        Deprecated.
        Returns:
        the size of the margin to be used on all sides of the panel, or -1 if it has not been set.
      • getNorth

        @Deprecated
        public int getNorth()
        Deprecated.
        Returns:
        the size of the north margin, or -1 if it has not been set.
      • getEast

        @Deprecated
        public int getEast()
        Deprecated.
        Returns:
        the size of the east margin, or -1 if it has not been set.
      • getSouth

        @Deprecated
        public int getSouth()
        Deprecated.
        Returns:
        the size of the south margin, or -1 if it has not been set.
      • getWest

        @Deprecated
        public int getWest()
        Deprecated.
        Returns:
        the size of the west margin, or -1 if it has not been set.
      • getMargin

        public Size getMargin()
        Returns:
        the margin on all sides of the container.
      • getTop

        public Size getTop()
        Returns:
        the margin on the top of the container.
      • getRight

        public Size getRight()
        Returns:
        the margin on the east side of the container.
      • getBottom

        public Size getBottom()
        Returns:
        the margin on the south side of the container.
      • getLeft

        public Size getLeft()
        Returns:
        the margin on the west side of the container.
      • getAsHTMLClassSet

        public final Set<String> getAsHTMLClassSet()
        Get a set of HTML class attribute values in the same form as AbstractWComponent.getHtmlClasses().
        Returns:
        the Margin expressed as a set of HTML class attribute values.
      • getAsHtmlClassValue

        public final String getAsHtmlClassValue()
        Returns:
        the margin expressed as a set of HTML class attribute values.